From nobody Mon May 20 00:25:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjJHy0tkzz5LKFx; Mon, 20 May 2024 00:25: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjJHx2qxmz4mMX; Mon, 20 May 2024 00:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EgW1LIukD3EYk0yugicYGQAAfvMnl0R/HUwdkDExWBk=; b=svFfxBxrFoQCT8LsRA2X7UQHzH8AXSQrl+H5i9Wl03bf4YwYcmn3PCLYoQZTHTJl91NbBh vD69/sroCIdda42zN6k2kEHtrtWizfclJ3eWs6FMKxorYJ6A/o6HLZ2iIrJ6RSIHGsoG2c HYXKaMQcYIGwkOnVugQB10mTFWlCiS74sT30x7iuQOZZlqnffFrTvUY6v3r6St09BLYRMp p/wY6f09opFVzaiCZN/aKnY9KdQtkFUC+LqSDVOELALxkCI31xeu17ovs7jtktbAsAYten RdbYMvFyYOouB1AxFImRaAy0iXwR/u8EgyDTUn3LVQZOTVFrc6mnIx7XdrGh6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716164733; a=rsa-sha256; cv=none; b=xnfRR9w+T0z8v3GEUOKj196vb/pjsasHWyEMvVNEpNqpHcDwDfi+Wj2KMAO4ISRf3gSAxT lMVjVpKpxxbUoEBo8xsx8sJdHx1HQFiLxTLj4fs9NZzNEhmsN/NKZjfUYetTq5PgydG2fB fEblHFwUE4G38JZ2NmYyWyDj/8ZbI6fxsJ9oUlxYndeVVP9yFsQn/7BWQHLRP0XcTflXjr Z1N/HzzkC/rR6NPsF0MWVzTSmkay3OI36jVkRcRoyLNelJRSfIoKm3hxbG4yaHDEHyyspZ YEQg5+mi81WCO42WmAoZysg+mHHkksv5274wJMjuxGv33EIJFKy4ASEVlHupMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EgW1LIukD3EYk0yugicYGQAAfvMnl0R/HUwdkDExWBk=; b=eX7WAMp3CzZSKWOn+qV12lix/I6r+JX102G6t2pA+cTmC8NGNKDq/603YqAFsUJ+jYMCU3 8iU3fgxC/iFh4XSRg7Zpzp6ELbysH8pTTcbuKhSiwKxyGd8xdKNUM4Qrd1HQOqzYsY32re ebw+MgzjjxSheLBo9Q7s5mDK1xauDSJVnPGjaEg8IfXPlBW52v46LFc9uuK0812Lln83MI bb14T149VrrsG+LN8u7jWjpCGiB3saib/af32TA2oN3AzrqqPzK+zNXeb1tNulya55O2Mp 3F23eZjrcJ/Y4u6ZUnpoMtN2Ko3fwCUd0UlPGVWIztbQN+RdxT9w8Qmu8qHwWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjJHx24ByzGjY; Mon, 20 May 2024 00:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K0PXYg008425; Mon, 20 May 2024 00:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K0PXiZ008422; Mon, 20 May 2024 00:25:33 GMT (envelope-from git) Date: Mon, 20 May 2024 00:25:33 GMT Message-Id: <202405200025.44K0PXiZ008422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ab135e19f70a - stable/14 - tmpfs_destroy_vobject(): clear v_object under the object lock List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ab135e19f70a517c41de30e89f18441c0134af22 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ab135e19f70a517c41de30e89f18441c0134af22 commit ab135e19f70a517c41de30e89f18441c0134af22 Author: Konstantin Belousov AuthorDate: 2024-05-12 01:26:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:57:54 +0000 tmpfs_destroy_vobject(): clear v_object under the object lock (cherry picked from commit 46811949797b7e44521cd56cfa61b6c8378c4600) --- sys/fs/tmpfs/tmpfs_subr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index b12e9b91fabc..de2c342e41c4 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -116,7 +116,7 @@ tmpfs_pager_writecount_recalc(vm_object_t object, vm_offset_t old, /* * Forced unmount? */ - if (vp == NULL) { + if (vp == NULL || vp->v_object == NULL) { KASSERT((object->flags & OBJ_TMPFS_VREF) == 0, ("object %p with OBJ_TMPFS_VREF but without vnode", object)); @@ -916,6 +916,8 @@ tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj) VM_OBJECT_WLOCK(obj); VI_LOCK(vp); + vp->v_object = NULL; + /* * May be going through forced unmount. */ From nobody Mon May 20 00:26:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjJJZ2BcZz5LKQX; Mon, 20 May 2024 00:26:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjJJY61KRz4n5F; Mon, 20 May 2024 00:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sfdlGrTr5Mlvv1NjRtRuvleTg5QWwmrIao9gktDRxVo=; b=vp+0Y8ABqqq0UQ4NGx5hOIawc3NxDDrSbTkiyyFz7wgcG+trj+XZHPV2FnJ7e6QAN+VpPu 53TURfoV5amozdZscUY//RZfSiUTsL3//hAeIc+HU1mnCBup1W7D2vtRJkzRdbIDxcJYm6 s4vjKkSxw7PUwfbvkIawKvuZZ93a8JPKfcH6Oq/joNrib59mAy0ezy2J4/A8/olWUoKiPu yn4rUIlE/xrsYMxmj+VnjHBhYBnm/VvwEVv5Bs4ZERJO7w6Wr1F72uWQ7zSoaDkyyuAyGN 9shr7p0GfONPBS3VXap5K8z2XVz6Sk56QWdedszAKpLnjfhfnPkYPtmQi5orlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716164765; a=rsa-sha256; cv=none; b=q6F/lVZlApVwwvF8ID7gyBy1Qc7PQjVnOzdwpgLgPylSdu+Y5BPahHHr8veNs8oGQ8QixK rrsuk/x1NK+YnBQcTBNMX5ZCtkCMCsCUT1UMwPhTbgZaopjs4nVlbxzCuwwMDLKMypQ+pG FMl3+yV8NVPDrwOl0rwpU218WD9CXdJHB4BsTG4rzQlSAht29/b//Udd7drwNVpQz0lHyW stimcfAXzjfHEG7vA8/CCLRZz1rRhmlxibGiZzejHNfGjIaHlurH7cE/fJFK8iAYijZ4Os EwBdkfqqEyXMXuqK4d3iXz/+1wkgt1iWesu/+RowQVpgzekVKSxOhWVrcENebg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sfdlGrTr5Mlvv1NjRtRuvleTg5QWwmrIao9gktDRxVo=; b=tRPYmWO4czdrabN2Z32Lq+yzoZOWBt6xN3mcxRdGtjznRZvB19p6l7IWfRhN+o7qcOUiOk oTXna0gGrBn3/PnD6V+ieE0Y+qZIU4iOztGDjIzD0z3sLLxY+sRm8Jo2AJ6XRCNeI1+mMt /gIrfzrtEgVgBXI24FFg4YVzq7RMF5g0LTyDoTW6A0OWzk/sNj6bs28MEPrnjIGxiU4zf1 YA6VfgeIJnkfSH5o97fUzuRCpAlZuE3/L+G1VQY4tTdajTZwpaRvjEo9e/LEp9edXtSJ2K NbeGjvg+CADRwBcy5g5MWbM/L0teck+yNbjiDbYsi1hkfx7CCHG2v1bwgJjZtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjJJY4JN2zGxg; Mon, 20 May 2024 00:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K0Q5nA008758; Mon, 20 May 2024 00:26:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K0Q5u4008755; Mon, 20 May 2024 00:26:05 GMT (envelope-from git) Date: Mon, 20 May 2024 00:26:05 GMT Message-Id: <202405200026.44K0Q5u4008755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e45c358ec663 - stable/13 - tmpfs_destroy_vobject(): clear v_object under the object lock List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e45c358ec6639209c748f6ad0dd2f89ebedfa91e Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e45c358ec6639209c748f6ad0dd2f89ebedfa91e commit e45c358ec6639209c748f6ad0dd2f89ebedfa91e Author: Konstantin Belousov AuthorDate: 2024-05-12 01:26:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:59:13 +0000 tmpfs_destroy_vobject(): clear v_object under the object lock (cherry picked from commit 46811949797b7e44521cd56cfa61b6c8378c4600) --- sys/fs/tmpfs/tmpfs_subr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 90fffb11e4c6..54d28edb10b5 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -116,7 +116,7 @@ tmpfs_pager_writecount_recalc(vm_object_t object, vm_offset_t old, /* * Forced unmount? */ - if (vp == NULL) { + if (vp == NULL || vp->v_object == NULL) { KASSERT((object->flags & OBJ_TMPFS_VREF) == 0, ("object %p with OBJ_TMPFS_VREF but without vnode", object)); @@ -909,6 +909,8 @@ tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj) VM_OBJECT_WLOCK(obj); VI_LOCK(vp); + vp->v_object = NULL; + /* * May be going through forced unmount. */ From nobody Mon May 20 00:26:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjJJX2FmGz5LKT0; Mon, 20 May 2024 00:26: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjJJW3lVsz4nG3; Mon, 20 May 2024 00:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LHThmjhbrRp1y19V1YkSx9x4FFS/dSjC1Be5lEjr5h8=; b=ju+LkkEaihdeyml0mtn5QT/GrSGpxwq0OZvmthu9V88grC+5v0vgq4p+MbYMve0TgoSrgV cKcP3QA5TN3J4tJb7wwkWyVfR1A4noib07e6alL2DBCWrgnD1t5/zIdVfj37OjQ6UEFEiE xhn5/awp5UuTY1s2IK7tM7uN1iUwKZPUPGYv/zXQs/QXmGXsSbgKwc9D0zaiuDqQmkrrFR v3wPhuhQ50L23TXLi+1KBoqtMU/79qXpMcdNtFGCzPF94TypJcLcAThoEVRhMyXZv31icJ 9Ik2Zcm4d9cjffMdTlG9Fk5WJ/yfKYRRaRMMCoX+2KCeIKJQ65QSDeSTkkNo9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716164763; a=rsa-sha256; cv=none; b=iisDfZUFaBi6WLMtlJ0qwWLmoO1DAIYHJAZmSgrL33PIUeczPeNj0jvpzc2IOLeCQxvJth YiznFNZfMHP/jQj6J36yjTW8nIGJ1JjMCxwvrMrgdkODlc6cLXWlZtdfChGOAZKzBIPisT 0xeVYuqJfLvaLCkcI9xinrVp3unWXaqFH0PeTlEMZwiCdAXQVY/bAGQ6yK+uBJA6WajaXq DXWWHeqislRKwvXo2nXxf01WfXWEvyT4Qr86xQsvQhYw130h1Ul+vKrBSt11bjUH5EXwXZ XGFWn0g7vxKxpYZ9bEPrt2PKd2EsdqKYGNe9G4NwNXDvCOeV3mxaTs7ukx3dxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LHThmjhbrRp1y19V1YkSx9x4FFS/dSjC1Be5lEjr5h8=; b=rDCSBCYJNt/3p3qAL3jkwQGwXZcaeyLKxmY/R7+nfXPyh0T4dM8lSpB/uU5ZiQvTqnT3J7 kfuA7bppo8jyZugEVme03q2cdDNmojrFyVdBN9MfBy9+wJJAPgkpvZtGp3+14+LFDeiieg 4Jb4xksr9N87ASjOFfnv+aV10GODyepexfbq+AP6eAIe+eMNKMtskeG4+fDZmD1KA7Tztj AFBxdyBVrSKWMnMM3HEoMyIhaR39hp+Qp3NFmSXT2aoU0ESLxyD0wkJTgBdlhA7mzQdZ+W ZRiAu+cthVfiUjoJ19RiWEgOruN588rCol+ql5qM7zzG1vZCcf2Q9ophIc0tJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjJJW2lx0zGrk; Mon, 20 May 2024 00:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K0Q3Dv008653; Mon, 20 May 2024 00:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K0Q3A2008650; Mon, 20 May 2024 00:26:03 GMT (envelope-from git) Date: Mon, 20 May 2024 00:26:03 GMT Message-Id: <202405200026.44K0Q3A2008650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e95708d7a1bf - stable/13 - tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e95708d7a1bf70d555da498eedc1a030a9106096 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e95708d7a1bf70d555da498eedc1a030a9106096 commit e95708d7a1bf70d555da498eedc1a030a9106096 Author: Konstantin Belousov AuthorDate: 2024-05-06 18:31:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:59:13 +0000 tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode (cherry picked from commit 58d7ac11e77db28640b8e47f9f9c1fe81d15baf5) --- sys/fs/tmpfs/tmpfs_subr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index d1aff2397cc4..a69e0357bc59 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1061,14 +1061,18 @@ loop: KASSERT((object->flags & OBJ_TMPFS_VREF) == 0, ("%s: object %p with OBJ_TMPFS_VREF but without vnode", __func__, object)); - KASSERT(object->un_pager.swp.writemappings == 0, - ("%s: object %p has writemappings", - __func__, object)); VI_LOCK(vp); KASSERT(vp->v_object == NULL, ("Not NULL v_object in tmpfs")); vp->v_object = object; vn_irflag_set_locked(vp, (tm->tm_pgread ? VIRF_PGREAD : 0)); VI_UNLOCK(vp); + VNASSERT((object->flags & OBJ_TMPFS_VREF) == 0, vp, + ("leaked OBJ_TMPFS_VREF")); + if (object->un_pager.swp.writemappings > 0) { + vrefact(vp); + vlazy(vp); + vm_object_set_flag(object, OBJ_TMPFS_VREF); + } VM_OBJECT_WUNLOCK(object); break; case VDIR: From nobody Mon May 20 00:26:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjJJY2W3Zz5LKLL; Mon, 20 May 2024 00:26: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjJJX4bRDz4nDP; Mon, 20 May 2024 00:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZMYNdAxu9gt8ZYqVKFnk9Qr1MQH5iPyKDlja2VJ6c0=; b=RJVE7Pw95JzWjlgm9yr08kWZNnyENQXsX1o6ubpcdN1inodryhHpqLSkP/laUIw4FzsAaC dt9OLwt6LgGl2UNcyXVzQ6YekjbbLFQu8gOqvjKTtwcEKBMZ1PtuJm0l1k8MAuohgeSXDe BYSJk9RONUTjMqt0jpqYRU3lYfhx2TlGXoA7xdbPr3yp9Dfop8azRZDlfFcw68wccnKCWB coN1+UWrAo3S3DbQChLxfEMLZxvpW5OmvYzQ0G5FFOnf+OFa/Uc8u6aaUbg0nXyMg+IeYr a9/14UXcdmKvT4icnJ/K6TKc6htfdtjetcB+TZqwSsbqtMBtQQdkZCl7lseyGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716164764; a=rsa-sha256; cv=none; b=ERP6AR4HAJCMAW/khBt660mxMFxO8SP7g9EzMyRhA8c6IQ3f5qPEjn51JdeZS5HlCCGjh1 bGh3KhWN7k2A6wH1afYbJSd7jU34j3sUDWIbVwu1QTrX1tsu+GO3zBynj22CmM3o2mb3pD L3IgUet5RVDSRwbw4F8wQImsK55L13EfQIE6kNyG/TvWpDIyDoUEXXt5xLEPNVy28FpnFd ukSBsNc13Q8tNu3N6UX8fztc1WwqNQj4eUg9jm624hff0tLW3J3brF1idyTXfzqFY+fCel QrEnTHUk58nSPESPka0WDuIzEod0SryPK2t4TzJNueo1c1JsUwBW+dUi0mtW5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZMYNdAxu9gt8ZYqVKFnk9Qr1MQH5iPyKDlja2VJ6c0=; b=iIh8dcPFOFOKk7JjYL/k9SH33KxmH973ovBvaRi355h2ZXksRnxiinHwe2wxdGUPfhFZsS 4EJVDPkaZsxzjxzFWykxe4dIfMKYZFaYfFO1gtPZATxscqML1Y4x3UxW5pFyJyrjZQaidV O1jcgBzrGqBZxXflTwczOJrLwtqJTHIt3++YVuMiJE0dSFlbVBljclAmulinmaEM3TnXiK Fz23uRX0UVWL6bCNO/uGCVCSjZIwHyfCx1tVAdPMdy2PWUV7o1nYAZkaAO6VL7LCjiTMK3 plPr0g49cdQpLMOM1uK2/bmIhOtv1OD9HF6yB7BOkMa6jxfp5rFnerJi9AYt7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjJJX3jhCzGxf; Mon, 20 May 2024 00:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K0Q48h008710; Mon, 20 May 2024 00:26:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K0Q4pX008707; Mon, 20 May 2024 00:26:04 GMT (envelope-from git) Date: Mon, 20 May 2024 00:26:04 GMT Message-Id: <202405200026.44K0Q4pX008707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 156b5b7bf44f - stable/13 - swap-like pagers: assert that writemapping decrease does not pass zero List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 156b5b7bf44fd7be5d745accea741527c46532cc Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=156b5b7bf44fd7be5d745accea741527c46532cc commit 156b5b7bf44fd7be5d745accea741527c46532cc Author: Konstantin Belousov AuthorDate: 2024-05-08 13:58:52 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:59:13 +0000 swap-like pagers: assert that writemapping decrease does not pass zero (cherry picked from commit 6ada4e8a0ae901f0012015c8d277d80aad7d8f37) --- sys/fs/tmpfs/tmpfs_subr.c | 3 +++ sys/vm/swap_pager.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index a69e0357bc59..90fffb11e4c6 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -179,6 +179,9 @@ tmpfs_pager_release_writecount(vm_object_t object, vm_offset_t start, KASSERT((object->flags & OBJ_ANON) == 0, ("%s: object %p with OBJ_ANON", __func__, object)); old = object->un_pager.swp.writemappings; + KASSERT(old >= (vm_ooffset_t)end - start, + ("tmpfs obj %p writecount %jx dec %jx", object, (uintmax_t)old, + (uintmax_t)((vm_ooffset_t)end - start))); object->un_pager.swp.writemappings -= (vm_ooffset_t)end - start; new = object->un_pager.swp.writemappings; tmpfs_pager_writecount_recalc(object, old, new); diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index dd7fecc066c4..a3e312af2ed9 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -3183,6 +3183,10 @@ swap_pager_release_writecount(vm_object_t object, vm_offset_t start, VM_OBJECT_WLOCK(object); KASSERT((object->flags & OBJ_ANON) == 0, ("Splittable object with writecount")); + KASSERT(object->un_pager.swp.writemappings >= (vm_ooffset_t)end - start, + ("swap obj %p writecount %jx dec %jx", object, + (uintmax_t)object->un_pager.swp.writemappings, + (uintmax_t)((vm_ooffset_t)end - start))); object->un_pager.swp.writemappings -= (vm_ooffset_t)end - start; VM_OBJECT_WUNLOCK(object); } From nobody Mon May 20 07:39:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjTwR14CYz5JbtS; Mon, 20 May 2024 07:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjTwR0KW0z4d2h; Mon, 20 May 2024 07:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716190759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4n3X0i2iHaAvEcY6UFedUuowNo2rABaChiISlD7YPK8=; b=j2yWN6d7VXImr464zSWzeAmClM3wjoRPXGYUa/iwxxdOJjjXSBi1+/YwytCdQeU2hD25s7 t6SZzsaxrgZwC/f6QLuL21XJqWPQ6IlYghEOxTL7sfCMmjyr3IiquUqfO8QyPRgIqFrSLX 9b40oHJLLSkZpUPPbLHQyjhu8bAh9yDgY+uIUqq0wU+Hdalajm8lqW5F9atKyf/vFHRUgj joHchAriMF8Szbv5Uft8dmxKxRHH1hI8XmAObLBEDj4z55GkVkmek+ZL1sq3+04cVZzdY7 kkdWSGHIx7pf+dEv+AQlpoB8jr4JyIJzEWefERFJSHyZ3a/FP9FtUIuQ+BpvXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716190759; a=rsa-sha256; cv=none; b=GfFKlgKNhx0d31qodJWjuT3bVhCAGFPoj1gvz2uDrdJJ2epIjnQslBSxe6TDCFhPLgGbGe DC/roN54OlOuAPqbqOTCI6dGRFR1un+E1BVjD2e1brGOlXWoskkPeq+Sak/59t72wMcvJl gb2GqpWqHACrW0tkzxBEAvb9FXTeXFn7F63kb1XsHhqfLmERVYI8oA/Q/L/4Hcd7qmhoXc L68ey6H01Db47x6XHZc3G4G74kg60YWEUxkuK29j+2S+yhYlec+ymLH2F6H8Ea1KbJSwdG UZ2ZNtF+j+7m2BpWICR3U+4bow8wtotFR/MKJjuK/SoqkxRQfx/d5CgZ76elXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716190759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4n3X0i2iHaAvEcY6UFedUuowNo2rABaChiISlD7YPK8=; b=BtvGQ+gQ3PIGqsROKYuJoLcmKI52e+jISniJyPDDLzZSeDYRULtstHVCqUVlDeOIEZjZOY GVCnmBSs7vtUZpAZvYCPKLYX3kdv7GZdwQuitCkZ7g5+JkSzlQ08vH3AhlMANCMi+HGoVM gLjWSTIn7WWyW4SiYbIeERoMgB7K2AOo0xtfL2oplRxfsJNm1Xi/nYw+GXNgT2sCCoM6Xs ZH2S9/hoqikuhkjKbuaqrmcSZy3iEGUQCL3XNgehTJN4NPHZMmOsknlKX65V2adHN+9VX1 0CDliDy8Y/m7lEg/vAOqm4N5smeGK/9OaQfbsvizhwOCuqLG5p+DlSBrFyZtUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjTwQ6VC6zV9P; Mon, 20 May 2024 07:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K7dIgr037661; Mon, 20 May 2024 07:39:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K7dInS037658; Mon, 20 May 2024 07:39:18 GMT (envelope-from git) Date: Mon, 20 May 2024 07:39:18 GMT Message-Id: <202405200739.44K7dInS037658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: fecd30388256 - releng/14.1 - if: guard against if_ioctl being NULL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: fecd303882565954f58d984e4a13735e080b5263 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fecd303882565954f58d984e4a13735e080b5263 commit fecd303882565954f58d984e4a13735e080b5263 Author: Kristof Provost AuthorDate: 2024-05-06 09:39:08 +0000 Commit: Kristof Provost CommitDate: 2024-05-20 07:38:40 +0000 if: guard against if_ioctl being NULL There are situations where an struct ifnet has a NULL if_ioctl pointer. For example, e6000sw creates such struct ifnets for each of its ports so it can call into the MII code. If there is then a link state event this calls do_link_state_change() -> rtnl_handle_ifevent() -> dump_iface() -> get_operstate() -> get_operstate_ether(). That wants to know if the link is up or down, so it tries to ioctl(SIOCGIFMEDIA), which doesn't go well if if_ioctl is NULL. Guard against this, and return EOPNOTSUPP. PR: 275920 MFC ater: 3 days Approved by: re (cperciva) Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 43387b4e574043b78a58c8bcb7575161b055fce1) (cherry picked from commit 9a8a26aefb366ef6f497d48547a1562a1de566c1) --- sys/net/if.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index 0128fb8039ee..1ca0893eb724 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4873,6 +4873,9 @@ if_resolvemulti(if_t ifp, struct sockaddr **srcs, struct sockaddr *dst) int if_ioctl(if_t ifp, u_long cmd, void *data) { + if (ifp->if_ioctl == NULL) + return (EOPNOTSUPP); + return (ifp->if_ioctl(ifp, cmd, data)); } From nobody Mon May 20 07:57:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjVKf55mkz5Jdf6; Mon, 20 May 2024 07:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjVKf42jRz4gy8; Mon, 20 May 2024 07:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716191862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7y/MgFo+4LG56nUH6PihukC4o58jRuYezxtPrJ5fg4w=; b=JIaBiocUGainJaJqt813mRzQiu0LFiHiKgQxs1V87OAf5BbxKauZ1twCu7P34vaBjMt+k9 QFRXgK1VLqJX42PuVCafQRZ+2pX0ati9OeIp0VLVDvcmOX6nE1p0Rig8tKTR4VQF4LNsv/ dPxZIX4T63lXgOikoNdT7OqZ1b7rZ9bymhl5KfgdGOlnFsU5mqxgwsvkQmnjvX7z2rIoin beSSoOqjfe3R+GDhEOLe7to7uvFM/8tbEeuqzwObxW3DL+s7IFBYv+yLXXwPup6RpxVMwF 2sJMWrkNKSUwGIuNhKV3uWoyDf1qI5nrKOFGg5npiXGJULHlJalLlHHA9rn1LQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716191862; a=rsa-sha256; cv=none; b=hc2BY75zvWZy3bT4pEFOV3xtDmeApLH1SYiHYANhWuHzYbgLQ7SCaokCBY7UX1rqs7vVXl X+YduUTRWyADwdKHxEpYeF4ih8Xg69bT6dCfdxnnIU6pPvjs2wYcPWeXK6fByZoXknXH2g XzpdNlRmNI656BAE6rU9EiAz6OZpaXjmoQZCAWk9YMKOYUpwXetNLaLNBkxYjHcFCo4iyJ R3ySkdp3vclW/TrFXF1up4rLIVvOa9XAey50bS4N+x1YZtkasYGxDfTztwGJFcWuSyjTdt sUu6jtJniKjDXKwYh3Vm85nkIKPiqE73zL8zWuaXwzMsyo3HwJm6C4PiQkrn8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716191862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7y/MgFo+4LG56nUH6PihukC4o58jRuYezxtPrJ5fg4w=; b=MYywbFfZ4lF3m6XdLKw68ynE9lbvQqD1550NmOuIiIYWYSjJmyKsTfemGnS3zpBujfw0W7 jih0pWJDv84yLCs5ggQcgs/Zj4VaMBkdnVEgXKOVJ6AGYjJw1XmBTcxNvcIJVSUi+7ZL8e jCPBXvrY9X8d9hb2KF/UMBCVNzAr3DI7vDhFLoJDX21OA3JTAz55RjjXWUmKjeLqyMdsES 0K0cVAJFhKBrhZEoVnrdlj7QjR+/yv4v43SCdILqUTKgneFuJ83J936FeC9tIJq18X6LON /zzffLYBIC1+FWyjXzNy1RHojFraMzgpw9akxXk4czG3e3S/VHQmUWhz2j2jdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjVKf3WG4zVyn; Mon, 20 May 2024 07:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K7vgSm070658; Mon, 20 May 2024 07:57:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K7vgxM070655; Mon, 20 May 2024 07:57:42 GMT (envelope-from git) Date: Mon, 20 May 2024 07:57:42 GMT Message-Id: <202405200757.44K7vgxM070655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 18c38eda39bb - stable/14 - if_ovpn: cope with loops List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18c38eda39bb8162ddce9acc4de4d6e4bbf48ef0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=18c38eda39bb8162ddce9acc4de4d6e4bbf48ef0 commit 18c38eda39bb8162ddce9acc4de4d6e4bbf48ef0 Author: Kristof Provost AuthorDate: 2024-05-13 10:06:47 +0000 Commit: Kristof Provost CommitDate: 2024-05-20 07:39:52 +0000 if_ovpn: cope with loops User misconfiguration may lead to routing loops where we try to send the tunnel packet into the tunnel. This eventually leads to stack overflows and panics. Avoid this using if_tunnel_check_nesting(), which will drop the packet if we're looping or we hit three layers of nested tunnels. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 59a6666ec91d71f97aaae5195bbfafd9d422db2e) --- sys/net/if_ovpn.c | 9 +++++++++ tests/sys/net/if_ovpn/if_ovpn.sh | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 1b5d419fe58b..7af669c69511 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -255,6 +255,7 @@ static const char ovpnname[] = "ovpn"; static const char ovpngroupname[] = "openvpn"; static MALLOC_DEFINE(M_OVPN, ovpnname, "OpenVPN DCO Interface"); +#define MTAG_OVPN_LOOP 0x6f76706e /* ovpn */ SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, IFT_OTHER, openvpn, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, @@ -1858,6 +1859,14 @@ ovpn_transmit_to_peer(struct ifnet *ifp, struct mbuf *m, if (af != 0) BPF_MTAP2(ifp, &af, sizeof(af), m); + if (__predict_false(if_tunnel_check_nesting(ifp, m, MTAG_OVPN_LOOP, 3))) { + if (_ovpn_lock_trackerp != NULL) + OVPN_RUNLOCK(sc); + OVPN_COUNTER_ADD(sc, lost_data_pkts_out, 1); + m_freem(m); + return (ELOOP); + } + len = m->m_pkthdr.len; MPASS(len <= ifp->if_mtu); diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index bbaffa0bce73..88df430aead6 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -95,6 +95,10 @@ atf_test_case "4in4" "cleanup" echo 'foo' | jexec b nc -u -w 2 192.0.2.1 1194 atf_check -s exit:0 -o ignore jexec b ping -c 3 198.51.100.1 + + # Test routing loop protection + jexec b route add 192.0.2.1 198.51.100.1 + atf_check -s exit:2 -o ignore jexec b ping -t 1 -c 1 198.51.100.1 } 4in4_cleanup() @@ -386,6 +390,10 @@ atf_test_case "6in6" "cleanup" atf_check -s exit:0 -o ignore jexec b ping6 -c 3 2001:db8:1::1 atf_check -s exit:0 -o ignore jexec b ping6 -c 3 -z 16 2001:db8:1::1 + + # Test routing loop protection + jexec b route add -6 2001:db8::1 2001:db8:1::1 + atf_check -s exit:2 -o ignore jexec b ping6 -t 1 -c 3 2001:db8:1::1 } 6in6_cleanup() From nobody Mon May 20 08:13:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjVgd2tphz5Jg4j; Mon, 20 May 2024 08:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjVgd2Ntsz4jgF; Mon, 20 May 2024 08:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716192797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z5uf+ODNLclOPwL8slFxazUWBc36ENbCLlDX6NrO0+Y=; b=dTcLETc+WRGQSZklEFysC2epb2oCgCS41RrdBkHZXh6fVx5Nx+L92In1yySfA4RJxYhqNb xiMqum0d0c4ZhapAvprgXnx9qc3Ul7dKe10oqko5CRROCl9c0u8cZH5dWbpmAMpDGdIseG +wzSz5Y51wua6gVyWnGVRbudwq/0vvhSQCmCqMMkBdivHBj79S+IEg4XRqg8FK1jWGQllI Guqv/6et5CY82ig2p91sBp3i8VvLfHdvsp/lYs3oWzHhKrg02pqJbugH2BWstIm3ZwaO6/ sJlEd6aaiRtf6jJq5prsb7AUyOmdzwAPV/GfUog/u2N+cSaGavtY/CNHYThX6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716192797; a=rsa-sha256; cv=none; b=IvgC5ZQli819Q1NGX2EkLH4LexRkSUQ8fPTTNaCW11NoqPqgVejKztFDk6zJE9YDwab60h OMfQEi4s1y8/fMwDJd6dotW9bQWzfSYABitD9PL9moJkcine3bUnS42vNmw74sXlkOdDtl YpxZCh+AOcftsMUNrabNWhA2yOiJHViRH7ZdPK3jrmb/ayWNTiFWTOwyFUPf6pItknZLSV fJzUWp9XapD1sF83FomLx7LVB5m8qrErkayIeNU/fHzzMDSQfdjv+aWI3YfIhMfiOaKH4E etmx9EPFDA6vSsTveZZ6Q2bUyJ4c2UF9ezHL1bg4OGu5P2yvBbVtFYdG4P5hhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716192797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z5uf+ODNLclOPwL8slFxazUWBc36ENbCLlDX6NrO0+Y=; b=dhyHz7CRZntYa6ZVx877dF6wi33suukzjIlTmb55do26EwbK943Wz3z95kyhnX7lnnQEIJ ZNjaDwFXeq4OUVgNFJaW0afy3/hnAgGxOQAeVewRsapT1bU6zoiN9huFqCxQRLVJMelWgh VwI80LR/iDbh1Fe3caOuHt69fAxovggBtMfddOiu7c19EJ2YAyAlHWivJ1MwE8zg89PD7V 3ARTt1ftSSZVp+kYUKdUVubtgukzR4ckdLUVMZDoi3rLFmZYhA7LeFdq7jacOgAJL7gZq5 qagH8YXUbD6VmotSkibK7NfMM+64fxcB7yhz9UH5iVwj3hFo1DlnC+8TTkqVGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjVgd1gmgzWwv; Mon, 20 May 2024 08:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K8DHCX004414; Mon, 20 May 2024 08:13:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K8DHal004411; Mon, 20 May 2024 08:13:17 GMT (envelope-from git) Date: Mon, 20 May 2024 08:13:17 GMT Message-Id: <202405200813.44K8DHal004411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 14efb9bb7104 - stable/14 - Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14efb9bb710486a6fba349ec1b4b1b94a9a5a089 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=14efb9bb710486a6fba349ec1b4b1b94a9a5a089 commit 14efb9bb710486a6fba349ec1b4b1b94a9a5a089 Author: Dimitry Andric AuthorDate: 2024-05-16 18:21:45 +0000 Commit: Dimitry Andric CommitDate: 2024-05-20 08:12:56 +0000 Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang): [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694) This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like: /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust. (For rust itself there is also a similar issue reported at https://github.com/rust-lang/rust/pull/121088). PR: 276104 Reported by: netchild MFC after: 3 days (cherry picked from commit fcfb2d6393712dee3f1f8f0c3840d14817dea416) --- contrib/llvm-project/llvm/lib/TargetParser/Host.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp index 1adef15771fa..848b531dd8dd 100644 --- a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp +++ b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp @@ -1774,7 +1774,8 @@ bool sys::getHostCPUFeatures(StringMap &Features) { Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1); // AVX512 is only supported if the OS supports the context save for it. Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; - Features["evex512"] = Features["avx512f"]; + if (Features["avx512f"]) + Features["evex512"] = true; Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1); Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1); From nobody Mon May 20 08:13:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjVgy6HWFz5Jg3T; Mon, 20 May 2024 08:13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjVgy1b5Xz4jvY; Mon, 20 May 2024 08:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716192814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8wuoTB0YX+/xXMj2/vsT/oQ7atqRIT796DOYalHlZlA=; b=jytGM7o0dRHhqCY4OM3IU2QI3A/RNew0WPnXzkfb+jt8BXimOKIyvhB0NP6Bnri+s92pgG Hfo1zrAQ4NXJ0vQDeyVw7UHqobj6ZHm8AllzlDwp0LNDYgM+4+qc+C3MprsuHVjohcDI+Q lqMvRoeGXnzqm3MuAI0wGsFUhtcjy80K4G3wkUC6bhMUHndTHsN1EfEuPEUQMQa+KxVVy3 AlbdKWtjmFSwXNSQaY+tYRkhZipEDRj03yL1ez/XwUFIwX8IX6oj9WHlreOdzP/PhfHpkV SLPFXJMwkHzAKc05CkWq98Bvo73SDYsZm8iiPi/94WCU3kJj1H5GI7o6v/OFCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716192814; a=rsa-sha256; cv=none; b=V+2tsxR3EAxYeQu7Pt0cnK1eMclHLZ7O9zwTSvR/s7mLCNaNFTnyfO6T1E4GEuEI1afqaG E49vjt3yknaXByY7CDQd/U38kqfysZY80PdgDLrIfbPwsIprsCDUFefLJKLmHs6fPVrpiy KuFy4xs7xGOJijLSrWN7fej8pZ/V9eKk353hSJDXNOV8umm/mgxkmCq21bIBXBXeo1JoHM 8P8Q/J+6pJ1ocFmU+nTzmizdkeanlz93qWQmRBEHnbVqbFqedGl0/u/E/xzJvIClTdM0hJ Idl/NEBW2qTWb22eUppDSwOHkYfUBfSUv4/PzWFguPsztz1hZcJ0FtH5lKEejQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716192814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8wuoTB0YX+/xXMj2/vsT/oQ7atqRIT796DOYalHlZlA=; b=Y5Sb+JTj0dpdWHDHXDnOAbcPxb0BQQEyTbqnmwQpyv+5bipO7iYoe7D/HDx6Io5W0HJrTW I5Bckw5kV4zVsTUIKm9hhUUxcFtBnK8eFphogz1LupC1VI7qe0cJgSZ84dSX24PF3jQTID JSd33Rd2DdY2YP+OLxWBMyurpkELQrvJITjiQHJgaZ7WJrLPuGKtr/Jmq0K2eEbtNHVeUf 00kOru3BXfKc+Q136dbkJx1tUaO7mc/3EBRyzlGunRghnIpSVKlwM9aFXM2Rqm8VQH//88 oGBJ0cOaE6wDJgGeDp89vdt2juznvto8zk3pUozt9XGd8aYb/urB73+6sMI0Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjVgy16j7zX0W; Mon, 20 May 2024 08:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K8DYdr004598; Mon, 20 May 2024 08:13:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K8DYEd004595; Mon, 20 May 2024 08:13:34 GMT (envelope-from git) Date: Mon, 20 May 2024 08:13:34 GMT Message-Id: <202405200813.44K8DYEd004595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: b6011652be32 - stable/13 - Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b6011652be3240e9d702f28e572ea7993226aa23 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b6011652be3240e9d702f28e572ea7993226aa23 commit b6011652be3240e9d702f28e572ea7993226aa23 Author: Dimitry Andric AuthorDate: 2024-05-16 18:21:45 +0000 Commit: Dimitry Andric CommitDate: 2024-05-20 08:13:00 +0000 Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang): [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694) This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like: /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust. (For rust itself there is also a similar issue reported at https://github.com/rust-lang/rust/pull/121088). PR: 276104 Reported by: netchild MFC after: 3 days (cherry picked from commit fcfb2d6393712dee3f1f8f0c3840d14817dea416) --- contrib/llvm-project/llvm/lib/TargetParser/Host.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp index 1adef15771fa..848b531dd8dd 100644 --- a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp +++ b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp @@ -1774,7 +1774,8 @@ bool sys::getHostCPUFeatures(StringMap &Features) { Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1); // AVX512 is only supported if the OS supports the context save for it. Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; - Features["evex512"] = Features["avx512f"]; + if (Features["avx512f"]) + Features["evex512"] = true; Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1); Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1); From nobody Mon May 20 09:08:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjWv72W8Mz5KWV3; Mon, 20 May 2024 09:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjWv71lBCz4qwQ; Mon, 20 May 2024 09:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716196099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21WeJxEhr6k5HmMEJFxmaxPzXr3EAWcERN/3qY5Ci5U=; b=gAolrZB1dRhHwt71WnpTjIY272XzPmM5JrmEutCWM+881iwxUXah5+47apmobOKIiCuVGT Bso+otBEzzxEY+HDXNNVHmJ+gLN7rmEYf8EW1v5CVPe1cF5zd3tolo7yaLOt5zw/JTdnsc cUnwXs9K/0mGkO7CN9L+QyPVgV0UzKi7wVFgxJjLp0ukLHEP4l1RYuVwu06S9w0lY/6HL6 yyRfZYMZ57YK4DuW3jcBfMKjHyz78jSCLEt2ssA0lFvgB49PgKNaLPH0ee9ZIMRYT0e02J mZEctFkqPJgxnCIumdYlM/VqxM+uWh3kF5f7OK6ulAugPM5Xs8Qw1Nhe0CaWFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716196099; a=rsa-sha256; cv=none; b=Vi/ZgM1VA/qMnmj5ygsQ6pPgmWFnuKGNjlhE/qWgTSvuIRHOKCPPXAXMOE3/iZ4nj+3g+0 PwaeI6EQxYw7OFLd9Rn4WXu4lT6SzTM2yXW5m9nskAqu7Wq8ZpdxqPSr/xnzb2o6peWKCy 88kQtvZUTik2mxK7NSlJ1UcrnnQK1ZcEBdLdnFN4DJ8wC7G6177wGzq4c8vKMBi965AOhH nWotIY9qnLfhjNUX4wkL1I1SeIl/5+rvE45rysq0cKYLbelnDYbXIcpF9f5D6iV09ihhz5 xAuWPS0Hjtg+uloiL1PCHKPBqLGzNLAbnPz9h1mNpp9NSWEywJb68bX2BsnM5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716196099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21WeJxEhr6k5HmMEJFxmaxPzXr3EAWcERN/3qY5Ci5U=; b=Zy6pZB6Byj0QzVGSapVYGL/UqptbLrrSsHs9Bn7XMEMW/4/5W2X3/y5K6tiXTBcJZdRjrp 4cZNDB0l6q4yRzOAeIxEHK6oFs848Kg/d6OFMoUs4aEX/X3xj7ebQMvljZV1lqxj28SHgF BCUv04sfyPzMbrgKc/+OHdI/iFBu32i+Lg1zWRyifJn3YipRwMOgo6Odaz2uFHL/hXE5J5 8AFVD7poA9um5sTx9UChoQb6mHkc5k2aZxv7yIBQ031Hv+x9CCHWybzytaZApO3yD8PXi2 1xSagDnhNQAkt0adXJkUv6reZfforKP5Cw5TLvARrJCUi7UjLI5EklJor+dj3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjWv71GmFzXwq; Mon, 20 May 2024 09:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K98JH1090577; Mon, 20 May 2024 09:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K98J5E090574; Mon, 20 May 2024 09:08:19 GMT (envelope-from git) Date: Mon, 20 May 2024 09:08:19 GMT Message-Id: <202405200908.44K98J5E090574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: dd1a16c9e2c1 - stable/14 - ifconfig: Add format shortcuts. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dd1a16c9e2c1c95d9ac7ad0b082248e60ede0e99 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dd1a16c9e2c1c95d9ac7ad0b082248e60ede0e99 commit dd1a16c9e2c1c95d9ac7ad0b082248e60ede0e99 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-14 06:51:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 09:04:54 +0000 ifconfig: Add format shortcuts. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45166 (cherry picked from commit 847ef59d4b5eab234bd1f8eb947ad74bdab5614e) ifconfig: Markup nits. MFC after: 3 days Reviewed by: imp, allanjude Differential Revision: https://reviews.freebsd.org/D45209 (cherry picked from commit 42b28f815214aa582fe4ca707687d3af47850230) --- sbin/ifconfig/ifconfig.8 | 32 +++++++++++++++++++++++--------- sbin/ifconfig/ifconfig.c | 42 +++++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 26 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index a538981608cd..471d37ac1779 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -27,7 +27,7 @@ .\" .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" -.Dd November 08, 2023 +.Dd May 12, 2024 .Dt IFCONFIG 8 .Os .Sh NAME @@ -137,7 +137,7 @@ and their associated .Ar format strings are: .Pp -.Bl -tag -width ether +.Bl -tag -width default .It Cm addr Adjust the display of inet and inet6 addresses: .Pp @@ -202,6 +202,16 @@ Integer format, for example: .Ql prefixlen 64 .El .El +.Pp +In addition, the following shortcuts are accepted: +.Bl -tag -width default +.It Cm default +Resets all formats to their default values. +.It Cm cidr +Shortcut notation for +.Cm inet:cidr,inet6:cidr . +.El +.Pp .It Fl G Ar groupname Exclude members of the specified .Ar groupname @@ -464,13 +474,17 @@ sending out requests and listening for replies. .It Cm stickyarp Enable the so-called sticky ARP mode for the interface. If this option is enabled on the given interface, any resolved address is -marked as a static one and never expires. This may be used to increase +marked as a static one and never expires. +This may be used to increase security of the network by preventing ARP spoofing or to reduce latency for high-performance Ethernet networks where the time needed for ARP resolution is -too high. Please note that a similar feature is also provided for bridges. See +too high. +Please note that a similar feature is also provided for bridges. +See the sticky option in the .Sx Bridge Interface Parameters -section. Enabling this +section. +Enabling this option may impact techniques which rely on ARP expiration/overwriting feature such as load-balancers or high-availabity solutions such as .Xr carp 4 . @@ -1227,8 +1241,8 @@ Set the interval at which beacon frames are sent when operating in ad-hoc or ap mode. The .Ar interval -parameter is specified in TU's (1024 usecs). -By default beacon frames are transmitted every 100 TU's. +parameter is specified in TUs (1024 usecs). +By default beacon frames are transmitted every 100 TUs. .It Cm bmissthreshold Ar count Set the number of consecutive missed beacons at which the station will attempt to roam (i.e., search for a new access point). @@ -1885,8 +1899,8 @@ Use .Fl powersave to disable powersave operation when operating as a client. .It Cm powersavesleep Ar sleep -Set the desired max powersave sleep time in TU's (1024 usecs). -By default the max powersave sleep time is 100 TU's. +Set the desired max powersave sleep time in TUs (1024 usecs). +By default the max powersave sleep time is 100 TUs. .It Cm protmode Ar technique For interfaces operating in 802.11g, use the specified .Ar technique diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 7a78e9a934f7..402967d405fd 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -322,14 +322,10 @@ cmpifaddrs(struct ifaddrs *a, struct ifaddrs *b, struct ifa_queue *q) static void freeformat(void) { - if (f_inet != NULL) - free(f_inet); - if (f_inet6 != NULL) - free(f_inet6); - if (f_ether != NULL) - free(f_ether); - if (f_addr != NULL) - free(f_addr); + free(f_inet); + free(f_inet6); + free(f_ether); + free(f_addr); } static void setformat(char *input) @@ -339,9 +335,18 @@ static void setformat(char *input) formatstr = strdup(input); while ((category = strsep(&formatstr, ",")) != NULL) { modifier = strchr(category, ':'); - if (modifier == NULL || modifier[1] == '\0') { - warnx("Skipping invalid format specification: %s\n", - category); + if (modifier == NULL) { + if (strcmp(category, "default") == 0) { + freeformat(); + } else if (strcmp(category, "cidr") == 0) { + free(f_inet); + f_inet = strdup(category); + free(f_inet6); + f_inet6 = strdup(category); + } else { + warnx("Skipping invalid format: %s\n", + category); + } continue; } @@ -349,14 +354,19 @@ static void setformat(char *input) modifier[0] = '\0'; modifier++; - if (strcmp(category, "addr") == 0) + if (strcmp(category, "addr") == 0) { + free(f_addr); f_addr = strdup(modifier); - else if (strcmp(category, "ether") == 0) + } else if (strcmp(category, "ether") == 0) { + free(f_ether); f_ether = strdup(modifier); - else if (strcmp(category, "inet") == 0) + } else if (strcmp(category, "inet") == 0) { + free(f_inet); f_inet = strdup(modifier); - else if (strcmp(category, "inet6") == 0) + } else if (strcmp(category, "inet6") == 0) { + free(f_inet6); f_inet6 = strdup(modifier); + } } free(formatstr); } @@ -621,8 +631,6 @@ main(int ac, char *av[]) .io_s = -1, }; - f_inet = f_inet6 = f_ether = f_addr = NULL; - lifh = ifconfig_open(); if (lifh == NULL) err(EXIT_FAILURE, "ifconfig_open"); From nobody Mon May 20 09:08:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjWv849QCz5KWQ5; Mon, 20 May 2024 09:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjWv82RQQz4qwR; Mon, 20 May 2024 09:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716196100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uPyro+lygMklKOj0BZpiWk4a5rozG7ePItiWM1TBn/M=; b=irOE1HYJIAN+RlExIjDwpgTDHF2VHC2t/Zti6kGrUU0RhYc42EZPVd8qnoPXB8IouRTg6n dvA45+lNxMIdwdHEm1KyD5lc6K4n9Y7CgiquEDf9xOURcyXYeh9DgTPcYRfVMDbtcpKCJA cPPQt6YAwscVKvDMYlKhOdCcwcfbOWQ92mddNkiTpyRrcBCLC9GYIbp1mgSTJhPnuixvKQ vDhrjXbQE+aN5kBK+uXAbLOagwBlFtR2ET0Bz3xDCfTXt6mnfW/8a4EQgp5Qf1dxpPg4e8 bDxx2SKfrjireVqv8r6Lpkhlab+ZGa/YFbGf/RA7hDM0G07yT66OinJMdimYqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716196100; a=rsa-sha256; cv=none; b=KeRjY6BsLyqSUK+HT33N4+lrD4U73yBUapAYyPyKaeCF18q54YNTmJlg7agDUKJc699pl4 rF8WFsWrSlHI6KazzOyVSrrYNgp2eb7joPm4+ph6fLio1MrGtm23sx5sXt4Ccd2BOQGDqx zAvCwYYr9vS/KybuTxpqgdcrjER1z2EavB8tUVb1Ex4VMPhgWkZqvUjsTCkUm+gtlZYcVD zcS+UuYyX9K88ppC2mdxNSqjah9dh+0j7kfpvkrkvPT+sLJL+ZXWEmpXkXFA/KTHFTeztY 9U1NfdnA9ThLMQfVBWYqEfHVqrhhU4zBxuPV3J/rvqov4LBs+n+mKJxwmKSTIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716196100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uPyro+lygMklKOj0BZpiWk4a5rozG7ePItiWM1TBn/M=; b=d8+mssiOQmhnQjEbU2rmiOLEBfUPE9gCqhabluX3lmtlyc5M+4GfF/MQzWJG+KrXITrhuO phBCJGBMxHXdMGdsg2+A/qPElDB321YSGxnULU0Py4x4bOVPi+vdjN5hXxmwivfchEA0rW iDabBjRdau2AD85RWAZjO2trOHMpSQvqFBTrhES5XTyonmbwT8pWoIPtn7X9pGF2Wn0TqS hxyWD9sJ+cvxjf2W+myn+RIXarf2cGH157sFbopr/BwBh23IKQCDKUHhkay3+BxcwSUFgC jp7FqQzReJ8xLPlPYZGfJEP+vVmPxU6s4Epj8mcUkTD6ZjIZkMebGq6COeNKrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjWv81r2JzY7N; Mon, 20 May 2024 09:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K98KwE090628; Mon, 20 May 2024 09:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K98KQY090625; Mon, 20 May 2024 09:08:20 GMT (envelope-from git) Date: Mon, 20 May 2024 09:08:20 GMT Message-Id: <202405200908.44K98KQY090625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 745ee870031e - stable/14 - atf: Guard against multiple evaluation. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 745ee870031e3b35141fe720bdebe9baa234e942 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=745ee870031e3b35141fe720bdebe9baa234e942 commit 745ee870031e3b35141fe720bdebe9baa234e942 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:08:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 09:04:54 +0000 atf: Guard against multiple evaluation. Note that the ATF-C++ macros have the same issue, but they are not as easily fixed. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D45148 (cherry picked from commit a7beca6fb113986839de73b7cf73d933464898c6) --- contrib/atf/atf-c/macros.h | 151 ++++++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 56 deletions(-) diff --git a/contrib/atf/atf-c/macros.h b/contrib/atf/atf-c/macros.h index 1784fc47435d..abcb9f697907 100644 --- a/contrib/atf/atf-c/macros.h +++ b/contrib/atf/atf-c/macros.h @@ -167,65 +167,104 @@ ATF_CHECK_MSG((expected) == (actual), "%s != %s: " fmt, \ #expected, #actual, ##__VA_ARGS__) -#define ATF_REQUIRE_STREQ(expected, actual) \ - ATF_REQUIRE_MSG(strcmp(expected, actual) == 0, "%s != %s (%s != %s)", \ - #expected, #actual, expected, actual) - -#define ATF_CHECK_STREQ(expected, actual) \ - ATF_CHECK_MSG(strcmp(expected, actual) == 0, "%s != %s (%s != %s)", \ - #expected, #actual, expected, actual) - -#define ATF_REQUIRE_STREQ_MSG(expected, actual, fmt, ...) \ - ATF_REQUIRE_MSG(strcmp(expected, actual) == 0, \ - "%s != %s (%s != %s): " fmt, \ - #expected, #actual, expected, actual, ##__VA_ARGS__) - -#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) \ - ATF_CHECK_MSG(strcmp(expected, actual) == 0, \ - "%s != %s (%s != %s): " fmt, \ - #expected, #actual, expected, actual, ##__VA_ARGS__) - -#define ATF_REQUIRE_INTEQ(expected, actual) \ - ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual)) - -#define ATF_CHECK_INTEQ(expected, actual) \ - ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \ - #actual, (intmax_t)(expected), (intmax_t)(actual)) - -#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) \ - ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual), ##__VA_ARGS__) - -#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) \ - ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual), ##__VA_ARGS__) - -#define ATF_REQUIRE_MATCH(regexp, string) \ - ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s'", regexp, string); - -#define ATF_CHECK_MATCH(regexp, string) \ - ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s'", regexp, string); - -#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) \ - ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s': " fmt, regexp, string, \ - ##__VA_ARGS__); - -#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) \ - ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s': " fmt, regexp, string, \ - ##__VA_ARGS__); +#define ATF_REQUIRE_STREQ(expected, actual) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_REQUIRE_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_CHECK_STREQ(expected, actual) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_CHECK_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_REQUIRE_STREQ_MSG(expected, actual, fmt, ...) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_REQUIRE_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_CHECK_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_REQUIRE_INTEQ(expected, actual) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_REQUIRE_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_CHECK_INTEQ(expected, actual) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_CHECK_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_REQUIRE_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_CHECK_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_REQUIRE_MATCH(regexp, string) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_REQUIRE_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s'", _atf_regexp, _atf_string); \ + } while (0) + +#define ATF_CHECK_MATCH(regexp, string) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_CHECK_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s'", _atf_regexp, _atf_string); \ + } while (0) + +#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_REQUIRE_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s': " fmt, _atf_regexp, _atf_string, \ + ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_CHECK_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s': " fmt, _atf_regexp, _atf_string, \ + ##__VA_ARGS__); \ + } while (0) #define ATF_CHECK_ERRNO(exp_errno, bool_expr) \ - atf_tc_check_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr) + atf_tc_check_errno(__FILE__, __LINE__, (exp_errno), #bool_expr, (bool_expr)) #define ATF_REQUIRE_ERRNO(exp_errno, bool_expr) \ - atf_tc_require_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr) + atf_tc_require_errno(__FILE__, __LINE__, (exp_errno), #bool_expr, (bool_expr)) #endif /* !defined(ATF_C_MACROS_H) */ From nobody Mon May 20 09:08:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjWv96Txjz5KWKQ; Mon, 20 May 2024 09:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjWv945Hbz4r24; Mon, 20 May 2024 09:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716196101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4cx/ipxUwend4+5NOjq9RLK45hx8ZkKic8GGQ/0VtCk=; b=dSlqTdOLfd0NCWuPozwKHuxYThytg2/8IMm7a/4iY3VZOQZKiqICprQLh0dYdHhGK+k5sy 4Itg3+oWvSWRZ2I1t23y1dRy5kA8kRKYoMDgGpKTSq7Re9lZdhAUJJCpKYg/KF+/gJziUB 8bU7otGnMJI1s4OM1X8KdxqI9Vq3yAldf/gwyhnNdncVBE7JwelkY92b4kyHewj83Soc+u TZ5fS+AKlc6QhBhixaxZNn8eApUcW5Dbz3Fb63PvUEg3S23BUH0Os71OjJo2Eq3YXn26D9 Gj32NpwpW6nfMQjb3gFVhCy81vOdKpMGtQd3v0pX690eM0ocliVB7Vmj1YQyZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716196101; a=rsa-sha256; cv=none; b=Qo8w3CaW8i2VxTjf/3+ndMUjdosWcq9n0Ayo8Kf5jrmghritDJqWmUFa2c6CCT+/bw79Lw L+6YDvKjyrjFr+xTNbOIbvFyrT+kuC3pbHWQX/z/8EAfviSsu9XY3hXPVvVHHublTsPn19 K7BHHv4Ba5Dz85vFRP3f3HM9NSLSZX+pw4/f5pq23s3ty5GzzXCIfryQzelORCQTEItZfc 3dQceip/w/8pRFIddrL4QfDNyVtwYZ6h1eDhEEr2snvbxkTOMkLjyMozkSAk6AAHmfn7xK K4YLKMJHZoIo4T8XbwGhqu4Vv0OatwIPTYBl9xhasPigH1jHFclDorhgKmq+XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716196101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4cx/ipxUwend4+5NOjq9RLK45hx8ZkKic8GGQ/0VtCk=; b=WdZk27k4CGsUPOyqygEXYQZOW1MKCZIbw96jcbulmKrcbFHZuGDSgdxrnJvuZ5ZZOhKWvl e+0iVizZH0W6kdkFEB8Ow8Noi1Hi3g2vIrsd2F3v400xlWrDPjPgQLpxRTrZkz7B1nL2st 399CIsv7LIVkYf3QnCNPkwMR/zso10S3p/4C4/AuYRtthfX4IkTE5T2BYZ6+1++Q21VH9R pfzCJeVB2XkQrO5yetxncB14tDLDQBtfTTqLPngibjh8IQw7i78yBHsnPK93OkOquCBWxm C1nbLZOqUXcskHnONwjaXv4DC5vNTL2vyQxG11/Q9o7FuS3Xdkdx0x4oLvMwvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjWv92PLgzYCq; Mon, 20 May 2024 09:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K98LSt090686; Mon, 20 May 2024 09:08:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K98LUv090683; Mon, 20 May 2024 09:08:21 GMT (envelope-from git) Date: Mon, 20 May 2024 09:08:21 GMT Message-Id: <202405200908.44K98LUv090683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 7daf36028411 - stable/14 - ldns: Ignore commented-out lines in resolv.conf. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7daf36028411c3a9c73e0c75732f9cbcbf66362e Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7daf36028411c3a9c73e0c75732f9cbcbf66362e commit 7daf36028411c3a9c73e0c75732f9cbcbf66362e Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:16:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 09:04:54 +0000 ldns: Ignore commented-out lines in resolv.conf. This merges upstream PR 238 + an additional bug fix. PR: 278721 MFC after: 1 week (cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e) --- contrib/ldns/ldns/parse.h | 2 ++ contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- contrib/ldns/resolver.c | 53 ++++++++--------------------------------------- 3 files changed, 42 insertions(+), 48 deletions(-) diff --git a/contrib/ldns/ldns/parse.h b/contrib/ldns/ldns/parse.h index ba7edf5679d8..6130dae32bd2 100644 --- a/contrib/ldns/ldns/parse.h +++ b/contrib/ldns/ldns/parse.h @@ -95,6 +95,8 @@ ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, */ ldns_status ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed, const char *delim, int *line_nr); +ssize_t ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, size_t limit, int *line_nr); + /** * returns a token/char from the buffer b. * This function deals with ( and ) in the buffer, diff --git a/contrib/ldns/parse.c b/contrib/ldns/parse.c index 9698ba71e881..af8b2c1321b2 100644 --- a/contrib/ldns/parse.c +++ b/contrib/ldns/parse.c @@ -27,9 +27,14 @@ ldns_fget_token(FILE *f, char *token, const char *delim, size_t limit) return ldns_fget_token_l(f, token, delim, limit, NULL); } -ldns_status -ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed - , const char *delim, int *line_nr) +enum file_type2parse { + zone_file_type, resolv_conf_file_type +}; + +static ldns_status +ldns_fget_token_l_st_file_type(FILE *f, char **token, size_t *limit, + bool fixed, const char *delim, int *line_nr, + enum file_type2parse file_type) { int c, prev_c; int p; /* 0 -> no parentheses seen, >0 nr of ( seen */ @@ -98,7 +103,9 @@ ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed } /* do something with comments ; */ - if (c == ';' && quoted == 0) { + if ((c == ';' + || (c == '#' && file_type == resolv_conf_file_type)) + && quoted == 0) { if (prev_c != '\\') { com = 1; } @@ -215,6 +222,26 @@ tokenread: return i == 0 ? LDNS_STATUS_SYNTAX_EMPTY : LDNS_STATUS_OK; } +ldns_status +ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed + , const char *delim, int *line_nr) +{ + return ldns_fget_token_l_st_file_type( + f, token, limit, fixed, delim, line_nr, zone_file_type); +} + +ssize_t +ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, + size_t limit, int *line_nr) +{ + if (limit == 0) + limit = LDNS_MAX_LINELEN; + if (ldns_fget_token_l_st_file_type(f, &token, &limit, true, delim, + line_nr, resolv_conf_file_type)) + return -1; + else + return (ssize_t)strlen(token); +} ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr) diff --git a/contrib/ldns/resolver.c b/contrib/ldns/resolver.c index f9ec65a55966..a426b82c034e 100644 --- a/contrib/ldns/resolver.c +++ b/contrib/ldns/resolver.c @@ -775,7 +775,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) #endif ssize_t gtr, bgtr; ldns_buffer *b; - int lnr = 0, oldline; + int lnr = 0; FILE* myfp = fp; if(!line_nr) line_nr = &lnr; @@ -809,36 +809,18 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) gtr = 1; word[0] = 0; - oldline = *line_nr; expect = LDNS_RESOLV_KEYWORD; while (gtr > 0) { - /* check comments */ - if (word[0] == '#') { - word[0]='x'; - if(oldline == *line_nr) { - /* skip until end of line */ - int c; - do { - c = fgetc(myfp); - } while(c != EOF && c != '\n'); - if(c=='\n') (*line_nr)++; - } - /* and read next to prepare for further parsing */ - oldline = *line_nr; - continue; - } - oldline = *line_nr; switch(expect) { case LDNS_RESOLV_KEYWORD: /* keyword */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr != 0) { - if(word[0] == '#') continue; for(i = 0; i < LDNS_RESOLV_KEYWORDS; i++) { if (strcasecmp(keyword[i], word) == 0) { /* chosen the keyword and * expect values carefully - */ + */ expect = i; break; } @@ -856,16 +838,12 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_DEFDOMAIN: /* default domain dname */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { if(!fp) fclose(myfp); @@ -879,16 +857,12 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_NAMESERVER: /* NS aaaa or a record */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } if(strchr(word, '%')) { /* snip off interface labels, * fe80::222:19ff:fe31:4222%eth0 */ @@ -911,7 +885,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_SEARCH: /* search list domain dname */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); b = LDNS_MALLOC(ldns_buffer); if(!b) { ldns_resolver_deep_free(r); @@ -929,10 +903,6 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) bgtr = ldns_bget_token(b, word, LDNS_PARSE_NORMAL, (size_t) gtr + 1); while (bgtr > 0) { gtr -= bgtr; - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - break; - } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { ldns_resolver_deep_free(r); @@ -954,28 +924,23 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) } break; case LDNS_RESOLV_SORTLIST: - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* sortlist not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_OPTIONS: - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* options not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_ANCHOR: /* a file containing a DNSSEC trust anchor */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { ldns_resolver_deep_free(r); if(!fp) fclose(myfp); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } - #ifdef HAVE_SSL tmp_rr = ldns_read_anchor_file(word); (void) ldns_resolver_push_dnssec_anchor(r, tmp_rr); From nobody Mon May 20 09:35:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjXV05QXGz5KZVw; Mon, 20 May 2024 09:35: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjXV04lcyz4t4M; Mon, 20 May 2024 09:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Uz7lnOXG481NMh4ETQqmgh930TDZkoYSbUlZyWnf50=; b=r4Fofp+WCnJbHl/YLR5S233vI5dVYMhqjIzZmlIQl8fx1onl8r6QXSNtzPm7K+hGZ75PJj tfQ0b7DX/cuNrXslgJsaQYkwk93US3iG2Omaw5p/DhtVr+r2qK3JtcCrfpC+FKBH0aAzqq 4Z8fTVpxhEBu81HgFrLI4z6LQgf23RMXmbcf/7jEVtCjcI9YBf092EsUFbtXLAq08g2I44 5ZZA7ze/sW8SIxjOwCvBlnVWJlZ9nZEJvgQ9US8nBlJXqgcjz6U/XIQy2AMOTmQa+kVsDU u8AjCfcMMzZwbXAwA5apWnd7z2eg1tWnszTjpoDP+3Cu+08vumzmH+XNEhUrUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716197704; a=rsa-sha256; cv=none; b=MKfDDkERFrmyOYgk/tgPRmepEmmubuhwfTpWooVpi9ER4ozfCmnuu0Q9LQle6g9huTMczB UMQOjNzekqUNBSqtB7XxHLqheaXqWMw/cCB/A3seqXw2DJviYMvnwuLtyNtTEGr3dy6kpQ HmXLhuF+Rd3rUek9VyvJKZv25ZA0A/fuDnwxHvX4Q2DBpH6jStZBAosMfHyKV6ibf0/xry Xl9ZLXJMSy6bl8AR/vRNEqvOEdlFk6FOtXYn+w3ibYNIo0rvCUfDdAxMHYRyjeNQRVRcMJ 4YealxbGlPj8y/UBkJy9bhIoViJchaz/P/RevLcT7dRUhrAzAdjTuia/x7T0RQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Uz7lnOXG481NMh4ETQqmgh930TDZkoYSbUlZyWnf50=; b=UfxuTZjXPNudRa2luDLy3NGeqKaeP6AnI+GiAREXUzslOGvGgKdPXwTfInaoR1owZMKty8 trxhnnPmFyVKNDs82yTAbHwIvV64DPcvccsndTgwXdOGYo+NTxosO+hDm88dalUWeXONwL AnNT5W/Fhl1hQNUpU9xu8SSXE+XGolzg0uB4KTl6TIk01ON7lCwqdXD2drNk5MLExrwpI8 OalB7QSv7N08ZEtxXLVTOgVlIEcdf7Htw1DFjZV1Kaj3dpHJooQj06+q1rEVUzYd6uAALV 6Q37iwaZ1+MBJNrFBF6vId6MaT1uC9elqQMlIdmAIpoQM6eNOkYoxtPY8CkYLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjXV04M3lzYHx; Mon, 20 May 2024 09:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K9Z4Pf039691; Mon, 20 May 2024 09:35:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K9Z4O3039688; Mon, 20 May 2024 09:35:04 GMT (envelope-from git) Date: Mon, 20 May 2024 09:35:04 GMT Message-Id: <202405200935.44K9Z4O3039688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 54290c48db65 - stable/13 - ifconfig: Add format shortcuts. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 54290c48db65986b9953e27420c86a18c3bb21f7 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=54290c48db65986b9953e27420c86a18c3bb21f7 commit 54290c48db65986b9953e27420c86a18c3bb21f7 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-14 06:51:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 09:04:58 +0000 ifconfig: Add format shortcuts. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45166 (cherry picked from commit 847ef59d4b5eab234bd1f8eb947ad74bdab5614e) --- sbin/ifconfig/ifconfig.8 | 14 ++++++++++++-- sbin/ifconfig/ifconfig.c | 41 +++++++++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index f280a263cb51..28b6f2dfb72e 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -27,7 +27,7 @@ .\" .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" -.Dd February 1, 2023 +.Dd May 12, 2024 .Dt IFCONFIG 8 .Os .Sh NAME @@ -131,7 +131,7 @@ and their associated .Ar format strings are: .Pp -.Bl -tag -width ether +.Bl -tag -width default .It Cm addr Adjust the display of inet and inet6 addresses: .Pp @@ -193,6 +193,16 @@ Integer format, for example: .Ql prefixlen 64 .El .El +.Pp +In addition, the following shortcuts are accepted: +.Bl -tag -width default +.It Cm default +Resets all formats to their default values. +.It Cm cidr +Shortcut notation for +.Cm inet:cidr,inet6:cidr . +.El +.Pp .It Fl G Ar groupname Exclude members of the specified .Ar groupname diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 1537edfc5ea2..74dfb73f565f 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -303,14 +303,10 @@ cmpifaddrs(struct ifaddrs *a, struct ifaddrs *b, struct ifa_queue *q) static void freeformat(void) { - if (f_inet != NULL) - free(f_inet); - if (f_inet6 != NULL) - free(f_inet6); - if (f_ether != NULL) - free(f_ether); - if (f_addr != NULL) - free(f_addr); + free(f_inet); + free(f_inet6); + free(f_ether); + free(f_addr); } static void setformat(char *input) @@ -320,9 +316,18 @@ static void setformat(char *input) formatstr = strdup(input); while ((category = strsep(&formatstr, ",")) != NULL) { modifier = strchr(category, ':'); - if (modifier == NULL || modifier[1] == '\0') { - warnx("Skipping invalid format specification: %s\n", - category); + if (modifier == NULL) { + if (strcmp(category, "default") == 0) { + freeformat(); + } else if (strcmp(category, "cidr") == 0) { + free(f_inet); + f_inet = strdup(category); + free(f_inet6); + f_inet6 = strdup(category); + } else { + warnx("Skipping invalid format: %s\n", + category); + } continue; } @@ -330,14 +335,19 @@ static void setformat(char *input) modifier[0] = '\0'; modifier++; - if (strcmp(category, "addr") == 0) + if (strcmp(category, "addr") == 0) { + free(f_addr); f_addr = strdup(modifier); - else if (strcmp(category, "ether") == 0) + } else if (strcmp(category, "ether") == 0) { + free(f_ether); f_ether = strdup(modifier); - else if (strcmp(category, "inet") == 0) + } else if (strcmp(category, "inet") == 0) { + free(f_inet); f_inet = strdup(modifier); - else if (strcmp(category, "inet6") == 0) + } else if (strcmp(category, "inet6") == 0) { + free(f_inet6); f_inet6 = strdup(modifier); + } } free(formatstr); } @@ -427,7 +437,6 @@ main(int argc, char *argv[]) #endif all = downonly = uponly = namesonly = noload = verbose = 0; - f_inet = f_inet6 = f_ether = f_addr = NULL; matchgroup = nogroup = NULL; lifh = ifconfig_open(); From nobody Mon May 20 09:35:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjXV2032Yz5KZ4L; Mon, 20 May 2024 09:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjXV15mWxz4tMx; Mon, 20 May 2024 09:35:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VSIE3yzHQvXkshHz0eDF3TRkv8Gw8FFtlxp6ZE8yBeI=; b=hvAMLTZZTOWdVTYkkwXRr6xtmqElwEUjpk87AGqIPo4CoauxwK4S0BJjFH4ZRut0ABJaDB psmc9de6e8bT66VP1/H3lUDbNkeoyko34QFGxmKXNICaqH0HwF+Boq6NsBtAq1hhETsI5U /il/2TPtTmETEtFFddJt8gaWOuju9q9IaHWYdz2HYFfvoPbz1O8popL4dCpaBjFpOGVqO4 CHRjrtbzXM081LMU540W4kGkLkfHvDo0toVPgRNiCUktnwjcrAqAiTSatb4DuyA747JFRw 6d6Z4mzAOCu8knN41zYGjdF7HghkfM8OeDGT50OqMWLcobmBYitC4Xr15+h13Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716197705; a=rsa-sha256; cv=none; b=lm+4B8P3a5sGRl7zMBMwWWz4/K+mRJCSme8tWAROYOQqNoXBAb4WAm8dXRqeygr7SugG0U O/fwl/5wllhfvJ7sDBCV6TkZQvvP0AWQssJXl2PkazMj4P/O3Fi3sV+QWMqkgZQ+WGWVm2 SRKsFMYJndHyO5j1DcTCw52r7tu08vNvbraWX492wGYTA2nndAvzOmPOOMkktkk3YMDMb5 wunhozp804eZ5PTKFB+uLL+CuixdQo94EdW5ms0w55RgxZ5cf7yTDQ3HKvGi2QX0DQMIBg G26H8XawZlbKhvN9VA1EjDidJ1RSjj0hizTy7/RvbDOeLwU1WWDIyF1v8zqQuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VSIE3yzHQvXkshHz0eDF3TRkv8Gw8FFtlxp6ZE8yBeI=; b=Ul6Wpn/u6S52dLk/QY6xAkyeDVfTs54IDBhNW5sxkG22NWv2UfIoRe/4RzwpkpxThGrJJq 40Ja3tQdDTxEWASPXNvtoQzPIrsxR5h8oTsSYWbhDOPzeG3jWblcrjsaM75fLuZFKOwQ54 LrVU84Ai7lo9iGbVO1yrAFudS3c4GA+N/DTayWtDkbEAxyDMfwa0tQYWRcMQiCQcMm9znj EHyIcVW+QqgFjaD70adMys9fE+r+3z6JgBgZLEesMZLOajhBwbqyTPnVyXdNqWq9IaqUQc wGeNiIPeGIPs/eTWW6Z/UKgCNV4EUjsGIV9Bet6f/mMS18UPMmxySYRyGznJ6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjXV15MQVzYXq; Mon, 20 May 2024 09:35:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K9Z5lf039737; Mon, 20 May 2024 09:35:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K9Z5PY039734; Mon, 20 May 2024 09:35:05 GMT (envelope-from git) Date: Mon, 20 May 2024 09:35:05 GMT Message-Id: <202405200935.44K9Z5PY039734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: fe623d689bd7 - stable/13 - Import atf 0.22 snapshot 55c21b2c5fb189bbdfccb2b297bfa89236502542 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fe623d689bd7dc3bb6f5418e53fac454999e8dce Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fe623d689bd7dc3bb6f5418e53fac454999e8dce commit fe623d689bd7dc3bb6f5418e53fac454999e8dce Author: Alan Somers AuthorDate: 2021-09-10 23:08:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 09:04:59 +0000 Import atf 0.22 snapshot 55c21b2c5fb189bbdfccb2b297bfa89236502542 The main improvement is the ability to skip a test that is expected to fail. (cherry picked from commit 71a1ae7cebd3791d4d18ac9620a7a4ce8cf15819) --- contrib/atf/atf-c/atf-c.3 | 27 ++++++++++++++++++++++----- contrib/atf/atf-c/macros.h | 19 +++++++++++++++++++ contrib/atf/atf-c/tc.c | 12 +++--------- contrib/atf/atf-sh/atf-check.cpp | 4 ++-- contrib/atf/atf-sh/atf-sh.3 | 12 ++++++------ 5 files changed, 52 insertions(+), 22 deletions(-) diff --git a/contrib/atf/atf-c/atf-c.3 b/contrib/atf/atf-c/atf-c.3 index d7aa8c382dff..c38e068bb380 100644 --- a/contrib/atf/atf-c/atf-c.3 +++ b/contrib/atf/atf-c/atf-c.3 @@ -22,7 +22,7 @@ .\" 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. -.Dd April 5, 2017 +.Dd February 23, 2021 .Dt ATF-C 3 .Os .Sh NAME @@ -35,6 +35,8 @@ .Nm ATF_CHECK_MATCH_MSG , .Nm ATF_CHECK_STREQ , .Nm ATF_CHECK_STREQ_MSG , +.Nm ATF_CHECK_INTEQ , +.Nm ATF_CHECK_INTEQ_MSG , .Nm ATF_CHECK_ERRNO , .Nm ATF_REQUIRE , .Nm ATF_REQUIRE_MSG , @@ -44,6 +46,8 @@ .Nm ATF_REQUIRE_MATCH_MSG , .Nm ATF_REQUIRE_STREQ , .Nm ATF_REQUIRE_STREQ_MSG , +.Nm ATF_REQUIRE_INTEQ , +.Nm ATF_REQUIRE_INTEQ_MSG , .Nm ATF_REQUIRE_ERRNO , .Nm ATF_TC , .Nm ATF_TC_BODY , @@ -96,8 +100,10 @@ .Fn ATF_CHECK_EQ_MSG "expected_expression" "actual_expression" "fail_msg_fmt" ... .Fn ATF_CHECK_MATCH "regexp" "string" .Fn ATF_CHECK_MATCH_MSG "regexp" "string" "fail_msg_fmt" ... -.Fn ATF_CHECK_STREQ "string_1" "string_2" -.Fn ATF_CHECK_STREQ_MSG "string_1" "string_2" "fail_msg_fmt" ... +.Fn ATF_CHECK_STREQ "expected_string" "actual_string" +.Fn ATF_CHECK_STREQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ... +.Fn ATF_CHECK_INTEQ "expected_int" "actual_int" +.Fn ATF_CHECK_INTEQ_MSG "expected_int" "actual_int" "fail_msg_fmt" ... .Fn ATF_CHECK_ERRNO "expected_errno" "bool_expression" .Fn ATF_REQUIRE "expression" .Fn ATF_REQUIRE_MSG "expression" "fail_msg_fmt" ... @@ -107,6 +113,8 @@ .Fn ATF_REQUIRE_MATCH_MSG "regexp" "string" "fail_msg_fmt" ... .Fn ATF_REQUIRE_STREQ "expected_string" "actual_string" .Fn ATF_REQUIRE_STREQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ... +.Fn ATF_REQUIRE_INTEQ "expected_int" "actual_int" +.Fn ATF_REQUIRE_INTEQ_MSG "expected_int" "actual_int" "fail_msg_fmt" ... .Fn ATF_REQUIRE_ERRNO "expected_errno" "bool_expression" .\" NO_CHECK_STYLE_END .Fn ATF_TC "name" @@ -494,7 +502,7 @@ and .Fn ATF_REQUIRE_EQ_MSG take two expressions and fail if the two evaluated values are not equal. The common style is to put the expected value in the first parameter and the -actual value in the second parameter. +observed value in the second parameter. .Pp .Fn ATF_CHECK_MATCH , .Fn ATF_CHECK_MATCH_MSG , @@ -513,7 +521,16 @@ and .Fn ATF_REQUIRE_STREQ_MSG take two strings and fail if the two are not equal character by character. The common style is to put the expected string in the first parameter and the -actual string in the second parameter. +observed string in the second parameter. +.Pp +.Fn ATF_CHECK_INTEQ , +.Fn ATF_CHECK_INTEQ_MSG , +.Fn ATF_REQUIRE_INTEQ +and +.Fn ATF_REQUIRE_INTQ_MSG +take two integers and fail if the two are not equal. +The common style is to put the expected integer in the first parameter and the +observed integer in the second parameter. .Pp .Fn ATF_CHECK_ERRNO and diff --git a/contrib/atf/atf-c/macros.h b/contrib/atf/atf-c/macros.h index 485a159acecb..1784fc47435d 100644 --- a/contrib/atf/atf-c/macros.h +++ b/contrib/atf/atf-c/macros.h @@ -185,6 +185,25 @@ "%s != %s (%s != %s): " fmt, \ #expected, #actual, expected, actual, ##__VA_ARGS__) +#define ATF_REQUIRE_INTEQ(expected, actual) \ + ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", \ + #expected, #actual, (intmax_t)(expected), \ + (intmax_t)(actual)) + +#define ATF_CHECK_INTEQ(expected, actual) \ + ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \ + #actual, (intmax_t)(expected), (intmax_t)(actual)) + +#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) \ + ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ + #expected, #actual, (intmax_t)(expected), \ + (intmax_t)(actual), ##__VA_ARGS__) + +#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) \ + ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ + #expected, #actual, (intmax_t)(expected), \ + (intmax_t)(actual), ##__VA_ARGS__) + #define ATF_REQUIRE_MATCH(regexp, string) \ ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ "'%s' not matched in '%s'", regexp, string); diff --git a/contrib/atf/atf-c/tc.c b/contrib/atf/atf-c/tc.c index 69b31123f3a3..84a8beb4fa13 100644 --- a/contrib/atf/atf-c/tc.c +++ b/contrib/atf/atf-c/tc.c @@ -381,15 +381,9 @@ pass(struct context *ctx) static void skip(struct context *ctx, atf_dynstr_t *reason) { - if (ctx->expect == EXPECT_PASS) { - create_resfile(ctx, "skipped", -1, reason); - context_close_resfile(ctx); - exit(EXIT_SUCCESS); - } else { - error_in_expect(ctx, "Can only skip a test case when running in " - "expect pass mode"); - } - UNREACHABLE; + create_resfile(ctx, "skipped", -1, reason); + context_close_resfile(ctx); + exit(EXIT_SUCCESS); } /** Formats a failure/skip reason message. diff --git a/contrib/atf/atf-sh/atf-check.cpp b/contrib/atf/atf-sh/atf-check.cpp index 38ab527aab54..4cb1e33a005a 100644 --- a/contrib/atf/atf-sh/atf-check.cpp +++ b/contrib/atf/atf-sh/atf-check.cpp @@ -501,7 +501,7 @@ compare_files(const atf::fs::path& p1, const atf::fs::path& p2) std::ifstream f2(p2.c_str()); if (!f2) - throw std::runtime_error("Failed to open " + p1.str()); + throw std::runtime_error("Failed to open " + p2.str()); for (;;) { char buf1[512], buf2[512]; @@ -512,7 +512,7 @@ compare_files(const atf::fs::path& p1, const atf::fs::path& p2) f2.read(buf2, sizeof(buf2)); if (f2.bad()) - throw std::runtime_error("Failed to read from " + p1.str()); + throw std::runtime_error("Failed to read from " + p2.str()); if ((f1.gcount() == 0) && (f2.gcount() == 0)) { equal = true; diff --git a/contrib/atf/atf-sh/atf-sh.3 b/contrib/atf/atf-sh/atf-sh.3 index 5d1119b2b5dc..c3080c296826 100644 --- a/contrib/atf/atf-sh/atf-sh.3 +++ b/contrib/atf/atf-sh/atf-sh.3 @@ -22,7 +22,7 @@ .\" 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. -.Dd June 08, 2017 +.Dd January 27, 2021 .Dt ATF-SH 3 .Os .Sh NAME @@ -361,21 +361,21 @@ This example demonstrates the use of the very useful function: .Bd -literal -offset indent # Check for silent output -atf_check -s exit:0 -o empty -e empty 'true' +atf_check -s exit:0 -o empty -e empty true # Check for silent output and failure -atf_check -s exit:1 -o empty -e empty 'false' +atf_check -s exit:1 -o empty -e empty false # Check for known stdout and silent stderr echo foo >expout -atf_check -s exit:0 -o file:expout -e empty 'echo foo' +atf_check -s exit:0 -o file:expout -e empty echo foo # Generate a file for later inspection -atf_check -s exit:0 -o save:stdout -e empty 'ls' +atf_check -s exit:0 -o save:stdout -e empty ls grep foo ls || atf_fail "foo file not found in listing" # Or just do the match along the way -atf_check -s exit:0 -o match:"^foo$" -e empty 'ls' +atf_check -s exit:0 -o match:"^foo$" -e empty ls .Ed .Sh SEE ALSO .Xr atf-check 1 , From nobody Mon May 20 09:35:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjXV34tcYz5KZWX; Mon, 20 May 2024 09:35: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjXV30T6pz4tQZ; Mon, 20 May 2024 09:35:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V0q4MObuoZFHZ2tn/4aiO6Oprq5124GVsCb56Y3hmhc=; b=O0bVoCSFEvPWrB6xusOnmI1Q+6F+ECwZiXyX2GSjNaOSe4BycJqk+sG0KxSJAl0bBMsHLJ YUQBl0Q+1jcXPg8UGWKf/BGPFFRQ4EVO7EqUR1rnPw/n/6ti/uuuj0Pb7gy3xt6t9YKD2m kOllB7c1vczzstEHXGeS2GuuiSPqtfoNNAo6gO2JXHpgKoJkqorlniumL9bXYUZexltSnF 9rM2mBcilDIZVqwYQEiD/ygiWK/XDkGhVrj/8w5XOes5A8AsuoLmgoy9H40gb/oBrp2aNb rGLV1dP4iUHn+6v2Mk6dg9TkanDQDjGEpMsJJZMrlGj3aD0GL6bCMIt5K36oYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716197707; a=rsa-sha256; cv=none; b=sataKIa9dWRnRbSTWDXPGViHdVamTkOslxNRlucGvO6HJrbqjUKK3a19KDjMETmBTzluN6 VFdUGyGB/Dfheqq2Lqf0PJL4lnX7AFG4+0dhrZnWo+9cOxg3Td0ntcW3DJNI38G+qhWHh9 z5p/pNcAqr+9vyWVQTkAMQCy6mJJJjdjJfHtfNijwP3G2LydFTyKXdgE0VYBfsH4rV6K67 ke5DuvaaWg8SMmNvyyEfpXbQqke3GiIwDVmPvQNqml2B94vitmrkks1IMnIfETC9HkuR0o Rj6Pal69PLycXqwC2esL+4CxuXZ70akHKALjnya+nya7wznj5foCzPSu8TYImA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V0q4MObuoZFHZ2tn/4aiO6Oprq5124GVsCb56Y3hmhc=; b=TiuC95PA2jQgTzQBrunpuu009IM++lIZomz4whZGgESlNsi8nS5tR0uTjLD8xxWnBadxIi c+HskDybzxY0Os2kPLpCBkhv+jv7Q5i8fxipwYvkEySQhjSXpmJ7vxFc2DYVIdeR+da2Si EGzSyX6re/3j8mOKPWi1oOFMQyDv6UR3sluas1lS5dSq0x5K248veSge1j4r9r5kB0n52j aSLA605M1tdQIStq8ZeG5WfdQ1yDV0sOg4lVqWdB4SldGJHbTtpDELUUGgQpnWi7Ux+JI/ 40HwU6CdL6c18eENR85/Dj24wXM6cRkHEjCwL2aXd2ay7tU9wpph0gEc/a0L8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjXV25vCczYXr; Mon, 20 May 2024 09:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K9Z6S9039779; Mon, 20 May 2024 09:35:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K9Z6Hc039776; Mon, 20 May 2024 09:35:06 GMT (envelope-from git) Date: Mon, 20 May 2024 09:35:06 GMT Message-Id: <202405200935.44K9Z6Hc039776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a8177d8f570f - stable/13 - atf-sh: fix comment typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a8177d8f570f52b60fc8af6926f9f5db69334239 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a8177d8f570f52b60fc8af6926f9f5db69334239 commit a8177d8f570f52b60fc8af6926f9f5db69334239 Author: Igor Ostapenko AuthorDate: 2023-12-26 23:21:54 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 09:04:59 +0000 atf-sh: fix comment typo Signed-off-by: Igor Ostapenko Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/895 (cherry picked from commit d4d14d965fb92d2bceb744be41310dc47f27ab80) --- contrib/atf/atf-sh/libatf-sh.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/atf/atf-sh/libatf-sh.subr b/contrib/atf/atf-sh/libatf-sh.subr index a2478b6a9be1..af2b75e5fe34 100644 --- a/contrib/atf/atf-sh/libatf-sh.subr +++ b/contrib/atf/atf-sh/libatf-sh.subr @@ -358,7 +358,7 @@ atf_require_prog() # # Sets the test case's variable 'varname' to the specified values # which are concatenated using a single blank space. This function -# is supposed to be called form the test case's head only. +# is supposed to be called from the test case's head only. # atf_set() { From nobody Mon May 20 09:35:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjXV50VTpz5KZCv; Mon, 20 May 2024 09:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjXV40DN0z4t4f; Mon, 20 May 2024 09:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uF3jUX02zaqmUh6j0iPFkKscVhb91CiTDjIb4IdAPqg=; b=T8TgTWRSwgZOWQ9Xnispg683/W5+s7NH0PgsOH71yHXF/qwjeAHthRu75n2tYVdNAdZkty trpaeHmXq9Xx3Qqe7Puw6XV0u4CAKCMY3+arwhIBEHCKGiy7QzPlKR1D6p+zkYyIYD4Oip 5VeeLYFvc5fK408TWT9qNyEB2INkNNH7QTxnQPi9P01hrjEeC1Gz9HvPtYEWoD3t/7YpdV /DUt1PHHV8WDnZwydFQcZHypAuPZWZbBFLMcK/xBN6/SKrPzxOX7Ifl2iDELp4KVPDcuG8 V/fteBJRvQ+AQyFRTBzfmYtyDf6/R6I3nNokRQ8+pSREM3nZ7CLP5IndWueUUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716197708; a=rsa-sha256; cv=none; b=Z3NYsR6J6oGX6OZBS1TM9GlfR7DHqC43+0kegakzrf0WwbN7sOvye8wUHCs718toHz2d+g suYuiHGx1bFlBHBnKuuN24GYKNuaYd0eRcoz6KDIfp+woYkUxmAi87ULVCKlbW0ItLui+1 ns54kKzBfHxP+q/XfK2Pv0OyVPqZe2Z4wejpS+R28TRC2kqomhYAm5M48ggWG9ThVeAi6D M07IuuQLvIE1nW4KEPA0AD88hKuWr5FAEFXnKIFUk0z2qBSsOZimHy86G4Ax6wPvWWWV6z 2tzHewbDhk6aCxuEGESbEgun6n9RtoGjW7w5TsM+2Dy2MkZcFTKJmYJ0GhyR1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uF3jUX02zaqmUh6j0iPFkKscVhb91CiTDjIb4IdAPqg=; b=pelSDDTICzU5Nne6h1wY6XxFt6Upsy78sSSiBJWiFXIagXo3zP7q37U7iSL+oX+2ciZyBK +igrJnGPtRe8WMiZ0EJYI/UZJVrJTJWZ0I5u+DLrGBvsEahBY4xdamW14UzVTptTzYR0kX va3aAPuWq/7K4pUTEbbWVig5Pi5qPgyoJQL/G5CA0fDufgpr4xIUz+FcG8/n0WXkn2C258 Tq2et94RPsua3XbBlTfoHdF+O3RmHWee6bL88nqrZ6zeZ/uh6MsPY7UlTyE60YgOczcxJy 9XrIXZiYUlAzasuQOQENtkgEoPX7vrp6r7Gvt1hZye83Qb6y2obQCvu4gtnhQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjXV36v8WzYT3; Mon, 20 May 2024 09:35:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K9Z72R039824; Mon, 20 May 2024 09:35:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K9Z7of039821; Mon, 20 May 2024 09:35:07 GMT (envelope-from git) Date: Mon, 20 May 2024 09:35:07 GMT Message-Id: <202405200935.44K9Z7of039821@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: d16bc4fda821 - stable/13 - atf: Guard against multiple evaluation. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d16bc4fda8215adab6b1c219ec2edd862fd757ac Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d16bc4fda8215adab6b1c219ec2edd862fd757ac commit d16bc4fda8215adab6b1c219ec2edd862fd757ac Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:08:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 09:04:59 +0000 atf: Guard against multiple evaluation. Note that the ATF-C++ macros have the same issue, but they are not as easily fixed. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D45148 (cherry picked from commit a7beca6fb113986839de73b7cf73d933464898c6) --- contrib/atf/atf-c/macros.h | 151 ++++++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 56 deletions(-) diff --git a/contrib/atf/atf-c/macros.h b/contrib/atf/atf-c/macros.h index 1784fc47435d..abcb9f697907 100644 --- a/contrib/atf/atf-c/macros.h +++ b/contrib/atf/atf-c/macros.h @@ -167,65 +167,104 @@ ATF_CHECK_MSG((expected) == (actual), "%s != %s: " fmt, \ #expected, #actual, ##__VA_ARGS__) -#define ATF_REQUIRE_STREQ(expected, actual) \ - ATF_REQUIRE_MSG(strcmp(expected, actual) == 0, "%s != %s (%s != %s)", \ - #expected, #actual, expected, actual) - -#define ATF_CHECK_STREQ(expected, actual) \ - ATF_CHECK_MSG(strcmp(expected, actual) == 0, "%s != %s (%s != %s)", \ - #expected, #actual, expected, actual) - -#define ATF_REQUIRE_STREQ_MSG(expected, actual, fmt, ...) \ - ATF_REQUIRE_MSG(strcmp(expected, actual) == 0, \ - "%s != %s (%s != %s): " fmt, \ - #expected, #actual, expected, actual, ##__VA_ARGS__) - -#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) \ - ATF_CHECK_MSG(strcmp(expected, actual) == 0, \ - "%s != %s (%s != %s): " fmt, \ - #expected, #actual, expected, actual, ##__VA_ARGS__) - -#define ATF_REQUIRE_INTEQ(expected, actual) \ - ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual)) - -#define ATF_CHECK_INTEQ(expected, actual) \ - ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \ - #actual, (intmax_t)(expected), (intmax_t)(actual)) - -#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) \ - ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual), ##__VA_ARGS__) - -#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) \ - ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual), ##__VA_ARGS__) - -#define ATF_REQUIRE_MATCH(regexp, string) \ - ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s'", regexp, string); - -#define ATF_CHECK_MATCH(regexp, string) \ - ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s'", regexp, string); - -#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) \ - ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s': " fmt, regexp, string, \ - ##__VA_ARGS__); - -#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) \ - ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s': " fmt, regexp, string, \ - ##__VA_ARGS__); +#define ATF_REQUIRE_STREQ(expected, actual) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_REQUIRE_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_CHECK_STREQ(expected, actual) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_CHECK_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_REQUIRE_STREQ_MSG(expected, actual, fmt, ...) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_REQUIRE_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_CHECK_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_REQUIRE_INTEQ(expected, actual) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_REQUIRE_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_CHECK_INTEQ(expected, actual) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_CHECK_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_REQUIRE_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_CHECK_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_REQUIRE_MATCH(regexp, string) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_REQUIRE_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s'", _atf_regexp, _atf_string); \ + } while (0) + +#define ATF_CHECK_MATCH(regexp, string) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_CHECK_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s'", _atf_regexp, _atf_string); \ + } while (0) + +#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_REQUIRE_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s': " fmt, _atf_regexp, _atf_string, \ + ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_CHECK_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s': " fmt, _atf_regexp, _atf_string, \ + ##__VA_ARGS__); \ + } while (0) #define ATF_CHECK_ERRNO(exp_errno, bool_expr) \ - atf_tc_check_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr) + atf_tc_check_errno(__FILE__, __LINE__, (exp_errno), #bool_expr, (bool_expr)) #define ATF_REQUIRE_ERRNO(exp_errno, bool_expr) \ - atf_tc_require_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr) + atf_tc_require_errno(__FILE__, __LINE__, (exp_errno), #bool_expr, (bool_expr)) #endif /* !defined(ATF_C_MACROS_H) */ From nobody Mon May 20 09:35:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjXV52qDWz5KZg9; Mon, 20 May 2024 09:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjXV51Kgbz4tKG; Mon, 20 May 2024 09:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dlkMbBSU3qWhHGsJbLRrWuPdL+yxKp/gKeTNrXVAUnc=; b=CJAuRdlU9hBHGbNErLbEBWr47a0H1HqrmLsTeX6XP3Jt8QTkFjMB3WdCCXsHBagjznPXUE llIBt8iEsJlWOYoyAvBnW8wKzh3AeskKjWkE5Nokv5h5YEedAhsMoPF0OmLXpKizFPOgYe Zkbob8MUaW8ZOrZMxTr9Lg+i5ALc0zWWEH2jYOeE3AXo+GiI82BhTBm73KeBQlsBAb+EdI Ll3/S0tIFSWV+2dv/bBM8D+iUnz0JX1HNP3AXmrO5i1sPsZc9YTs/j5FSJUkWFUfN1OjXs fR6Nr3DavH2oQzDq4hSST8KakhiRbE9f6IqbfEs2LF/8hEAwdeIAIbxTQTlmSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716197709; a=rsa-sha256; cv=none; b=vgxxSPIvAeBCiNdJYfidZ5cBrDR9PdO4BqfuR0VMI83o/SsRVCyNtRABSfTeW5090QKlw4 uSyc5hKn12J+GnoSWkPdkn473R97cgEicqYjKFX9H1oHqrdY8BGVCi2/5gduG78z3tsw6w OBdbncKfodLHUs5F3ZWjFunCFH3RumlSv6HvrIhUmN+xmLGPe9U6PIMu+J5+4zRXStn/sT 27ak9O1TeU115TW4vdl/Xh5UxhvQ96WR2HHYzEYASYENdTAOqF83tlkSqS13VmGQwzgl95 25Y/eyoiXdMi23uKGoifAc0wh9IMj4VexEA63fB5lKMDioBGeQMtE3FlMaI6Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716197709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dlkMbBSU3qWhHGsJbLRrWuPdL+yxKp/gKeTNrXVAUnc=; b=QNPE3s+MXMq5X+bSDLqwUPsXBGsQ9hi8OTId0cvre87MkTltR6SMWJZn/81/JVX/i4RwqE azh+wvfHE5fe1uoWl9IcFPZWSog3Oez0yAYVsycNOZCkkgM1iBmkHGTPQ03Wre3IagpmH9 OxQ4tCMDtPKg6KhSYXJL29363CA80ziUrI3a8LL6oKrnPRvpJi0QHpndU9p/QgxCe8gtFf Us/i7D/myp8QMuD/DZNw7EY9Fr39YV2505WKaLP+3HmYkYzBOSpPouDOwVLI63Q/Sk8Wvb +kCWke6k9rn1PFVFq4gQ5pxzCFiUSzSCRBiCImyXGqOCiGvRoOVUX9Uh8IFNDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjXV50jgMzYjL; Mon, 20 May 2024 09:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44K9Z8Jw039875; Mon, 20 May 2024 09:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K9Z82g039872; Mon, 20 May 2024 09:35:08 GMT (envelope-from git) Date: Mon, 20 May 2024 09:35:08 GMT Message-Id: <202405200935.44K9Z82g039872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e95e16191f63 - stable/13 - ldns: Ignore commented-out lines in resolv.conf. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e95e16191f63240971687634a23c2defed64d713 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e95e16191f63240971687634a23c2defed64d713 commit e95e16191f63240971687634a23c2defed64d713 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:16:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 09:04:59 +0000 ldns: Ignore commented-out lines in resolv.conf. This merges upstream PR 238 + an additional bug fix. PR: 278721 MFC after: 1 week (cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e) --- contrib/ldns/ldns/parse.h | 2 ++ contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- contrib/ldns/resolver.c | 53 ++++++++--------------------------------------- 3 files changed, 42 insertions(+), 48 deletions(-) diff --git a/contrib/ldns/ldns/parse.h b/contrib/ldns/ldns/parse.h index ba7edf5679d8..6130dae32bd2 100644 --- a/contrib/ldns/ldns/parse.h +++ b/contrib/ldns/ldns/parse.h @@ -95,6 +95,8 @@ ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, */ ldns_status ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed, const char *delim, int *line_nr); +ssize_t ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, size_t limit, int *line_nr); + /** * returns a token/char from the buffer b. * This function deals with ( and ) in the buffer, diff --git a/contrib/ldns/parse.c b/contrib/ldns/parse.c index 9698ba71e881..af8b2c1321b2 100644 --- a/contrib/ldns/parse.c +++ b/contrib/ldns/parse.c @@ -27,9 +27,14 @@ ldns_fget_token(FILE *f, char *token, const char *delim, size_t limit) return ldns_fget_token_l(f, token, delim, limit, NULL); } -ldns_status -ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed - , const char *delim, int *line_nr) +enum file_type2parse { + zone_file_type, resolv_conf_file_type +}; + +static ldns_status +ldns_fget_token_l_st_file_type(FILE *f, char **token, size_t *limit, + bool fixed, const char *delim, int *line_nr, + enum file_type2parse file_type) { int c, prev_c; int p; /* 0 -> no parentheses seen, >0 nr of ( seen */ @@ -98,7 +103,9 @@ ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed } /* do something with comments ; */ - if (c == ';' && quoted == 0) { + if ((c == ';' + || (c == '#' && file_type == resolv_conf_file_type)) + && quoted == 0) { if (prev_c != '\\') { com = 1; } @@ -215,6 +222,26 @@ tokenread: return i == 0 ? LDNS_STATUS_SYNTAX_EMPTY : LDNS_STATUS_OK; } +ldns_status +ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed + , const char *delim, int *line_nr) +{ + return ldns_fget_token_l_st_file_type( + f, token, limit, fixed, delim, line_nr, zone_file_type); +} + +ssize_t +ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, + size_t limit, int *line_nr) +{ + if (limit == 0) + limit = LDNS_MAX_LINELEN; + if (ldns_fget_token_l_st_file_type(f, &token, &limit, true, delim, + line_nr, resolv_conf_file_type)) + return -1; + else + return (ssize_t)strlen(token); +} ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr) diff --git a/contrib/ldns/resolver.c b/contrib/ldns/resolver.c index f9ec65a55966..a426b82c034e 100644 --- a/contrib/ldns/resolver.c +++ b/contrib/ldns/resolver.c @@ -775,7 +775,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) #endif ssize_t gtr, bgtr; ldns_buffer *b; - int lnr = 0, oldline; + int lnr = 0; FILE* myfp = fp; if(!line_nr) line_nr = &lnr; @@ -809,36 +809,18 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) gtr = 1; word[0] = 0; - oldline = *line_nr; expect = LDNS_RESOLV_KEYWORD; while (gtr > 0) { - /* check comments */ - if (word[0] == '#') { - word[0]='x'; - if(oldline == *line_nr) { - /* skip until end of line */ - int c; - do { - c = fgetc(myfp); - } while(c != EOF && c != '\n'); - if(c=='\n') (*line_nr)++; - } - /* and read next to prepare for further parsing */ - oldline = *line_nr; - continue; - } - oldline = *line_nr; switch(expect) { case LDNS_RESOLV_KEYWORD: /* keyword */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr != 0) { - if(word[0] == '#') continue; for(i = 0; i < LDNS_RESOLV_KEYWORDS; i++) { if (strcasecmp(keyword[i], word) == 0) { /* chosen the keyword and * expect values carefully - */ + */ expect = i; break; } @@ -856,16 +838,12 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_DEFDOMAIN: /* default domain dname */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { if(!fp) fclose(myfp); @@ -879,16 +857,12 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_NAMESERVER: /* NS aaaa or a record */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } if(strchr(word, '%')) { /* snip off interface labels, * fe80::222:19ff:fe31:4222%eth0 */ @@ -911,7 +885,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_SEARCH: /* search list domain dname */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); b = LDNS_MALLOC(ldns_buffer); if(!b) { ldns_resolver_deep_free(r); @@ -929,10 +903,6 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) bgtr = ldns_bget_token(b, word, LDNS_PARSE_NORMAL, (size_t) gtr + 1); while (bgtr > 0) { gtr -= bgtr; - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - break; - } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { ldns_resolver_deep_free(r); @@ -954,28 +924,23 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) } break; case LDNS_RESOLV_SORTLIST: - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* sortlist not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_OPTIONS: - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* options not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_ANCHOR: /* a file containing a DNSSEC trust anchor */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { ldns_resolver_deep_free(r); if(!fp) fclose(myfp); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } - #ifdef HAVE_SSL tmp_rr = ldns_read_anchor_file(word); (void) ldns_resolver_push_dnssec_anchor(r, tmp_rr); From nobody Mon May 20 11:25:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjZxC55y0z5L36X; Mon, 20 May 2024 11:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjZxC4Xy8z45yY; Mon, 20 May 2024 11:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716204319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dIJJDMGZPhIbjs8/n+iJprLpl1U4ky7tP0q0/IOLfs4=; b=aDrQCyj6+RWtY2wJ/sYli/2dFhcG+RoMlCgAYJlLa5i3n3oizosaoaerphlwaHX5NV6Pdu npx194i8gjyYLrwxdSpgpwo0SNrNqhXxakMZAOeHdGID6CDSTT/vFIZdaci0bj3bTA7UVU 3xaX+sO2VaRCcxY6g0MyVIRLMTUfpVxZGg18gESfrD9J2hP4MhbwGbN5d/TfYK19glNPT1 vFI76Eq+hDQ2zF6SYUHZvHofLi8M4Z/57LUhmcq+gu790CIsdRo6AHKcMnan8rDaIj29Hu IE5Sphlf1zLewm6MGbs1DLYNYzlbMrVQ+MuITNjh5laimK/bnO4Uew9oZ5akwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716204319; a=rsa-sha256; cv=none; b=atI4P6qRCT0DJd+bjOddhCeTGgQwsQQC6EMudB0CBNAIhWcqDfEivSHBTA9bIujz26bbf3 VtGC0VR4gH3D8q+vChr9ZcTt35xutbtqKXQpqOhaGxmJlpJuenePud8DSKMMYFwczczZ/Z zb90qF5ylwsiu5Yv3T6qj9VKWtccze/AczEo3Brg1TDB42Ql2bzuPzC/itxZoXMKm5hT6T hLLIJrkLDD1S6RB8pt3y8IBqbIHyX/ZsRiT0TzgxFdtc0jF38nntJ72UreIK4zukphJBcI mnhutQuUPOMDAuZMZoB1NpvVhcbV+ZFBRbtXQjjH7/JWu34/Vr2s8uzw3nRifQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716204319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dIJJDMGZPhIbjs8/n+iJprLpl1U4ky7tP0q0/IOLfs4=; b=tpPD3McuJRWRvqH6pWeZ/uwnERskijqcJIhChtmXDjC2065oIXk2m0xKx9/B9RGL8ArWmj ebg2PwnP7l2yQguUDmYhiB8FYa6XwBNfVyp3fw2UIkkvReNzJLbdxGiIOgg8XOS0UyJsH/ ftWzOSAoXbB0wc9O3Jz6VXkgyQyreg5dVQpfZXREerfTYjCoHK/qPzwmv+IByNAeq8sFsC oKE3ib34M0ADRRAee2Qtz7K2v06lZdYCjWFQDsusGlCy0NhkCfrOtTUFAOE+UQQG4jm5iF s2RLJT0kFL2+BL+PuFeEl5BHIg/S4f5dU0SzvIdD2tETU4ImLhQAzpYJj7LYdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjZxC482tzby7; Mon, 20 May 2024 11:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KBPJeE025731; Mon, 20 May 2024 11:25:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KBPJsk025728; Mon, 20 May 2024 11:25:19 GMT (envelope-from git) Date: Mon, 20 May 2024 11:25:19 GMT Message-Id: <202405201125.44KBPJsk025728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 2c5c85cbcfac - stable/14 - nuageinit: by default to not enable nuageinit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c5c85cbcfac0037aaafff130d9c4bdb5d341fe8 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2c5c85cbcfac0037aaafff130d9c4bdb5d341fe8 commit 2c5c85cbcfac0037aaafff130d9c4bdb5d341fe8 Author: Baptiste Daroussin AuthorDate: 2024-05-14 12:15:43 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-20 11:24:38 +0000 nuageinit: by default to not enable nuageinit MFC After: 1 day Reported by: karels@ (cherry picked from commit 5681636ead6790d5ad2c24a4712f010fcdfc926c) --- libexec/rc/rc.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 831ef202219c..7f9e67981eec 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -725,6 +725,7 @@ newsyslog_enable="YES" # Run newsyslog at startup. newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off +nuageinit_enable="NO" # Run nuageinit at startup # rctl(8) requires kernel options RACCT and RCTL rctl_enable="YES" # Load rctl(8) rules on boot From nobody Mon May 20 11:25:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjZxD5kLKz5L322; Mon, 20 May 2024 11:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjZxD5JZxz461y; Mon, 20 May 2024 11:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716204320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p+08uNoFeH6nL4pZxnYVZcnTp1t8W9zSPuD4ky295YI=; b=aYSsd15k6luWa54NPpQc9NmLrMuYH111BdKCfBHx1f+gVa3Q0eapX6IHugCxNTA3dt1Fuq 0PMS40+KBku0yrvWIHLQJTSZH8nAxzweiMhN0EYD4paZFEr3Y3OOTvOgbnPcP6huZc4wvz QkHgtGqJJ5x9iBl3dTpQWhA4ofhlA3vkcv3haqk5j7t5EBjkjBXmP6VOLl3BjV2xvmN+fn 1oMoX2BmW2Sdk4aDItd5CTYgWNXyK7DdhK7v8w1nt4J4QkycZT3F+FUrr5fJU3B1Dz8rRq c7Pmmt2OhW9bh2BRuyyrG1xK8+cHGKTnfOCFePTpB4/jIX1TRjEyZuAebgWmlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716204320; a=rsa-sha256; cv=none; b=wSoG3F8KaTVDR4+vlnCg5J50vT4WXvuKEe5t7FYwfJ0H17+q8zzwxhswa8UsL6S+ewFTbF f6xNdCUVdEy7bMmQlr1+nU/WFFoN9epbDgJnMSO73JNpt6KmSSVIePCxcjodxU6Do2JHMn 14Z69SmEdNjijHoFzOhCeUNGNqZwyEprdkimKq3eBvPWkXLoxQM4yoob+NN226qui2FJ9/ cVHQXhWKWHyiVqvd/jAaEjSLySRyABFr+pjpIS8pTWgFv8DXAl0HATLVdoXfgxoFYjGlaX Gb2WPd18NhnMM12N2WJT1r5Zc5UCXrlqhHD8fBKUsgqC4bJyaaPcz05zVKLwaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716204320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p+08uNoFeH6nL4pZxnYVZcnTp1t8W9zSPuD4ky295YI=; b=HoOnpik0XO6/FkTZ2rrZC9z4TtKwJ3kVi3xRxRfjwJkHDEUto7fzLcpK+wTZ81aJ4aGSHG Sfkl/kFip4sI1eNeCEjqPBHf1dxvPa36EGzoOOwFxGzQazFOL5YvhVGuvNol051po+uzuD BQ/r9biBo0QWXHcy5AaqLZEE1Hze3fj6UC24H8KzvTeChN6Tj0Amg6WO4rIciZd1NbrHXY Fb1F14x9LURMr9Caml8fbZy+jxWWzVZ+rYrgddPtATHt9CnisQr3ztvWiBOF19g/Oyjq2y EThGT0HyZ/4BmRyoI7BlaP4n5xYneFDaJyYtBNzDkEB3lyZlvKeYwmuF2vlrdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjZxD4wT2zby8; Mon, 20 May 2024 11:25:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KBPKJG025770; Mon, 20 May 2024 11:25:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KBPKoo025767; Mon, 20 May 2024 11:25:20 GMT (envelope-from git) Date: Mon, 20 May 2024 11:25:20 GMT Message-Id: <202405201125.44KBPKoo025767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 5b609bbf91a3 - stable/14 - pci_vendors: update to 2024.05.14 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5b609bbf91a308bb7a17c2b2527e0a012d49de19 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5b609bbf91a308bb7a17c2b2527e0a012d49de19 commit 5b609bbf91a308bb7a17c2b2527e0a012d49de19 Author: Baptiste Daroussin AuthorDate: 2024-05-14 12:18:20 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-20 11:24:43 +0000 pci_vendors: update to 2024.05.14 (cherry picked from commit b0b9435ef1ec64c21f7243dbd02ad10e7f612149) --- share/misc/pci_vendors | 501 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 449 insertions(+), 52 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index ca3e5af4c97c..df152a4e97e0 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2024.02.02 -# Date: 2024-02-02 14:41:33 +# Version: 2024.05.14 +# Date: 2024-05-14 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -454,6 +454,7 @@ 1028 1f07 SAS 5/iR Integrated RAID Controller 1028 1f08 SAS 5/iR Integrated RAID Controller 1028 1f09 SAS 5/iR Adapter RAID Controller + 103c 3228 SAS3080X-HP 8-port PCI-X 133MHz Host Bus Adapter with 2xSFF-8484 15ad 1976 SAS Controller 0055 SAS1068 PCI-X Fusion-MPT SAS 1033 8336 SAS1068 @@ -764,7 +765,7 @@ 1bd4 0026 12G SAS3008IT RACK 1bd4 0027 12G SAS3008IMR RACK 1bd4 0028 12G SAS3008IR RACK - 00a5 Fusion-MPT 24GSAS/PCIe SAS40xx + 00a5 Fusion-MPT 24GSAS/PCIe SAS40xx/41xx 1000 4600 MegaRAID 9670W-16i Tri-Mode Storage Adapter 1000 4610 MegaRAID 9670-24i Tri-Mode Storage Adapter 1000 4620 MegaRAID 9660-16i Tri-Mode Storage Adapter @@ -3779,6 +3780,7 @@ 699f Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] 1028 1720 Radeon RX 550X 148c 2380 Lexa XL [Radeon RX 550] + 17aa 5069 Thinkpad E480/E580 1da2 e367 Lexa PRO [Radeon RX 550] 69a0 Vega 12 69a1 Vega 12 @@ -3960,6 +3962,8 @@ 73a3 Navi 21 GL-XL [Radeon PRO W6800] 73a4 Navi 21 USB 73a5 Navi 21 [Radeon RX 6950 XT] +# Reference + 1002 0e3a Radeon RX 6950 XT 1849 5230 Navi 21 [ASRock OC Forumla Radeon RX 6950XT] 1da2 441d Navi 21 [Sapphire Nitro+ Radeon RX 6950 XT] 1eae 6950 Navi 21 [XFX Speedster MERC319 Radeon RX 6950 XT] @@ -3990,6 +3994,7 @@ 1da2 465e Radeon RX 6750 XT PULSE OC 1da2 e445 Sapphire Radeon RX 6700 1eae 6601 Speedster QICK 319 RX 6700 XT + 1eae 661a Radeon RX 6700 [SPEEDSTER SWFT 309] 73e0 Navi 23 73e1 Navi 23 WKS-XM [Radeon PRO W6600M] 73e3 Navi 23 WKS-XL [Radeon PRO W6600] @@ -5642,6 +5647,8 @@ 9609 RS780/RS880 PCI to PCI bridge (PCIE port 5) 960a RS780 PCI to PCI bridge (NB-SB link) 960b RS780 PCI to PCI bridge (ext gfx port 1) +# Takes over NVMe PCI ID when RAID is enabled + b000 RAID Bottom Device 1023 Trident Microsystems 0194 82C194 2000 4DWave DX @@ -9193,6 +9200,7 @@ 87d0 PEX PCI Express Switch DMA interface 9016 PLX 9016 8-port serial controller 9030 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 10b5 1205 Becker & Hickl MSA-1000 10b5 2695 Hilscher CIF50-PB/DPS Profibus 10b5 2862 Alpermann+Velte PCL PCI LV (3V/5V): Timecode Reader Board 10b5 2906 Alpermann+Velte PCI TS (3V/5V): Time Synchronisation Board @@ -9228,7 +9236,13 @@ 10b5 1067 IXXAT CAN i165 10b5 114e Wasco WITIO PCI168extended 10b5 1169 Wasco OPTOIO32standard 32 digital in, 32 digital out + 10b5 1171 Becker & Hickl PMS-400 10b5 1172 IK220 (Heidenhain) + 10b5 1201 Becker & Hickl SPC-6x0 + 10b5 1202 Becker & Hickl SPC-7x0 + 10b5 1203 Becker & Hickl MSA-300 + 10b5 1206 Becker & Hickl DCC-100 + 10b5 120a Becker & Hickl STP-340 10b5 2036 SatPak GPS 10b5 2221 Alpermann+Velte PCL PCI LV: Timecode Reader Board 10b5 2273 SH ARC-PCI SOHARD ARCNET card @@ -9276,6 +9290,11 @@ d84d 4078 EX-4078 2S(16C552) RS-232+1P 9052 PCI9052 PCI <-> IOBus Bridge 9054 PCI9054 32-bit 33MHz PCI <-> IOBus Bridge + 10b5 1171 Becker & Hickl PMS-400A + 10b5 1208 Becker & Hickl SPC-830 + 10b5 120e Becker & Hickl SPC-930 + 10b5 120f Becker & Hickl SPC-150 + 10b5 1210 Becker & Hickl DPC-230 10b5 2455 Wessex Techology PHIL-PCI 10b5 2696 Innes Corp AM Radcap card 10b5 2717 Innes Corp Auricon card @@ -11734,6 +11753,9 @@ 0f02 GF108 [GeForce GT 730] 0f03 GF108 [GeForce GT 610] 0f06 GF108 [GeForce GT 730] + 0fa0 GK11x [GK11x_FPGA] + 0fa5 GK11x + 0fa7 GK11x [Tegra on x86 (PEATRANS)] 0fb0 GM200 High Definition Audio 0fb8 GP108 High Definition Audio Controller 0fb9 GP107GL High Definition Audio Controller @@ -11743,13 +11765,18 @@ 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] 0fc2 GK107 [GeForce GT 630 OEM] + 0fc4 GK107 [D14P1-15] 0fc5 GK107 [GeForce GT 1030] 0fc6 GK107 [GeForce GTX 650] 1043 8428 GTX650-DC-1GD5 0fc8 GK107 [GeForce GT 740] 0fc9 GK107 [GeForce GT 730] + 0fcb GK107 [EXK107] + 0fcc GK107 [GeForce GT 720] 0fcd GK107M [GeForce GT 755M] 0fce GK107M [GeForce GT 640M LE] + 0fcf GK107 [GEN3 ESI] + 0fd0 GK107 [NB1G] 0fd1 GK107M [GeForce GT 650M] 1043 1597 GeForce GT 650M 1043 15a7 GeForce GT 650M @@ -11764,10 +11791,15 @@ 0fd3 GK107M [GeForce GT 640M LE] 0fd4 GK107M [GeForce GTX 660M] 0fd5 GK107M [GeForce GT 650M Mac Edition] - 0fd6 GK107M + 0fd6 GK107M [N13P-GS-W] + 0fd7 GK107 [GK107-GTX] 0fd8 GK107M [GeForce GT 640M Mac Edition] 0fd9 GK107M [GeForce GT 645M] - 0fdb GK107M + 0fda GK107 [GK107-ES-A1] + 0fdb GK107 [GK107-ESP-A1] + 0fdc GK107 [GK107-INT22-A1] + 0fdd GK107 [GK107-INT11-A1] + 0fde GK107 [GK107-ES-KA-E1] 0fdf GK107M [GeForce GT 740M] 0fe0 GK107M [GeForce GTX 660M Mac Edition] 0fe1 GK107M [GeForce GT 730M] @@ -11788,6 +11820,7 @@ 0fed GK107M [GeForce 820M] 0fee GK107M [GeForce 810M] 0fef GK107GL [GRID K340] + 0ff0 GK107 [NB1Q] 0ff1 GK107 [NVS 1000] 0ff2 GK107GL [GRID K1] 0ff3 GK107GL [Quadro K420] @@ -12307,9 +12340,13 @@ 11a2 GK104M [GeForce GTX 675MX Mac Edition] 11a3 GK104M [GeForce GTX 680MX] 106b 010d iMac 13,2 + 11a4 GK104 [GK104-ESA] + 11a5 GK104 [GK104-ESA] 11a7 GK104M [GeForce GTX 675MX] 11a8 GK104GLM [Quadro K5100M] 11a9 GK104M [GeForce GTX 870M] + 11aa GK104 [GK104-INT] + 11ac GK104 [GK104-CS] 11af GK104GLM [GRID IceCube] 11b0 GK104GL [GRID K240Q / K260Q vGPU] 10de 101a GRID K240Q @@ -12327,6 +12364,7 @@ 11be GK104GLM [Quadro K3000M] 11bf GK104GL [GRID K2] 11c0 GK106 [GeForce GTX 660] + 11c1 GK106 [D14P2-30] 11c2 GK106 [GeForce GTX 650 Ti Boost] 1043 845b GeForce GTX 650 Ti Boost DirectCU II OC 1462 2874 GeForce GTX 650 Ti Boost TwinFrozr II OC @@ -12342,6 +12380,10 @@ 11c7 GK106 [GeForce GTX 750 Ti] 11c8 GK106 [GeForce GTX 650 OEM] 11cb GK106 [GeForce GT 740] + 11d0 GK106 [GK106-INT353] + 11d1 GK106 [GK106-INT343] + 11d2 GK106 [GK106-INT232] + 11d3 GK106 [GK106-ES] 11e0 GK106M [GeForce GTX 770M] 11e1 GK106M [GeForce GTX 765M] 11e2 GK106M [GeForce GTX 765M] @@ -12350,6 +12392,7 @@ 11e7 GK106M 11fa GK106GL [Quadro K4000] 11fc GK106GLM [Quadro K2100M] + 11ff GK106 [NB1Q] 1200 GF114 [GeForce GTX 560 Ti] 1201 GF114 [GeForce GTX 560] 1202 GF114 [GeForce GTX 560 Ti OEM] @@ -12397,7 +12440,9 @@ 1280 GK208 [GeForce GT 635] 1281 GK208 [GeForce GT 710] 1282 GK208 [GeForce GT 640 Rev. 2] + 1283 GK208 [D15M2-10] 1284 GK208 [GeForce GT 630 Rev. 2] + 1285 GK208 [GK208-100] 1286 GK208 [GeForce GT 720] 1287 GK208B [GeForce GT 730] 1288 GK208B [GeForce GT 720] @@ -12437,8 +12482,14 @@ 17aa 36af GeForce 920M 129a GK208BM [GeForce 910M] 12a0 GK208 + 12ad GK208 [GK208-ES] + 12ae GK208 [GK208-CS1-C] + 12af GK208 [GK208-INT] + 12b0 GK208 [GK208-CS-Q] + 12b1 GK208 [GK208 INT] 12b9 GK208GLM [Quadro K610M] 12ba GK208GLM [Quadro K510M] + 130b GK110 [Q12U-1] 1340 GM108M [GeForce 830M] 103c 2b2b GeForce 830A 1341 GM108M [GeForce 840M] @@ -12483,6 +12534,8 @@ 103c 2b4c GeForce GTX 960A 139c GM107M [GeForce 940M] 139d GM107M [GeForce GTX 750 Ti] + 13ad GM204 [GM107 INT52] + 13ae GM204 [GM107 CS1] 13b0 GM107GLM [Quadro M2000M] 13b1 GM107GLM [Quadro M1000M] 13b2 GM107GLM [Quadro M600M] @@ -12497,15 +12550,19 @@ 10de 110a GRID M40 10de 1160 Tesla M10 10de 11d2 GRID M10-8Q + 13be GM204 [GM107 CS1] + 13bf GM204 [GM107 INT52] 13c0 GM204 [GeForce GTX 980] 1043 8504 GTX980-4GD5 13c1 GM204 13c2 GM204 [GeForce GTX 970] 13c3 GM204 + 13c4 GM204 [D17U-20] 13d7 GM204M [GeForce GTX 980M] 13d8 GM204M [GeForce GTX 960 OEM / 970M] 13d9 GM204M [GeForce GTX 965M] 13da GM204M [GeForce GTX 980 Mobile] + 13e4 GM204 [Graphics Device ES-A] 13e7 GM204GL [GeForce GTX 980 Engineering Sample] 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] @@ -12531,6 +12588,7 @@ 1430 GM206GL [Quadro M2000] 1431 GM206GL [Tesla M4] 1436 GM206GLM [Quadro M2200 Mobile] + 15c2 GP100 [CMP 100-100] 15f0 GP100GL [Quadro GP100] 15f1 GP100GL 15f7 GP100GL [Tesla P100 PCIe 12GB] @@ -12538,6 +12596,7 @@ 15f9 GP100GL [Tesla P100 SXM2 16GB] 15fa GP100GL [DGX Station / PH402 SKU 200] 15fb GP100GL [GP100 SKU 200] + 15fc GP100GL [Tesla P100-DGXS-16GB] 15ff GP100GL [GP100 SKU 15ff] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] @@ -12697,6 +12756,7 @@ 1d81 GV100 [TITAN V] 1d83 GV100 [CMP 100-200] 1d84 GV100 [CMP 100-210] + 1db0 GV100GL [Tesla GV100 SXM2-16GB SKU 890] 1db1 GV100GL [Tesla V100 SXM2 16GB] 1db2 GV100GL [Tesla V100 DGXS 16GB] 1db3 GV100GL [Tesla V100 FHHL 16GB] @@ -12713,6 +12773,7 @@ 1dc1 GV100 [CMP 100-200] 1df0 GV100GL [Tesla PG500-216] 1df2 GV100GL [Tesla PG503-216] + 1df4 GV100 [CMP 100-210] 1df5 GV100GL [Tesla V100 SXM2 16GB] 1df6 GV100GL [Tesla V100S PCIe 32GB] 1e02 TU102 [TITAN RTX] @@ -12726,6 +12787,7 @@ 1e30 TU102GL [Quadro RTX 6000/8000] 10de 129e Quadro RTX 8000 10de 12ba Quadro RTX 6000 + 1e35 TU102GL [Tesla T10] 1e36 TU102GL [Quadro RTX 6000] 1e37 TU102GL [Tesla T10 16GB / GRID RTX T10-2/T10-4/T10-8] 10de 1304 Tesla T10 16GB @@ -12823,7 +12885,7 @@ 1fd9 TU117BM [GeForce GTX 1650 Mobile Refresh] 1fdd TU117BM [GeForce GTX 1650 Mobile Refresh] 1ff0 TU117GL [T1000 8GB] - 1ff2 TU117GL [T400 4GB] + 1ff2 TU117GL [T400 4GB / T400E] 1ff9 TU117GLM [Quadro T1000 Mobile] 2080 GA100 2081 GA100 @@ -12902,8 +12964,10 @@ 2321 GH100 [H100L 94GB] 2322 GH100 [H800 PCIe] 2324 GH100 [H800] + 2329 GH100 [H20] 2330 GH100 [H100 SXM5 80GB] 2331 GH100 [H100 PCIe] + 2335 GH100 [H200 SXM 141GB] 2336 GH100 [H100] 2337 GH100 [H100 SXM5 64GB] 2338 GH100 [H100 SXM5 96GB] @@ -12932,6 +12996,9 @@ 2488 GA104 [GeForce RTX 3070 Lite Hash Rate] 2489 GA104 [GeForce RTX 3060 Ti Lite Hash Rate] 248a GA104 [CMP 70HX] + 248c GA104 [GeForce RTX 3070 Ti] + 248d GA104 [GeForce RTX 3070] + 248e GA104 [GeForce RTX 3060 Ti] 249c GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] 249d GA104M [GeForce RTX 3070 Mobile / Max-Q] 249f GA104M @@ -12991,6 +13058,8 @@ 25ac GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] 25ad GA107 [GeForce RTX 2050] 25af GA107 [GeForce RTX 3050 Engineering Sample] + 25b0 GA107GL [RTX A1000] + 25b2 GA107GL [RTX A400] 25b5 GA107GLM [RTX A4 Mobile] # A16 - 25B6 10DE 14A9 / A2 - 25B6 10DE 157E 25b6 GA107GL [A2 / A16] @@ -13024,6 +13093,7 @@ 2703 AD103 [GeForce RTX 4080 SUPER] 2704 AD103 [GeForce RTX 4080] 2705 AD103 [GeForce RTX 4070 Ti SUPER] + 2709 AD103 [GeForce RTX 4070] 2717 GN21-X11 [GeForce RTX 4090 Laptop GPU] 2730 AD103GLM [RTX 5000 Ada Generation Laptop GPU] 2757 GN21-X11 @@ -13032,6 +13102,7 @@ 2783 AD104 [GeForce RTX 4070 SUPER] 2785 AD104 [AC AD104 20GB] 2786 AD104 [GeForce RTX 4070] + 2788 AD104 [GeForce RTX 4060 Ti] 27a0 AD104M [GeForce RTX 4080 Max-Q / Mobile] 27b0 AD104GL [RTX 4000 SFF Ada Generation] 27b1 AD104GL [RTX 4500 Ada Generation] @@ -13046,6 +13117,7 @@ 27fb AD104GLM [RTX 3500 Ada Generation Embedded GPU] 2803 AD106 [GeForce RTX 4060 Ti] 2805 AD106 [GeForce RTX 4060 Ti 16GB] + 2808 AD106 [GeForce RTX 4060] 2820 AD106M [GeForce RTX 4070 Max-Q / Mobile] 2838 AD106GLM [RTX 3000 Ada Generation Laptop GPU] 2860 AD106M [GeForce RTX 4070 Max-Q / Mobile] @@ -13053,7 +13125,11 @@ 2882 AD107 [GeForce RTX 4060] 28a0 AD107M [GeForce RTX 4060 Max-Q / Mobile] 28a1 AD107M [GeForce RTX 4050 Max-Q / Mobile] + 28b0 AD107GL [RTX 2000 / 2000E Ada Generation] 28b8 AD107GLM [RTX 2000 Ada Generation Laptop GPU] + 28b9 AD107GLM [RTX 1000 Ada Generation Laptop GPU] + 28ba AD107GLM [RTX 500 Ada Generation Laptop GPU] + 28bb AD107GLM [RTX 500 Ada Generation Laptop GPU] 28e0 AD107M [GeForce RTX 4060 Max-Q / Mobile] 28e1 AD107M [GeForce RTX 4050 Max-Q / Mobile] 28f8 AD107GLM [RTX 2000 Ada Generation Embedded GPU] @@ -13308,6 +13384,7 @@ 5762 RTS5762 NVMe SSD Controller 5763 RTS5763DL NVMe SSD Controller (DRAM-less) 5765 RTS5765DL NVMe SSD Controller (DRAM-less) + 5770 RTS5770DL NVMe SSD Controller (DRAM-less) 5772 RTS5772DL NVMe SSD Controller (DRAM-less) 8029 RTL-8029(AS) 10b8 2011 EZ-Card (SMC1208) @@ -13317,6 +13394,7 @@ 1259 2400 AT-2400 1af4 1100 QEMU Virtual Machine 8125 RTL8125 2.5GbE Controller + 4c52 2022 LRES2022PT Single-port 2.5Gb Ethernet Network Adapter 8129 RTL-8129 10ec 8129 RT8129 Fast Ethernet Adapter 11ec 8129 RTL8111/8168 PCIe Gigabit Ethernet (misconfigured) @@ -13416,7 +13494,7 @@ 1043 8505 P8 series motherboard 1043 8554 H81M-C Motherboard 1043 859e AM1I-A Motherboard - 1043 8677 PRIME B450M-A Motherboard + 1043 8677 Onboard RTL8111H Ethernet 105b 0d7c D270S/D250S Motherboard 10ec 8168 RTL8111/8168 PCI Express Gigabit Ethernet controller 144d c652 RTL8168 on a NP300E5C series laptop @@ -13432,6 +13510,7 @@ 17aa 3098 ThinkCentre E73 17aa 3814 Z50-75 17aa 3823 Lenovo V130-15IGM Laptop - Type 81HL + 17aa 5068 Thinkpad E480/E580 17aa 5124 ThinkPad E595 1849 8168 Motherboard (one of many) 7470 3468 TG-3468 Gigabit PCI Express Network Adapter @@ -16401,6 +16480,38 @@ 11e2 Samsung Information Systems America 11e3 Quicklogic Corporation 0001 COM-ON-AIR Dosch&Amand DECT + 0010 QL5032 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0011 QL5032 (PBGA256) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0012 QL5232 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 11e3 1204 Becker & Hickl SPC-130 + 11e3 1207 Becker & Hickl DDG-200 + 11e3 1209 Becker & Hickl SHM-180 + 11e3 120c Becker & Hickl PMM-428 + 0013 QL5232 (PBGA456) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0014 QL5030 (TQFP144) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 0015 QL5130 (TQFP144) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 0016 QL5130 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 11e3 120b Becker & Hickl DEL-350 + 0017 QL5130 (PBGA256) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 0019 QL5332 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001a QL5332 (PBGA256) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001b QL5432 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 11e3 120d Becker & Hickl SPC-140 + 11e3 1211 Becker & Hickl GVD-120 + 11e3 1212 Becker & Hickl DDG-210 + 001c QL5432 (PBGA456) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001d QL5632 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001e QL5632 (PBGA280) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 001f QL5632 (PBGA484) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0020 QL5632 (PBGA516) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0021 QL5732 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0022 QL5732 (PBGA280) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0023 QL5732 (PBGA484) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 0024 QL5732 (PBGA516) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 002d QL5022 (TQFP144) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 002e QL5022 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Master/Target with Embedded Programmable Logic and Dual Port SRAM + 002f QL5020 (TQFP144) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM + 0030 QL5020 (PQFP208) [QuickPCI] 33 MHz/32-bit PCI Target with Embedded Programmable Logic and Dual Port SRAM 0560 QL5064 Companion Design Demo Board 5030 PC Watchdog 8417 QL5064 [QuickPCI] PCI v2.2 bridge for SMT417 Dual TMS320C6416T PMC Module @@ -16649,6 +16760,7 @@ 8331 O2 Flash Memory Card 8520 SD/MMC Card Reader Controller 8621 SD/MMC Card Reader Controller + 17aa 5068 Thinkpad E480/E580 8760 FORESEE E2M2 NVMe SSD 1218 Hybricon Corp. 1219 First Virtual Corporation @@ -17009,6 +17121,7 @@ 0820 SM820 Lynx3D 0910 SM910 2260 SM2260 NVMe SSD Controller + 2261 SM2261XT x2 NVMe SSD Controller (DRAM-less) 2262 SM2262/SM2262EN SSD Controller 2263 SM2263EN/SM2263XT (DRAM-less) NVMe SSD Controllers 2269 SM2269XT (DRAM-less) NVMe SSD Controller @@ -17498,6 +17611,7 @@ 8152 PI7C8152A/PI7C8152B/PI7C8152BI PCI-to-PCI Bridge 8154 PI7C8154A/PI7C8154B/PI7C8154BI PCI-to-PCI Bridge 8619 PI7C9X2G1616PR PCIe2 16-Port/16-Lane Packet Switch + b404 PI7C9X2G404 EV/SV PCIe2 4-Port/4-Lane Packet Switch e110 PI7C9X110 PCIe- to-PCI bridge 1775 11cc CC11/CL11 CompactPCI Bridge e111 PI7C9X111SL PCIe-to-PCI Reversible Bridge @@ -17848,8 +17962,25 @@ 1344 5000 6.4 TB U.2 1344 6000 12.8TB U.2 51b7 7500 PRO NVMe SSD + 1028 22e7 DC NVMe 7500 U.2 SED RI 15.36TB + 1028 22e8 DC NVMe 7500 U.2 SED RI 7.68TB + 1028 22e9 DC NVMe 7500 U.2 SED RI 3.84TB + 1028 22ea DC NVMe 7500 U.2 SED RI 1.92TB + 1028 22eb DC NVMe 7500 U.2 SED RI 960GB + 1028 22ec DC NVMe 7500 U.2 ISE RI 15.36TB + 1028 22ed DC NVMe 7500 U.2 ISE RI 7.68TB + 1028 22ee DC NVMe 7500 U.2 ISE RI 3.84TB + 1028 22ef DC NVMe 7500 U.2 ISE RI 1.92TB + 1028 22f0 DC NVMe 7500 U.2 ISE RI 960GB 51b8 7500 MAX NVMe SSD + 1028 22f1 DC NVMe 7500 U.2 ISE MU 12.8TB + 1028 22f2 DC NVMe 7500 U.2 ISE MU 6.4TB + 1028 22f3 DC NVMe 7500 U.2 ISE MU 3.2TB + 1028 22f4 DC NVMe 7500 U.2 ISE MU 1.6TB + 1028 22f5 DC NVMe 7500 U.2 ISE MU 800GB 51b9 6500 ION NVMe SSD + 1028 22e6 Ent NVMe 6500 RI 30.72TB + 1028 22f6 Ent NVMe 6500 RI FIPS 30.72TB 51c0 7400 PRO NVMe SSD 1028 2162 EC NVMe OPAL 7400 RI M.2 480GB 1028 2163 EC NVMe OPAL 7400 RI M.2 960GB @@ -17887,7 +18018,38 @@ 1344 4000 U.3 3200GB 1344 5000 U.3 6400GB 51c3 7450 PRO NVMe SSD + 1028 226b EC NVMe FIPS 7450 RI M.2 110 960GB + 1028 226c EC NVMe ISE 7450 RI M.2 80 480GB + 1028 226d EC NVMe ISE 7450 RI M.2 80 960GB + 1028 226e EC NVMe SED 7450 RI M.2 80 480GB + 1028 226f EC NVMe SED 7450 RI M.2 80 960GB + 1028 2270 EC NVMe FIPS 7450 RI M.2 80 480GB + 1028 2271 EC NVMe FIPS 7450 RI M.2 80 960GB + 1028 2273 EC NVMe ISE 7450 RI M.2 110 960GB + 1028 2274 EC NVMe ISE 7450 RI M.2 110 1920GB + 1028 2275 EC NVMe ISE 7450 RI M.2 110 3840GB + 1028 2278 DC NVMe ISE 7450 RI U.2 960GB + 1028 2279 DC NVMe ISE 7450 RI U.2 1.92TB + 1028 227a DC NVMe ISE 7450 RI U.2 3.84TB + 1028 227b DC NVMe ISE 7450 RI U.2 7.68TB + 1028 227c DC NVMe ISE 7450 RI U.2 15.36TB + 1028 227d DC NVMe SED 7450 RI U.2 960GB + 1028 227e DC NVMe SED 7450 RI U.2 1.92TB + 1028 227f DC NVMe SED 7450 RI U.2 3.84TB + 1028 2280 DC NVMe SED 7450 RI U.2 7.68TB + 1028 2281 DC NVMe SED 7450 RI U.2 15.36TB 51c4 7450 MAX NVMe SSD + 1028 2272 EC NVMe ISE 7450 MU M.2 80 800GB + 1028 228b DC NVMe SED 7450 MU U.2 800GB + 1028 228c DC NVMe ISE 7450 MU U.2 800GB + 1028 228d DC NVMe SED 7450 MU U.2 1.6TB + 1028 228e DC NVMe ISE 7450 MU U.2 1.6TB + 1028 228f DC NVMe SED 7450 MU U.2 3.2TB + 1028 2290 DC NVMe ISE 7450 MU U.2 3.2TB + 1028 2291 DC NVMe SED 7450 MU U.2 6.4TB + 1028 2292 DC NVMe ISE 7450 MU U.2 6.4TB + 1028 2293 DC NVMe SED 7450 MU U.2 12.8TB + 1028 2294 DC NVMe ISE 7450 MU U.2 12.8TB 1344 3000 U.3 1600GB [MTFDKCB1T6TFS/MTFDKCC1T6TFS] 5404 2210 NVMe SSD [Cobain] 5405 2300 NVMe SSD [Santana] @@ -19493,14 +19655,14 @@ 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller 6004 T6425-SO-CR Unified Wire Ethernet Controller - 6005 T6225-OCP-SO Unified Wire Ethernet Controller - 6006 T62100-OCP-SO Unified Wire Ethernet Controller + 6005 T6225-SO-OCP3 Unified Wire Ethernet Controller + 6006 T6225-OCP3 Unified Wire Ethernet Controller 6007 T62100-LP-CR Unified Wire Ethernet Controller 6008 T62100-SO-CR Unified Wire Ethernet Controller 6009 T6210-BT Unified Wire Ethernet Controller 600d T62100-CR Unified Wire Ethernet Controller 6011 T6225-LL-CR Unified Wire Ethernet Controller - 6014 T61100-OCP-SO Unified Wire Ethernet Controller + 6014 T62100-SO-OCP3 Unified Wire Ethernet Controller 6015 T6201-BT Unified Wire Ethernet Controller 6080 T6225-6080 Unified Wire Ethernet Controller 6081 T62100-6081 Unified Wire Ethernet Controller @@ -19519,14 +19681,14 @@ 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller 6404 T6425-SO-CR Unified Wire Ethernet Controller - 6405 T6225-OCP-SO Unified Wire Ethernet Controller - 6406 T62100-OCP-SO Unified Wire Ethernet Controller + 6405 T6225-SO-OCP3 Unified Wire Ethernet Controller + 6406 T6225-OCP3 Unified Wire Ethernet Controller 6407 T62100-LP-CR Unified Wire Ethernet Controller 6408 T62100-SO-CR Unified Wire Ethernet Controller 6409 T6210-BT Unified Wire Ethernet Controller 640d T62100-CR Unified Wire Ethernet Controller 6411 T6225-LL-CR Unified Wire Ethernet Controller - 6414 T61100-OCP-SO Unified Wire Ethernet Controller + 6414 T62100-SO-OCP3 Unified Wire Ethernet Controller 6415 T6201-BT Unified Wire Ethernet Controller 6480 T6225-6080 Unified Wire Ethernet Controller 6481 T62100-6081 Unified Wire Ethernet Controller @@ -19545,14 +19707,14 @@ 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller 6504 T6425-SO-CR Unified Wire Storage Controller - 6505 T6225-OCP-SO Unified Wire Storage Controller - 6506 T62100-OCP-SO Unified Wire Storage Controller + 6505 T6225-SO-OCP3 Unified Wire Storage Controller + 6506 T6225-OCP3 Unified Wire Storage Controller 6507 T62100-LP-CR Unified Wire Storage Controller 6508 T62100-SO-CR Unified Wire Storage Controller 6509 T6210-BT Unified Wire Storage Controller 650d T62100-CR Unified Wire Storage Controller 6511 T6225-LL-CR Unified Wire Storage Controller - 6514 T61100-OCP-SO Unified Wire Storage Controller + 6514 T62100-SO-OCP3 Unified Wire Storage Controller 6515 T6201-BT Unified Wire Storage Controller 6580 T6225-6080 Unified Wire Storage Controller 6581 T62100-6081 Unified Wire Storage Controller @@ -19570,14 +19732,14 @@ 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller 6604 T6425-SO-CR Unified Wire Storage Controller - 6605 T6225-OCP-SO Unified Wire Storage Controller - 6606 T62100-OCP-SO Unified Wire Storage Controller + 6605 T6225-SO-OCP3 Unified Wire Storage Controller + 6606 T6225-OCP3 Unified Wire Storage Controller 6607 T62100-LP-CR Unified Wire Storage Controller 6608 T62100-SO-CR Unified Wire Storage Controller 6609 T6210-BT Unified Wire Storage Controller 660d T62100-CR Unified Wire Storage Controller 6611 T6225-LL-CR Unified Wire Storage Controller - 6614 T61100-OCP-SO Unified Wire Storage Controller + 6614 T62100-SO-OCP3 Unified Wire Storage Controller 6615 T6201-BT Unified Wire Storage Controller 6680 T6225-6080 Unified Wire Storage Controller 6681 T62100-6081 Unified Wire Storage Controller @@ -19595,14 +19757,14 @@ 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] 6804 T6425-SO-CR Unified Wire Ethernet Controller [VF] - 6805 T6225-OCP-SO Unified Wire Ethernet Controller [VF] - 6806 T62100-OCP-SO Unified Wire Ethernet Controller [VF] + 6805 T6225-SO-OCP3 Unified Wire Ethernet Controller [VF] + 6806 T6225-OCP3 Unified Wire Ethernet Controller [VF] 6807 T62100-LP-CR Unified Wire Ethernet Controller [VF] 6808 T62100-SO-CR Unified Wire Ethernet Controller [VF] 6809 T6210-BT Unified Wire Ethernet Controller [VF] 680d T62100-CR Unified Wire Ethernet Controller [VF] 6811 T6225-LL-CR Unified Wire Ethernet Controller [VF] - 6814 T61100-OCP-SO Unified Wire Ethernet Controller [VF] + 6814 T62100-SO-OCP3 Unified Wire Ethernet Controller [VF] 6815 T6201-BT Unified Wire Ethernet Controller [VF] 6880 T6225-6080 Unified Wire Ethernet Controller [VF] 6881 T62100-6081 Unified Wire Ethernet Controller [VF] @@ -19847,6 +20009,7 @@ 1028 225d NVMe PM1745 MU U.2 6.4TB 1028 225e NVMe FIPS PM1745 MU U.2 12.8TB 1028 225f NVMe PM1745 MU U.2 12.8TB + a900 NVMe SSD Controller PM9DXa ecec Exynos 8895 PCIe Root Complex 144e OLITEC 144f Askey Computer Corp. @@ -20434,6 +20597,7 @@ 193d 1003 530F-B 193d 1006 530F-L 193d 100f NIC-ETH522i-Mb-2x10G + 4c52 9812 LREC9812AF Dual-port 10Gb Ethernet Server Adapter 1690 NetXtreme BCM57760 Gigabit Ethernet PCIe 1691 NetLink BCM57788 Gigabit Ethernet PCIe 1028 04aa XPS 8300 @@ -20461,6 +20625,7 @@ 16a1 BCM57840 NetXtreme II 10 Gigabit Ethernet 1043 866e PEB-10G/57840-2T 10GBase-T Network Adapter 193d 100b NIC-ETH521i-Mb-4x10G + 4c52 9814 LREC9814AF Quad-port 10Gb Ethernet Server Adapter 16a2 BCM57840 NetXtreme II 10/20-Gigabit Ethernet 103c 1916 FlexFabric 20Gb 2-port 630FLB Adapter 103c 1917 FlexFabric 20Gb 2-port 630M Adapter @@ -20680,7 +20845,7 @@ 14e4 5425 NetXtreme-E Quad-port 25G SFP28 Ethernet OCP 3.0 Adapter (BCM957504-N425G) 14e4 d142 NetXtreme-E P425D BCM57504 4x25G SFP28 PCIE 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet - 1760 BCM57608 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet + 1760 BCM57608 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet 14e4 d125 BCM57608 2x200G PCIe Ethernet NIC 1800 BCM57502 NetXtreme-E Ethernet Partition 1801 BCM57504 NetXtreme-E Ethernet Partition @@ -21508,6 +21673,7 @@ 9290 FPGA Card 9300 Universal Exhaust Gas Oxygen Sensor Simulator 9310 Digital Programmable Resistor + 9320 Arria 10 FPGA Card 9350 Analog Input Card 1543 SILICON Laboratories 3052 Intel 537 [Winmodem] @@ -21719,6 +21885,10 @@ 021f CX8 Family [ConnectX-8 Secure Flash Recovery] 0220 BF4 Family Flash Recovery [BlueField-4 SoC Flash Recovery] 0221 BF4 Family Secure Flash Recovery [BlueField-4 Secure Flash Recovery] + 0222 CX8 PCIe Switch Family [ConnectX-8 PCIe Switch Flash Recovery] + 0223 CX8 PCIe Switch Family [ConnectX-8 PCIe Switch Secure Flash Recovery-RMA] + 0224 CX9 Family [ConnectX-9 Flash Recovery] + 0225 CX9 Family [ConnectX-9 Secure Flash Recovery-RMA] 024e MT53100 [Spectrum-2, Flash recovery mode] 024f MT53100 [Spectrum-2, Secure Flash recovery mode] 0250 Spectrum-3, Flash recovery mode @@ -21750,6 +21920,9 @@ 0285 Sagitta RMA 0286 LibraE Flash Recovery 0287 LibraE RMA +# Flash recovery + 0288 Arcus2 + 0289 Arcus2 RMA 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power @@ -21850,6 +22023,8 @@ 1020 MT28860 1021 MT2910 Family [ConnectX-7] 1023 CX8 Family [ConnectX-8] + 1024 CX8 PCIe Switch Family [ConnectX-8 PCIe Switch] + 1025 CX9 Family [ConnectX-9] 1974 MT28800 Family [ConnectX-5 PCIe Bridge] 1975 MT416842 Family [BlueField SoC PCIe Bridge] 1976 MT28908 Family [ConnectX-6 PCIe Bridge] @@ -21859,11 +22034,14 @@ 197a MT43162 Family [BlueField-3 Lx SoC PCIe Bridge] 197b MT43244 Family [BlueField-3 SoC PCIe Bridge] 197c ConnectX/BlueField Family mlx5Gen PCIe Bridge [PCIe Bridge] + 197d CX8 Family [ConnectX-8 PCIe Bridge] + 197e CX9 Family [ConnectX-9 PCIe Bridge] 2020 MT2892 Family [ConnectX-6 Dx Emulated PCIe Bridge] 2021 MT42822 Family [BlueField-2 SoC Emulated PCIe Bridge] 2023 MT2910 Family [ConnectX-7 Emulated PCIe Bridge] 2024 MT43244 Family [BlueField-3 SoC Emulated PCIe Bridge] 2025 ConnectX/BlueField Family mlx5Gen Emulated PCIe Bridge [Emulated PCIe Bridge] + 2100 CX8 Family [CX8 Data Direct Interface] 4117 MT27712A0-FDCF-AE 1bd4 0039 SN10XMP2P25 1bd4 003a 25G SFP28 SP EO251FM9 Adapter @@ -21929,6 +22107,7 @@ a2df BF4 Family integrated network controller [BlueField-4 integrated network controller] b200 ArcusE b201 LibraE + b202 Arcus2 c2d1 BlueField DPU Family Auxiliary Communication Channel [BlueField Family] c2d2 MT416842 BlueField SoC management interfac c2d3 MT42822 BlueField-2 SoC Management Interface @@ -21995,12 +22174,14 @@ 5019 WD Green SN350 240GB (DRAM-less) / SN560E NVMe SSD 501a SanDisk Ultra 3D / WD Blue SN570 NVMe SSD (DRAM-less) 501d WD Blue SN550 NVMe SSD 2TB (DRAM-less) - 501e PC SN735 NVMe SSD (DRAM-less) + 501e PC SN735 / WD_BLACK SN750 SE NVMe SSD (DRAM-less) 501f WD PC SN735 NVMe SSD 512GB (DRAM-less) 5025 WD Blue SN570 NVMe SSD 2TB 5026 WD PC SN735 NVMe SSD 1TB (DRAM-less) 5028 WD CH SN560 NVMe SSD 5030 WD Black SN850X NVMe SSD + 5034 WD PC SN5000S M.2 2230 NVMe SSD (DRAM-less) + 5036 WD PC SN5000S M.2 2280 NVMe SSD (DRAM-less) 5041 WD Blue SN580 NVMe SSD (DRAM-less) 5042 WD Black SN770M NVMe SSD (DRAM-less) 15b8 ADDI-DATA GmbH @@ -23753,7 +23934,7 @@ 0100 A104d QUAD T1/E1 AFT card 0300 A101 single-port T1/E1 0400 A104u Quad T1/E1 AFT -1924 Solarflare Communications +1924 AMD Solarflare 0703 SFC4000 rev A net [Solarstorm] 10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard] 10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard] @@ -24070,8 +24251,11 @@ 196d Club-3D BV 196e PNY 1971 AGEIA Technologies, Inc. - 1011 Physics Processing Unit [PhysX] + 0000 Physics Processing Unit [PhysX] 100 Series PCI Express Card +# The PCI and PCIe versions have a different PID + 1011 Physics Processing Unit [PhysX] 100 Series PCI Card 1043 0001 PhysX P1 + 1021 Physics Processing Unit [PhysX] 200 Series PCI Express Card # nee Eberspaecher Electronics 1974 Star Electronics GmbH & Co. KG 0009 FlexCard PMC-II @@ -24727,6 +24911,7 @@ 1b96 4000 WD_BLACK AN1500 NVMe SSD 1d49 0306 ThinkSystem M.2 NVMe 2-Bay RAID Enablement Kit 1d49 0307 ThinkSystem 7mm NVMe 2-Bay Rear RAID Enablement Kit + 2b42 88W8997 2.4/5 GHz Dual-Band 2x2 Wi-Fi® 5 (802.11ac) + Bluetooth® 5.3 Solution 2b43 NXP 88W9098 Wi-Fi 6 (ax) MAC #1 2b44 NXP 88W9098 Wi-Fi 6 (ax) MAC #2 2b45 NXP 88W9098 Bluetooth 5.3 @@ -24775,6 +24960,7 @@ # 2xHDMI and 2xHD-SDI inputs e5f4 MPEG2 and H264 Encoder-Transcoder f1c4 Dual ASI-RX/TX-CI card +1b61 Byd Precision Manufacture Co.,Ltd 1b66 DELTACAST 0007 DELTA-3G-elp-d 1b6f Etron Technology, Inc. @@ -25005,6 +25191,21 @@ 1bee IXXAT Automation GmbH 0002 CAN-IB100/PCIe 0003 CAN-IB200/PCIe + 0004 CAN-IB120/PCIe Mini + 0005 CAN-IB130/PCIe 104 + 0006 CAN-IB230/PCIe 104 + 000e CAN-IB500/PCIe + 000f CAN-IB600/PCIe + 0010 CAN-IB300/PCI + 0011 CAN-IB400/PCI + 0012 CAN-IB520/PCIe Mini + 0016 CAN-IB410/PMC + 001c CAN-IB810/PMC + 001e INpact PCIe + 001f INpact PCIe Mini + 0029 INpact M.2 + 002d CAN-IB630/PCIe 104 + 002e CAN-IB640/PCIe 1bef Lantiq 0011 MIPS SoC PCI Express Port 1bf4 VTI Instruments Corporation @@ -25133,6 +25334,7 @@ 2429 PE6011 NVMe Solid State Drive 243b PE6110 NVMe Solid State Drive 1c5c 0100 PE6110 NVMe Solid State Drive + 2527 PE4010 NVMe Solid State Drive 2839 PE8000 Series NVMe Solid State Drive 1028 2143 DC NVMe SED PE8010 RI U.2 960GB 1028 2144 DC NVMe PE8010 RI U.2 960GB @@ -25259,6 +25461,14 @@ 1c5f 5445 NVMe SSD PBlaze7 7946 6400G E1.S 1c5f 5450 NVMe SSD PBlaze7 7946 12800G AIC 1c5f 5451 NVMe SSD PBlaze7 7946 12800G 2.5" U.2 + 1ea0 2100 TP2510 Series U.2 NVMe Datacenter SSD(3.84TB) + 1ea0 2101 TP2511 Series U.2 NVMe Datacenter SSD(3.84TB) + 1ea0 2110 TP2510 Series E3.S NVMe Datacenter SSD(3.84TB) + 1ea0 2111 TP2511 Series E3.S NVMe Datacenter SSD(3.84TB) + 1ea0 2200 TP2510 Series U.2 NVMe Datacenter SSD(7.68TB) + 1ea0 2201 TP2511 Series U.2 NVMe Datacenter SSD(7.68TB) + 1ea0 2210 TP2510 Series E3.S NVMe Datacenter SSD(7.68TB) + 1ea0 2211 TP2511 Series E3.S NVMe Datacenter SSD(7.68TB) 0540 PBlaze4 NVMe SSD 0550 PBlaze5 700/900 0555 PBlaze5 510/516 @@ -25373,6 +25583,10 @@ 1cc4 2213 NVMe SSD UH832a E3.S 3.2TB 1cc4 2214 NVMe SSD UH832a E3.S 6.4TB 1cc4 2215 NVMe SSD UH832a E3.S 12.8TB + 1cc4 3122 NVMe SSD UH712a U.2 1.92TB + 1cc4 3123 NVMe SSD UH712a U.2 3.84TB + 1cc4 3124 NVMe SSD UH712a U.2 7.68TB + 1cc4 3125 NVMe SSD UH712a U.2 15.36TB 1cc5 Embedded Intelligence, Inc. 0100 PCIe-CAN-02 Dual CAN bus (9-pin male). PCI Express x1. 0101 PCIe-CAN-01 Single CAN bus (9-pin male). PCI Express x1. @@ -25571,14 +25785,18 @@ 2440 CL2440 1d6a Aquantia Corp. 0001 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + 4c52 6880 LREC6880BT Single-port 10Gb Ethernet Network Adapter 00b1 AQtion AQC100 NBase-T/IEEE 802.3an Ethernet Controller [Atlantic 10G] 00c0 Antigua NBase-T/IEEE 802.3an Ethernet Controller - Engineering Sample 04c0 AQtion AQC113 NBase-T/IEEE 802.3an Ethernet Controller [Antigua 10G] + 4c52 1053 LRES1053PT Quad-port 10Gb Ethernet Network Adapter + 4c52 2051 LRES2051PT Single-port 10Gb Ethernet Network Adapter 07b1 AQtion AQC107 NBase-T/IEEE 802.3an Ethernet Controller [Atlantic 10G] # Older revision of QNAP QM2 M.2 2280 PCIe SSD & 10GbE Expansion Card 1baa 07b1 QM2-2P10G1TA [QXG 10GbE Network Adapter] # Newer revision of QNAP QM2 M.2 2280 PCIe SSD & 10GbE Expansion Card 1baa 07b2 QM2-2P10G1TA [QM2 Expansion Adapter] + 4c52 6880 LREC6880BT Single-port 10Gb Ethernet Network Adapter 08b1 AQC108 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 11b1 AQC111 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 12b1 AQC112 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] @@ -25701,7 +25919,7 @@ 2262 NVMe PCIe SSD 220S/MTE662T2 2263 NVMe PCIe SSD 110S/112S/120S/MTE300S/MTE400S/MTE652T2 (DRAM-less) 2264 NVMe PCIe SSD 250H - 2267 NVMe PCIe SSD 240S/MTE710T + 2267 NVMe PCIe SSD 220S/240S/MTE710T 5766 NVMe PCIe SSD 110Q (DRAM-less) 1d7c Aerotech, Inc. # Fiber-optic HyperWire motion control bus from Aerotech. @@ -26178,6 +26396,7 @@ 1df3 0001 ENA2100RN 1df5 Shenzhen TIGO Semiconductor 1202 kimtigo NVMe SSD (DRAM-less) + 2263 kimtigo MG931K NVMe SSD (DRAM-less) 1df7 opencpi.org 0001 ml605 0002 alst4 @@ -26286,6 +26505,7 @@ 1028 223c Ent NVMe CM7 U.2 MU 6.4TB 1028 223d Ent NVMe CM7 U.2 MU 3.2TB 1028 223e Ent NVMe CM7 U.2 MU 1.6TB + 002a Exceria Plus G3 NVMe SSD (DRAM-less) 002c NVMe SSD Controller CD8P EDSFF 1028 22bf DC NVMe CD8P E3.S 15.36TB 1028 22c0 DC NVMe CD8P E3.S 7.68TB @@ -26329,7 +26549,9 @@ # FHFL PCIe card, dual slot, 3rd generation from Enflame, 48GB device memory c032 S90 [Enflame] # FHFL PCIe card, dual slot, 3rd generation from Enflame, 48GB device memory - c033 S60 [Enflame] + c033 S60G [Enflame] +# FHFL PCIe card, dual slot, 3rd generation from Enflame, 48GB device memory + c035 S60 [Enflame] # nee Thinci, Inc 1e38 Blaize, Inc 0102 Xplorer X1600 @@ -26338,7 +26560,7 @@ 2263 270PM6, 270PM7 series NVMe SSD 1e3b DapuStor Corporation 0600 NVMe SSD Controller DP600 - 1e3b 0006 Enterprise NVMe SSD U.2 QDP 7.68TB (J5000) + 1e3b 0006 Enterprise NVMe SSD U.2 ODP 7.68TB (J5001) 1e3b 0010 Enterprise NVMe SSD U.2 3.84TB (R5102) 1e3b 0013 Enterprise NVMe SSD U.2 3.20TB (R5302) 1e3b 0030 Enterprise NVMe SSD U.2 3.84TB (J5100) @@ -26377,23 +26599,39 @@ 1e3b 00be Enterprise NVMe SSD U.2 QDP 30.72TB (R5100) 1e3b 00c1 Enterprise NVMe SSD U.2 QDP 25.60TB (R5300D) 1e3b 00c4 Enterprise NVMe SSD U.2 QDP 30.72TB (R5100D) - 1e3b 00c9 Enterprise NVMe SSD U.2 15.36TB (J5000) - 1e3b 00ca Enterprise NVMe SSD U.2 3.84TB (J5102) - 1e3b 00cb Enterprise NVMe SSD U.2 7.68TB (J5102) - 1e3b 00cc Enterprise NVMe SSD U.2 3.84TB (J5101) - 1e3b 00cd Enterprise NVMe SSD U.2 7.68TB (J5101) - 1e3b 00ce Enterprise NVMe SSD U.2 3.84TB (J5101D) - 1e3b 00cf Enterprise NVMe SSD U.2 7.68TB (J5101D) - 1e3b 00e8 Enterprise NVMe SSD U.2 3.20TB (J5301) - 1e3b 00e9 Enterprise NVMe SSD U.2 6.40TB (J5301) - 1e3b 00ea Enterprise NVMe SSD U.2 3.20TB (J5301D) - 1e3b 00eb Enterprise NVMe SSD U.2 6.40TB (J5301D) + 1e3b 00c9 Enterprise NVMe SSD U.2 ODP 15.36TB (J5001) + 1e3b 00ca Enterprise NVMe SSD U.2 ODP 3.84TB (J5102) + 1e3b 00cb Enterprise NVMe SSD U.2 ODP 7.68TB (J5102) + 1e3b 00cc Enterprise NVMe SSD U.2 QDP 3.84TB (J5101) + 1e3b 00cd Enterprise NVMe SSD U.2 ODP 7.68TB (J5101) + 1e3b 00ce Enterprise NVMe SSD U.2 QDP 3.84TB (J5101D) + 1e3b 00cf Enterprise NVMe SSD U.2 ODP 7.68TB (J5101D) + 1e3b 00dc Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM (J5001) + 1e3b 00dd Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5001) + 1e3b 00de Enterprise NVMe SSD U.2 ODP 15.36TB with SK 16GB DRAM(J5001D) + 1e3b 00df Enterprise NVMe SSD U.2 ODP 30.72TB with SAMSUNG 32GB DRAM(J5001D) + 1e3b 00e7 Enterprise NVMe SSD U.2 ODP 30.72TB with MT 32GB DRAM(J5001D) + 1e3b 00e8 Enterprise NVMe SSD U.2 QDP 3.20TB (J5301) + 1e3b 00e9 Enterprise NVMe SSD U.2 ODP 6.40TB (J5301) + 1e3b 00ea Enterprise NVMe SSD U.2 QDP 3.20TB (J5301D) + 1e3b 00eb Enterprise NVMe SSD U.2 ODP 6.40TB (J5301D) 1e3b 00f0 Enterprise NVMe SSD U.2 0.40TB (X2900) 1e3b 00f1 Enterprise NVMe SSD U.2 0.80TB (X2900) 1e3b 00f2 Enterprise NVMe SSD U.2 1.60TB (X2900) 1e3b 00f3 Enterprise NVMe SSD U.2 3.20TB (X2900) 1e3b 00f5 Enterprise NVMe SSD U.2 0.40TB (X2900P) 1e3b 00f6 Enterprise NVMe SSD U.2 0.80TB (X2900P) + 0800 DP800 + 1e3b 0001 Enterprise NVMe SSD U.2 QDP 3.84TB(R6100) + 1e3b 0007 Enterprise NVMe SSD U.2 ODP 15.36TB (R6100) + 1e3b 000a Enterprise NVMe SSD U.2 3.20TB (R6300) + 1e3b 000d Enterprise NVMe SSD U.2 6.40TB (R6300) + 1e3b 0010 Enterprise NVMe SSD U.2 12.80TB (R6300) + 1e3b 0018 Enterprise NVMe SSD U.2 QDP 3.84TB (R6100C) + 1e3b 0019 Enterprise NVMe SSD U.2 ODP 7.68TB (R6100C) + 1e3b 001a Enterprise NVMe SSD U.2 3.20TB (R6300C) + 1e3b 001b Enterprise NVMe SSD U.2 6.40TB (R6300C) + 1e3b 001c Enterprise NVMe SSD U.2 ODP 7.68TB (R6100) 1098 Haishen3 NVMe SSD 1e3b 0001 Enterprise NVMe SSD U.2 0.8TB (H2100) 1e3b 0002 Enterprise NVMe SSD U.2 0.96TB (H2200) @@ -26446,6 +26684,8 @@ 1011 PC210 NVMe SSD 1013 PC210 NVMe SSD 1031 PC300 NVMe SSD (DRAM-less) + 1033 PC300 NVMe SSD (DRAM-less) + 1071 PC411 NVMe SSD (DRAM-less) 1e4b MAXIO Technology (Hangzhou) Ltd. 1001 NVMe SSD Controller MAP1001 1002 NVMe SSD Controller MAP1002 (DRAM-less) @@ -26461,8 +26701,13 @@ 1e50 IP3 Tech (HK) Limited 1e52 Tenstorrent Inc 401e Wormhole + 1e52 0014 n300 + 1e52 0018 n150 b140 Blackhole faca Grayskull + 1e52 0003 e150 + 1e52 0007 e75 + 1e52 000a e300 1e57 Beijing Panyi Technology Co., Ltd 0100 The device has already been deleted. 0000 0100 PY8800 64GB Accelerator @@ -26526,6 +26771,7 @@ 2a16 Cloud Intelligent Inference Controller 2a18 Video Transcode Controller 2a20 Cloud Intelligent Inference and Training Controller + 2a22 Cloud Intelligent Inference Controller 1ea7 Intelliprop, Inc 223a Typhon+ PCIe to Gen-Z Bridge 224a IPA-PE224A CXL to Gen-Z Bridge [Sphinx] @@ -26585,6 +26831,10 @@ 1ed0 Hosin Global Electronics 1ed2 FuriosaAI, Inc. *** 739 LINES SKIPPED *** From nobody Mon May 20 11:25:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjZxG23jrz5L2sT; Mon, 20 May 2024 11:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjZxF6tbwz45yr; Mon, 20 May 2024 11:25:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716204322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uVrYn5+tG3dO+G41X/Dg8y4I2ekeUcheKf6rXoEAzRE=; b=OKRhlxxtn4sgB/RRN1ySxn/u6R6Oelvh0PFa06XPQks6Wm/evLfC7rU3k5hMsLn57tH1Jv +0hBb4achX68Q5XVETvtHzspRY9gcXW/etrc3SG41uMG2QHpP3neiVT/MVSWGEAURymIQQ TiOUiatZnt6p+bpH4qY9iLWClVRvUUagchocMOKxQEdfyz+1V9/S2X4VR+yAJ+C6FuCksy +zG7QYcAHiCstWbaWZzO3XJpPJhlrEn0pCvHVHgwMNuHxvYcnYtJmoCM6conjNb2oPH8Ga bv51ueNxTgXSIZCOHUt0dnJWkuYoTTLbE5SxTPQ32Hj9Ryqr9+9mGWuwvhiUxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716204322; a=rsa-sha256; cv=none; b=gM9smreWexfqrKnAsBtUf8aw1pxYfZuggctxDyudXKjufby3cAdwnWa+sPmx/zFsMPbirE JpXDDor3g7EJ9qktIkULP9SkmPhwKA80hjXSXj0ld62D9Ac5U99UNKkGYPoFG5J9lrihwZ rRIypoh+/+19CXXJGQl1feE2dgrAUoN16zWydzEremvqTCOFgqOVuZ/wXXcrgco6yz6JCI KVYhNvdmOM9iLoF3Hvgo3spst+l+c9Mzu53mMQcPQ8r2oLwisgxtN+DjplMlICqapdFlpe jbK46XDVKTb8O5BzPGGjZxrfrFyy19rlF9tKpahFY+qvCASy/QhTST/vrDv5ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716204322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uVrYn5+tG3dO+G41X/Dg8y4I2ekeUcheKf6rXoEAzRE=; b=QXfmI1vi1R4fRRc++VPkFGZ1D4bayce0xLYTeJb8xQqRQCipxiXyZao+0VN4zWqJU3M1C+ 5sEu0YDmxwF9ohfgXfbjASN+FTl7vFCrXD8lrEtn2rgwEqGlk76Ymynqjv2jMR8WrLVsMq aQeVQcAnKuS959s4Zk4X5OWaGCowhWvilvmR/IiKkLLRl423cimbq3A7GLB567/vDysySF MMv6kcJgs0asoWtimgm/RxrCohndbhns0csx9GRhlo2Afwtn5Gd1QGTsI3SPiUCFN/ljhO mHcEqvvAw/40ZYR6CjWKYS5ShhbHrxzsNXWAYSpgv1VdN4VBNZpkIla6fKqjzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjZxF6JlrzcL3; Mon, 20 May 2024 11:25:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KBPLNq025809; Mon, 20 May 2024 11:25:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KBPLNT025806; Mon, 20 May 2024 11:25:21 GMT (envelope-from git) Date: Mon, 20 May 2024 11:25:21 GMT Message-Id: <202405201125.44KBPLNT025806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: b454ede7524d - stable/14 - usb_vendors: update to 2024.03.18 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b454ede7524dae95d13ed570db886ca81060a9f5 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b454ede7524dae95d13ed570db886ca81060a9f5 commit b454ede7524dae95d13ed570db886ca81060a9f5 Author: Baptiste Daroussin AuthorDate: 2024-05-14 12:18:52 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-20 11:24:45 +0000 usb_vendors: update to 2024.03.18 (cherry picked from commit 79bffdf3f42e2e8e62223fcffd537d5d254ddbb7) --- share/misc/usb_vendors | 52 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/share/misc/usb_vendors b/share/misc/usb_vendors index 74a0cef04aa3..a1e3ea4acd1d 100644 --- a/share/misc/usb_vendors +++ b/share/misc/usb_vendors @@ -9,8 +9,8 @@ # The latest version can be obtained from # http://www.linux-usb.org/usb.ids # -# Version: 2024.01.30 -# Date: 2024-01-30 20:34:02 +# Version: 2024.03.18 +# Date: 2024-03-18 20:34:02 # # Vendors, devices and interfaces. Please keep sorted. @@ -209,6 +209,7 @@ 0012 DeskJet 1125C Printer Port 0024 KU-0316 Keyboard 002a LaserJet P1102 + 0036 CCID Smartcard Keyboard KUS0133 0053 DeskJet 2620 All-in-One Printer 0101 ScanJet 4100c 0102 PhotoSmart S20 @@ -2401,6 +2402,7 @@ 02ea Xbox One Controller 02fd Xbox One S Controller [Bluetooth] 02fe Xbox Wireless Adapter for Windows + 0306 Surface Pro 7 SD Card Reader 0400 Windows Powered Pocket PC 2002 0401 Windows Powered Pocket PC 2002 0402 Windows Powered Pocket PC 2002 @@ -5049,6 +5051,7 @@ 072d Revio KD410Z 04ca Lite-On Technology Corp. 0020 USB Keyboard + 003a Multimedia Keyboard 004b Keyboard 004f SK-9020 keyboard 008a Acer Wired Mouse Model SM-9023 @@ -8243,6 +8246,7 @@ 1093 Rugged 1094 Rugged THB 1095 Rugged + 1105 Mobile Drive (RLSD: 2022) a601 HardDrive a602 CD R/W 05a0 Vetronix Corp. @@ -9283,6 +9287,8 @@ # typo? 4004 Minolta Dimage Scan Elite II AF-2920 (2888) 0639 Chrontel, Inc. + 7213 CH7213 + 7231 CH7213 063a Techwin Corp. 063b Taugagreining HF 063c Yamaichi Electronics Co., Ltd (Sakura) @@ -11443,6 +11449,7 @@ 0826 Data Transit 0827 BroadLogic, Inc. 0828 Sato Corp. + a003 WS408 Label Printer 0829 DirecTV Broadband, Inc. (Telocity) 082d Handspring 0100 Visor @@ -12081,6 +12088,12 @@ 04b2 NC interface 04b3 keyboard front panel Cockpit 04b4 SCR_CCID + 04b5 Camera + 04b6 Cockpit Touchkeypad + 04b7 Cockpit Touchkeypad Bootloader + 04b8 MediSET USB4-W + 04b9 MediSET USB4-R + 04ba MediSET USB4-G 2701 ShenZhen SANZHAI Technology Co.,Ltd Spy Pen VGA 0909 Audio-Technica Corp. 001b ATR2100-USB @@ -12188,6 +12201,7 @@ 4cda Fenix 6 Sapphire 4cdb Fenix 6 0920 Echelon Co. + 5550 U60 FT Network Interface 7500 Network Interface 0921 GoHubs, Inc. 1001 GoCOM232 Serial @@ -12406,6 +12420,7 @@ 010f nanoKONTROL studio controller 0117 nanoKONTROL2 MIDI Controller 012f SQ-1 + 0203 KRONOS 0f03 K-Series K61P MIDI studio controller 0945 Pasco Scientific 0948 Kronauer music in digital @@ -12477,7 +12492,8 @@ 7140 T124 [Tegra K1/Logan 32-bit] 7210 SHIELD Controller 7321 Switch [Tegra Erista] recovery mode - 7423 T234 [Orin NX] recovery mode + 7323 T234 [Orin NX 16GB] recovery mode + 7423 T234 [Orin NX 8GB] recovery mode 7721 T210 [TX1 Tegra Erista] recovery mode 7820 T20 [Tegra 2] recovery mode 7c18 T186 [TX2 Tegra Parker] recovery mode @@ -12678,6 +12694,8 @@ 09d8 ELATEC GmbH 0320 TWN3 Multi125 0406 TWN4 MIFARE NFC + 0410 TWN4 HID + 0420 TWN4 CDC 09d9 KRF Tech, Ltd 09da A4Tech Co., Ltd. 0006 Optical Mouse WOP-35 / Trust 450L Optical Mouse @@ -12686,6 +12704,7 @@ 0018 Trust Human Interface Device 001a Wireless Mouse & RXM-15 Receiver 002a Wireless Optical Mouse NB-30 + 0103 Oscar X-710BK Gaming Mouse 022b Wireless Mouse (Battery Free) 024f RF Receiver and G6-20D Wireless Optical Mouse 0260 KV-300H Isolation Keyboard @@ -12693,12 +12712,16 @@ 09da Bloody V8 Mouse 1068 Bloody A90 Mouse 112c Bloody V5 Mouse + 2268 Keyboard (FK11) + 2690 PK-635G 3a60 Bloody V8M Core 2 Mouse 8090 X-718BK Oscar Optical Gaming Mouse 9033 X-718BK Optical Mouse 9066 F3 V-Track Gaming Mouse - 9090 XL-730K / XL-750BK / XL-755BK Mice + 9090 XL-730K / XL-747H / XL-750BK / XL-755BK Mice f613 Bloody V7M Mouse + f6cc B314 Light Strike Gaming Keyboard + fa44 B930 Light Strike RGB Mechanical Gaming Keyboard 09db Measurement Computing Corp. 0075 MiniLab 1008 0076 PMD-1024 @@ -12715,11 +12738,13 @@ 09e6 Silutia, Inc. 09e7 Real 3D, Inc. 09e8 AKAI Professional M.I. Corp. + 0029 APC40 mkII 0045 MPK Mini Mk II MIDI Controller 0062 MPD16 MIDI Pad Controller Unit 006d EWI electronic wind instrument 0071 MPK25 MIDI Keyboard 0076 LPK25 MIDI Keyboard + 007c MPK Mini MIDI Controller 09e9 Chen-Source, Inc. 09eb IM Networks, Inc. 4331 iRhythm Tuner Remote @@ -12783,6 +12808,9 @@ 1010 Bluetooth Device 1011 Bluetooth Device 1012 Bluetooth Device + 1243 CSRA64210 [TaoTronics Headset BH-22 in charging mode] + 4007 Mpow HC5 Headset in charging mode - HID / Mass Storage + 4010 Mpow HC5 Headset in charging mode - USB Hub ffff USB Bluetooth Device in DFU State 0a13 Telebyte, Inc. 0a14 Spacelabs Medical, Inc. @@ -12826,6 +12854,7 @@ 0a35 Radikal Technologies 002a SAC - Software Assigned Controller 008a SAC Hub +0a38 IRIS sa 0a39 Gilat Satellite Networks, Ltd 0a3a PentaMedia Co., Ltd 0163 KN-W510U 1.0 Wireless LAN Adapter @@ -12950,6 +12979,7 @@ 217f BCM2045B (BDC-2.1) 2198 Bluetooth 3.0 Device 219b Bluetooth 2.1 Device + 219c BCM2070 Bluetooth 21b1 HP Bluetooth Module 21b4 BCM2070 Bluetooth 2.1 + EDR 21b9 BCM2070 Bluetooth 2.1 + EDR @@ -12973,6 +13003,7 @@ 5802 BCM5880 Secure Applications Processor with fingerprint touch sensor 5803 BCM5880 Secure Applications Processor with secure keyboard 5804 BCM5880 Secure Applications Processor with fingerprint swipe sensor + 5832 BCM5880 Secure Applications Processor Smartcard reader 6300 Pirelli Remote NDIS Device 6410 BCM20703A1 Bluetooth 4.1 + LE bd11 BCM4320 802.11bg Wireless Adapter @@ -21442,6 +21473,8 @@ 20a0 Clay Logic 0006 flirc 4107 GPF Crypto Stick V1.2 + 4108 Nitrokey Pro + 4109 Nitrokey Storage 4123 IKALOGIC SCANALOGIC 2 414a MDE SPI Interface 415a OpenPilot @@ -21450,7 +21483,16 @@ 41e5 BlinkStick 4211 Nitrokey Start 4223 ATSAMD21 [castAR] + 4230 Nitrokey HSM + 4287 Nitrokey FIDO U2F 428d Electrosense wideband converter + 42b1 Nitrokey FIDO2 + 42b2 Nitrokey 3A Mini/3A NFC/3C NFC + 42b4 Nitrokey Pro Bootloader + 42da MuteMe + 42dd Nitrokey 3A NFC Bootloader/3C NFC Bootloader + 42e8 Nitrokey 3A Mini Bootloader + 42ec RP2040 [PicoWifi] 20b1 XMOS Ltd 10ad XUSB Loader f7d1 XTAG2 - JTAG Adapter @@ -22171,7 +22213,7 @@ 2581 Plug-up 1807 Generic HID Smartcard 1808 WinUSB Smartcard - f1d0 FIDO U2F Security Key + f1d0 Nitrokey U2F 258d Sequans Communications 259a TriQuint Semiconductor 25a7 Areson Technology Corp From nobody Mon May 20 13:46:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vjf4M15Crz5LJX1; Mon, 20 May 2024 13:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vjf4M0RFtz4Qtv; Mon, 20 May 2024 13:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716212803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9sjaGg01gUpHlc7vncrNFPldOofjs1sJ2BROmuvIh8Q=; b=sElQyStBX7NDTuSnGAtUad5rIvIxAQ4+4S6oxYMOZu8t+6cJprmlLFVA8iO8+qUid8e7uH fHMn3BafZB7Sj3J0ZlbSbMiEwkPIVbHOoJckVNigFrH2bUpj18WPaEYjMEZLtfz4gS9mkG /uefXXXxH9zAV7T7oHPwZ3xRe9LLX5c9cLFcHXM5e2YNqIQHUFPLef+rxnqy/XRbMnlerY sCS6m6dbC0MWB+C29Sb5s1kH6kqYoJvVVbUMFnQUSQjkPrhSBjk01SZkqQXG0OA36WF8kj K/Wju+AFT2Y58yVKiODae1wGHupZGID57BfQRZ2EI4v7zyHZejeMN2c2GoQf+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716212803; a=rsa-sha256; cv=none; b=qIkuX/151jtPX2DVGzzuZJnlyGly3hRjxPVou1n+bX66HvDBKR9jKqQfd8gT/wn1e6Sl9P FAmiyOHj//xNxk1Xfx96S2mHeAU80VUHieHJ8wpAP0EgX+n2+2kebD3KWnSi9z7QjlV5NE XHvs5MdknGxUJLACLQ3mnJ9kB9WD8dqHhZpdFrMyQ8Xdplz6a3t6vcOrJIAY849nbgl1iC VUQIj6SuARt5zI6pmnv+Mmb2VJO3FtyvXIbRndjnNWy1/qzkqRb8M1A+yFRSFHUCjdnEp8 2SxUwJ8YJY5YizosE3O4DUVYUWNTTnzJltALPZKFXH7qqbmLdS1lz5WwZ4fUTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716212803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9sjaGg01gUpHlc7vncrNFPldOofjs1sJ2BROmuvIh8Q=; b=I85DOKvDTkGefcnsdov+bb5/Cvg0OH/XAJqjAT+Qtt0UISXbb2+ZQr4GRNtE563gQhTvXi RN5SaOwSXTduuHyAYETlj9S8306oeOOrSRLagzt1rFGkjivP8VSaToN3UdIgVSzwt3xxCB r/PtNrLMp71JXQ1fWdXDmSGzXYIZB0hRAqQeN4yBkfSc7zWFttZTXF5Ibc8Rw/wjdD198w E0GJp+i6ajiMJR5WFUiby43VpzTKP19VJNFdryPoogRw4TO6EJtJRBzjJh2cswdRe7JHp3 /0HCR9igChq8GApYiSW5s3XRUbC+jSQQd3L2h8GDhQ3K5lKUxjJB3McMkV54YQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vjf4L72N4zgmr; Mon, 20 May 2024 13:46:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KDkgHj062872; Mon, 20 May 2024 13:46:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KDkgGk062869; Mon, 20 May 2024 13:46:42 GMT (envelope-from git) Date: Mon, 20 May 2024 13:46:42 GMT Message-Id: <202405201346.44KDkgGk062869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d27c35123b92 - stable/14 - clang-format: Minor tweaks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d27c35123b92a656170ebfc44383162812d79cd3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d27c35123b92a656170ebfc44383162812d79cd3 commit d27c35123b92a656170ebfc44383162812d79cd3 Author: Mark Johnston AuthorDate: 2024-04-30 21:32:38 +0000 Commit: Mark Johnston CommitDate: 2024-05-20 13:42:32 +0000 clang-format: Minor tweaks Invert KeepEmptyLinesAtTheStartOfBlocks. We used to require an empty line at the beginning of functions with no local variables, which I believe is the reason for this setting. Now it is discouraged in new code. Tell clang-format to align consecutive macros, since we tend to do that. clang-format's output isn't quite what we want here. Typically we have a tab after a #define for some reason, and clang-format doesn't appear to have an option for that. clang-format will also use a mix of tabs and spaces to minimize indentation, which is also against our convention. However, the result looks better with this setting than without. Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29870 (cherry picked from commit 2c18289b72c8594bb5dbe22d54ff3434a56ec6c6) --- .clang-format | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 6c541a571e1d..3d436fa0b35d 100644 --- a/.clang-format +++ b/.clang-format @@ -2,6 +2,7 @@ --- BasedOnStyle: WebKit AlignAfterOpenBracket: DontAlign +AlignConsecutiveMacros: AcrossEmptyLines AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Left @@ -94,6 +95,7 @@ ForEachMacros: - TAILQ_FOREACH_SAFE - VM_MAP_ENTRY_FOREACH - VM_PAGE_DUMP_FOREACH +SpaceBeforeParens: ControlStatementsExceptForEachMacros IndentCaseLabels: false IndentPPDirectives: None Language: Cpp @@ -162,7 +164,7 @@ IncludeCategories: # http://llvm.org/docs/CodingStandards.html#include-style IncludeIsMainRegex: 'BLAH_DONT_MATCH_ANYTHING' SortIncludes: true -KeepEmptyLinesAtTheStartOfBlocks: true +KeepEmptyLinesAtTheStartOfBlocks: false TypenameMacros: - ARB_ELMTYPE - ARB_HEAD From nobody Mon May 20 13:46:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vjf4N3FMYz5LJRM; Mon, 20 May 2024 13:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vjf4N10Bdz4Qtw; Mon, 20 May 2024 13:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716212804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zthJzFAa8t2xDdvWv8ygnQbWttVsUo5NW48BsLSpWJ8=; b=muUUywWmI5yejyDZ1kYXMmwTjlQm9igYOttL8WVn68qI9D+WU6X1NoaSOGfr38G3GeL4A8 +2ENZb/ONSKSQn65DmtbDRMfDSe6rPKat9kcTYeVkmShVgdE8IqhSdmyUMi/riGXoP8X11 /jZCFu4i8Yst/ql4JXmbPiyg5awWMDqXlLbP4szMlYerN5pCjygeXfb4Fssx4OjjdjZwVR kkSW5DydbjQ4/+YCBpw+qLBs/RAkzGSM6Gd7OyCkeN17OlC2ScpvGPfkpJY+Sgy785s7AV BPH3B/NCN7KTE3fvI7R7EldE46I3fEQ2i8U66YZexyfUI/N69y81y/qFkGxeWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716212804; a=rsa-sha256; cv=none; b=lKGrq/xSKPyM0pRjxLSqQVH3/Y+d+tgEx22OERXX4C1S1bL36o6zc4DC2EIgMIm76hZ4b9 VWK3UAVMb9Aw4ma2XOQaJ8C1Sklc+IMbWyh3ZccnUFdWECECy+5wCJREPpc40gadWpD2fQ 4qWqmwTD9aUVRgOpqf6H1iVB6GHY9LhQce4X5aQLxSBOYmLq1RHG7yffKEzcbWIiXZyb4Y 94gisMQl31UP1713C5ds7YCBTIc103KrdOJGfuOQfGMHh+AkCgMUjPwgdP6z2u+/X5DJV7 P3e2aq48bb/Cs13NANZC5t4mhLnowFsY0OS7RjLuRBCu8UvWuE5PNZM65vdPxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716212804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zthJzFAa8t2xDdvWv8ygnQbWttVsUo5NW48BsLSpWJ8=; b=SDqqyqFfKpHSO9zzVbpGDHo/kW7LlttN+WmX2IzTcdoUzCRS1QrEEA5luxcYIYtOPeZaBa PA8Nx1xZ4y4ZwhzePKg13fBha/38QZRke0Yf/S17kpjXTfwvVRcsOU3af60rJIeZpY0bZH 87GPDx4kudZFf+zdagHUTT2wjJtNREXcXn46txA9hbn0i78uNFTYwsEag9OAvhqTCYBqBa AlK6PXF6op8j2VVl/jk4BU9hD3g2O74hbpei/nAfu/M2P1/hrjjLoNKtRIEjWahRwpGT/w WBRJvzV6ST3AtTwqTBgy/qIhN6i+P7s+IRuq4uKxmLox5FFsBXw5IjiwQ6Vflw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vjf4N0c8mzh1g; Mon, 20 May 2024 13:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KDkhZd062911; Mon, 20 May 2024 13:46:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KDkhS8062908; Mon, 20 May 2024 13:46:43 GMT (envelope-from git) Date: Mon, 20 May 2024 13:46:43 GMT Message-Id: <202405201346.44KDkhS8062908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 160e7a4c16eb - stable/14 - wg: Add netmap support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 160e7a4c16ebbec4211a941a706778daf8ea62bd Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=160e7a4c16ebbec4211a941a706778daf8ea62bd commit 160e7a4c16ebbec4211a941a706778daf8ea62bd Author: Mark Johnston AuthorDate: 2024-04-20 16:01:28 +0000 Commit: Mark Johnston CommitDate: 2024-05-20 13:42:35 +0000 wg: Add netmap support When in netmap (emulated) mode, wireguard interfaces prepend or strip a dummy ethernet header when interfacing with netmap. The netmap application thus sees unencrypted, de-encapsulated frames with a fixed header. In this mode, netmap hooks the if_input and if_transmit routines of the ifnet. Packets from the host TX ring are handled by wg_if_input(), which simply hands them to the netisr layer; packets which would otherwise be tunneled are intercepted in wg_output() and placed in the host RX ring. The "physical" TX ring is processed by wg_transmit(), which behaves identically to wg_output() when netmap is not enabled, and packets appear in the "physical" RX ring by hooking wg_deliver_in(). Reviewed by: vmaffione MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: Zenarmor Differential Revision: https://reviews.freebsd.org/D43460 (cherry picked from commit bf454ca88bdf4acfa873386e876ff5e772e6a830) --- share/man/man4/wg.4 | 14 +++++ sys/dev/wg/if_wg.c | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 163 insertions(+), 6 deletions(-) diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 index d0d871e52220..05d6961a9610 100644 --- a/share/man/man4/wg.4 +++ b/share/man/man4/wg.4 @@ -121,6 +121,19 @@ as follows: Although a valid Curve25519 key must have 5 bits set to specific values, this is done by the interface and so it will accept any random 32-byte base64 string. +.Sh NETMAP +.Xr netmap 4 +applications may open a WireGuard interface in emulated mode. +The netmap application will receive decrypted, unencapsulated packets prepended +by a dummy Ethernet header. +The Ethertype field will be one of +.Dv ETHERTYPE_IP +or +.Dv ETHERTYPE_IPV6 +depending on the address family of the packet. +Packets transmitted by the application should similarly begin with a dummy +Ethernet header; this header will be stripped before the packet is encrypted +and tunneled. .Sh EXAMPLES Create a .Nm @@ -183,6 +196,7 @@ is not assigned to the allowed IPs of Peer X. .Xr ip 4 , .Xr ipsec 4 , .Xr netintro 4 , +.Xr netmap 4 , .Xr ovpn 4 , .Xr ipf 5 , .Xr pf.conf 5 , diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 30429c3725cd..552f47f9645b 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -1672,6 +1672,31 @@ error: } } +#ifdef DEV_NETMAP +/* + * Hand a packet to the netmap RX ring, via netmap's + * freebsd_generic_rx_handler(). + */ +static void +wg_deliver_netmap(if_t ifp, struct mbuf *m, int af) +{ + struct ether_header *eh; + + M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); + if (__predict_false(m == NULL)) { + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + return; + } + + eh = mtod(m, struct ether_header *); + eh->ether_type = af == AF_INET ? + htons(ETHERTYPE_IP) : htons(ETHERTYPE_IPV6); + memcpy(eh->ether_shost, "\x02\x02\x02\x02\x02\x02", ETHER_ADDR_LEN); + memcpy(eh->ether_dhost, "\xff\xff\xff\xff\xff\xff", ETHER_ADDR_LEN); + if_input(ifp, m); +} +#endif + static void wg_deliver_in(struct wg_peer *peer) { @@ -1680,6 +1705,7 @@ wg_deliver_in(struct wg_peer *peer) struct wg_packet *pkt; struct mbuf *m; struct epoch_tracker et; + int af; while ((pkt = wg_queue_dequeue_serial(&peer->p_decrypt_serial)) != NULL) { if (atomic_load_acq_int(&pkt->p_state) != WG_PACKET_CRYPTED) @@ -1705,19 +1731,25 @@ wg_deliver_in(struct wg_peer *peer) if (m->m_pkthdr.len == 0) goto done; - MPASS(pkt->p_af == AF_INET || pkt->p_af == AF_INET6); + af = pkt->p_af; + MPASS(af == AF_INET || af == AF_INET6); pkt->p_mbuf = NULL; m->m_pkthdr.rcvif = ifp; NET_EPOCH_ENTER(et); - BPF_MTAP2_AF(ifp, m, pkt->p_af); + BPF_MTAP2_AF(ifp, m, af); CURVNET_SET(if_getvnet(ifp)); M_SETFIB(m, if_getfib(ifp)); - if (pkt->p_af == AF_INET) +#ifdef DEV_NETMAP + if ((if_getcapenable(ifp) & IFCAP_NETMAP) != 0) + wg_deliver_netmap(ifp, m, af); + else +#endif + if (af == AF_INET) netisr_dispatch(NETISR_IP, m); - if (pkt->p_af == AF_INET6) + else if (af == AF_INET6) netisr_dispatch(NETISR_IPV6, m); CURVNET_RESTORE(); NET_EPOCH_EXIT(et); @@ -2162,13 +2194,36 @@ determine_af_and_pullup(struct mbuf **m, sa_family_t *af) return (0); } +#ifdef DEV_NETMAP +static int +determine_ethertype_and_pullup(struct mbuf **m, int *etp) +{ + struct ether_header *eh; + + *m = m_pullup(*m, sizeof(struct ether_header)); + if (__predict_false(*m == NULL)) + return (ENOBUFS); + eh = mtod(*m, struct ether_header *); + *etp = ntohs(eh->ether_type); + if (*etp != ETHERTYPE_IP && *etp != ETHERTYPE_IPV6) + return (EAFNOSUPPORT); + return (0); +} + +/* + * This should only be invoked by netmap, via nm_os_generic_xmit_frame(), to + * transmit packets from the netmap TX ring. + */ static int wg_transmit(if_t ifp, struct mbuf *m) { sa_family_t af; - int ret; + int et, ret; struct mbuf *defragged; + KASSERT((if_getcapenable(ifp) & IFCAP_NETMAP) != 0, + ("%s: ifp %p is not in netmap mode", __func__, ifp)); + defragged = m_defrag(m, M_NOWAIT); if (defragged) m = defragged; @@ -2178,14 +2233,94 @@ wg_transmit(if_t ifp, struct mbuf *m) return (ENOBUFS); } + ret = determine_ethertype_and_pullup(&m, &et); + if (ret) { + xmit_err(ifp, m, NULL, AF_UNSPEC); + return (ret); + } + m_adj(m, sizeof(struct ether_header)); + ret = determine_af_and_pullup(&m, &af); if (ret) { xmit_err(ifp, m, NULL, AF_UNSPEC); return (ret); } - return (wg_xmit(ifp, m, af, if_getmtu(ifp))); + + /* + * netmap only gets to see transient errors, since it handles errors by + * refusing to advance the transmit ring and retrying later. + */ + ret = wg_xmit(ifp, m, af, if_getmtu(ifp)); + if (ret == ENOBUFS) + return (ret); + return (0); } +/* + * This should only be invoked by netmap, via nm_os_send_up(), to process + * packets from the host TX ring. + */ +static void +wg_if_input(if_t ifp, struct mbuf *m) +{ + int et; + + KASSERT((if_getcapenable(ifp) & IFCAP_NETMAP) != 0, + ("%s: ifp %p is not in netmap mode", __func__, ifp)); + + if (determine_ethertype_and_pullup(&m, &et) != 0) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + return; + } + CURVNET_SET(if_getvnet(ifp)); + switch (et) { + case ETHERTYPE_IP: + m_adj(m, sizeof(struct ether_header)); + netisr_dispatch(NETISR_IP, m); + break; + case ETHERTYPE_IPV6: + m_adj(m, sizeof(struct ether_header)); + netisr_dispatch(NETISR_IPV6, m); + break; + default: + __assert_unreachable(); + } + CURVNET_RESTORE(); +} + +/* + * Deliver a packet to the host RX ring. Because the interface is in netmap + * mode, the if_transmit() call should pass the packet to netmap_transmit(). + */ +static int +wg_xmit_netmap(if_t ifp, struct mbuf *m, int af) +{ + struct ether_header *eh; + + if (__predict_false(if_tunnel_check_nesting(ifp, m, MTAG_WGLOOP, + MAX_LOOPS))) { + printf("%s:%d\n", __func__, __LINE__); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + return (ELOOP); + } + + M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); + if (__predict_false(m == NULL)) { + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + return (ENOBUFS); + } + + eh = mtod(m, struct ether_header *); + eh->ether_type = af == AF_INET ? + htons(ETHERTYPE_IP) : htons(ETHERTYPE_IPV6); + memcpy(eh->ether_shost, "\x06\x06\x06\x06\x06\x06", ETHER_ADDR_LEN); + memcpy(eh->ether_dhost, "\xff\xff\xff\xff\xff\xff", ETHER_ADDR_LEN); + return (if_transmit(ifp, m)); +} +#endif /* DEV_NETMAP */ + static int wg_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { @@ -2204,6 +2339,11 @@ wg_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro return (EAFNOSUPPORT); } +#ifdef DEV_NETMAP + if ((if_getcapenable(ifp) & IFCAP_NETMAP) != 0) + return (wg_xmit_netmap(ifp, m, af)); +#endif + defragged = m_defrag(m, M_NOWAIT); if (defragged) m = defragged; @@ -2779,7 +2919,10 @@ wg_clone_create(struct if_clone *ifc, char *name, size_t len, if_setinitfn(ifp, wg_init); if_setreassignfn(ifp, wg_reassign); if_setqflushfn(ifp, wg_qflush); +#ifdef DEV_NETMAP if_settransmitfn(ifp, wg_transmit); + if_setinputfn(ifp, wg_if_input); +#endif if_setoutputfn(ifp, wg_output); if_setioctlfn(ifp, wg_ioctl); if_attach(ifp); From nobody Mon May 20 13:46:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vjf4P4rKBz5LJTW; Mon, 20 May 2024 13:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vjf4P229gz4Qgs; Mon, 20 May 2024 13:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716212805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iZqvJn6c7MHjAqTjGUYzX+gpNp/eatE+o5EgFKmhaA8=; b=akSzzuuqrxalTeZZktAMk5oUE+ccMPlaSffy0APAma9EBFIfLXO5vWFlk08t1csRyVp4DF 1UPT+TlhMgOT60yvPZoVo7QO/Y6AXcMTUZQT+8ZRKPqA77iay+Wh+bPoOdFEbTJGZrXPpI SNWiidTwzpLG9N8tbxa2cjeKOqLurcAQ6o/RatR+UM2YF7cQS4IuM5A6++lwNj4+N8nz6u xNLkZxYWZjxsR/ep4g1BMPaMVfQN0d+gCM+IQ7CURvqUFzYJ74pP/S4H2ItVegXzC1EG13 /S/uoNTs2OsDz2/E57XauKcKrO1lHV6kXE4qk7uh4mkE/TpgfxDb2A8tqiZY7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716212805; a=rsa-sha256; cv=none; b=Zu9K/5IKa6hS18GSXjxFMPH07IlTdGrbZOusZ+Q0D8WLtvPNHFaUGSsg3j/O32dJIt4S16 WNfY3OhXjPuXk5NLwlHfVMN7CeFEokXtsDUfnw4qCTdUq6KXH3/V0QnFNFZdAEDS7c5Hid 44ja0RHj/VremFVFNrf5vlZjPfZ8q4ARL4jZeVQ1WOaQL4vzFpeGpVFE9Deoe2Wq9Wl1Vo pC63XX4zofT3PE8xCLZIZkv6EwwLmHtheIjBP8QSqjthMjCj4Q9jYtyXsncraxBitTmaDt OvJ6fZ7bsAq1YZ/ePI5gsD3tvnFGjCwR7wTXBwMSc7lXPZwfJCsNjtHwfKa5tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716212805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iZqvJn6c7MHjAqTjGUYzX+gpNp/eatE+o5EgFKmhaA8=; b=y1sK31lff5P8gWyqcUQBOmWPnL79Wy5nEryGXMKu0MHglNl7ewkVPQw5jmP66EPxaRwQdI k6JChKzluFBv9nJetE9qzquHjPB/06i1FMjcjRp0rcSwHzqC/ijyCZzasHc7OQ/RngGzos O6vmHYn5KZ8HML1xegzka2x3VMMGvuFLqrOZ4LDl+GGCf+jAv3RAWQuLa/+RYoVdmrxmAg 4wYs6yX1xviEHWVE4cwwJ1ZaldslV8mubmTEgp/cVlV8USOWrqc4Vw0VkmSxJrTyxMWBpt ZkNk/Dnun8Nzo2VQsw0TSa+SdPSG8NBVe0mJp+AwQU16N7GkTDvH4+5R6RQaqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vjf4P1fV0zh1h; Mon, 20 May 2024 13:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KDkjZg062988; Mon, 20 May 2024 13:46:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KDkjRV062985; Mon, 20 May 2024 13:46:45 GMT (envelope-from git) Date: Mon, 20 May 2024 13:46:45 GMT Message-Id: <202405201346.44KDkjRV062985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c39084799647 - stable/14 - wg tests: Add a simple regression test case for netmap support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c39084799647c0c085c6e3433a232c668d9447a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c39084799647c0c085c6e3433a232c668d9447a9 commit c39084799647c0c085c6e3433a232c668d9447a9 Author: Mark Johnston AuthorDate: 2024-04-20 16:01:53 +0000 Commit: Mark Johnston CommitDate: 2024-05-20 13:42:46 +0000 wg tests: Add a simple regression test case for netmap support MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: Zenarmor (cherry picked from commit c0f13232410cf881475d6e4dbd0ec28ab3476c59) --- tests/sys/net/Makefile | 6 +++- tests/sys/net/if_wg.sh | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index 75596028688b..95ab86156a0a 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -1,4 +1,3 @@ - PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/net @@ -19,6 +18,11 @@ ATF_TESTS_SH+= if_wg TESTS_SUBDIRS+= if_ovpn TESTS_SUBDIRS+= routing +# The netmap bridge application is used by if_wg tests. +.PATH: ${SRCTOP}/tools/tools/netmap +PROGS+= bridge +LIBADD.bridge+= netmap + # The tests are written to be run in parallel, but doing so leads to random # panics. I think it's because the kernel's list of interfaces isn't properly # locked. diff --git a/tests/sys/net/if_wg.sh b/tests/sys/net/if_wg.sh index 1f2ea308853a..b43b40f25018 100644 --- a/tests/sys/net/if_wg.sh +++ b/tests/sys/net/if_wg.sh @@ -92,6 +92,97 @@ wg_basic_cleanup() vnet_cleanup } +atf_test_case "wg_basic_netmap" "cleanup" +wg_basic_netmap_head() +{ + atf_set descr 'Create a wg(4) tunnel over an epair and pass traffic between jails with netmap' + atf_set require.user root +} + +wg_basic_netmap_body() +{ + local epair pri1 pri2 pub1 pub2 wg1 wg2 + local endpoint1 endpoint2 tunnel1 tunnel2 tunnel3 tunnel4 + local pid status + + kldload -n if_wg || atf_skip "This test requires if_wg and could not load it" + kldload -n netmap || atf_skip "This test requires netmap and could not load it" + + pri1=$(wg genkey) + pri2=$(wg genkey) + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + tunnel1=192.168.3.1 + tunnel2=192.168.3.2 + tunnel3=192.168.3.3 + tunnel4=192.168.3.4 + + epair=$(vnet_mkepair) + + vnet_init + + vnet_mkjail wgtest1 ${epair}a + vnet_mkjail wgtest2 ${epair}b + + jexec wgtest1 ifconfig ${epair}a ${endpoint1}/24 up + jexec wgtest2 ifconfig ${epair}b ${endpoint2}/24 up + + wg1=$(jexec wgtest1 ifconfig wg create) + echo "$pri1" | jexec wgtest1 wg set $wg1 listen-port 12345 \ + private-key /dev/stdin + pub1=$(jexec wgtest1 wg show $wg1 public-key) + wg2=$(jexec wgtest2 ifconfig wg create) + echo "$pri2" | jexec wgtest2 wg set $wg2 listen-port 12345 \ + private-key /dev/stdin + pub2=$(jexec wgtest2 wg show $wg2 public-key) + + atf_check -s exit:0 -o ignore \ + jexec wgtest1 wg set $wg1 peer "$pub2" \ + endpoint ${endpoint2}:12345 allowed-ips ${tunnel2}/32,${tunnel4}/32 + atf_check -s exit:0 \ + jexec wgtest1 ifconfig $wg1 inet ${tunnel1}/24 up + + atf_check -s exit:0 -o ignore \ + jexec wgtest2 wg set $wg2 peer "$pub1" \ + endpoint ${endpoint1}:12345 allowed-ips ${tunnel1}/32,${tunnel3}/32 + atf_check -s exit:0 \ + jexec wgtest2 ifconfig $wg2 inet ${tunnel2}/24 up + + atf_check -s exit:0 -o ignore \ + jexec wgtest1 sysctl net.inet.ip.forwarding=1 + atf_check -s exit:0 -o ignore \ + jexec wgtest2 sysctl net.inet.ip.forwarding=1 + + jexec wgtest1 $(atf_get_srcdir)/bridge -w 0 -i netmap:wg0 -i netmap:wg0^ & + pid=$! + + # Generous timeout since the handshake takes some time. + atf_check -s exit:0 -o ignore jexec wgtest1 ping -c 1 -t 5 $tunnel2 + atf_check -s exit:0 -o ignore jexec wgtest2 ping -c 1 $tunnel1 + + # Verify that we cannot ping non-existent tunnel addresses. In general + # the remote side should respond with an ICMP message. + atf_check -s exit:2 -o ignore jexec wgtest1 ping -c 1 -t 2 $tunnel4 + atf_check -s exit:2 -o ignore jexec wgtest2 ping -c 1 -t 2 $tunnel3 + + # Make sure that the bridge is still functional. + atf_check -s exit:0 -o ignore jexec wgtest1 ping -c 1 $tunnel2 + atf_check -s exit:0 -o ignore jexec wgtest2 ping -c 1 $tunnel1 + + atf_check -s exit:0 kill -TERM $pid + wait $pid + status=$? + + # Make sure that SIGTERM was received and handled. + atf_check_equal $status 143 +} + +wg_basic_netmap_cleanup() +{ + vnet_cleanup +} + # The kernel is expected to silently ignore any attempt to add a peer with a # public key identical to the host's. atf_test_case "wg_key_peerdev_shared" "cleanup" @@ -258,6 +349,7 @@ wg_vnet_parent_routing_cleanup() atf_init_test_cases() { atf_add_test_case "wg_basic" + atf_add_test_case "wg_basic_netmap" atf_add_test_case "wg_key_peerdev_shared" atf_add_test_case "wg_key_peerdev_makeshared" atf_add_test_case "wg_vnet_parent_routing" From nobody Mon May 20 17:06:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjkWK34Mjz5LfR2; Mon, 20 May 2024 17:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjkWK2ZdWz42vC; Mon, 20 May 2024 17:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716224813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmvBxwUq03por5hDYHyyuhWbVTjShZpM7nXtG5SdzPk=; b=TjUVzVcAsjW63RJUeljJ6pEfa0Vm+5PCQ76VHs1xNVidlcJKgQxF1yu/A01Z7zmoquWQJU iYw0vw6KmTg8X9lO0z2VLldrOmT+7PDi9F1QiLxFV2PdS08btomHVcIzAdHHK1YKLqgqvu 5196gHdOBCc0+EjTvYDruporbLnSJWrcwrpl7DNsRv7HbjZw/EI3oLIStXjUjaaXBPMYwK BEk4GAUZQQL7UsU4ipVU5NhqsdpdSMP7CFNlwoRpAHKoGzetYOo9Z2k/F8cWQQWs+tOa1t WVNkq/lVbYhhAEv/3lFg4mNC3E1LaqA8800YxVtMsTSxjzjOhw7WeSAk9NUVJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716224813; a=rsa-sha256; cv=none; b=nb3AaFu26FB0lYxZSxk89B36D8UPPB4wHr5p1p4HUZT0Nkj9CbBaZuOH0GpqHUb02HwXcQ tRjZt9+Eg6zE/O7U2LcVbdqCo5Y7Iq8ITtVgIGUY5O+RR+FirQsUStogxk+ITPUpJIJuMe NrEd9kN1qsb0OY+20SrjuBT+UrUlmfr6LbujyX5kgW9ePh53ofHu3EsHsm1yUhC6slzeBG SEJctg4OvcCSjkphwin2HK9j13YlroOlKKhOxrftpxBFcWcfKGvvlyB5vxfNLs/fi19dMu sk7E8j4hXSMxPHF58SnE/piI22A40N7Dw0pOwO9+6WQjJOEz8yQn9vbzdajLvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716224813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmvBxwUq03por5hDYHyyuhWbVTjShZpM7nXtG5SdzPk=; b=OAw1eO+WHoLcw/VfFDXqTHDgCXt/8E39b1A92F21udnuxo9IS/WGjUc8Z2v/EN2QMb69Gh xulAiq1seKtOuQEF/KZ/8BoeYbNEUppPQw+iqSmMaz8nn1d+YTqKuaxafOabx5HR9b7jBF bcICYjn0WYD9zbGeT7TgyrmbsDknntrVaOfdNOjFhG4TSDH182Uln09a5PPK3lkKuut7OV boSe5xJcej+3gAem+P0HiMDhH/V/pK5vr2s4SFe+xo4wDh8BZuPmzldw9DQYPu81uTf+E1 9Yr3XwvDuKLnCN1fIqX9kKVcK0Kvphp7ELHJPKg/iMCqTQZKf8Sgq1fFsOs1rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjkWK23LCzm7T; Mon, 20 May 2024 17:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KH6rNg003397; Mon, 20 May 2024 17:06:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KH6rnP003394; Mon, 20 May 2024 17:06:53 GMT (envelope-from git) Date: Mon, 20 May 2024 17:06:53 GMT Message-Id: <202405201706.44KH6rnP003394@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 2f9bf48e797e - releng/14.1 - Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 2f9bf48e797e095df48d4668ab48347baaf9fc88 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2f9bf48e797e095df48d4668ab48347baaf9fc88 commit 2f9bf48e797e095df48d4668ab48347baaf9fc88 Author: Dimitry Andric AuthorDate: 2024-05-16 18:21:45 +0000 Commit: Dimitry Andric CommitDate: 2024-05-20 17:06:20 +0000 Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang): [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694) This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like: /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust. (For rust itself there is also a similar issue reported at https://github.com/rust-lang/rust/pull/121088). PR: 276104 Reported by: netchild Approved by: re (cperciva) MFC after: 3 days (cherry picked from commit fcfb2d6393712dee3f1f8f0c3840d14817dea416) (cherry picked from commit 14efb9bb710486a6fba349ec1b4b1b94a9a5a089) --- contrib/llvm-project/llvm/lib/TargetParser/Host.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp index 1adef15771fa..848b531dd8dd 100644 --- a/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp +++ b/contrib/llvm-project/llvm/lib/TargetParser/Host.cpp @@ -1774,7 +1774,8 @@ bool sys::getHostCPUFeatures(StringMap &Features) { Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1); // AVX512 is only supported if the OS supports the context save for it. Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; - Features["evex512"] = Features["avx512f"]; + if (Features["avx512f"]) + Features["evex512"] = true; Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1); Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1); From nobody Mon May 20 17:09:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjkZc0gTTz5Lg2x; Mon, 20 May 2024 17:09: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjkZb64jjz43S2; Mon, 20 May 2024 17:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716224983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CfW2W93HEanc4i59oyPIr1yRkLAWHSsv1rW0D2Pt9ks=; b=CxXoSCDA02zm8TUqAwAJ9vyiRuM6FtxHsEgXQ+hZklXfk4rR0h747RQnzd/+/q+AdA9Oyt 78XfhpkSBLMdZ+UEfs6X/uBuSrTaCUyhOKR6ZYa3PAXYt/uOMhzbqeaq07vvEpvCNvDCuV /PI7hntMXpduZvPyAEfizgsmkjsfRP6FfDJEdNeJJZDZ5Hw8U/QCNddTQ7fiILhG71iD4m rXqv1g71ySNxvYxRYa7p1jnc9nUxg42dOeIHlW3+kUxMpLd1otSNL2LDTEORzHEZRcocrV FszdvHSRrWT9DpVFFhFs1xJDKB5fgcVQZGmOGrqHnEDPxrtE/Vk7FeNRLd+s2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716224983; a=rsa-sha256; cv=none; b=fEaLRYEmqoLliGJBSmkJNS+l1XafT+j1vMQ6ntiX6Lm58HUVKvTY9km4wno+ttqdE03Fma t2MWJwUdBJsK+vNjlFFwfFgcVCGV7BLKZSHHExPuv4CjVwbLdtq1tp/eDMLXCfY+uTHKLp JCc2j7JFbPRqIe/l0uvdLYV4MYSadM4SMz71V46y4A2+zgup95PzQ3jkozj77kW9M9pKpj Fuy8q4Tj8GZIEuyJxCShnxmjcWBzyQFyWIgoOlgXzIcfQlc8we6hcluDwJBE0rXl5s4Dq3 BdIY8ntBddP3JXTNET/xO3UM/oBJmDWURr+LxM68WrE7asMnGLXt1wKvGbjM2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716224983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CfW2W93HEanc4i59oyPIr1yRkLAWHSsv1rW0D2Pt9ks=; b=ALDAa7+HO7fawBqTGT4COgWqerCAgqxE3ro+g+uV3tZewnad1x9wDkVLX71P8MHTTXHRUb kSmcqX/0oB+GFgAFOsZOaweY70Bl502uyaBsYHeEUGvD0q9J9ZZ9JRckMtNhSKcKr07/In Unar560QEFli4Ydg6NaBxPty2Torel2YjYGoczOx1un9qcxxX9HOoaRrn2qW8Cd9W5eWlX 0HLBuCKqmMewd6vCQN6XjHT9+qqWLz+AqnqixkhzuXwSmiBUZ5NNzbAFqEcZqXJMjZVLGZ wRfOPhLsV8TTx0aQLNIb1GLjQbcV5Baj6fUkaIom04dCmNmJo+NytXwLTVZK+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 4VjkZb5gwQzmtl; Mon, 20 May 2024 17:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KH9hI5003934; Mon, 20 May 2024 17:09:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KH9hML003931; Mon, 20 May 2024 17:09:43 GMT (envelope-from git) Date: Mon, 20 May 2024 17:09:43 GMT Message-Id: <202405201709.44KH9hML003931@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 5dd6fb108dd9 - stable/14 - stand: Spell LUA_COMPILE_SET correctly. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5dd6fb108dd9f5abbacbdc73197ef8468b93b958 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=5dd6fb108dd9f5abbacbdc73197ef8468b93b958 commit 5dd6fb108dd9f5abbacbdc73197ef8468b93b958 Author: Warner Losh AuthorDate: 2024-05-11 18:05:53 +0000 Commit: Dimitry Andric CommitDate: 2024-05-20 17:08:53 +0000 stand: Spell LUA_COMPILE_SET correctly. MFC After: 2 days Sponsored by: Netflix (cherry picked from commit e63d20b70ee1dbee9b075f29de6f30cdcfe1abe1) --- stand/liblua/lutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/liblua/lutils.h b/stand/liblua/lutils.h index ea715096df09..7fff8d3ae83d 100644 --- a/stand/liblua/lutils.h +++ b/stand/liblua/lutils.h @@ -34,7 +34,7 @@ int luaopen_pager(lua_State *); #include typedef void lua_init_md_t(lua_State *); -#define _LUA_COMPIE_SET Xlua_compile_set +#define _LUA_COMPILE_SET Xlua_compile_set #define LUA_COMPILE_SET(func) \ DATA_SET(_LUA_COMPILE_SET, func) #define LUA_FOREACH_SET(s) \ From nobody Mon May 20 20:06:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjpVm0tPxz5LKrS; Mon, 20 May 2024 20:06: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjpVm0QfHz4NB9; Mon, 20 May 2024 20:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716235600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3knuY0lqlMIt1jh4B4HM8m/Nf5QQzNTIvAGO7wsKlqc=; b=QlA+mKLcZhaODAhzz8S78WQVv7ud3Ksx0fJeRAoHr31uPP1+6BwxMBgjaO6W+/NrTDqx7+ P0stpJJqXvIuhwHTgbmJFB2dDFT9509e8418kVaKsAa/rxhLwL65tuppghkJo2DOW4Q1WI 7FOZ6WGPZZNoXXdQf9+QFjE8L8xvEkmj3r4+0yuWwHpcwO+0KFFR8wE+OelhDzwopQKGN5 COPc9Ugx4pP6/yj5g1HX4DjT78IOFOAOedDN0ohJ+ie4C3799iO5wPMyiKIQSha8j20+qn 7OJbgaJwUmSkT1WYwfmOmPul/wqF4B06woa0NTwBqSFen0uiQQzgEDzkHk66Jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716235600; a=rsa-sha256; cv=none; b=R25lZq00G1ri3QB3x97BwAmh+/6Mqqjy5Jt/YPwgpC6nMSlb7BjU0yp2yIRfh3RjaK/771 0k3NhfTOpMXNwhcYIz0trsiuxkx2F5CvffhO3ouHia4mvCXEafBjiS6nqVf00QOzTmz8lX qPAVhEUONT3YGPYlV7OMSIdZKer6+BOG465gVtwLOPtAFybSBO/KoGh6722/XaBlXfsFve yXDwI9zOTWlP4ZJLOiFSfEDrZdVWzxKzg0SdTCXdT058KnIZ1LCXAXpMisfojJA/Gy3X4K 56nPTpoUXAgDr/bq9P3gwqZoz/uPQj+oTSW8OwuTGLRfkxPDbMCmSLEa5i2Vlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716235600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3knuY0lqlMIt1jh4B4HM8m/Nf5QQzNTIvAGO7wsKlqc=; b=cD+JwlQUGmKZoogeCvLEUTf26Bgi1A/LNSn4S+3QvDfXzTxoot+MSZaPCwAwhGrm8E6z9q sjIUbsg0tT6B9ow2AhPDISmATkRC4AyodiV2S1iFX3Vxkcny0SbHJLaFbCsxxyuLde4saN l+wbO0Io2aOxIj90JZhQqiTxH3H95XjDX88ujUUgkF3DYARgi9l3mUqkJ9DL7frLEKxb6C XHEQx9OIzlTTt+Zj3nHjIaRvE68oYPehKinqaynTeTFLj+mPE1ldEGLfCQnS286Gs0H2ZM 4fw4Zjn2UlvIG8k5FGoekV7eyA1zuthfEelmJPytLmYvX7vr79o2Clzzgem52g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjpVm01gczrvN; Mon, 20 May 2024 20:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KK6dNA007246; Mon, 20 May 2024 20:06:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KK6d0b007243; Mon, 20 May 2024 20:06:39 GMT (envelope-from git) Date: Mon, 20 May 2024 20:06:39 GMT Message-Id: <202405202006.44KK6d0b007243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 4c2ea6e26d21 - stable/14 - da: Update trim stats for WRITE SAME and ATA TRIM List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4c2ea6e26d210d07d29c845addeb0c2a103f5904 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4c2ea6e26d210d07d29c845addeb0c2a103f5904 commit 4c2ea6e26d210d07d29c845addeb0c2a103f5904 Author: Matthew Grooms AuthorDate: 2024-05-03 14:41:05 +0000 Commit: Warner Losh CommitDate: 2024-05-20 19:23:40 +0000 da: Update trim stats for WRITE SAME and ATA TRIM The scsi UNMAP path updated trim stats in the da sysctl, but the ATA TRIM passthru and WRITE SAME paths did not. Add code so they do. PR: 277637 Reviewed by: imp (tweaked WS path to update ranges) (cherry picked from commit 12117d0e9314d1706508386c1c49ace2de578b31) --- sys/cam/scsi/scsi_da.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index ae691520e157..5b1cc7314984 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -4209,6 +4209,9 @@ da_delete_trim(struct cam_periph *periph, union ccb *ccb, struct bio *bp) da_default_timeout * 1000); ccb->ccb_h.ccb_state = DA_CCB_DELETE; ccb->ccb_h.flags |= CAM_UNLOCKED; + softc->trim_count++; + softc->trim_ranges += ranges; + softc->trim_lbas += block_count; cam_iosched_submit_trim(softc->cam_iosched); } @@ -4269,6 +4272,9 @@ da_delete_ws(struct cam_periph *periph, union ccb *ccb, struct bio *bp) da_default_timeout * 1000); ccb->ccb_h.ccb_state = DA_CCB_DELETE; ccb->ccb_h.flags |= CAM_UNLOCKED; + softc->trim_count++; + softc->trim_ranges++; + softc->trim_lbas += count; cam_iosched_submit_trim(softc->cam_iosched); } From nobody Mon May 20 20:06:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjpVn27Rsz5LKnt; Mon, 20 May 2024 20:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjpVn1Qdfz4NHh; Mon, 20 May 2024 20:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716235601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DtrztrjsF/0HrqpLESjMXTtnpke3da1fPAjqTovvMN4=; b=Md9ih/BMfiAZZUGmOKL50xwE6xJ2A4Iu4ted2HefCTgUZzeutqicxVQmTDmwcSBfSfzAIv 2fbLENB9UAMGYePey3uj44oZkmyspvSP7/zVkriWVUlSIYaclxp2U0RY4UqW/MhYOTg+VS BRTRhFg+mmMLNXh8b0RT7hxXUv3v/chFwtVppQIIpnPTYwTK8YvnUJtMAeJb665hIzxkCF p7EnFxrquFoYnuv1jG4lPOiTDTwPpePzNHPwcsBkOEQ8aOPfnMF2aRUeTFwqenavk7B+pq wfOqhcVRc3jAqBvBNwO0fUcN+vwnmoxzkCO2pyQF6aOdwKR095bNtJIgntWZ9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716235601; a=rsa-sha256; cv=none; b=xahY8B/MfbjrgCzFhsbf9MOrqKAO9zi2AteypvLbIv113Zt6MiHe0I0UITkeWK0Xv47QUL G3m7sO5W4AYjA/1yO/47c4kCB0rGuWbniAvCgmnEBwHE7qIWDbCSvyIZFU3vnF8DhfbZ+S qQUtJJm+XCjQu270cvtJ56cTp/kiLVYOn11YhmkTrQMS7eSyexkO6/hIzkKOtSGpCSGVk/ Rs+m6EsyYhxqh2v6Blc+EtnI2HHfkMqsW6Pp9T+qNbUJqH2KCNcSFraOKvMkY5/0PX5icX Q9HY0cj6HYaKgml4PFSdbfBIW/Tty1ZVx9gZmA1qTvSSCv1HOFuGp2ZLfisyAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716235601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DtrztrjsF/0HrqpLESjMXTtnpke3da1fPAjqTovvMN4=; b=XSsgJCdSIeLUp3oDCph9KZQulvsUITiq4EzsT89fphIrGCcoriUzg1owzIQIovw7uwyJ8y BW3NV+4IVA4OQUwzoTXU9UBuYUtETMnmVFn9DvAluNK0B6/w6w0IsBvooblnbxVt1VNrBj KvaMtcAd77tvKreNRyIBPX4loxHUNAUTacJS8/iE7qjOReD9tR5ARdyCS63C8pkmU56mXo PKSXb8tFpd5iS9Exjp1geVJeFPQiML7x571Wd0QEnc1/giruN3TaCxlHeQ9hcxltmCE/F+ Vto+wN5AdrFp4K2QO2DunrZ8Gv2wJmZ0DUhIr0nEUkxPQK/PRQ13suh8LlblLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjpVn12V1zrvP; Mon, 20 May 2024 20:06:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KK6fe7007300; Mon, 20 May 2024 20:06:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KK6f3l007297; Mon, 20 May 2024 20:06:41 GMT (envelope-from git) Date: Mon, 20 May 2024 20:06:41 GMT Message-Id: <202405202006.44KK6f3l007297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f65f02ccf2a5 - stable/14 - geom_stripe: Cascade cantrim just like we do for gmirror List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f65f02ccf2a5656e96b32705bad52b11fbc3177c Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f65f02ccf2a5656e96b32705bad52b11fbc3177c commit f65f02ccf2a5656e96b32705bad52b11fbc3177c Author: Matthew Grooms AuthorDate: 2024-05-03 15:01:21 +0000 Commit: Warner Losh CommitDate: 2024-05-20 19:23:40 +0000 geom_stripe: Cascade cantrim just like we do for gmirror If any of the disks can support trim, cascade that up the stack. Otherwise, trims won't pass through striped raid setups. PR: 277673 Reviewed by: imp (minor style tweaks from bug report) (cherry picked from commit ea2d874cca7cdfe6133c1835dadd8f0672723fa6) --- sys/geom/stripe/g_stripe.c | 21 ++++++++++++++++++++- sys/geom/stripe/g_stripe.h | 3 +++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c index ca3fbcbb30b2..2708284a8091 100644 --- a/sys/geom/stripe/g_stripe.c +++ b/sys/geom/stripe/g_stripe.c @@ -592,7 +592,12 @@ g_stripe_start(struct bio *bp) g_stripe_pushdown(sc, bp); return; case BIO_GETATTR: - /* To which provider it should be delivered? */ + if (!strcmp(bp->bio_attribute, "GEOM::candelete")) { + int val = (sc->sc_flags & G_STRIPE_FLAG_CANDELETE) != 0; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); + return; + } + /* otherwise: To which provider it should be delivered? */ default: g_io_deliver(bp, EOPNOTSUPP); return; @@ -795,6 +800,20 @@ g_stripe_add_disk(struct g_stripe_softc *sc, struct g_provider *pp, u_int no) } sc->sc_disks[no] = cp; + + /* cascade candelete */ + error = g_access(cp, 1, 0, 0); + if (error == 0) { + int can_delete; + + error = g_getattr("GEOM::candelete", cp, &can_delete); + if (error == 0 && can_delete != 0) + sc->sc_flags |= G_STRIPE_FLAG_CANDELETE; + G_STRIPE_DEBUG(1, "Provider %s candelete %i.", pp->name, + can_delete); + g_access(cp, -1, 0, 0); + } + G_STRIPE_DEBUG(0, "Disk %s attached to %s.", pp->name, sc->sc_name); g_stripe_check_and_run(sc); diff --git a/sys/geom/stripe/g_stripe.h b/sys/geom/stripe/g_stripe.h index 4c5430275350..1075a176b9b3 100644 --- a/sys/geom/stripe/g_stripe.h +++ b/sys/geom/stripe/g_stripe.h @@ -47,6 +47,8 @@ #define G_STRIPE_TYPE_MANUAL 0 #define G_STRIPE_TYPE_AUTOMATIC 1 +#define G_STRIPE_FLAG_CANDELETE 0x00000001UL + #define G_STRIPE_DEBUG(lvl, ...) \ _GEOM_DEBUG("GEOM_STRIPE", g_stripe_debug, (lvl), NULL, __VA_ARGS__) #define G_STRIPE_LOGREQ(bp, ...) \ @@ -62,6 +64,7 @@ struct g_stripe_softc { off_t sc_stripesize; uint32_t sc_stripebits; struct mtx sc_lock; + int sc_flags; }; #define sc_name sc_geom->name #endif /* _KERNEL */ From nobody Mon May 20 20:06:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjpVp3qxvz5LL2C; Mon, 20 May 2024 20:06:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjpVp2DqRz4N5C; Mon, 20 May 2024 20:06:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716235602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7RtncvVHOkLbKnD5IPi7naroNdGarh2HFo7ScyjDnWo=; b=Je6oOm+4b4aGLg3DArVuaoTrYLE7eCPRP7BMpfcI4BAxCtcrHPyVO6xZenSJ/bluBItTS+ wM3quSsbj0wgi/oOGZwgDNXb8g4zuseLlYJ2O0D0xrp5CCgI7bMEsXVdriwqX+pfIyU4tc VZO1REk0NL2SgmPbZiJp5pYRUJzvgconVXP9hNCiGdCMJ8S7KunpjXRlgihWHKzZ9fhlew 6iNJi0PXO8CdOXZk0747OLsNjQP+iJ14jjKp4/AiwoNroXW3K/mJnlFOdRQNRnhc/G/RqH GOuNbjwObdlsxGhRzYHeLM03I7BX4DQB+TRAYZ5Yxpw5cUbusNaUH/6LTsbCkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716235602; a=rsa-sha256; cv=none; b=xnMmmOzC1yz8g5vYTWoMe2XXwNsqNPmeOoAmUIRNV8Cd3EI17gjrDdaEYvj4nFQxYvGqnn GWjiJZwlb57v8xs7aupYn5m2SZimaZRbrfClqXqfAtzRoIO7qnR5KKWhVkZGZtPFQfF4Sn nMdGQZSQ087rHrIbwRXP08WJ6EA8zsG31M+OS6vOgvN/mV5ysOzpQnk+2z/88B5fnoyy8m 81GBflwAzGBnH8v+K8z/6eev/N0tAhnaUeLbgU6sEVIvRWiAOm3NLenjTedh2FS6Tr1U54 0scXeeZp4e0jg07GCFps6BHCITfSL1TffhsW00Ho5I8+VJVsS6ZkJWc9RFxy5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716235602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7RtncvVHOkLbKnD5IPi7naroNdGarh2HFo7ScyjDnWo=; b=NkvV0q14rMPg2V0qDkg0ujxzd5FmbR3HprKOFZ/aLmFW1bRiQAti5ceKSsDlEGoj9/+eGS OBHl2bHCtatDPDH5PeW+rtzSLvehovIzyPh7UDh/avd/6BSSMFUVg/c5W5S9eDGKlh2ki7 9G1+NPqlk/vwLncQNpG/G3aNBFfrKPPpGNS93W3a2aOFxwFzHFw7sMMBe+Pmw5GJkV+y64 8hqm7pZ47Vxt8SB/Z4L05OdigpboFelSV5DwdW8FkIFmbUKYxV1dTqrN2m665z71o8dMLj m0SM/vSriEk1e+5KR02eTPrUZGZepit1BxD7BO2DNd0qQcggdaA12mT2D0d9aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjpVp1s3XzrGK; Mon, 20 May 2024 20:06:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KK6gQ6007348; Mon, 20 May 2024 20:06:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KK6gQo007346; Mon, 20 May 2024 20:06:42 GMT (envelope-from git) Date: Mon, 20 May 2024 20:06:42 GMT Message-Id: <202405202006.44KK6gQo007346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 02cae85fdb9b - stable/14 - ota: Merge one true awk 20240422 (a3b68e649d2d) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 02cae85fdb9b4d959bad253ce3dbb03e554b6f40 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=02cae85fdb9b4d959bad253ce3dbb03e554b6f40 commit 02cae85fdb9b4d959bad253ce3dbb03e554b6f40 Author: Warner Losh AuthorDate: 2024-05-04 21:50:33 +0000 Commit: Warner Losh CommitDate: 2024-05-20 19:29:19 +0000 ota: Merge one true awk 20240422 (a3b68e649d2d) Apr 22, 2024: fixed regex engine gototab reallocation issue that was introduced during the Nov 24 rewrite. Thanks to Arnold Robbins. Fixed a scan bug in split in the case the separator is a single character. thanks to Oguz Ismail for spotting the issue. Mar 10, 2024: fixed use-after-free bug in fnematch due to adjbuf invalidating the pointers to buf. thanks to github user caffe3 for spotting the issue and providing a fix, and to Miguel Pineiro Jr. for the alternative fix. MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max. thanks to Miguel Pineiro Jr. Sponsored by: Netflix (cherry picked from commit 1023317ac491090f8d84a62999ffc303cf88528c) --- contrib/one-true-awk/ChangeLog | 24 --- contrib/one-true-awk/FIXES | 14 ++ contrib/one-true-awk/awk.1 | 52 ----- contrib/one-true-awk/awk.h | 8 - contrib/one-true-awk/awkgram.y | 20 +- contrib/one-true-awk/b.c | 34 +-- contrib/one-true-awk/bugs-fixed/REGRESS | 2 +- contrib/one-true-awk/bugs-fixed/system-status.ok2 | 3 + contrib/one-true-awk/lex.c | 9 - contrib/one-true-awk/main.c | 2 +- contrib/one-true-awk/maketab.c | 1 - contrib/one-true-awk/parse.c | 23 -- contrib/one-true-awk/proto.h | 3 - contrib/one-true-awk/run.c | 244 +--------------------- 14 files changed, 44 insertions(+), 395 deletions(-) diff --git a/contrib/one-true-awk/ChangeLog b/contrib/one-true-awk/ChangeLog index dea4ed7e3187..6ce9417c10da 100644 --- a/contrib/one-true-awk/ChangeLog +++ b/contrib/one-true-awk/ChangeLog @@ -47,30 +47,6 @@ * test/T.lilly: Remove gawk warnings from output, improves portability. -2019-10-17 Arnold D. Robbins - - Pull in systime() and strftime() from the NetBSD awk. - - * awk.1: Document the functions. - * run.c (bltin): Implement the functions. - * awk.h: Add defines for systime and strftime. - * lex.c: Add support for systime and strftime. - -2019-10-07 Arnold D. Robbins - - Integrate features from different *BSD versions of awk. - Gensub support from NetBSD. Bitwise functions from OpenBSD. - - * awk.h: Add defines for and, or, xor, compl, lshift and rshift. - * awkgram.y: Add support for gensub. - * maketab.c: Ditto. - * lex.c: Add support for gensub and bitwise functions. - * parse.c (node5, op5): New functions. - * proto.h (node5, op5): New declarations. - * run.c (bltin): Implement the bitwise functions. - (gensub): New function. - * awk.1: Document additional functions. - 2019-10-07 Arnold D. Robbins * b.c (fnematch): Change type of pbuf from unsigned char to char. diff --git a/contrib/one-true-awk/FIXES b/contrib/one-true-awk/FIXES index a043b356fafa..c4eef3bd8ea0 100644 --- a/contrib/one-true-awk/FIXES +++ b/contrib/one-true-awk/FIXES @@ -25,6 +25,20 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the second edition of the AWK book was published in September 2023. +Apr 22, 2024: + fixed regex engine gototab reallocation issue that was + introduced during the Nov 24 rewrite. Thanks to Arnold Robbins. + Fixed a scan bug in split in the case the separator is a single + character. thanks to Oguz Ismail for spotting the issue. + +Mar 10, 2024: + fixed use-after-free bug in fnematch due to adjbuf invalidating + the pointers to buf. thanks to github user caffe3 for spotting + the issue and providing a fix, and to Miguel Pineiro Jr. + for the alternative fix. + MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max. + thanks to Miguel Pineiro Jr. + Jan 22, 2024: Restore the ability to compile with g++. Thanks to Arnold Robbins. diff --git a/contrib/one-true-awk/awk.1 b/contrib/one-true-awk/awk.1 index 496a2a652379..ef40a0104468 100644 --- a/contrib/one-true-awk/awk.1 +++ b/contrib/one-true-awk/awk.1 @@ -305,25 +305,6 @@ and .B gsub return the number of replacements. .TP -\fBgensub(\fIpat\fB, \fIrepl\fB, \fIhow\fR [\fB, \fItarget\fR]\fB)\fR -replaces instances of -.I pat -in -.I target -with -.IR repl . -If -.I how -is \fB"g"\fR or \fB"G"\fR, do so globally. Otherwise, -.I how -is a number indicating which occurrence to replace. If no -.IR target , -use -.BR $0 . -Return the resulting string; -.I target -is not modified. -.TP .BI sprintf( fmt , " expr" , " ...\fB) the string resulting from formatting .I expr ... @@ -332,28 +313,6 @@ according to the format .IR fmt . .TP -.B systime() -returns the current date and time as a standard -``seconds since the epoch'' value. -.TP -.BI strftime( fmt ", " timestamp\^ ) -formats -.I timestamp -(a value in seconds since the epoch) -according to -.IR fmt , -which is a format string as supported by -.IR strftime (3). -Both -.I timestamp -and -.I fmt -may be omitted; if no -.IR timestamp , -the current time of day is used, and if no -.IR fmt , -a default format of \fB"%a %b %e %H:%M:%S %Z %Y"\fR is used. -.TP .BI system( cmd ) executes .I cmd @@ -413,17 +372,6 @@ In all cases, returns 1 for a successful input, 0 for end of file, and \-1 for an error. .PP -The functions -.BR compl , -.BR and , -.BR or , -.BR xor , -.BR lshift , -and -.B rshift -peform the corresponding bitwise operations on their -operands, which are first truncated to integer. -.PP Patterns are arbitrary Boolean combinations (with .BR "! || &&" ) diff --git a/contrib/one-true-awk/awk.h b/contrib/one-true-awk/awk.h index 740447ee2167..76180e47f16a 100644 --- a/contrib/one-true-awk/awk.h +++ b/contrib/one-true-awk/awk.h @@ -154,14 +154,6 @@ extern Cell *symtabloc; /* SYMTAB */ #define FTOUPPER 12 #define FTOLOWER 13 #define FFLUSH 14 -#define FAND 15 -#define FFOR 16 -#define FXOR 17 -#define FCOMPL 18 -#define FLSHIFT 19 -#define FRSHIFT 20 -#define FSYSTIME 21 -#define FSTRFTIME 22 /* Node: parse tree is made of nodes, with Cell's at bottom */ diff --git a/contrib/one-true-awk/awkgram.y b/contrib/one-true-awk/awkgram.y index 233253a4307b..db804e117e19 100644 --- a/contrib/one-true-awk/awkgram.y +++ b/contrib/one-true-awk/awkgram.y @@ -53,7 +53,7 @@ Node *arglist = 0; /* list of args for current function */ %token FINAL DOT ALL CCL NCCL CHAR OR STAR QUEST PLUS EMPTYRE ZERO %token AND BOR APPEND EQ GE GT LE LT NE IN %token ARG BLTIN BREAK CLOSE CONTINUE DELETE DO EXIT FOR FUNC -%token GENSUB SUB GSUB IF INDEX LSUBSTR MATCHFCN NEXT NEXTFILE +%token SUB GSUB IF INDEX LSUBSTR MATCHFCN NEXT NEXTFILE %token ADD MINUS MULT DIVIDE MOD %token ASSIGN ASGNOP ADDEQ SUBEQ MULTEQ DIVEQ MODEQ POWEQ %token PRINT PRINTF SPRINTF @@ -377,24 +377,6 @@ term: | INCR var { $$ = op1(PREINCR, $2); } | var DECR { $$ = op1(POSTDECR, $1); } | var INCR { $$ = op1(POSTINCR, $1); } - | GENSUB '(' reg_expr comma pattern comma pattern ')' - { $$ = op5(GENSUB, NIL, (Node*)makedfa($3, 1), $5, $7, rectonode()); } - | GENSUB '(' pattern comma pattern comma pattern ')' - { if (constnode($3)) { - $$ = op5(GENSUB, NIL, (Node *)makedfa(strnode($3), 1), $5, $7, rectonode()); - free($3); - } else - $$ = op5(GENSUB, (Node *)1, $3, $5, $7, rectonode()); - } - | GENSUB '(' reg_expr comma pattern comma pattern comma pattern ')' - { $$ = op5(GENSUB, NIL, (Node*)makedfa($3, 1), $5, $7, $9); } - | GENSUB '(' pattern comma pattern comma pattern comma pattern ')' - { if (constnode($3)) { - $$ = op5(GENSUB, NIL, (Node *)makedfa(strnode($3),1), $5,$7,$9); - free($3); - } else - $$ = op5(GENSUB, (Node *)1, $3, $5, $7, $9); - } | GETLINE var LT term { $$ = op3(GETLINE, $2, itonp($3), $4); } | GETLINE LT term { $$ = op3(GETLINE, NIL, itonp($2), $3); } | GETLINE var { $$ = op3(GETLINE, $2, NIL, NIL); } diff --git a/contrib/one-true-awk/b.c b/contrib/one-true-awk/b.c index 4c438fab4cd4..f650269753c7 100644 --- a/contrib/one-true-awk/b.c +++ b/contrib/one-true-awk/b.c @@ -651,8 +651,8 @@ static int set_gototab(fa *f, int state, int ch, int val) /* hide gototab implem if (tab->inuse + 1 >= tab->allocated) resize_gototab(f, state); - f->gototab[state].entries[f->gototab[state].inuse-1].ch = ch; - f->gototab[state].entries[f->gototab[state].inuse-1].state = val; + f->gototab[state].entries[f->gototab[state].inuse].ch = ch; + f->gototab[state].entries[f->gototab[state].inuse].state = val; f->gototab[state].inuse++; return val; } else { @@ -677,9 +677,9 @@ static int set_gototab(fa *f, int state, int ch, int val) /* hide gototab implem gtt *tab = & f->gototab[state]; if (tab->inuse + 1 >= tab->allocated) resize_gototab(f, state); - ++tab->inuse; f->gototab[state].entries[tab->inuse].ch = ch; f->gototab[state].entries[tab->inuse].state = val; + ++tab->inuse; qsort(f->gototab[state].entries, f->gototab[state].inuse, sizeof(gtte), entry_cmp); @@ -830,8 +830,6 @@ int nematch(fa *f, const char *p0) /* non-empty match, for sub */ } -#define MAX_UTF_BYTES 4 // UTF-8 is up to 4 bytes long - /* * NAME * fnematch @@ -868,16 +866,28 @@ bool fnematch(fa *pfa, FILE *f, char **pbuf, int *pbufsize, int quantum) do { /* - * Call u8_rune with at least MAX_UTF_BYTES ahead in + * Call u8_rune with at least awk_mb_cur_max ahead in * the buffer until EOF interferes. */ - if (k - j < MAX_UTF_BYTES) { - if (k + MAX_UTF_BYTES > buf + bufsize) { + if (k - j < awk_mb_cur_max) { + if (k + awk_mb_cur_max > buf + bufsize) { + char *obuf = buf; adjbuf((char **) &buf, &bufsize, - bufsize + MAX_UTF_BYTES, + bufsize + awk_mb_cur_max, quantum, 0, "fnematch"); + + /* buf resized, maybe moved. update pointers */ + *pbufsize = bufsize; + if (obuf != buf) { + i = buf + (i - obuf); + j = buf + (j - obuf); + k = buf + (k - obuf); + *pbuf = buf; + if (patlen) + patbeg = buf + (patbeg - obuf); + } } - for (n = MAX_UTF_BYTES ; n > 0; n--) { + for (n = awk_mb_cur_max ; n > 0; n--) { *k++ = (c = getc(f)) != EOF ? c : 0; if (c == EOF) { if (ferror(f)) @@ -914,10 +924,6 @@ bool fnematch(fa *pfa, FILE *f, char **pbuf, int *pbufsize, int quantum) s = 2; } while (1); - /* adjbuf() may have relocated a resized buffer. Inform the world. */ - *pbuf = buf; - *pbufsize = bufsize; - if (patlen) { /* * Under no circumstances is the last character fed to diff --git a/contrib/one-true-awk/bugs-fixed/REGRESS b/contrib/one-true-awk/bugs-fixed/REGRESS index acdbeebb6271..30bdc7cd5c0f 100755 --- a/contrib/one-true-awk/bugs-fixed/REGRESS +++ b/contrib/one-true-awk/bugs-fixed/REGRESS @@ -27,6 +27,6 @@ do then rm -f $OUT else - echo '++++ $i failed!' + echo "+++ $i failed!" fi done diff --git a/contrib/one-true-awk/bugs-fixed/system-status.ok2 b/contrib/one-true-awk/bugs-fixed/system-status.ok2 new file mode 100644 index 000000000000..f1f631e1cb33 --- /dev/null +++ b/contrib/one-true-awk/bugs-fixed/system-status.ok2 @@ -0,0 +1,3 @@ +normal status 42 +death by signal status 257 +death by signal with core dump status 262 diff --git a/contrib/one-true-awk/lex.c b/contrib/one-true-awk/lex.c index 141cc81d2b59..0473a338c906 100644 --- a/contrib/one-true-awk/lex.c +++ b/contrib/one-true-awk/lex.c @@ -47,11 +47,9 @@ const Keyword keywords[] = { /* keep sorted: binary searched */ { "BEGIN", XBEGIN, XBEGIN }, { "END", XEND, XEND }, { "NF", VARNF, VARNF }, - { "and", FAND, BLTIN }, { "atan2", FATAN, BLTIN }, { "break", BREAK, BREAK }, { "close", CLOSE, CLOSE }, - { "compl", FCOMPL, BLTIN }, { "continue", CONTINUE, CONTINUE }, { "cos", FCOS, BLTIN }, { "delete", DELETE, DELETE }, @@ -63,7 +61,6 @@ const Keyword keywords[] = { /* keep sorted: binary searched */ { "for", FOR, FOR }, { "func", FUNC, FUNC }, { "function", FUNC, FUNC }, - { "gensub", GENSUB, GENSUB }, { "getline", GETLINE, GETLINE }, { "gsub", GSUB, GSUB }, { "if", IF, IF }, @@ -72,30 +69,24 @@ const Keyword keywords[] = { /* keep sorted: binary searched */ { "int", FINT, BLTIN }, { "length", FLENGTH, BLTIN }, { "log", FLOG, BLTIN }, - { "lshift", FLSHIFT, BLTIN }, { "match", MATCHFCN, MATCHFCN }, { "next", NEXT, NEXT }, { "nextfile", NEXTFILE, NEXTFILE }, - { "or", FFOR, BLTIN }, { "print", PRINT, PRINT }, { "printf", PRINTF, PRINTF }, { "rand", FRAND, BLTIN }, { "return", RETURN, RETURN }, - { "rshift", FRSHIFT, BLTIN }, { "sin", FSIN, BLTIN }, { "split", SPLIT, SPLIT }, { "sprintf", SPRINTF, SPRINTF }, { "sqrt", FSQRT, BLTIN }, { "srand", FSRAND, BLTIN }, - { "strftime", FSTRFTIME, BLTIN }, { "sub", SUB, SUB }, { "substr", SUBSTR, SUBSTR }, { "system", FSYSTEM, BLTIN }, - { "systime", FSYSTIME, BLTIN }, { "tolower", FTOLOWER, BLTIN }, { "toupper", FTOUPPER, BLTIN }, { "while", WHILE, WHILE }, - { "xor", FXOR, BLTIN }, }; #define RET(x) { if(dbg)printf("lex %s\n", tokname(x)); return(x); } diff --git a/contrib/one-true-awk/main.c b/contrib/one-true-awk/main.c index 73af89ec1058..0e70288a92f3 100644 --- a/contrib/one-true-awk/main.c +++ b/contrib/one-true-awk/main.c @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20240122"; +const char *version = "version 20240422"; #define DEBUG #include diff --git a/contrib/one-true-awk/maketab.c b/contrib/one-true-awk/maketab.c index 3a80c87725ac..3747efa03702 100644 --- a/contrib/one-true-awk/maketab.c +++ b/contrib/one-true-awk/maketab.c @@ -104,7 +104,6 @@ struct xx { ARG, "arg", "arg" }, { VARNF, "getnf", "NF" }, { GETLINE, "awkgetline", "getline" }, - { GENSUB, "gensub", "gensub" }, { 0, "", "" }, }; diff --git a/contrib/one-true-awk/parse.c b/contrib/one-true-awk/parse.c index 2b7fd1928930..14608be7570a 100644 --- a/contrib/one-true-awk/parse.c +++ b/contrib/one-true-awk/parse.c @@ -93,20 +93,6 @@ Node *node4(int a, Node *b, Node *c, Node *d, Node *e) return(x); } -Node *node5(int a, Node *b, Node *c, Node *d, Node *e, Node *f) -{ - Node *x; - - x = nodealloc(5); - x->nobj = a; - x->narg[0] = b; - x->narg[1] = c; - x->narg[2] = d; - x->narg[3] = e; - x->narg[4] = f; - return(x); -} - Node *stat1(int a, Node *b) { Node *x; @@ -179,15 +165,6 @@ Node *op4(int a, Node *b, Node *c, Node *d, Node *e) return(x); } -Node *op5(int a, Node *b, Node *c, Node *d, Node *e, Node *f) -{ - Node *x; - - x = node5(a,b,c,d,e,f); - x->ntype = NEXPR; - return(x); -} - Node *celltonode(Cell *a, int b) { Node *x; diff --git a/contrib/one-true-awk/proto.h b/contrib/one-true-awk/proto.h index b44f9e7a5599..ed63e7875da3 100644 --- a/contrib/one-true-awk/proto.h +++ b/contrib/one-true-awk/proto.h @@ -73,14 +73,12 @@ extern Node *node1(int, Node *); extern Node *node2(int, Node *, Node *); extern Node *node3(int, Node *, Node *, Node *); extern Node *node4(int, Node *, Node *, Node *, Node *); -extern Node *node5(int, Node *, Node *, Node *, Node *, Node *); extern Node *stat3(int, Node *, Node *, Node *); extern Node *op2(int, Node *, Node *); extern Node *op1(int, Node *); extern Node *stat1(int, Node *); extern Node *op3(int, Node *, Node *, Node *); extern Node *op4(int, Node *, Node *, Node *, Node *); -extern Node *op5(int, Node *, Node *, Node *, Node *, Node *); extern Node *stat2(int, Node *, Node *); extern Node *stat4(int, Node *, Node *, Node *, Node *); extern Node *celltonode(Cell *, int); @@ -199,7 +197,6 @@ extern const char *filename(FILE *); extern Cell *closefile(Node **, int); extern void closeall(void); extern Cell *dosub(Node **, int); -extern Cell *gensub(Node **, int); extern FILE *popen(const char *, const char *); extern int pclose(FILE *); diff --git a/contrib/one-true-awk/run.c b/contrib/one-true-awk/run.c index ede3ba7d9827..99306992df41 100644 --- a/contrib/one-true-awk/run.c +++ b/contrib/one-true-awk/run.c @@ -1827,7 +1827,7 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ for (;;) { n++; t = s; - while (*s != sep && *s != '\n' && *s != '\0') + while (*s != sep && *s != '\0') s++; temp = *s; setptr(s, '\0'); @@ -2062,14 +2062,12 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis { Cell *x, *y; Awkfloat u; - int t, sz; + int t; Awkfloat tmp; - char *buf, *fmt; + char *buf; Node *nextarg; FILE *fp; int status = 0; - time_t tv; - struct tm *tm; int estatus = 0; t = ptoi(a[0]); @@ -2111,64 +2109,6 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis nextarg = nextarg->nnext; } break; - case FCOMPL: - u = ~((int)getfval(x)); - break; - case FAND: - if (nextarg == 0) { - WARNING("and requires two arguments; returning 0"); - u = 0; - break; - } - y = execute(a[1]->nnext); - u = ((int)getfval(x)) & ((int)getfval(y)); - tempfree(y); - nextarg = nextarg->nnext; - break; - case FFOR: - if (nextarg == 0) { - WARNING("or requires two arguments; returning 0"); - u = 0; - break; - } - y = execute(a[1]->nnext); - u = ((int)getfval(x)) | ((int)getfval(y)); - tempfree(y); - nextarg = nextarg->nnext; - break; - case FXOR: - if (nextarg == 0) { - WARNING("xor requires two arguments; returning 0"); - u = 0; - break; - } - y = execute(a[1]->nnext); - u = ((int)getfval(x)) ^ ((int)getfval(y)); - tempfree(y); - nextarg = nextarg->nnext; - break; - case FLSHIFT: - if (nextarg == 0) { - WARNING("lshift requires two arguments; returning 0"); - u = 0; - break; - } - y = execute(a[1]->nnext); - u = ((int)getfval(x)) << ((int)getfval(y)); - tempfree(y); - nextarg = nextarg->nnext; - break; - case FRSHIFT: - if (nextarg == 0) { - WARNING("rshift requires two arguments; returning 0"); - u = 0; - break; - } - y = execute(a[1]->nnext); - u = ((int)getfval(x)) >> ((int)getfval(y)); - tempfree(y); - nextarg = nextarg->nnext; - break; case FSYSTEM: fflush(stdout); /* in case something is buffered already */ estatus = status = system(getsval(x)); @@ -2223,41 +2163,6 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis else u = fflush(fp); break; - case FSYSTIME: - u = time((time_t *) 0); - break; - case FSTRFTIME: - /* strftime([format [,timestamp]]) */ - if (nextarg) { - y = execute(nextarg); - nextarg = nextarg->nnext; - tv = (time_t) getfval(y); - tempfree(y); - } else - tv = time((time_t *) 0); - tm = localtime(&tv); - if (tm == NULL) - FATAL("bad time %ld", (long)tv); - - if (isrec(x)) { - /* format argument not provided, use default */ - fmt = tostring("%a %b %d %H:%M:%S %Z %Y"); - } else - fmt = tostring(getsval(x)); - - sz = 32; - buf = NULL; - do { - if ((buf = realloc(buf, (sz *= 2))) == NULL) - FATAL("out of memory in strftime"); - } while (strftime(buf, sz, fmt, tm) == 0 && fmt[0] != '\0'); - - y = gettemp(); - setsval(y, buf); - free(fmt); - free(buf); - - return y; default: /* can't happen */ FATAL("illegal function type %d", t); break; @@ -2501,7 +2406,7 @@ void backsub(char **pb_ptr, const char **sptr_ptr); Cell *dosub(Node **a, int subop) /* sub and gsub */ { fa *pfa; - int tempstat; + int tempstat = 0; char *repl; Cell *x; @@ -2637,147 +2542,6 @@ next_search: return x; } -Cell *gensub(Node **a, int nnn) /* global selective substitute */ - /* XXX incomplete - doesn't support backreferences \0 ... \9 */ -{ - Cell *x, *y, *res, *h; - char *rptr; - const char *sptr; - char *buf, *pb; - const char *t, *q; - fa *pfa; - int mflag, tempstat, num, whichm; - int bufsz = recsize; - - if ((buf = malloc(bufsz)) == NULL) - FATAL("out of memory in gensub"); - mflag = 0; /* if mflag == 0, can replace empty string */ - num = 0; - x = execute(a[4]); /* source string */ - t = getsval(x); - res = copycell(x); /* target string - initially copy of source */ - res->csub = CTEMP; /* result values are temporary */ - if (a[0] == 0) /* 0 => a[1] is already-compiled regexpr */ - pfa = (fa *) a[1]; /* regular expression */ - else { - y = execute(a[1]); - pfa = makedfa(getsval(y), 1); - tempfree(y); - } - y = execute(a[2]); /* replacement string */ - h = execute(a[3]); /* which matches should be replaced */ - sptr = getsval(h); - if (sptr[0] == 'g' || sptr[0] == 'G') - whichm = -1; - else { - /* - * The specified number is index of replacement, starting - * from 1. GNU awk treats index lower than 0 same as - * 1, we do same for compatibility. - */ - whichm = (int) getfval(h) - 1; - if (whichm < 0) - whichm = 0; - } - tempfree(h); - - if (pmatch(pfa, t)) { - char *sl; - - tempstat = pfa->initstat; - pfa->initstat = 2; - pb = buf; - rptr = getsval(y); - /* - * XXX if there are any backreferences in subst string, - * complain now. - */ - for (sl = rptr; (sl = strchr(sl, '\\')) && sl[1]; sl++) { - if (strchr("0123456789", sl[1])) { - FATAL("gensub doesn't support backreferences (subst \"%s\")", rptr); - } - } - - do { - if (whichm >= 0 && whichm != num) { - num++; - adjbuf(&buf, &bufsz, (pb - buf) + (patbeg - t) + patlen, recsize, &pb, "gensub"); - - /* copy the part of string up to and including - * match to output buffer */ - while (t < patbeg + patlen) - *pb++ = *t++; - continue; - } - - if (patlen == 0 && *patbeg != 0) { /* matched empty string */ - if (mflag == 0) { /* can replace empty */ - num++; - sptr = rptr; - while (*sptr != 0) { - adjbuf(&buf, &bufsz, 5+pb-buf, recsize, &pb, "gensub"); - if (*sptr == '\\') { - backsub(&pb, &sptr); - } else if (*sptr == '&') { - sptr++; - adjbuf(&buf, &bufsz, 1+patlen+pb-buf, recsize, &pb, "gensub"); - for (q = patbeg; q < patbeg+patlen; ) - *pb++ = *q++; - } else - *pb++ = *sptr++; - } - } - if (*t == 0) /* at end */ - goto done; - adjbuf(&buf, &bufsz, 2+pb-buf, recsize, &pb, "gensub"); - *pb++ = *t++; - if (pb > buf + bufsz) /* BUG: not sure of this test */ - FATAL("gensub result0 %.30s too big; can't happen", buf); - mflag = 0; - } - else { /* matched nonempty string */ - num++; - sptr = t; - adjbuf(&buf, &bufsz, 1+(patbeg-sptr)+pb-buf, recsize, &pb, "gensub"); - while (sptr < patbeg) - *pb++ = *sptr++; - sptr = rptr; - while (*sptr != 0) { - adjbuf(&buf, &bufsz, 5+pb-buf, recsize, &pb, "gensub"); - if (*sptr == '\\') { - backsub(&pb, &sptr); - } else if (*sptr == '&') { - sptr++; - adjbuf(&buf, &bufsz, 1+patlen+pb-buf, recsize, &pb, "gensub"); - for (q = patbeg; q < patbeg+patlen; ) - *pb++ = *q++; - } else - *pb++ = *sptr++; - } - t = patbeg + patlen; - if (patlen == 0 || *t == 0 || *(t-1) == 0) - goto done; - if (pb > buf + bufsz) - FATAL("gensub result1 %.30s too big; can't happen", buf); - mflag = 1; - } - } while (pmatch(pfa,t)); - sptr = t; - adjbuf(&buf, &bufsz, 1+strlen(sptr)+pb-buf, 0, &pb, "gensub"); - while ((*pb++ = *sptr++) != 0) - ; - done: if (pb > buf + bufsz) - FATAL("gensub result2 %.30s too big; can't happen", buf); - *pb = '\0'; - setsval(res, buf); - pfa->initstat = tempstat; - } - tempfree(x); - tempfree(y); - free(buf); - return(res); -} - void backsub(char **pb_ptr, const char **sptr_ptr) /* handle \\& variations */ { /* sptr[0] == '\\' */ char *pb = *pb_ptr; From nobody Mon May 20 20:06:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjpVq68vNz5LL2D; Mon, 20 May 2024 20:06: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjpVq31jYz4NGB; Mon, 20 May 2024 20:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716235603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vve6g8oqAHYUsnHE21OpPhI2885ljX4ogwPDbjN6drI=; b=hUwu3zAXdtcyIcnCKDAdwA/1DFfa+msOQvGuIWhzzflC/U9Y11YexWQ6NuN0nqGEnOOmgq gGRrzGfcniTmd84NkNt7J+N4cTRgYAf966Vqckt+4AaTJMJUgw/MzsXMTidtCtxiOTBKV3 rxo+YugxxzLABzJaS840RasFNtgz32dCSpOAkoNaaQxkDSYC4saXrZrINLsvKhyY0aH+Dn 478qNrNn2hxLAsESQh7X9h/6FRZkXHSjTYf8NIoG8J/a24O4+Oul2ZUlNrGFcNqx9wP69Z zaCiVgKHftNIAsRglRmife+BXMrEdPWtPNAH78VUev7PIT5iZFHWOPdbobr2/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716235603; a=rsa-sha256; cv=none; b=HvLqpCUbnERvVbXczQqWDLz49nrZOp73W6aAfkTqdL+At3ylbDRx28+mgN2jhFttMIWMhy OOjRXxGCpmPndJelCu2EBsLeht40UQ1KZ8+m2HyWM3bR/IGYJFtU4Dtu3QZx9F1+P04D/i WGbyQqAws6oEb0uOdGhiH84GRWdii4ROSb35ogH2AQExYQJB0bnP8/ZwMl4r4nVDqNqhDx v2bDWjp2vvXTeYdOU8CDC4/cygJWW8C0wHeYn4N1GZQPUR8N4BKHyPMb9HJ4PMoOfm40Rt htvoL8prt3HPUyA0OgFPUWXkz3UF6qhqcUW7TKyGuKMhdA4trGiSipBdFgUMhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716235603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vve6g8oqAHYUsnHE21OpPhI2885ljX4ogwPDbjN6drI=; b=ug7mnlHXxfYgwqk43wR4imEBJXwnWQuj35f5sYlPh0GvnQRB6uvw5/+4B2GnfQxTMycur7 C3yYjcvLEpznatNCS68PgMSQy7wtKcUUUPtzfxVQ6/zVtKEAmg3UNTPRWsg5UkmT/PucRx vptIoiqz+O1vyuyIKdxRQbJ+Wh5FOly4d1/VMJ+cbFvBQW0ChG3RBNkq5JB19fqyUav9M8 tB/3wjEJ/sEq+0kmlgkUTlem1LwptLBGBSyD1TUc1cys1TUa8nETA2oMD9wTwEeJJkhWEj 0ElaWzc+09j/UfGvyhoK1oGm/tirn+2/buPEacydRQgSkeh0Mz/u6OOQRefYgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjpVq2dZPzrvQ; Mon, 20 May 2024 20:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KK6hNh007405; Mon, 20 May 2024 20:06:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KK6hDf007402; Mon, 20 May 2024 20:06:43 GMT (envelope-from git) Date: Mon, 20 May 2024 20:06:43 GMT Message-Id: <202405202006.44KK6hDf007402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 284244ac3683 - stable/14 - awk: Merge in bsd-feature branch of OTA from 20240422 (31bb33a32f71) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 284244ac36832b71f2e9e128f45ce132a3c293b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=284244ac36832b71f2e9e128f45ce132a3c293b0 commit 284244ac36832b71f2e9e128f45ce132a3c293b0 Author: Warner Losh AuthorDate: 2024-05-14 18:15:43 +0000 Commit: Warner Losh CommitDate: 2024-05-20 19:29:26 +0000 awk: Merge in bsd-feature branch of OTA from 20240422 (31bb33a32f71) In the last 2nd edition import, I mistakenly grabbed from the 'main' branch of upstream rather than the bsd-feature branch. This means that we have a regression in awk from that point forward: all the BSD-specific bit functions (and a few others) were dropped. This restores it at the same level. MFC After: 1 day Sponsored by: Netflix (cherry picked from commit eb690a0576e8cf5412124477eace3bb765068c3d) --- contrib/one-true-awk/ChangeLog | 24 +++++ contrib/one-true-awk/awk.1 | 52 +++++++++ contrib/one-true-awk/awk.h | 8 ++ contrib/one-true-awk/awkgram.y | 20 +++- contrib/one-true-awk/lex.c | 9 ++ contrib/one-true-awk/maketab.c | 1 + contrib/one-true-awk/parse.c | 23 ++++ contrib/one-true-awk/proto.h | 3 + contrib/one-true-awk/run.c | 240 ++++++++++++++++++++++++++++++++++++++++- 9 files changed, 377 insertions(+), 3 deletions(-) diff --git a/contrib/one-true-awk/ChangeLog b/contrib/one-true-awk/ChangeLog index 6ce9417c10da..dea4ed7e3187 100644 --- a/contrib/one-true-awk/ChangeLog +++ b/contrib/one-true-awk/ChangeLog @@ -47,6 +47,30 @@ * test/T.lilly: Remove gawk warnings from output, improves portability. +2019-10-17 Arnold D. Robbins + + Pull in systime() and strftime() from the NetBSD awk. + + * awk.1: Document the functions. + * run.c (bltin): Implement the functions. + * awk.h: Add defines for systime and strftime. + * lex.c: Add support for systime and strftime. + +2019-10-07 Arnold D. Robbins + + Integrate features from different *BSD versions of awk. + Gensub support from NetBSD. Bitwise functions from OpenBSD. + + * awk.h: Add defines for and, or, xor, compl, lshift and rshift. + * awkgram.y: Add support for gensub. + * maketab.c: Ditto. + * lex.c: Add support for gensub and bitwise functions. + * parse.c (node5, op5): New functions. + * proto.h (node5, op5): New declarations. + * run.c (bltin): Implement the bitwise functions. + (gensub): New function. + * awk.1: Document additional functions. + 2019-10-07 Arnold D. Robbins * b.c (fnematch): Change type of pbuf from unsigned char to char. diff --git a/contrib/one-true-awk/awk.1 b/contrib/one-true-awk/awk.1 index ef40a0104468..496a2a652379 100644 --- a/contrib/one-true-awk/awk.1 +++ b/contrib/one-true-awk/awk.1 @@ -305,6 +305,25 @@ and .B gsub return the number of replacements. .TP +\fBgensub(\fIpat\fB, \fIrepl\fB, \fIhow\fR [\fB, \fItarget\fR]\fB)\fR +replaces instances of +.I pat +in +.I target +with +.IR repl . +If +.I how +is \fB"g"\fR or \fB"G"\fR, do so globally. Otherwise, +.I how +is a number indicating which occurrence to replace. If no +.IR target , +use +.BR $0 . +Return the resulting string; +.I target +is not modified. +.TP .BI sprintf( fmt , " expr" , " ...\fB) the string resulting from formatting .I expr ... @@ -313,6 +332,28 @@ according to the format .IR fmt . .TP +.B systime() +returns the current date and time as a standard +``seconds since the epoch'' value. +.TP +.BI strftime( fmt ", " timestamp\^ ) +formats +.I timestamp +(a value in seconds since the epoch) +according to +.IR fmt , +which is a format string as supported by +.IR strftime (3). +Both +.I timestamp +and +.I fmt +may be omitted; if no +.IR timestamp , +the current time of day is used, and if no +.IR fmt , +a default format of \fB"%a %b %e %H:%M:%S %Z %Y"\fR is used. +.TP .BI system( cmd ) executes .I cmd @@ -372,6 +413,17 @@ In all cases, returns 1 for a successful input, 0 for end of file, and \-1 for an error. .PP +The functions +.BR compl , +.BR and , +.BR or , +.BR xor , +.BR lshift , +and +.B rshift +peform the corresponding bitwise operations on their +operands, which are first truncated to integer. +.PP Patterns are arbitrary Boolean combinations (with .BR "! || &&" ) diff --git a/contrib/one-true-awk/awk.h b/contrib/one-true-awk/awk.h index 76180e47f16a..740447ee2167 100644 --- a/contrib/one-true-awk/awk.h +++ b/contrib/one-true-awk/awk.h @@ -154,6 +154,14 @@ extern Cell *symtabloc; /* SYMTAB */ #define FTOUPPER 12 #define FTOLOWER 13 #define FFLUSH 14 +#define FAND 15 +#define FFOR 16 +#define FXOR 17 +#define FCOMPL 18 +#define FLSHIFT 19 +#define FRSHIFT 20 +#define FSYSTIME 21 +#define FSTRFTIME 22 /* Node: parse tree is made of nodes, with Cell's at bottom */ diff --git a/contrib/one-true-awk/awkgram.y b/contrib/one-true-awk/awkgram.y index db804e117e19..233253a4307b 100644 --- a/contrib/one-true-awk/awkgram.y +++ b/contrib/one-true-awk/awkgram.y @@ -53,7 +53,7 @@ Node *arglist = 0; /* list of args for current function */ %token FINAL DOT ALL CCL NCCL CHAR OR STAR QUEST PLUS EMPTYRE ZERO %token AND BOR APPEND EQ GE GT LE LT NE IN %token ARG BLTIN BREAK CLOSE CONTINUE DELETE DO EXIT FOR FUNC -%token SUB GSUB IF INDEX LSUBSTR MATCHFCN NEXT NEXTFILE +%token GENSUB SUB GSUB IF INDEX LSUBSTR MATCHFCN NEXT NEXTFILE %token ADD MINUS MULT DIVIDE MOD %token ASSIGN ASGNOP ADDEQ SUBEQ MULTEQ DIVEQ MODEQ POWEQ %token PRINT PRINTF SPRINTF @@ -377,6 +377,24 @@ term: | INCR var { $$ = op1(PREINCR, $2); } | var DECR { $$ = op1(POSTDECR, $1); } | var INCR { $$ = op1(POSTINCR, $1); } + | GENSUB '(' reg_expr comma pattern comma pattern ')' + { $$ = op5(GENSUB, NIL, (Node*)makedfa($3, 1), $5, $7, rectonode()); } + | GENSUB '(' pattern comma pattern comma pattern ')' + { if (constnode($3)) { + $$ = op5(GENSUB, NIL, (Node *)makedfa(strnode($3), 1), $5, $7, rectonode()); + free($3); + } else + $$ = op5(GENSUB, (Node *)1, $3, $5, $7, rectonode()); + } + | GENSUB '(' reg_expr comma pattern comma pattern comma pattern ')' + { $$ = op5(GENSUB, NIL, (Node*)makedfa($3, 1), $5, $7, $9); } + | GENSUB '(' pattern comma pattern comma pattern comma pattern ')' + { if (constnode($3)) { + $$ = op5(GENSUB, NIL, (Node *)makedfa(strnode($3),1), $5,$7,$9); + free($3); + } else + $$ = op5(GENSUB, (Node *)1, $3, $5, $7, $9); + } | GETLINE var LT term { $$ = op3(GETLINE, $2, itonp($3), $4); } | GETLINE LT term { $$ = op3(GETLINE, NIL, itonp($2), $3); } | GETLINE var { $$ = op3(GETLINE, $2, NIL, NIL); } diff --git a/contrib/one-true-awk/lex.c b/contrib/one-true-awk/lex.c index 0473a338c906..141cc81d2b59 100644 --- a/contrib/one-true-awk/lex.c +++ b/contrib/one-true-awk/lex.c @@ -47,9 +47,11 @@ const Keyword keywords[] = { /* keep sorted: binary searched */ { "BEGIN", XBEGIN, XBEGIN }, { "END", XEND, XEND }, { "NF", VARNF, VARNF }, + { "and", FAND, BLTIN }, { "atan2", FATAN, BLTIN }, { "break", BREAK, BREAK }, { "close", CLOSE, CLOSE }, + { "compl", FCOMPL, BLTIN }, { "continue", CONTINUE, CONTINUE }, { "cos", FCOS, BLTIN }, { "delete", DELETE, DELETE }, @@ -61,6 +63,7 @@ const Keyword keywords[] = { /* keep sorted: binary searched */ { "for", FOR, FOR }, { "func", FUNC, FUNC }, { "function", FUNC, FUNC }, + { "gensub", GENSUB, GENSUB }, { "getline", GETLINE, GETLINE }, { "gsub", GSUB, GSUB }, { "if", IF, IF }, @@ -69,24 +72,30 @@ const Keyword keywords[] = { /* keep sorted: binary searched */ { "int", FINT, BLTIN }, { "length", FLENGTH, BLTIN }, { "log", FLOG, BLTIN }, + { "lshift", FLSHIFT, BLTIN }, { "match", MATCHFCN, MATCHFCN }, { "next", NEXT, NEXT }, { "nextfile", NEXTFILE, NEXTFILE }, + { "or", FFOR, BLTIN }, { "print", PRINT, PRINT }, { "printf", PRINTF, PRINTF }, { "rand", FRAND, BLTIN }, { "return", RETURN, RETURN }, + { "rshift", FRSHIFT, BLTIN }, { "sin", FSIN, BLTIN }, { "split", SPLIT, SPLIT }, { "sprintf", SPRINTF, SPRINTF }, { "sqrt", FSQRT, BLTIN }, { "srand", FSRAND, BLTIN }, + { "strftime", FSTRFTIME, BLTIN }, { "sub", SUB, SUB }, { "substr", SUBSTR, SUBSTR }, { "system", FSYSTEM, BLTIN }, + { "systime", FSYSTIME, BLTIN }, { "tolower", FTOLOWER, BLTIN }, { "toupper", FTOUPPER, BLTIN }, { "while", WHILE, WHILE }, + { "xor", FXOR, BLTIN }, }; #define RET(x) { if(dbg)printf("lex %s\n", tokname(x)); return(x); } diff --git a/contrib/one-true-awk/maketab.c b/contrib/one-true-awk/maketab.c index 3747efa03702..3a80c87725ac 100644 --- a/contrib/one-true-awk/maketab.c +++ b/contrib/one-true-awk/maketab.c @@ -104,6 +104,7 @@ struct xx { ARG, "arg", "arg" }, { VARNF, "getnf", "NF" }, { GETLINE, "awkgetline", "getline" }, + { GENSUB, "gensub", "gensub" }, { 0, "", "" }, }; diff --git a/contrib/one-true-awk/parse.c b/contrib/one-true-awk/parse.c index 14608be7570a..2b7fd1928930 100644 --- a/contrib/one-true-awk/parse.c +++ b/contrib/one-true-awk/parse.c @@ -93,6 +93,20 @@ Node *node4(int a, Node *b, Node *c, Node *d, Node *e) return(x); } +Node *node5(int a, Node *b, Node *c, Node *d, Node *e, Node *f) +{ + Node *x; + + x = nodealloc(5); + x->nobj = a; + x->narg[0] = b; + x->narg[1] = c; + x->narg[2] = d; + x->narg[3] = e; + x->narg[4] = f; + return(x); +} + Node *stat1(int a, Node *b) { Node *x; @@ -165,6 +179,15 @@ Node *op4(int a, Node *b, Node *c, Node *d, Node *e) return(x); } +Node *op5(int a, Node *b, Node *c, Node *d, Node *e, Node *f) +{ + Node *x; + + x = node5(a,b,c,d,e,f); + x->ntype = NEXPR; + return(x); +} + Node *celltonode(Cell *a, int b) { Node *x; diff --git a/contrib/one-true-awk/proto.h b/contrib/one-true-awk/proto.h index ed63e7875da3..b44f9e7a5599 100644 --- a/contrib/one-true-awk/proto.h +++ b/contrib/one-true-awk/proto.h @@ -73,12 +73,14 @@ extern Node *node1(int, Node *); extern Node *node2(int, Node *, Node *); extern Node *node3(int, Node *, Node *, Node *); extern Node *node4(int, Node *, Node *, Node *, Node *); +extern Node *node5(int, Node *, Node *, Node *, Node *, Node *); extern Node *stat3(int, Node *, Node *, Node *); extern Node *op2(int, Node *, Node *); extern Node *op1(int, Node *); extern Node *stat1(int, Node *); extern Node *op3(int, Node *, Node *, Node *); extern Node *op4(int, Node *, Node *, Node *, Node *); +extern Node *op5(int, Node *, Node *, Node *, Node *, Node *); extern Node *stat2(int, Node *, Node *); extern Node *stat4(int, Node *, Node *, Node *, Node *); extern Node *celltonode(Cell *, int); @@ -197,6 +199,7 @@ extern const char *filename(FILE *); extern Cell *closefile(Node **, int); extern void closeall(void); extern Cell *dosub(Node **, int); +extern Cell *gensub(Node **, int); extern FILE *popen(const char *, const char *); extern int pclose(FILE *); diff --git a/contrib/one-true-awk/run.c b/contrib/one-true-awk/run.c index 99306992df41..9c61b1a1c558 100644 --- a/contrib/one-true-awk/run.c +++ b/contrib/one-true-awk/run.c @@ -2062,12 +2062,14 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis { Cell *x, *y; Awkfloat u; - int t; + int t, sz; Awkfloat tmp; - char *buf; + char *buf, *fmt; Node *nextarg; FILE *fp; int status = 0; + time_t tv; + struct tm *tm; int estatus = 0; t = ptoi(a[0]); @@ -2109,6 +2111,64 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis nextarg = nextarg->nnext; } break; + case FCOMPL: + u = ~((int)getfval(x)); + break; + case FAND: + if (nextarg == 0) { + WARNING("and requires two arguments; returning 0"); + u = 0; + break; + } + y = execute(a[1]->nnext); + u = ((int)getfval(x)) & ((int)getfval(y)); + tempfree(y); + nextarg = nextarg->nnext; + break; + case FFOR: + if (nextarg == 0) { + WARNING("or requires two arguments; returning 0"); + u = 0; + break; + } + y = execute(a[1]->nnext); + u = ((int)getfval(x)) | ((int)getfval(y)); + tempfree(y); + nextarg = nextarg->nnext; + break; + case FXOR: + if (nextarg == 0) { + WARNING("xor requires two arguments; returning 0"); + u = 0; + break; + } + y = execute(a[1]->nnext); + u = ((int)getfval(x)) ^ ((int)getfval(y)); + tempfree(y); + nextarg = nextarg->nnext; + break; + case FLSHIFT: + if (nextarg == 0) { + WARNING("lshift requires two arguments; returning 0"); + u = 0; + break; + } + y = execute(a[1]->nnext); + u = ((int)getfval(x)) << ((int)getfval(y)); + tempfree(y); + nextarg = nextarg->nnext; + break; + case FRSHIFT: + if (nextarg == 0) { + WARNING("rshift requires two arguments; returning 0"); + u = 0; + break; + } + y = execute(a[1]->nnext); + u = ((int)getfval(x)) >> ((int)getfval(y)); + tempfree(y); + nextarg = nextarg->nnext; + break; case FSYSTEM: fflush(stdout); /* in case something is buffered already */ estatus = status = system(getsval(x)); @@ -2163,6 +2223,41 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis else u = fflush(fp); break; + case FSYSTIME: + u = time((time_t *) 0); + break; + case FSTRFTIME: + /* strftime([format [,timestamp]]) */ + if (nextarg) { + y = execute(nextarg); + nextarg = nextarg->nnext; + tv = (time_t) getfval(y); + tempfree(y); + } else + tv = time((time_t *) 0); + tm = localtime(&tv); + if (tm == NULL) + FATAL("bad time %ld", (long)tv); + + if (isrec(x)) { + /* format argument not provided, use default */ + fmt = tostring("%a %b %d %H:%M:%S %Z %Y"); + } else + fmt = tostring(getsval(x)); + + sz = 32; + buf = NULL; + do { + if ((buf = realloc(buf, (sz *= 2))) == NULL) + FATAL("out of memory in strftime"); + } while (strftime(buf, sz, fmt, tm) == 0 && fmt[0] != '\0'); + + y = gettemp(); + setsval(y, buf); + free(fmt); + free(buf); + + return y; default: /* can't happen */ FATAL("illegal function type %d", t); break; @@ -2542,6 +2637,147 @@ next_search: return x; } +Cell *gensub(Node **a, int nnn) /* global selective substitute */ + /* XXX incomplete - doesn't support backreferences \0 ... \9 */ +{ + Cell *x, *y, *res, *h; + char *rptr; + const char *sptr; + char *buf, *pb; + const char *t, *q; + fa *pfa; + int mflag, tempstat, num, whichm; + int bufsz = recsize; + + if ((buf = malloc(bufsz)) == NULL) + FATAL("out of memory in gensub"); + mflag = 0; /* if mflag == 0, can replace empty string */ + num = 0; + x = execute(a[4]); /* source string */ + t = getsval(x); + res = copycell(x); /* target string - initially copy of source */ + res->csub = CTEMP; /* result values are temporary */ + if (a[0] == 0) /* 0 => a[1] is already-compiled regexpr */ + pfa = (fa *) a[1]; /* regular expression */ + else { + y = execute(a[1]); + pfa = makedfa(getsval(y), 1); + tempfree(y); + } + y = execute(a[2]); /* replacement string */ + h = execute(a[3]); /* which matches should be replaced */ + sptr = getsval(h); + if (sptr[0] == 'g' || sptr[0] == 'G') + whichm = -1; + else { + /* + * The specified number is index of replacement, starting + * from 1. GNU awk treats index lower than 0 same as + * 1, we do same for compatibility. + */ + whichm = (int) getfval(h) - 1; + if (whichm < 0) + whichm = 0; + } + tempfree(h); + + if (pmatch(pfa, t)) { + char *sl; + + tempstat = pfa->initstat; + pfa->initstat = 2; + pb = buf; + rptr = getsval(y); + /* + * XXX if there are any backreferences in subst string, + * complain now. + */ + for (sl = rptr; (sl = strchr(sl, '\\')) && sl[1]; sl++) { + if (strchr("0123456789", sl[1])) { + FATAL("gensub doesn't support backreferences (subst \"%s\")", rptr); + } + } + + do { + if (whichm >= 0 && whichm != num) { + num++; + adjbuf(&buf, &bufsz, (pb - buf) + (patbeg - t) + patlen, recsize, &pb, "gensub"); + + /* copy the part of string up to and including + * match to output buffer */ + while (t < patbeg + patlen) + *pb++ = *t++; + continue; + } + + if (patlen == 0 && *patbeg != 0) { /* matched empty string */ + if (mflag == 0) { /* can replace empty */ + num++; + sptr = rptr; + while (*sptr != 0) { + adjbuf(&buf, &bufsz, 5+pb-buf, recsize, &pb, "gensub"); + if (*sptr == '\\') { + backsub(&pb, &sptr); + } else if (*sptr == '&') { + sptr++; + adjbuf(&buf, &bufsz, 1+patlen+pb-buf, recsize, &pb, "gensub"); + for (q = patbeg; q < patbeg+patlen; ) + *pb++ = *q++; + } else + *pb++ = *sptr++; + } + } + if (*t == 0) /* at end */ + goto done; + adjbuf(&buf, &bufsz, 2+pb-buf, recsize, &pb, "gensub"); + *pb++ = *t++; + if (pb > buf + bufsz) /* BUG: not sure of this test */ + FATAL("gensub result0 %.30s too big; can't happen", buf); + mflag = 0; + } + else { /* matched nonempty string */ + num++; + sptr = t; + adjbuf(&buf, &bufsz, 1+(patbeg-sptr)+pb-buf, recsize, &pb, "gensub"); + while (sptr < patbeg) + *pb++ = *sptr++; + sptr = rptr; + while (*sptr != 0) { + adjbuf(&buf, &bufsz, 5+pb-buf, recsize, &pb, "gensub"); + if (*sptr == '\\') { + backsub(&pb, &sptr); + } else if (*sptr == '&') { + sptr++; + adjbuf(&buf, &bufsz, 1+patlen+pb-buf, recsize, &pb, "gensub"); + for (q = patbeg; q < patbeg+patlen; ) + *pb++ = *q++; + } else + *pb++ = *sptr++; + } + t = patbeg + patlen; + if (patlen == 0 || *t == 0 || *(t-1) == 0) + goto done; + if (pb > buf + bufsz) + FATAL("gensub result1 %.30s too big; can't happen", buf); + mflag = 1; + } + } while (pmatch(pfa,t)); + sptr = t; + adjbuf(&buf, &bufsz, 1+strlen(sptr)+pb-buf, 0, &pb, "gensub"); + while ((*pb++ = *sptr++) != 0) + ; + done: if (pb > buf + bufsz) + FATAL("gensub result2 %.30s too big; can't happen", buf); + *pb = '\0'; + setsval(res, buf); + pfa->initstat = tempstat; + } + tempfree(x); + tempfree(y); + free(buf); + return(res); +} + void backsub(char **pb_ptr, const char **sptr_ptr) /* handle \\& variations */ { /* sptr[0] == '\\' */ char *pb = *pb_ptr; From nobody Mon May 20 20:38:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjqCY6RHHz5LP9d; Mon, 20 May 2024 20:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjqCY5lsVz4RVw; Mon, 20 May 2024 20:38:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6tMX9vng1NBmZx6k/T8u0gDpGDM6aWaOh+Q4cgRv0mY=; b=xSHex30IH5YWDcFhaEDCKMJYzGDy1ygJetHTpPcaseLJBDCXgLcGX+1XvonUqQ3DVGVPgE tqbvI/Kvac93ix9kA5MqhTTeNV3zr4iWtzuHm5I4lQ6fkORRzM2wrfKOlm3xF2BcSMDo/2 J9EwNBokQDiKhuqR5RcvbsJns2/Ee6m+8uQ+eelOlCXqF/cEG8WnkbCsp68ZTRW33RRGsy 253tgEd0vcAMukVNgKGJXXb7Db6q2FkprnoPUvMZHGurWRrt1botGQU5rKgL0Bbro22RkU is/T1wzHdc9vhFIXvZDYeLFB0k6GVfgEIm/4a2Pzl73OR8PhGogGuTaVmtCz8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716237513; a=rsa-sha256; cv=none; b=ON3EbXtBoxZwGhk0FxaB90jXA7rR/sxrEiLZWxyY1YHK3XFNBB/sPtI2WdKHDZ4yxgvO5U YQRVpjwv1lBl62rmU2X3T/3Q8oLy7tOt4rCApW7ms5g0iV5S9BsLyeFwg4hcygpIekLxkj lHrsZVmtxdqrQ5tKXh3Ht97uwGm8N+cctMlSp/4jsYBqp3t4er/cixsT+wjxEKJGdn6o6f 4h6WK9euGUwBAQROGrPjbpF0UdpTx+9A3SGu8jIRIvCxCPv1yVNALE7cakSNvzPpIQRYh2 Nb2VVF4WmpWX5hilsa13dqBDCuUSmgZWklkbGMmrhapuMaCqWNp0IU8lEk6AHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6tMX9vng1NBmZx6k/T8u0gDpGDM6aWaOh+Q4cgRv0mY=; b=udTxmgHdDdRcYFhdCcUp2aO/GOsJ1Qw0zQx+rlSTOUj6XXJXUP4B/zZFvy7t6AlhToM5PP NwRCQihVvaSSEr59iA9RF+Fg3mypSl/yGALIacxixHPuk3go9gUU//csRncZBckruBWmf7 R7vmOHltlLGRN/m2K4fkEI3KGVypYwHIRGVXkHkOAQp3kTVr74JlA9qaWnytCN/HkWrvFX rf8ub6oCapZqVsT/Bdj5oGj1ux0ADOx8EZrkqJ7zB+CHqPk844iiBP+158svsnApZcT6n/ 0qSzHZEU/xUePbN6d6QfmgxNawNesZDGijF/UfgbZigyYvb38YeTVWbpWob4Zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjqCY58ynzsxm; Mon, 20 May 2024 20:38:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KKcXai057573; Mon, 20 May 2024 20:38:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KKcXeM057570; Mon, 20 May 2024 20:38:33 GMT (envelope-from git) Date: Mon, 20 May 2024 20:38:33 GMT Message-Id: <202405202038.44KKcXeM057570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f44abb705590 - releng/14.1 - ifconfig: Add format shortcuts. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: f44abb7055904b5d7ea2ce984abccd3098a54987 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f44abb7055904b5d7ea2ce984abccd3098a54987 commit f44abb7055904b5d7ea2ce984abccd3098a54987 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-14 06:51:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 20:37:28 +0000 ifconfig: Add format shortcuts. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45166 (cherry picked from commit 847ef59d4b5eab234bd1f8eb947ad74bdab5614e) ifconfig: Markup nits. MFC after: 3 days Reviewed by: imp, allanjude Differential Revision: https://reviews.freebsd.org/D45209 (cherry picked from commit 42b28f815214aa582fe4ca707687d3af47850230) (cherry picked from commit dd1a16c9e2c1c95d9ac7ad0b082248e60ede0e99) Approved by: re (cperciva) --- sbin/ifconfig/ifconfig.8 | 32 +++++++++++++++++++++++--------- sbin/ifconfig/ifconfig.c | 42 +++++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 26 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index a538981608cd..471d37ac1779 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -27,7 +27,7 @@ .\" .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" -.Dd November 08, 2023 +.Dd May 12, 2024 .Dt IFCONFIG 8 .Os .Sh NAME @@ -137,7 +137,7 @@ and their associated .Ar format strings are: .Pp -.Bl -tag -width ether +.Bl -tag -width default .It Cm addr Adjust the display of inet and inet6 addresses: .Pp @@ -202,6 +202,16 @@ Integer format, for example: .Ql prefixlen 64 .El .El +.Pp +In addition, the following shortcuts are accepted: +.Bl -tag -width default +.It Cm default +Resets all formats to their default values. +.It Cm cidr +Shortcut notation for +.Cm inet:cidr,inet6:cidr . +.El +.Pp .It Fl G Ar groupname Exclude members of the specified .Ar groupname @@ -464,13 +474,17 @@ sending out requests and listening for replies. .It Cm stickyarp Enable the so-called sticky ARP mode for the interface. If this option is enabled on the given interface, any resolved address is -marked as a static one and never expires. This may be used to increase +marked as a static one and never expires. +This may be used to increase security of the network by preventing ARP spoofing or to reduce latency for high-performance Ethernet networks where the time needed for ARP resolution is -too high. Please note that a similar feature is also provided for bridges. See +too high. +Please note that a similar feature is also provided for bridges. +See the sticky option in the .Sx Bridge Interface Parameters -section. Enabling this +section. +Enabling this option may impact techniques which rely on ARP expiration/overwriting feature such as load-balancers or high-availabity solutions such as .Xr carp 4 . @@ -1227,8 +1241,8 @@ Set the interval at which beacon frames are sent when operating in ad-hoc or ap mode. The .Ar interval -parameter is specified in TU's (1024 usecs). -By default beacon frames are transmitted every 100 TU's. +parameter is specified in TUs (1024 usecs). +By default beacon frames are transmitted every 100 TUs. .It Cm bmissthreshold Ar count Set the number of consecutive missed beacons at which the station will attempt to roam (i.e., search for a new access point). @@ -1885,8 +1899,8 @@ Use .Fl powersave to disable powersave operation when operating as a client. .It Cm powersavesleep Ar sleep -Set the desired max powersave sleep time in TU's (1024 usecs). -By default the max powersave sleep time is 100 TU's. +Set the desired max powersave sleep time in TUs (1024 usecs). +By default the max powersave sleep time is 100 TUs. .It Cm protmode Ar technique For interfaces operating in 802.11g, use the specified .Ar technique diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 7a78e9a934f7..402967d405fd 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -322,14 +322,10 @@ cmpifaddrs(struct ifaddrs *a, struct ifaddrs *b, struct ifa_queue *q) static void freeformat(void) { - if (f_inet != NULL) - free(f_inet); - if (f_inet6 != NULL) - free(f_inet6); - if (f_ether != NULL) - free(f_ether); - if (f_addr != NULL) - free(f_addr); + free(f_inet); + free(f_inet6); + free(f_ether); + free(f_addr); } static void setformat(char *input) @@ -339,9 +335,18 @@ static void setformat(char *input) formatstr = strdup(input); while ((category = strsep(&formatstr, ",")) != NULL) { modifier = strchr(category, ':'); - if (modifier == NULL || modifier[1] == '\0') { - warnx("Skipping invalid format specification: %s\n", - category); + if (modifier == NULL) { + if (strcmp(category, "default") == 0) { + freeformat(); + } else if (strcmp(category, "cidr") == 0) { + free(f_inet); + f_inet = strdup(category); + free(f_inet6); + f_inet6 = strdup(category); + } else { + warnx("Skipping invalid format: %s\n", + category); + } continue; } @@ -349,14 +354,19 @@ static void setformat(char *input) modifier[0] = '\0'; modifier++; - if (strcmp(category, "addr") == 0) + if (strcmp(category, "addr") == 0) { + free(f_addr); f_addr = strdup(modifier); - else if (strcmp(category, "ether") == 0) + } else if (strcmp(category, "ether") == 0) { + free(f_ether); f_ether = strdup(modifier); - else if (strcmp(category, "inet") == 0) + } else if (strcmp(category, "inet") == 0) { + free(f_inet); f_inet = strdup(modifier); - else if (strcmp(category, "inet6") == 0) + } else if (strcmp(category, "inet6") == 0) { + free(f_inet6); f_inet6 = strdup(modifier); + } } free(formatstr); } @@ -621,8 +631,6 @@ main(int ac, char *av[]) .io_s = -1, }; - f_inet = f_inet6 = f_ether = f_addr = NULL; - lifh = ifconfig_open(); if (lifh == NULL) err(EXIT_FAILURE, "ifconfig_open"); From nobody Mon May 20 20:38:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjqCb0gX5z5LP16; Mon, 20 May 2024 20:38:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjqCZ6GQlz4RN0; Mon, 20 May 2024 20:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SgTTBPukJ64jLEQDTgXszH/YNbxPu0cXIieeynOjhCA=; b=fBPYl2kaq333IQcoCjjlac9SksY5B0lJbVBZ3hrRBa1SqSCux0uhYbWzczWHhR0S5Wj5VV gfFon7kXMHFDNQmsIoMkmXCdUKM1K6X/Abm1Zlx3+lT/tCaIeFKsB3YTeHkaE0iqlmOb5r CEU/zu1ukzyxq6plnUVlgz4UupNOm/+5kecc2HoGHSq+jxt+pjmDrsWFoR6SRrO+80Ka8F bSZPQ0LQ8VkAAWCBXRrAEOAN9+zRYXFbWYP5N3duPZQU5SdnsYqY1TiqbmLSa60z6wfNu+ r8N4B4ZNphw8iOh/sMKwA3KjsQ4PQI+9g8rxRTkY6NdWk7eXaqfd/N9OehGyIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716237514; a=rsa-sha256; cv=none; b=xJOG6zrgtKSTNtBxSABCtd0WKRDKwSfPyZWed439gflstwVG9siXLAZYnuqgDiUnflK5ga grnWuotC2O5G6Uf1rxS0Pe2OxqAcWQ7zCRU0Xv3nnRFJosbdeE7PVriHU5RE5p+SeA4XBf /Jmdd4lW99Yfx3YfZAosIAR6u4r8tu8UK8mBRjbbWWWlORL1YFQzN7WwMbllgp9vuh48TX qxOohlqb8H1lrhWd6nW7MHmeA3bo5byn6pDL4XBVa6be4V48pf3p1TGw52dckts67zffF/ SoxjuDzykMqc/rSvpPZegnIY5mEWYBQLTV6XnswW+mw/yB5W7o/KSABRcK4gbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SgTTBPukJ64jLEQDTgXszH/YNbxPu0cXIieeynOjhCA=; b=akDcHNE1GFIVGfiAO9j5JfTjz9G9xE051LMx97L4MhD7mZftTEmGtJWjM6JOlghEnCFwP6 erCRPr8lylB8V88ElswGOA9/eUkf46bkfZGbVkd5sl641Utc5t+GmEUUvqLP5YOvVE047S 0sQfWbWRCvkZ3+AxWJ2FiBGNhJmUNbqBeMUIfQonzvLSawmpZhyQ+lQNwbc4zt4jyF7z6+ T/XmcC/iXg0/NnBm4n4MKrAMj+xmFbJ8nmIol3wbcgHmo9P1zZnRRyJNjMtugoqgC2Q6VW CN62R74gC3xE1LDG5Beo9gwuHYaX7ESmYPcYftFxr42K/0VZrWjWvXjkQ1q/KQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjqCZ5THpztBj; Mon, 20 May 2024 20:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KKcY4B057625; Mon, 20 May 2024 20:38:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KKcYqB057622; Mon, 20 May 2024 20:38:34 GMT (envelope-from git) Date: Mon, 20 May 2024 20:38:34 GMT Message-Id: <202405202038.44KKcYqB057622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0829f9334cdd - releng/14.1 - atf: Guard against multiple evaluation. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 0829f9334cdd4f839eb3081ea91d533d1a026bcc Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0829f9334cdd4f839eb3081ea91d533d1a026bcc commit 0829f9334cdd4f839eb3081ea91d533d1a026bcc Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:08:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 20:37:40 +0000 atf: Guard against multiple evaluation. Note that the ATF-C++ macros have the same issue, but they are not as easily fixed. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D45148 (cherry picked from commit a7beca6fb113986839de73b7cf73d933464898c6) (cherry picked from commit 745ee870031e3b35141fe720bdebe9baa234e942) Approved by: re (cperciva) --- contrib/atf/atf-c/macros.h | 151 ++++++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 56 deletions(-) diff --git a/contrib/atf/atf-c/macros.h b/contrib/atf/atf-c/macros.h index 1784fc47435d..abcb9f697907 100644 --- a/contrib/atf/atf-c/macros.h +++ b/contrib/atf/atf-c/macros.h @@ -167,65 +167,104 @@ ATF_CHECK_MSG((expected) == (actual), "%s != %s: " fmt, \ #expected, #actual, ##__VA_ARGS__) -#define ATF_REQUIRE_STREQ(expected, actual) \ - ATF_REQUIRE_MSG(strcmp(expected, actual) == 0, "%s != %s (%s != %s)", \ - #expected, #actual, expected, actual) - -#define ATF_CHECK_STREQ(expected, actual) \ - ATF_CHECK_MSG(strcmp(expected, actual) == 0, "%s != %s (%s != %s)", \ - #expected, #actual, expected, actual) - -#define ATF_REQUIRE_STREQ_MSG(expected, actual, fmt, ...) \ - ATF_REQUIRE_MSG(strcmp(expected, actual) == 0, \ - "%s != %s (%s != %s): " fmt, \ - #expected, #actual, expected, actual, ##__VA_ARGS__) - -#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) \ - ATF_CHECK_MSG(strcmp(expected, actual) == 0, \ - "%s != %s (%s != %s): " fmt, \ - #expected, #actual, expected, actual, ##__VA_ARGS__) - -#define ATF_REQUIRE_INTEQ(expected, actual) \ - ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual)) - -#define ATF_CHECK_INTEQ(expected, actual) \ - ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \ - #actual, (intmax_t)(expected), (intmax_t)(actual)) - -#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) \ - ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual), ##__VA_ARGS__) - -#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) \ - ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \ - #expected, #actual, (intmax_t)(expected), \ - (intmax_t)(actual), ##__VA_ARGS__) - -#define ATF_REQUIRE_MATCH(regexp, string) \ - ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s'", regexp, string); - -#define ATF_CHECK_MATCH(regexp, string) \ - ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s'", regexp, string); - -#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) \ - ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s': " fmt, regexp, string, \ - ##__VA_ARGS__); - -#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) \ - ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \ - "'%s' not matched in '%s': " fmt, regexp, string, \ - ##__VA_ARGS__); +#define ATF_REQUIRE_STREQ(expected, actual) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_REQUIRE_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_CHECK_STREQ(expected, actual) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_CHECK_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_REQUIRE_STREQ_MSG(expected, actual, fmt, ...) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_REQUIRE_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) do { \ + const char *_atf_expected = (expected); \ + const char *_atf_actual = (actual); \ + ATF_CHECK_MSG(strcmp(_atf_expected, _atf_actual) == 0, \ + "%s != %s (%s != %s): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_REQUIRE_INTEQ(expected, actual) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_REQUIRE_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_CHECK_INTEQ(expected, actual) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_CHECK_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd)", #expected, #actual, \ + _atf_expected, _atf_actual); \ + } while (0) + +#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_REQUIRE_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) do { \ + intmax_t _atf_expected = (expected); \ + intmax_t _atf_actual = (actual); \ + ATF_CHECK_MSG(_atf_expected == _atf_actual, \ + "%s != %s (%jd != %jd): " fmt, #expected, #actual, \ + _atf_expected, _atf_actual, ##__VA_ARGS__); \ + } while (0) + +#define ATF_REQUIRE_MATCH(regexp, string) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_REQUIRE_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s'", _atf_regexp, _atf_string); \ + } while (0) + +#define ATF_CHECK_MATCH(regexp, string) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_CHECK_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s'", _atf_regexp, _atf_string); \ + } while (0) + +#define ATF_REQUIRE_MATCH_MSG(regexp, string, fmt, ...) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_REQUIRE_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s': " fmt, _atf_regexp, _atf_string, \ + ##__VA_ARGS__); \ + } while (0) + +#define ATF_CHECK_MATCH_MSG(regexp, string, fmt, ...) do { \ + const char *_atf_regexp = (regexp); \ + const char *_atf_string = (string); \ + ATF_CHECK_MSG(atf_utils_grep_string("%s", _atf_string, _atf_regexp), \ + "'%s' not matched in '%s': " fmt, _atf_regexp, _atf_string, \ + ##__VA_ARGS__); \ + } while (0) #define ATF_CHECK_ERRNO(exp_errno, bool_expr) \ - atf_tc_check_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr) + atf_tc_check_errno(__FILE__, __LINE__, (exp_errno), #bool_expr, (bool_expr)) #define ATF_REQUIRE_ERRNO(exp_errno, bool_expr) \ - atf_tc_require_errno(__FILE__, __LINE__, exp_errno, #bool_expr, bool_expr) + atf_tc_require_errno(__FILE__, __LINE__, (exp_errno), #bool_expr, (bool_expr)) #endif /* !defined(ATF_C_MACROS_H) */ From nobody Mon May 20 20:38:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjqCc32h7z5LP9j; Mon, 20 May 2024 20:38:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjqCc0TKnz4RSP; Mon, 20 May 2024 20:38:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wBZOynk8IyuaDZwZ4UdwSUoP+DEAnNDN2yVpdfmJ+v0=; b=savaRWkHufIZFuzp9db+eBxHfbHYdFXpZ0yz+V+Yjy+ExIConciO40uzFi8NPFoXI/huBd gDQx77FZrMV1zwupUo3D5RzdFuh63nTn3NnVhz7MU0aGvuLobZLRT+MPPhzC6HWtvjfC9i 0CrivMnIBaGG9y0SesyggVWAaE/b2r2ylc5lMiB20KK3CqBxQQswT5jBvvVL+LihVnjB4W nD9ze7qohyXngr+OZoP+W5ZbbgkG0EvdWkmgdYmJrQ36v1dKdb3EdOUAPXMGRrVjiHOZVG DxR53CKilTJudsxG/1a0CcPCFfDiWX09rkuFbpydmGOisLKqvvWWXNO5m7Oj6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716237516; a=rsa-sha256; cv=none; b=yTP7HV/Ggy3nmDF0QYYHsM/t+CBduqALRD3SWTzeD9uPAHKdLvPH47Zg1IYJamkHx/Ppxm PZ1bhtmj3BuYDJ5+8XMtTgsylniGxKTyH8SC09yVIahYdwlnAQr14DaggYScoeOnpLcGEy QnQ+u9ijyWrMujCNW03Ja8Kl7Q5kFaNJKsr6EhLJcN3WeQW7JsqcLxIKqJWlpL111QGPvp 9y0EWtlzf9vuCV1XCw14Zrve0mHVlM9xw1SuWDV6QD/87pzd4z8Qp+ZV6UwoYI0PnSESvr v/bWyzOb3ixcxiAHSiKWEDEvOJOcgdc/dYiHCQNSD/q6SmGwxcVXQLeBgw+0eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wBZOynk8IyuaDZwZ4UdwSUoP+DEAnNDN2yVpdfmJ+v0=; b=VBes7AlQds4wl8bQa5kE6VCgVIY6QAg4zeERTlna1OUeTBBtZbhduhhnZ1045QuXMfaoWM jDwhEPuTgStrt/0gSFF3mW+pIVjk1lKPuRzITHYqJ6hWKLPMywppQYn17MFLhv1IzrGQPF CtQTiEgnNPQN7/5x38SQRQrN5jPzsjZm8IUN7afMEwSEV7PeIb6S97gMVfsfBuaLefLa+/ sIH5KiwLXOCXeG0v5MA8ke6Wp9uLubS4LWeG4wCZfjxEsz4ZSP7fc/luy8gRFm8XQ+nFpL uo1SzDoy7FwnkFFzPyQ9EGagmCF7Tzvvtw7h/OJcBITmOcZCGphB+PuQhuYI4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjqCb6BGgztBk; Mon, 20 May 2024 20:38:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KKcZsA057680; Mon, 20 May 2024 20:38:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KKcZQB057677; Mon, 20 May 2024 20:38:35 GMT (envelope-from git) Date: Mon, 20 May 2024 20:38:35 GMT Message-Id: <202405202038.44KKcZQB057677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 5df49242be71 - releng/14.1 - ldns: Ignore commented-out lines in resolv.conf. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 5df49242be716cd8736fd10086dc6b31af1eafbd Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5df49242be716cd8736fd10086dc6b31af1eafbd commit 5df49242be716cd8736fd10086dc6b31af1eafbd Author: Dag-Erling Smørgrav AuthorDate: 2024-05-15 10:16:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 20:37:46 +0000 ldns: Ignore commented-out lines in resolv.conf. This merges upstream PR 238 + an additional bug fix. PR: 278721 MFC after: 1 week (cherry picked from commit 3b092e4936c433889cc668ea9563c8fd437d1a3e) (cherry picked from commit 7daf36028411c3a9c73e0c75732f9cbcbf66362e) Approved by: re (cperciva) --- contrib/ldns/ldns/parse.h | 2 ++ contrib/ldns/parse.c | 35 +++++++++++++++++++++++++++---- contrib/ldns/resolver.c | 53 ++++++++--------------------------------------- 3 files changed, 42 insertions(+), 48 deletions(-) diff --git a/contrib/ldns/ldns/parse.h b/contrib/ldns/ldns/parse.h index ba7edf5679d8..6130dae32bd2 100644 --- a/contrib/ldns/ldns/parse.h +++ b/contrib/ldns/ldns/parse.h @@ -95,6 +95,8 @@ ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, */ ldns_status ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed, const char *delim, int *line_nr); +ssize_t ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, size_t limit, int *line_nr); + /** * returns a token/char from the buffer b. * This function deals with ( and ) in the buffer, diff --git a/contrib/ldns/parse.c b/contrib/ldns/parse.c index 9698ba71e881..af8b2c1321b2 100644 --- a/contrib/ldns/parse.c +++ b/contrib/ldns/parse.c @@ -27,9 +27,14 @@ ldns_fget_token(FILE *f, char *token, const char *delim, size_t limit) return ldns_fget_token_l(f, token, delim, limit, NULL); } -ldns_status -ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed - , const char *delim, int *line_nr) +enum file_type2parse { + zone_file_type, resolv_conf_file_type +}; + +static ldns_status +ldns_fget_token_l_st_file_type(FILE *f, char **token, size_t *limit, + bool fixed, const char *delim, int *line_nr, + enum file_type2parse file_type) { int c, prev_c; int p; /* 0 -> no parentheses seen, >0 nr of ( seen */ @@ -98,7 +103,9 @@ ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed } /* do something with comments ; */ - if (c == ';' && quoted == 0) { + if ((c == ';' + || (c == '#' && file_type == resolv_conf_file_type)) + && quoted == 0) { if (prev_c != '\\') { com = 1; } @@ -215,6 +222,26 @@ tokenread: return i == 0 ? LDNS_STATUS_SYNTAX_EMPTY : LDNS_STATUS_OK; } +ldns_status +ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, bool fixed + , const char *delim, int *line_nr) +{ + return ldns_fget_token_l_st_file_type( + f, token, limit, fixed, delim, line_nr, zone_file_type); +} + +ssize_t +ldns_fget_token_l_resolv_conf(FILE *f, char *token, const char *delim, + size_t limit, int *line_nr) +{ + if (limit == 0) + limit = LDNS_MAX_LINELEN; + if (ldns_fget_token_l_st_file_type(f, &token, &limit, true, delim, + line_nr, resolv_conf_file_type)) + return -1; + else + return (ssize_t)strlen(token); +} ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr) diff --git a/contrib/ldns/resolver.c b/contrib/ldns/resolver.c index f9ec65a55966..a426b82c034e 100644 --- a/contrib/ldns/resolver.c +++ b/contrib/ldns/resolver.c @@ -775,7 +775,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) #endif ssize_t gtr, bgtr; ldns_buffer *b; - int lnr = 0, oldline; + int lnr = 0; FILE* myfp = fp; if(!line_nr) line_nr = &lnr; @@ -809,36 +809,18 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) gtr = 1; word[0] = 0; - oldline = *line_nr; expect = LDNS_RESOLV_KEYWORD; while (gtr > 0) { - /* check comments */ - if (word[0] == '#') { - word[0]='x'; - if(oldline == *line_nr) { - /* skip until end of line */ - int c; - do { - c = fgetc(myfp); - } while(c != EOF && c != '\n'); - if(c=='\n') (*line_nr)++; - } - /* and read next to prepare for further parsing */ - oldline = *line_nr; - continue; - } - oldline = *line_nr; switch(expect) { case LDNS_RESOLV_KEYWORD: /* keyword */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr != 0) { - if(word[0] == '#') continue; for(i = 0; i < LDNS_RESOLV_KEYWORDS; i++) { if (strcasecmp(keyword[i], word) == 0) { /* chosen the keyword and * expect values carefully - */ + */ expect = i; break; } @@ -856,16 +838,12 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_DEFDOMAIN: /* default domain dname */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { if(!fp) fclose(myfp); @@ -879,16 +857,12 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_NAMESERVER: /* NS aaaa or a record */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { if(!fp) fclose(myfp); ldns_resolver_deep_free(r); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } if(strchr(word, '%')) { /* snip off interface labels, * fe80::222:19ff:fe31:4222%eth0 */ @@ -911,7 +885,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) break; case LDNS_RESOLV_SEARCH: /* search list domain dname */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); b = LDNS_MALLOC(ldns_buffer); if(!b) { ldns_resolver_deep_free(r); @@ -929,10 +903,6 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) bgtr = ldns_bget_token(b, word, LDNS_PARSE_NORMAL, (size_t) gtr + 1); while (bgtr > 0) { gtr -= bgtr; - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - break; - } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word); if (!tmp) { ldns_resolver_deep_free(r); @@ -954,28 +924,23 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr) } break; case LDNS_RESOLV_SORTLIST: - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* sortlist not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_OPTIONS: - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr); /* options not implemented atm */ expect = LDNS_RESOLV_KEYWORD; break; case LDNS_RESOLV_ANCHOR: /* a file containing a DNSSEC trust anchor */ - gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); + gtr = ldns_fget_token_l_resolv_conf(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr); if (gtr == 0) { ldns_resolver_deep_free(r); if(!fp) fclose(myfp); return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR; } - if(word[0] == '#') { - expect = LDNS_RESOLV_KEYWORD; - continue; - } - #ifdef HAVE_SSL tmp_rr = ldns_read_anchor_file(word); (void) ldns_resolver_push_dnssec_anchor(r, tmp_rr); From nobody Mon May 20 20:40:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjqFL41bfz5LPfc; Mon, 20 May 2024 20:40:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjqFL3Vrgz4SG5; Mon, 20 May 2024 20:40:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMRNeGn4nejpyIWxgCLcT3tJ+GMSU5p6XsHH7b7jow4=; b=AEQktLBrTjdUU5c5LwzxGHKm5tQqIrTakhS21Vcj4QoUFhkM8sKh/5sjnoSBxcmQutbFR+ dl1VLL5Fnamn6tLa0NRfdGn8+kHLQy5QfTyUXZ7hosGJEOwyLEdSk/aIuuNTKvYwFphkPi bLtZWls51fh0nv9QmeN0KuY5toMmBqmgwYUveswhjVDnNJjFE5tUCphN8L2a9yrZR7lydM kOsMB5hKRkG67wcYd1OVqWW7acyPoGvLJ8262l8ls+rw+wKmQ+26/WTe+S1Fm2cMNvHfaH VtzJS6L5TvscL72M1LIOMp9HAQQYCGpydpLmDwg3KhAUWZ9A8AOw6li7RQNXag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716237606; a=rsa-sha256; cv=none; b=B+MyzwuJAwpDKDSo0PW/lM7inUs9YDcBBrPgSfr0m8yYiVJxJQudHzc2Pn95uwYkDWSYk1 H4+2tQD7nbj78RWZI/p1nyLQxogoOF+unRHDuZ/aoAodBYu4eiwxsTvSwrqQihs3YxcuUj rUs95dowiKi66EFgYJPnYpHYu0tgWwG3yTa9y2EefYuRDrK/WRwIZHd765WcmdH3a/8E2a 4UOQPIKjHLnEYPOFNlaZSsq6N6ipXRaYZ81eY8i8ZbM1yb3ktAEqLY8Yx19giBH2N/NgVe utdDRPHys4o2+lilb9LujkCikzFOd9IiBV0vNNDMROrH8CY/x94fEuomkP6DwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMRNeGn4nejpyIWxgCLcT3tJ+GMSU5p6XsHH7b7jow4=; b=M5rfsN6OEXFkgKYl9RZVEJRHuYCD/fr00eyey/u2XeEsSrHwssIT6EpZDaigM2FqFO74y9 0xdL8kX2jSjhPlE1iwjNc+CxExM4raKvitOBZtiMgQoNML+yDp2Tef1Mywfe/+RXSj6AGf QNSOaXzKf3pMgyZYh0Z7E7YQ5fWMBdXPb5azVa7m8xu0jFKYapcKu+bt/MTsUcQuTivpOi K7axK76VfeoRKO2uq1JXTPYaf2nYEOCY3FB2OBueg+RvKP0yfJH2f0+pg/NXEuepCnGFUp AuKMDNHyXKBALG5QyXU0gCuqHYQXUrw60cgOqoC+ouiJbttn/kI1pzVLyKbiUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjqFL326Czsxp; Mon, 20 May 2024 20:40:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KKe6dC060949; Mon, 20 May 2024 20:40:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KKe5ge060756; Mon, 20 May 2024 20:40:05 GMT (envelope-from git) Date: Mon, 20 May 2024 20:40:05 GMT Message-Id: <202405202040.44KKe5ge060756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a11839e6172d - stable/13 - unbound: Vendor import 1.20.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a11839e6172de9e0d375f92a5b454e02a8537e59 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a11839e6172de9e0d375f92a5b454e02a8537e59 commit a11839e6172de9e0d375f92a5b454e02a8537e59 Author: Cy Schubert AuthorDate: 2024-05-10 20:56:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 12:47:06 +0000 unbound: Vendor import 1.20.0 Release notes at https://www.nlnetlabs.nl/news/2024/May/08/unbound-1.20.0-released/ Security: The DNSBomb vulnerability CVE-2024-33655 Merge commit 'c2a80056864d6eda0398fd127dc0ae515b39752b' into main (cherry picked from commit 335c7cda12138f2aefa41fb739707612cc12a9be) --- contrib/unbound/Makefile.in | 16 +- contrib/unbound/{ac_pkg_swig.m4 => ax_pkg_swig.m4} | 110 +- contrib/unbound/ax_pthread.m4 | 444 +- contrib/unbound/cachedb/cachedb.c | 133 +- contrib/unbound/cachedb/cachedb.h | 16 + contrib/unbound/config.h.in | 105 +- contrib/unbound/configure | 12872 +++++---- contrib/unbound/configure.ac | 16 +- contrib/unbound/configure~ | 26616 +++++++++++++++++++ contrib/unbound/contrib/rc_d_unbound | 9 + contrib/unbound/contrib/unbound.init | 1 + contrib/unbound/contrib/unbound.init_fedora | 1 + contrib/unbound/contrib/unbound.init_yocto | 1 + contrib/unbound/daemon/cachedump.c | 23 +- contrib/unbound/daemon/daemon.c | 26 +- contrib/unbound/daemon/remote.c | 130 +- contrib/unbound/daemon/unbound.c | 39 +- contrib/unbound/daemon/worker.c | 35 +- contrib/unbound/doc/Changelog | 187 +- contrib/unbound/doc/README | 2 +- contrib/unbound/doc/example.conf.in | 28 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 6 +- contrib/unbound/doc/unbound-control.8.in | 8 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 72 +- contrib/unbound/doc/unbound.doxygen | 2931 +- contrib/unbound/edns-subnet/subnetmod.c | 40 +- contrib/unbound/iterator/iter_fwd.c | 119 +- contrib/unbound/iterator/iter_fwd.h | 60 +- contrib/unbound/iterator/iter_hints.c | 95 +- contrib/unbound/iterator/iter_hints.h | 54 +- contrib/unbound/iterator/iter_utils.c | 62 +- contrib/unbound/iterator/iter_utils.h | 6 +- contrib/unbound/iterator/iterator.c | 295 +- contrib/unbound/libunbound/context.c | 8 + contrib/unbound/libunbound/libunbound.c | 5 + contrib/unbound/libunbound/libworker.c | 21 +- contrib/unbound/services/authzone.c | 10 + contrib/unbound/services/cache/dns.c | 52 +- contrib/unbound/services/cache/infra.c | 170 +- contrib/unbound/services/cache/infra.h | 28 + contrib/unbound/services/cache/rrset.c | 87 + contrib/unbound/services/cache/rrset.h | 31 + contrib/unbound/services/listen_dnsport.c | 51 +- contrib/unbound/services/listen_dnsport.h | 8 +- contrib/unbound/services/localzone.c | 6 +- contrib/unbound/services/mesh.c | 106 +- contrib/unbound/services/mesh.h | 6 + contrib/unbound/services/rpz.c | 342 +- contrib/unbound/services/rpz.h | 8 + contrib/unbound/services/view.h | 3 +- contrib/unbound/smallapp/unbound-anchor.c | 70 +- contrib/unbound/smallapp/unbound-checkconf.c | 13 +- contrib/unbound/smallapp/unbound-control.c | 5 +- contrib/unbound/testdata/cachedb_expired.crpl | 324 + .../testdata/cachedb_expired_client_timeout.crpl | 343 + .../testdata/cachedb_expired_reply_ttl.crpl | 259 + .../unbound/testdata/cachedb_subnet_change.crpl | 304 + .../unbound/testdata/cachedb_subnet_expired.crpl | 322 + .../testdata/cachedb_subnet_toecs_timeout.crpl | 229 + contrib/unbound/testdata/iter_dname_ttl.rpl | 39 - .../testdata/iter_ghost_grandchild_delegation.rpl | 256 + contrib/unbound/testdata/local_cnameother.rpl | 67 + contrib/unbound/testdata/rpz_clientip_override.rpl | 269 + contrib/unbound/testdata/rpz_cname_handle.rpl | 779 + contrib/unbound/testdata/rpz_nsdname_override.rpl | 325 + contrib/unbound/testdata/rpz_nsip_override.rpl | 332 + contrib/unbound/testdata/rpz_passthru_clientip.rpl | 90 + contrib/unbound/testdata/rpz_qtype_cname.rpl | 120 + .../testdata/rpz_reload.tdir/example.org.zone | 2 + .../testdata/rpz_reload.tdir/rpz.example.com.zone | 6 + .../testdata/rpz_reload.tdir/rpz_reload.conf | 30 + .../testdata/rpz_reload.tdir/rpz_reload.dsc | 16 + .../testdata/rpz_reload.tdir/rpz_reload.post | 12 + .../testdata/rpz_reload.tdir/rpz_reload.pre | 26 + .../testdata/rpz_reload.tdir/rpz_reload.test | 109 + contrib/unbound/testdata/subnet_cached_size.crpl | 308 + contrib/unbound/testdata/ttl_max_negative.rpl | 206 + contrib/unbound/testdata/ttl_min_negative.rpl | 204 + contrib/unbound/testdata/val_cnameqtype_qmin.rpl | 784 + contrib/unbound/testdata/val_dnameqtype.rpl | 689 + contrib/unbound/testdata/val_dnameqtype_qmin.rpl | 859 + contrib/unbound/util/config_file.c | 39 + contrib/unbound/util/config_file.h | 19 + contrib/unbound/util/configlexer.c | 8195 +++--- contrib/unbound/util/configlexer.lex | 7 + contrib/unbound/util/configparser.c | 4502 ++-- contrib/unbound/util/configparser.h | 508 +- contrib/unbound/util/configparser.y | 83 +- contrib/unbound/util/data/msgparse.h | 2 + contrib/unbound/util/data/msgreply.c | 33 +- contrib/unbound/util/module.c | 11 +- contrib/unbound/util/module.h | 18 +- contrib/unbound/util/net_help.c | 36 +- contrib/unbound/util/netevent.c | 8 +- contrib/unbound/util/netevent.h | 2 + contrib/unbound/util/storage/lookup3.c | 2 +- contrib/unbound/util/storage/lruhash.c | 34 + contrib/unbound/util/storage/lruhash.h | 11 + contrib/unbound/util/storage/slabhash.c | 7 + contrib/unbound/util/storage/slabhash.h | 12 + contrib/unbound/validator/val_utils.c | 40 +- contrib/unbound/validator/validator.c | 36 +- usr.sbin/unbound/config.h | 6 +- 107 files changed, 53017 insertions(+), 13503 deletions(-) diff --git a/contrib/unbound/Makefile.in b/contrib/unbound/Makefile.in index 22fb75c123bd..f30ca81a84f8 100644 --- a/contrib/unbound/Makefile.in +++ b/contrib/unbound/Makefile.in @@ -1278,7 +1278,8 @@ daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/edns.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h \ - $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h + $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ @@ -1355,7 +1356,7 @@ testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/test $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h $(srcdir)/daemon/worker.h testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h @@ -1428,7 +1429,7 @@ fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/t $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/daemon/remote.h + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/daemon/remote.h $(srcdir)/util/storage/slabhash.h $(srcdir)/daemon/daemon.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ @@ -1484,7 +1485,8 @@ context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbou $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/unbound-event.h config.h $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ @@ -1496,7 +1498,8 @@ libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbou $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h + $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ @@ -1510,8 +1513,7 @@ libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/li $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \ $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/str2wire.h + $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/str2wire.h unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \ diff --git a/contrib/unbound/ac_pkg_swig.m4 b/contrib/unbound/ax_pkg_swig.m4 similarity index 55% rename from contrib/unbound/ac_pkg_swig.m4 rename to contrib/unbound/ax_pkg_swig.m4 index 87f99fb2fe98..7a4196ff5dff 100644 --- a/contrib/unbound/ac_pkg_swig.m4 +++ b/contrib/unbound/ax_pkg_swig.m4 @@ -1,39 +1,43 @@ # =========================================================================== -# http://autoconf-archive.cryp.to/ac_pkg_swig.html +# https://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html # =========================================================================== # # SYNOPSIS # -# AC_PROG_SWIG([major.minor.micro]) +# AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found]) # # DESCRIPTION # -# This macro searches for a SWIG installation on your system. If found you -# should call SWIG via $(SWIG). You can use the optional first argument to -# check if the version of the available SWIG is greater than or equal to -# the value of the argument. It should have the format: N[.N[.N]] (N is a -# number between 0 and 999. Only the first N is mandatory.) +# This macro searches for a SWIG installation on your system. If found, +# then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is +# found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd. # -# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that -# the swig package is this version number or higher. +# You can use the optional first argument to check if the version of the +# available SWIG is greater than or equal to the value of the argument. It +# should have the format: N[.N[.N]] (N is a number between 0 and 999. Only +# the first N is mandatory.) If the version argument is given (e.g. +# 1.3.17), AX_PKG_SWIG checks that the swig package is this version number +# or higher. # -# In configure.in, use as: -# -# AC_PROG_SWIG(1.3.17) -# SWIG_ENABLE_CXX -# SWIG_MULTI_MODULE_SUPPORT -# SWIG_PYTHON +# As usual, action-if-found is executed if SWIG is found, otherwise +# action-if-not-found is executed. # -# LAST MODIFICATION +# In configure.in, use as: # -# 2008-04-12 +# AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ]) +# AX_SWIG_ENABLE_CXX +# AX_SWIG_MULTI_MODULE_SUPPORT +# AX_SWIG_PYTHON # -# COPYLEFT +# LICENSE # # Copyright (c) 2008 Sebastian Huber -# Copyright (c) 2008 Alan W. Irwin +# Copyright (c) 2008 Alan W. Irwin # Copyright (c) 2008 Rafael Laboissiere -# Copyright (c) 2008 Andrew Collier +# Copyright (c) 2008 Andrew Collier +# Copyright (c) 2011 Murray Cumming +# Copyright (c) 2018 Reini Urban +# Copyright (c) 2021 Vincent Danjean # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -46,7 +50,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -57,17 +61,21 @@ # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. -AC_DEFUN([AC_PROG_SWIG],[ - AC_PATH_PROG([SWIG],[swig]) +#serial 15 + +AC_DEFUN([AX_PKG_SWIG],[ + # Find path to the "swig" executable. + AC_PATH_PROGS([SWIG],[swig swig3.0 swig2.0]) if test -z "$SWIG" ; then - AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org]) - SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' - elif test -n "$1" ; then - AC_MSG_CHECKING([for SWIG version]) + m4_ifval([$3],[$3],[:]) + elif test -z "$1" ; then + m4_ifval([$2],[$2],[:]) + else + AC_MSG_CHECKING([SWIG version]) [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] AC_MSG_RESULT([$swig_version]) if test -n "$swig_version" ; then @@ -77,12 +85,12 @@ AC_DEFUN([AC_PROG_SWIG],[ if test -z "$required_major" ; then [required_major=0] fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`] [required_minor=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_minor" ; then [required_minor=0] fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`] [required_patch=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_patch" ; then [required_patch=0] @@ -103,30 +111,28 @@ AC_DEFUN([AC_PROG_SWIG],[ if test -z "$available_patch" ; then [available_patch=0] fi - [badversion=0] - if test $available_major -lt $required_major ; then - [badversion=1] - fi - if test $available_major -eq $required_major \ - -a $available_minor -lt $required_minor ; then - [badversion=1] - fi - if test $available_major -eq $required_major \ - -a $available_minor -eq $required_minor \ - -a $available_patch -lt $required_patch ; then - [badversion=1] - fi - if test $badversion -eq 1 ; then - AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org]) - SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' + # Convert the version tuple into a single number for easier comparison. + # Using base 100 should be safe since SWIG internally uses BCD values + # to encode its version number. + required_swig_vernum=`expr $required_major \* 10000 \ + \+ $required_minor \* 100 \+ $required_patch` + available_swig_vernum=`expr $available_major \* 10000 \ + \+ $available_minor \* 100 \+ $available_patch` + + if test $available_swig_vernum -lt $required_swig_vernum; then + AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version.]) + SWIG='' + m4_ifval([$3],[$3],[]) else - AC_MSG_NOTICE([SWIG executable is '$SWIG']) - SWIG_LIB=`$SWIG -swiglib` - AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB']) + AC_MSG_CHECKING([for SWIG library]) + SWIG_LIB=`$SWIG -swiglib | tr '\r\n' ' '` + AC_MSG_RESULT([$SWIG_LIB]) + m4_ifval([$2],[$2],[]) fi else AC_MSG_WARN([cannot determine SWIG version]) - SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' + SWIG='' + m4_ifval([$3],[$3],[]) fi fi AC_SUBST([SWIG_LIB]) diff --git a/contrib/unbound/ax_pthread.m4 b/contrib/unbound/ax_pthread.m4 index ff7d2a67e11f..9f35d139149f 100644 --- a/contrib/unbound/ax_pthread.m4 +++ b/contrib/unbound/ax_pthread.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# https://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS @@ -14,24 +14,28 @@ # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) +# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is +# needed for multi-threaded programs (defaults to the value of CC +# respectively CXX otherwise). (This is necessary on e.g. AIX to use the +# special cc_r/CC_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with +# but also to link with them as well. For example, you might link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # -# If you are only building threads programs, you may wish to use these +# If you are only building threaded programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" +# CXX="$PTHREAD_CXX" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with @@ -55,6 +59,7 @@ # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. +# Copyright (c) 2019 Marc Stevens # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -67,7 +72,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -82,35 +87,41 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 21 +#serial 31 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). +# requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) + AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) AC_MSG_RESULT([$ax_pthread_ok]) - if test x"$ax_pthread_ok" = xno; then + if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different @@ -118,12 +129,14 @@ fi # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. -ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: @@ -132,82 +145,163 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case ${host_os} in +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], + [ +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + ], + [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) + ;; + solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" + ;; +esac + +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC + +AS_IF([test "x$GCC" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) + +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + +AS_IF([test "x$ax_pthread_clang" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread"]) - ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" ;; - darwin*) - ax_pthread_flags="-pthread $ax_pthread_flags" + aix*) + ax_pthread_check_macro="_THREAD_SAFE" ;; -esac -# Clang doesn't consider unrecognized options an error unless we specify -# -Werror. We throw in some extra Clang-specific options to ensure that -# this doesn't happen for GCC, which also accepts -Werror. + *) + ax_pthread_check_macro="--" + ;; +esac +AS_IF([test "x$ax_pthread_check_macro" = "x--"], + [ax_pthread_check_cond=0], + [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) -AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) -save_CFLAGS="$CFLAGS" -ax_pthread_extra_flags="-Werror" -CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], - [AC_MSG_RESULT([yes])], - [ax_pthread_extra_flags= - AC_MSG_RESULT([no])]) -CFLAGS="$save_CFLAGS" -if test x"$ax_pthread_ok" = xno; then -for flag in $ax_pthread_flags; do +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do - case $flag in + case $ax_pthread_try_flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) + ;; + -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - if test x"$ax_pthread_config" = xno; then continue; fi + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we @@ -218,8 +312,18 @@ for flag in $ax_pthread_flags; do # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include - static void routine(void *a) { *((int*)a) = 0; } +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); @@ -227,101 +331,187 @@ for flag in $ax_pthread_flags; do pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) + [ax_pthread_ok=yes], + []) - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = xyes; then - break; - fi + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [ac_link="$ax_pthread_2step_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [break]) + ]) + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + ]) + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + + + # Various other checks: -if test "x$ax_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $attr; return attr /* ; */])], - [attr_name=$attr; break], - []) - done - AC_MSG_RESULT([$attr_name]) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case ${host_os} in - aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; - osf* | hpux*) flag="-D_REENTRANT";; - solaris*) - if test "$GCC" = "yes"; then - flag="-D_REENTRANT" - else - # TODO: What about Clang on Solaris? - flag="-mt -D_REENTRANT" - fi - ;; - esac - AC_MSG_RESULT([$flag]) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi + AC_CACHE_CHECK([for joinable pthread attribute], + [ax_cv_PTHREAD_JOINABLE_ATTR], + [ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $ax_pthread_attr; return attr /* ; */])], + [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], + []) + done + ]) + AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"], + [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], + [$ax_cv_PTHREAD_JOINABLE_ATTR], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + ax_pthread_joinable_attr_defined=yes + ]) + + AC_CACHE_CHECK([whether more special flags are required for pthreads], + [ax_cv_PTHREAD_SPECIAL_FLAGS], + [ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + ]) + AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"], + [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes]) AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) + [ax_cv_PTHREAD_PRIO_INHERIT], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT; + return i;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) + ax_pthread_prio_inherit_defined=yes + ]) - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant - if test "x$GCC" != xyes; then + if test "x$GCC" != "xyes"; then case $host_os in aix*) AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], - [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [ + AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) + AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) + ], + [ + AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) + AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) + ] + ) + ]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) +AC_SUBST([PTHREAD_CXX]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$ax_pthread_ok" = xyes; then +if test "x$ax_pthread_ok" = "xyes"; then ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else diff --git a/contrib/unbound/cachedb/cachedb.c b/contrib/unbound/cachedb/cachedb.c index b912be8ed54f..95ac28904693 100644 --- a/contrib/unbound/cachedb/cachedb.c +++ b/contrib/unbound/cachedb/cachedb.c @@ -50,6 +50,8 @@ #include "util/data/msgreply.h" #include "util/data/msgencode.h" #include "services/cache/dns.h" +#include "services/mesh.h" *** 83295 LINES SKIPPED *** From nobody Mon May 20 20:41:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjqHR5wyqz5LPcH; Mon, 20 May 2024 20:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjqHR48Lnz4ScT; Mon, 20 May 2024 20:41:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XxCdL/p5k1l1rRFthgtZTnMBRNl2zD48FRLQRzHfT3E=; b=XPs2Cged7JTdQIY4R2httd25RUDT4SWS1DJGqHeS1MNQm2zjuW5/Js34T60+Tiwwlgaffx 4P9NXHVHT1elB4bsAECjKI1VvRU/NXyJHFORq7nZkxp4DG4kg+EGeJ/SQUBFgFwrOQ6AsI 38nJkftsvBu+9mOngZtbxW/8IhJKiBlFfV+5XkvrPztQ9CFMI+k08AZ0p2slIU2QSeKazb WxuE6K/hiAYHX4pRBkcMkaIbWwZdFUSusV4S3qxfpg00tQL/+bjzrM35TIhxnXu+73nwIH K8miWPs4jbmGc96vQhjR9LQzRMqheRXafC+l+O4L1f7U/6KZCMcLARz9DRqsOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716237715; a=rsa-sha256; cv=none; b=rO9IOgwXaSjN3/43d5paPt87niB04N36jcJG2YUb0kA8xZN6B1HNBWw4EurxiQDepp5/Ql LC4cV62tM4XM+QpReI5anbUbXvzxPy7Ww+U1pr/Q82IkLwwwWc5TajRzKbbLndwlk41qHh DPgwz9aGhsKu4ckA+X0oUPKFKqU6r+QjGjpJZFdIyhSzTg0FaDwkHfXOovTnnRZIuaSTtJ cxlqARY2KPhROm3pAXaiJOrjdhMhgaJvjapswnCAJ1C1thZm29MUQ0vULEzbLPdgVwEKGP hpGSCoqBALpkED+KagVm4bSPlI+6xdZf6NmUZa4wgjUoAXZ5CIzjgm+LAnl0tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716237715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XxCdL/p5k1l1rRFthgtZTnMBRNl2zD48FRLQRzHfT3E=; b=OIBHNCPkIrsyNennq4sGMaIbptq7PbDR+xrfnPMLsePo9NyPWuIp8+2QU1lQP0IccrjLre v0rwK4WrUmuEfEunvb31d3aQ8TbMjxQa82smpowzYZ/HraTjo9tCaWRCoXcGaY8aUyJnIx v3wCYatwF+ntSGEOZu1VTWJD70YC78/oAlTA26D+hpfW0Gu/Yjk0l9z7c4B3JrQQBilS4y FS9aNWDKGM339r+gYtWzsMAFNhKS0bK3dfzbvTAzlcHUw5Bjqt6x4P1M1n7TKH8U+jyTHs SQ+xtSObO8doOsHrPdK/Fhr9IDr+nN3DTe6wXHx3rHU/J2Ob5R2we/sYDzeriw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjqHR3lJSzsy8; Mon, 20 May 2024 20:41:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KKftdw073556; Mon, 20 May 2024 20:41:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KKfsFV073553; Mon, 20 May 2024 20:41:54 GMT (envelope-from git) Date: Mon, 20 May 2024 20:41:54 GMT Message-Id: <202405202041.44KKfsFV073553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 7a2bb28f8e6d - stable/14 - unbound: Vendor import 1.20.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a2bb28f8e6d85ab82712d0f37261f388fbf7775 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7a2bb28f8e6d85ab82712d0f37261f388fbf7775 commit 7a2bb28f8e6d85ab82712d0f37261f388fbf7775 Author: Cy Schubert AuthorDate: 2024-05-10 20:56:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-20 20:39:57 +0000 unbound: Vendor import 1.20.0 Release notes at https://www.nlnetlabs.nl/news/2024/May/08/unbound-1.20.0-released/ Security: The DNSBomb vulnerability CVE-2024-33655 Merge commit 'c2a80056864d6eda0398fd127dc0ae515b39752b' into main (cherry picked from commit 335c7cda12138f2aefa41fb739707612cc12a9be) --- contrib/unbound/Makefile.in | 16 +- contrib/unbound/{ac_pkg_swig.m4 => ax_pkg_swig.m4} | 110 +- contrib/unbound/ax_pthread.m4 | 444 +- contrib/unbound/cachedb/cachedb.c | 133 +- contrib/unbound/cachedb/cachedb.h | 16 + contrib/unbound/config.h.in | 105 +- contrib/unbound/configure | 12872 +++++---- contrib/unbound/configure.ac | 16 +- contrib/unbound/configure~ | 26616 +++++++++++++++++++ contrib/unbound/contrib/rc_d_unbound | 9 + contrib/unbound/contrib/unbound.init | 1 + contrib/unbound/contrib/unbound.init_fedora | 1 + contrib/unbound/contrib/unbound.init_yocto | 1 + contrib/unbound/daemon/cachedump.c | 23 +- contrib/unbound/daemon/daemon.c | 26 +- contrib/unbound/daemon/remote.c | 130 +- contrib/unbound/daemon/unbound.c | 39 +- contrib/unbound/daemon/worker.c | 35 +- contrib/unbound/doc/Changelog | 187 +- contrib/unbound/doc/README | 2 +- contrib/unbound/doc/example.conf.in | 28 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 6 +- contrib/unbound/doc/unbound-control.8.in | 8 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 72 +- contrib/unbound/doc/unbound.doxygen | 2931 +- contrib/unbound/edns-subnet/subnetmod.c | 40 +- contrib/unbound/iterator/iter_fwd.c | 119 +- contrib/unbound/iterator/iter_fwd.h | 60 +- contrib/unbound/iterator/iter_hints.c | 95 +- contrib/unbound/iterator/iter_hints.h | 54 +- contrib/unbound/iterator/iter_utils.c | 62 +- contrib/unbound/iterator/iter_utils.h | 6 +- contrib/unbound/iterator/iterator.c | 295 +- contrib/unbound/libunbound/context.c | 8 + contrib/unbound/libunbound/libunbound.c | 5 + contrib/unbound/libunbound/libworker.c | 21 +- contrib/unbound/services/authzone.c | 10 + contrib/unbound/services/cache/dns.c | 52 +- contrib/unbound/services/cache/infra.c | 170 +- contrib/unbound/services/cache/infra.h | 28 + contrib/unbound/services/cache/rrset.c | 87 + contrib/unbound/services/cache/rrset.h | 31 + contrib/unbound/services/listen_dnsport.c | 51 +- contrib/unbound/services/listen_dnsport.h | 8 +- contrib/unbound/services/localzone.c | 6 +- contrib/unbound/services/mesh.c | 106 +- contrib/unbound/services/mesh.h | 6 + contrib/unbound/services/rpz.c | 342 +- contrib/unbound/services/rpz.h | 8 + contrib/unbound/services/view.h | 3 +- contrib/unbound/smallapp/unbound-anchor.c | 70 +- contrib/unbound/smallapp/unbound-checkconf.c | 13 +- contrib/unbound/smallapp/unbound-control.c | 5 +- contrib/unbound/testdata/cachedb_expired.crpl | 324 + .../testdata/cachedb_expired_client_timeout.crpl | 343 + .../testdata/cachedb_expired_reply_ttl.crpl | 259 + .../unbound/testdata/cachedb_subnet_change.crpl | 304 + .../unbound/testdata/cachedb_subnet_expired.crpl | 322 + .../testdata/cachedb_subnet_toecs_timeout.crpl | 229 + contrib/unbound/testdata/iter_dname_ttl.rpl | 39 - .../testdata/iter_ghost_grandchild_delegation.rpl | 256 + contrib/unbound/testdata/local_cnameother.rpl | 67 + contrib/unbound/testdata/rpz_clientip_override.rpl | 269 + contrib/unbound/testdata/rpz_cname_handle.rpl | 779 + contrib/unbound/testdata/rpz_nsdname_override.rpl | 325 + contrib/unbound/testdata/rpz_nsip_override.rpl | 332 + contrib/unbound/testdata/rpz_passthru_clientip.rpl | 90 + contrib/unbound/testdata/rpz_qtype_cname.rpl | 120 + .../testdata/rpz_reload.tdir/example.org.zone | 2 + .../testdata/rpz_reload.tdir/rpz.example.com.zone | 6 + .../testdata/rpz_reload.tdir/rpz_reload.conf | 30 + .../testdata/rpz_reload.tdir/rpz_reload.dsc | 16 + .../testdata/rpz_reload.tdir/rpz_reload.post | 12 + .../testdata/rpz_reload.tdir/rpz_reload.pre | 26 + .../testdata/rpz_reload.tdir/rpz_reload.test | 109 + contrib/unbound/testdata/subnet_cached_size.crpl | 308 + contrib/unbound/testdata/ttl_max_negative.rpl | 206 + contrib/unbound/testdata/ttl_min_negative.rpl | 204 + contrib/unbound/testdata/val_cnameqtype_qmin.rpl | 784 + contrib/unbound/testdata/val_dnameqtype.rpl | 689 + contrib/unbound/testdata/val_dnameqtype_qmin.rpl | 859 + contrib/unbound/util/config_file.c | 39 + contrib/unbound/util/config_file.h | 19 + contrib/unbound/util/configlexer.c | 8195 +++--- contrib/unbound/util/configlexer.lex | 7 + contrib/unbound/util/configparser.c | 4502 ++-- contrib/unbound/util/configparser.h | 508 +- contrib/unbound/util/configparser.y | 83 +- contrib/unbound/util/data/msgparse.h | 2 + contrib/unbound/util/data/msgreply.c | 33 +- contrib/unbound/util/module.c | 11 +- contrib/unbound/util/module.h | 18 +- contrib/unbound/util/net_help.c | 36 +- contrib/unbound/util/netevent.c | 8 +- contrib/unbound/util/netevent.h | 2 + contrib/unbound/util/storage/lookup3.c | 2 +- contrib/unbound/util/storage/lruhash.c | 34 + contrib/unbound/util/storage/lruhash.h | 11 + contrib/unbound/util/storage/slabhash.c | 7 + contrib/unbound/util/storage/slabhash.h | 12 + contrib/unbound/validator/val_utils.c | 40 +- contrib/unbound/validator/validator.c | 36 +- lib/libunbound/config.h | 6 +- 107 files changed, 53017 insertions(+), 13503 deletions(-) diff --git a/contrib/unbound/Makefile.in b/contrib/unbound/Makefile.in index 22fb75c123bd..f30ca81a84f8 100644 --- a/contrib/unbound/Makefile.in +++ b/contrib/unbound/Makefile.in @@ -1278,7 +1278,8 @@ daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/edns.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h \ - $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h + $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ @@ -1355,7 +1356,7 @@ testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/test $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h $(srcdir)/daemon/worker.h testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h @@ -1428,7 +1429,7 @@ fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/t $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/daemon/remote.h + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/daemon/remote.h $(srcdir)/util/storage/slabhash.h $(srcdir)/daemon/daemon.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ @@ -1484,7 +1485,8 @@ context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbou $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/unbound-event.h config.h $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ @@ -1496,7 +1498,8 @@ libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbou $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h + $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ @@ -1510,8 +1513,7 @@ libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/li $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \ $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/str2wire.h + $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/str2wire.h unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \ diff --git a/contrib/unbound/ac_pkg_swig.m4 b/contrib/unbound/ax_pkg_swig.m4 similarity index 55% rename from contrib/unbound/ac_pkg_swig.m4 rename to contrib/unbound/ax_pkg_swig.m4 index 87f99fb2fe98..7a4196ff5dff 100644 --- a/contrib/unbound/ac_pkg_swig.m4 +++ b/contrib/unbound/ax_pkg_swig.m4 @@ -1,39 +1,43 @@ # =========================================================================== -# http://autoconf-archive.cryp.to/ac_pkg_swig.html +# https://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html # =========================================================================== # # SYNOPSIS # -# AC_PROG_SWIG([major.minor.micro]) +# AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found]) # # DESCRIPTION # -# This macro searches for a SWIG installation on your system. If found you -# should call SWIG via $(SWIG). You can use the optional first argument to -# check if the version of the available SWIG is greater than or equal to -# the value of the argument. It should have the format: N[.N[.N]] (N is a -# number between 0 and 999. Only the first N is mandatory.) +# This macro searches for a SWIG installation on your system. If found, +# then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is +# found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd. # -# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that -# the swig package is this version number or higher. +# You can use the optional first argument to check if the version of the +# available SWIG is greater than or equal to the value of the argument. It +# should have the format: N[.N[.N]] (N is a number between 0 and 999. Only +# the first N is mandatory.) If the version argument is given (e.g. +# 1.3.17), AX_PKG_SWIG checks that the swig package is this version number +# or higher. # -# In configure.in, use as: -# -# AC_PROG_SWIG(1.3.17) -# SWIG_ENABLE_CXX -# SWIG_MULTI_MODULE_SUPPORT -# SWIG_PYTHON +# As usual, action-if-found is executed if SWIG is found, otherwise +# action-if-not-found is executed. # -# LAST MODIFICATION +# In configure.in, use as: # -# 2008-04-12 +# AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ]) +# AX_SWIG_ENABLE_CXX +# AX_SWIG_MULTI_MODULE_SUPPORT +# AX_SWIG_PYTHON # -# COPYLEFT +# LICENSE # # Copyright (c) 2008 Sebastian Huber -# Copyright (c) 2008 Alan W. Irwin +# Copyright (c) 2008 Alan W. Irwin # Copyright (c) 2008 Rafael Laboissiere -# Copyright (c) 2008 Andrew Collier +# Copyright (c) 2008 Andrew Collier +# Copyright (c) 2011 Murray Cumming +# Copyright (c) 2018 Reini Urban +# Copyright (c) 2021 Vincent Danjean # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -46,7 +50,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -57,17 +61,21 @@ # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. -AC_DEFUN([AC_PROG_SWIG],[ - AC_PATH_PROG([SWIG],[swig]) +#serial 15 + +AC_DEFUN([AX_PKG_SWIG],[ + # Find path to the "swig" executable. + AC_PATH_PROGS([SWIG],[swig swig3.0 swig2.0]) if test -z "$SWIG" ; then - AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org]) - SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' - elif test -n "$1" ; then - AC_MSG_CHECKING([for SWIG version]) + m4_ifval([$3],[$3],[:]) + elif test -z "$1" ; then + m4_ifval([$2],[$2],[:]) + else + AC_MSG_CHECKING([SWIG version]) [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] AC_MSG_RESULT([$swig_version]) if test -n "$swig_version" ; then @@ -77,12 +85,12 @@ AC_DEFUN([AC_PROG_SWIG],[ if test -z "$required_major" ; then [required_major=0] fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`] [required_minor=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_minor" ; then [required_minor=0] fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`] [required_patch=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_patch" ; then [required_patch=0] @@ -103,30 +111,28 @@ AC_DEFUN([AC_PROG_SWIG],[ if test -z "$available_patch" ; then [available_patch=0] fi - [badversion=0] - if test $available_major -lt $required_major ; then - [badversion=1] - fi - if test $available_major -eq $required_major \ - -a $available_minor -lt $required_minor ; then - [badversion=1] - fi - if test $available_major -eq $required_major \ - -a $available_minor -eq $required_minor \ - -a $available_patch -lt $required_patch ; then - [badversion=1] - fi - if test $badversion -eq 1 ; then - AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org]) - SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' + # Convert the version tuple into a single number for easier comparison. + # Using base 100 should be safe since SWIG internally uses BCD values + # to encode its version number. + required_swig_vernum=`expr $required_major \* 10000 \ + \+ $required_minor \* 100 \+ $required_patch` + available_swig_vernum=`expr $available_major \* 10000 \ + \+ $available_minor \* 100 \+ $available_patch` + + if test $available_swig_vernum -lt $required_swig_vernum; then + AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version.]) + SWIG='' + m4_ifval([$3],[$3],[]) else - AC_MSG_NOTICE([SWIG executable is '$SWIG']) - SWIG_LIB=`$SWIG -swiglib` - AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB']) + AC_MSG_CHECKING([for SWIG library]) + SWIG_LIB=`$SWIG -swiglib | tr '\r\n' ' '` + AC_MSG_RESULT([$SWIG_LIB]) + m4_ifval([$2],[$2],[]) fi else AC_MSG_WARN([cannot determine SWIG version]) - SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' + SWIG='' + m4_ifval([$3],[$3],[]) fi fi AC_SUBST([SWIG_LIB]) diff --git a/contrib/unbound/ax_pthread.m4 b/contrib/unbound/ax_pthread.m4 index ff7d2a67e11f..9f35d139149f 100644 --- a/contrib/unbound/ax_pthread.m4 +++ b/contrib/unbound/ax_pthread.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# https://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS @@ -14,24 +14,28 @@ # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) +# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is +# needed for multi-threaded programs (defaults to the value of CC +# respectively CXX otherwise). (This is necessary on e.g. AIX to use the +# special cc_r/CC_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with +# but also to link with them as well. For example, you might link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # -# If you are only building threads programs, you may wish to use these +# If you are only building threaded programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" +# CXX="$PTHREAD_CXX" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with @@ -55,6 +59,7 @@ # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. +# Copyright (c) 2019 Marc Stevens # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -67,7 +72,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -82,35 +87,41 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 21 +#serial 31 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). +# requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) + AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) AC_MSG_RESULT([$ax_pthread_ok]) - if test x"$ax_pthread_ok" = xno; then + if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different @@ -118,12 +129,14 @@ fi # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. -ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: @@ -132,82 +145,163 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case ${host_os} in +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], + [ +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + ], + [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) + ;; + solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" + ;; +esac + +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC + +AS_IF([test "x$GCC" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) + +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + +AS_IF([test "x$ax_pthread_clang" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread"]) - ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" ;; - darwin*) - ax_pthread_flags="-pthread $ax_pthread_flags" + aix*) + ax_pthread_check_macro="_THREAD_SAFE" ;; -esac -# Clang doesn't consider unrecognized options an error unless we specify -# -Werror. We throw in some extra Clang-specific options to ensure that -# this doesn't happen for GCC, which also accepts -Werror. + *) + ax_pthread_check_macro="--" + ;; +esac +AS_IF([test "x$ax_pthread_check_macro" = "x--"], + [ax_pthread_check_cond=0], + [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) -AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) -save_CFLAGS="$CFLAGS" -ax_pthread_extra_flags="-Werror" -CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], - [AC_MSG_RESULT([yes])], - [ax_pthread_extra_flags= - AC_MSG_RESULT([no])]) -CFLAGS="$save_CFLAGS" -if test x"$ax_pthread_ok" = xno; then -for flag in $ax_pthread_flags; do +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do - case $flag in + case $ax_pthread_try_flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) + ;; + -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - if test x"$ax_pthread_config" = xno; then continue; fi + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we @@ -218,8 +312,18 @@ for flag in $ax_pthread_flags; do # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include - static void routine(void *a) { *((int*)a) = 0; } +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); @@ -227,101 +331,187 @@ for flag in $ax_pthread_flags; do pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) + [ax_pthread_ok=yes], + []) - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = xyes; then - break; - fi + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [ac_link="$ax_pthread_2step_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [break]) + ]) + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + ]) + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + + + # Various other checks: -if test "x$ax_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $attr; return attr /* ; */])], - [attr_name=$attr; break], - []) - done - AC_MSG_RESULT([$attr_name]) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case ${host_os} in - aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; - osf* | hpux*) flag="-D_REENTRANT";; - solaris*) - if test "$GCC" = "yes"; then - flag="-D_REENTRANT" - else - # TODO: What about Clang on Solaris? - flag="-mt -D_REENTRANT" - fi - ;; - esac - AC_MSG_RESULT([$flag]) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi + AC_CACHE_CHECK([for joinable pthread attribute], + [ax_cv_PTHREAD_JOINABLE_ATTR], + [ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $ax_pthread_attr; return attr /* ; */])], + [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], + []) + done + ]) + AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"], + [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], + [$ax_cv_PTHREAD_JOINABLE_ATTR], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + ax_pthread_joinable_attr_defined=yes + ]) + + AC_CACHE_CHECK([whether more special flags are required for pthreads], + [ax_cv_PTHREAD_SPECIAL_FLAGS], + [ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + ]) + AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"], + [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes]) AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) + [ax_cv_PTHREAD_PRIO_INHERIT], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT; + return i;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) + ax_pthread_prio_inherit_defined=yes + ]) - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant - if test "x$GCC" != xyes; then + if test "x$GCC" != "xyes"; then case $host_os in aix*) AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], - [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [ + AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) + AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) + ], + [ + AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) + AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) + ] + ) + ]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) +AC_SUBST([PTHREAD_CXX]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$ax_pthread_ok" = xyes; then +if test "x$ax_pthread_ok" = "xyes"; then ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else diff --git a/contrib/unbound/cachedb/cachedb.c b/contrib/unbound/cachedb/cachedb.c index b912be8ed54f..95ac28904693 100644 --- a/contrib/unbound/cachedb/cachedb.c +++ b/contrib/unbound/cachedb/cachedb.c @@ -50,6 +50,8 @@ #include "util/data/msgreply.h" #include "util/data/msgencode.h" #include "services/cache/dns.h" +#include "services/mesh.h" *** 83295 LINES SKIPPED *** From nobody Mon May 20 21:16:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vjr362RCkz5LTfw; Mon, 20 May 2024 21:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vjr361wwCz4WNZ; Mon, 20 May 2024 21:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716239778; h=from:from:reply-to:subject:subject: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+Nt9HRV6ytAzUrxpDqcHr0jYaleHpSuI4qPvgVTNns=; b=UzgXf5u+qQn+CoPlpnB59d5P1SMmRQS0osj3Mmrh/w5384czBGIbnlv32YinyKLESyxK7+ RM3zYUZhKQe7H8LpRwhaj9DjpKj9GU5QqXgU8NeSUsRgzMhu4x0RrQqVjym+7joi99P83l o5v1eGbtQibWW/EheQaLIc1TkysvBb0nj5fdHV5uI3UQpNH2kv0N5dbGmRGWqSeLfay7Ay TimZQrpfgJMRNkZIOyphz0DNuqjogyvEWb9oUGTyl9Od6uYPOTwajcIxUB69gWCVT+DZ1o 4kz3YTig7E2r3VpB/fMpUWGfyZhEGUY4OIUBzTnyyKXMe8svCmq4BX1zuB34lQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716239778; a=rsa-sha256; cv=none; b=xzqfqd8eVk/1XrFwLQT3/B+Nk1l1PC45vRDV8HZDd8ey2QRnYR7+nIcR/8u30Twnj1Qdro 34+Vp4VF58TAZkzJvMd/8ecZED0wLuzF0Fn4WP8XTmgB1h2wWmLmMcpukheZEqwft1WbWj g3ScaRB5EWvazKawBc15FaQXzMQNAOrzawqffNzenw/ws4Va2QD55h7qhzTzzRNTXJRLmd PwPuNv/0go4pI3wUGlif0ps0BmG0tnvmwxpi0pLbqgAHi3OCC4t6f3A1SxpyiaUYPQZ4LA AvkNQ38o8D4564Ih2DltfA284Hm/2Jx5jXMIvPXRHJ4ROxmVrUUEbH9oPtOUbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716239778; h=from:from:reply-to:subject:subject: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+Nt9HRV6ytAzUrxpDqcHr0jYaleHpSuI4qPvgVTNns=; b=JpwTRABv+JHS9OWsuv5kdtxTwMhNhWZfdje2PiVgnQcd2rRz7YZjMECCrOh4S6XNlIx4Fl /drLCCjYWQGO5/WZAZz6qPKvMOTsg4XrZN9zQIa2cTyUGfY7PPVvhTNKf0y9ckpiFncyxb pCr5qbkpDp460HBbq9fnCuLcyg+4GFnmMMD6CHJtLEBO4yZci4ZoVbIYPMZRU051rXxlhQ NhTkoN+s+QLKNmcAOFvvHXpji/BZPUR2fCCWsVTDos13XxMp4EzuUBZK0aaffRAFxkJDuL vfxnFIruKVXQWtgTNwmraT8HeQ6bJC/TVeKgmPQFcTUVmYMpIIypvHuh/uN+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 4Vjr361QnXztq3; Mon, 20 May 2024 21:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KLGI4h025517; Mon, 20 May 2024 21:16:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KLGIut025514; Mon, 20 May 2024 21:16:18 GMT (envelope-from git) Date: Mon, 20 May 2024 21:16:18 GMT Message-Id: <202405202116.44KLGIut025514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 7ad17751074c - stable/14 - msun/riscv: expose fe{disable,enable}except List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7ad17751074ca79a89ca503f5ac647819579e858 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=7ad17751074ca79a89ca503f5ac647819579e858 commit 7ad17751074ca79a89ca503f5ac647819579e858 Author: Brooks Davis AuthorDate: 2024-03-21 23:45:53 +0000 Commit: Brooks Davis CommitDate: 2024-05-20 20:49:06 +0000 msun/riscv: expose fe{disable,enable}except This is required for GCC to build. PR: 272759 Reported by: dgilbert@eicat.ca Submitted by: jrtc27 Differential Revision: https://reviews.freebsd.org/D44333 (cherry picked from commit 1947a9383ec3a048e334022365aa199a6ae55289) --- lib/msun/riscv/Symbol.map | 10 ++++------ lib/msun/riscv/fenv.h | 7 +++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/msun/riscv/Symbol.map b/lib/msun/riscv/Symbol.map index 2bc6215688bb..c3d72443cb2c 100644 --- a/lib/msun/riscv/Symbol.map +++ b/lib/msun/riscv/Symbol.map @@ -1,15 +1,13 @@ -/* - */ -FBSD_1.0 { -}; - FBSD_1.3 { fesetexceptflag; feraiseexcept; fegetenv; feholdexcept; feupdateenv; + fegetexcept; +}; + +FBSD_1.8 { feenableexcept; fedisableexcept; - fegetexcept; }; diff --git a/lib/msun/riscv/fenv.h b/lib/msun/riscv/fenv.h index 1971e976645c..36abb7b00b7d 100644 --- a/lib/msun/riscv/fenv.h +++ b/lib/msun/riscv/fenv.h @@ -216,14 +216,12 @@ feupdateenv(const fenv_t *__envp) #if __BSD_VISIBLE -/* We currently provide no external definitions of the functions below. */ - #ifdef __riscv_float_abi_soft int feenableexcept(int __mask); int fedisableexcept(int __mask); int fegetexcept(void); #else -static inline int +__fenv_static inline int feenableexcept(int __mask __unused) { @@ -232,7 +230,7 @@ feenableexcept(int __mask __unused) return (0); } -static inline int +__fenv_static inline int fedisableexcept(int __mask __unused) { @@ -241,6 +239,7 @@ fedisableexcept(int __mask __unused) return (0); } +/* We currently provide no external definition of fegetexcept(). */ static inline int fegetexcept(void) { From nobody Mon May 20 22:24:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjsYX3Fycz5LcyS; Mon, 20 May 2024 22:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjsYX2nhwz4gKl; Mon, 20 May 2024 22:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716243856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HEeUKU1vJ5NZ3e13YlkMAwmpk5wSXG156ZzlpXWQeoM=; b=ZPAkk502p+HMFEgTcIhdcm9HaNmHUkE9DW+QHFkM8qL52j+t/O/0I1kS4R1ayotbKEvaiA QYA9QM93Jm2z3p+MgoGUYFCy2r8i1GM7VLRfyQ2pF8SjN6pl4KOFtjxzJ52/TNcy7wBmjv EWRIzoLXaueZpL7Kz2ly6sy1ziDfdhbvEsud3Jdr+ABINNl1tQpJF4s+zCx5RPtLuKSR/5 HpXMzSZL6rHQYW6I1MAe6IBAlH+tx33NBP4Pgf2s6ewLwaMkVXO6/yKgrUlMmX7mB2iX9z OtJPidQ3gdPvyMi/zrpcsvcR5U51IB8dv/dbN3ozOU1LUIjztIr18yPU6ULy3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716243856; a=rsa-sha256; cv=none; b=Px6OSiH0ahwHdbpVIMN27kfn7YDOlHhUZ/nYr8UUDU3hG+esBGp27q5KdEfp4MJcRHyfMJ 8uxQ6QnFO6euoKm3vHmYj57kET2OQ7xhmT5kMQNbBj5u++BcUQNiLwW+2N89PX+US4cbT7 SR7eAU27VKRDFiEmJ51kMtSxX8FZ/5mwlwEycCLV4Vtuxz22FbpftRkckFIbj87ioq9zp6 PYGveUHWqfEXwnu/vIjvpstXqg5Flvxv9e0NF0hmPy/SrmYWnQYDsaV+Voeq/PESqvmRdY /ztzbsyoOD5QyokmCXTbUygmcqNPUKsBcOq2lkoHY8zIMmwhPiLy3MMZ1AqmwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716243856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HEeUKU1vJ5NZ3e13YlkMAwmpk5wSXG156ZzlpXWQeoM=; b=GgMoC6cXepdSbS1YBqWI/+ZbKTWP4z+JewadzOHuiDLgf6tIxQ+brF1MmPSDIpD4iigN56 vzMuktzO0x0cIJm1YZlZD4/lOBoE4sVJdqoPb+6w+FIgbTF0WNledazxQvaPkLp07ZlC0I sffS9MLa0kxMiCWBkytdwetaZHpw0LG2MdyTTaXUFr3CHdr96MHzTZ3UdqXdUxsUx38WyL WguJSG+i9AUdBRHCziN0rq81TiyFIGRLJ3FYFi2B+q9tJQk6QI7q48sKMByXUR09Fqwq2o mFb+BgyfjE4/GDg/qa7vGRI8gQwrvnDSceF8AyVL4/9IwaAOGqY6jjekBBDowg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjsYX2PlPzwrj; Mon, 20 May 2024 22:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44KMOGn0044559; Mon, 20 May 2024 22:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44KMOGxt044556; Mon, 20 May 2024 22:24:16 GMT (envelope-from git) Date: Mon, 20 May 2024 22:24:16 GMT Message-Id: <202405202224.44KMOGxt044556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 07f986601620 - releng/14.1 - msun/riscv: expose fe{disable,enable}except List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 07f986601620e6edee11a7000af681c1cc135403 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=07f986601620e6edee11a7000af681c1cc135403 commit 07f986601620e6edee11a7000af681c1cc135403 Author: Brooks Davis AuthorDate: 2024-03-21 23:45:53 +0000 Commit: Brooks Davis CommitDate: 2024-05-20 22:23:30 +0000 msun/riscv: expose fe{disable,enable}except This is required for GCC to build. PR: 272759 Reported by: dgilbert@eicat.ca Approved by: re (cperciva) Submitted by: jrtc27 Differential Revision: https://reviews.freebsd.org/D44333 (cherry picked from commit 1947a9383ec3a048e334022365aa199a6ae55289) (cherry picked from commit 7ad17751074ca79a89ca503f5ac647819579e858) --- lib/msun/riscv/Symbol.map | 10 ++++------ lib/msun/riscv/fenv.h | 7 +++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/msun/riscv/Symbol.map b/lib/msun/riscv/Symbol.map index 2bc6215688bb..c3d72443cb2c 100644 --- a/lib/msun/riscv/Symbol.map +++ b/lib/msun/riscv/Symbol.map @@ -1,15 +1,13 @@ -/* - */ -FBSD_1.0 { -}; - FBSD_1.3 { fesetexceptflag; feraiseexcept; fegetenv; feholdexcept; feupdateenv; + fegetexcept; +}; + +FBSD_1.8 { feenableexcept; fedisableexcept; - fegetexcept; }; diff --git a/lib/msun/riscv/fenv.h b/lib/msun/riscv/fenv.h index 1971e976645c..36abb7b00b7d 100644 --- a/lib/msun/riscv/fenv.h +++ b/lib/msun/riscv/fenv.h @@ -216,14 +216,12 @@ feupdateenv(const fenv_t *__envp) #if __BSD_VISIBLE -/* We currently provide no external definitions of the functions below. */ - #ifdef __riscv_float_abi_soft int feenableexcept(int __mask); int fedisableexcept(int __mask); int fegetexcept(void); #else -static inline int +__fenv_static inline int feenableexcept(int __mask __unused) { @@ -232,7 +230,7 @@ feenableexcept(int __mask __unused) return (0); } -static inline int +__fenv_static inline int fedisableexcept(int __mask __unused) { @@ -241,6 +239,7 @@ fedisableexcept(int __mask __unused) return (0); } +/* We currently provide no external definition of fegetexcept(). */ static inline int fegetexcept(void) { From nobody Tue May 21 00:05:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vjvnr6pFCz5LpXy; Tue, 21 May 2024 00:05: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vjvnr4LL0z4rQd; Tue, 21 May 2024 00:05:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716249904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9Jcu3iIDnptLij/DCf4rB/aU0zkU8pkFrrX4yDqvu8=; b=o+UpIpgAzXIkj6u9RrqTmYRR5yREAZz9WOnuenBmOXcy/LTPme1fWjjnK/g1aA5msvdcwe eUP177lJ/71NQXM8XsuPEux6YhwpP051FyTGp4a6w+zqIhOiISlBHe+intwE6pWQaOiAEb agdDVMsY8q9e49BHYrKGWz8x4FIPjsO/HaXnCbJvU8YhGgtvz7CtsPRLY/G5iAKpcRc0rA bYU/qxoJjtg09D6J22+huyLBwABnC1mmQd7T1m+UwLXASxpfc6aH49whUuAvSEENmum1Lm IkJu16jP1QT1UcCm/9ZWvHFzCXFHCStrV5CCAFI6+8iPpcErSjoEbtfv9Mhhgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716249904; a=rsa-sha256; cv=none; b=M5LCaP8IIyOHkT+bmrCu7z1/onpCKHM1drVAO989F0/FUvEYJvP0u1M1eu5N6FQlBA0Grq feAuuwX5KLAENb/iT9suBmi0FTfuKcf7eBCuQi1eSQnItgRz7Qv2LrmXSFZYWW6QzSP1Mo TEnjQ4+Emn2VPrephQRb2tauBe4E5YJpS3lsnwx+s4rlDcYAWX8dZ7HWBz1/M+crRzSQgi W16huCJxP16NwGpNq0uMzF/liki5+arLytW/FoibBf8dxLhaHfwA0ApE9Xv4muRpNeRsV0 ir82VTAcgUZPJhymSKYVZToS+/lI06OBEkIiycVLpnBjRZxetyZMqtYY5ZWpyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716249904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9Jcu3iIDnptLij/DCf4rB/aU0zkU8pkFrrX4yDqvu8=; b=ahztL0upWtz7XmxwPWiWJu/+BIX7BEALqQIP3/NSFK1V9FI9IIGpPnBV5cFUcIRXNGwdwY oh2mao6krqHRIyJX5zlxN20Js8LIH2vQIA4alevpbSoMoxegyLmU7GAjSNW0hl7jbRSrCh tWMlMtEMwhN+YxPYCkStDlY4s4olbbupUAmRsy3995rszjaQF46tpkS/c450A+xh9rTpHW Du76pcUigIxDZEJrYHeqVdG3p714RbEHFlArzPWuIYRFc1ydouwSb0RKmFmls0smhUt/GG uhYt5FFNlHXCFjwtK24rMlOTBxSU/TI+G39ZuOYD0hUezB64OuTKdzaZEfKlcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vjvnr3xsmz10DS; Tue, 21 May 2024 00:05:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L054vO013413; Tue, 21 May 2024 00:05:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L054hg013410; Tue, 21 May 2024 00:05:04 GMT (envelope-from git) Date: Tue, 21 May 2024 00:05:04 GMT Message-Id: <202405210005.44L054hg013410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 364133901a8d - stable/13 - msun/riscv: expose fe{disable,enable}except List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 364133901a8dcd228e975e88ded0c3f624992150 Auto-Submitted: auto-generated The branch stable/13 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=364133901a8dcd228e975e88ded0c3f624992150 commit 364133901a8dcd228e975e88ded0c3f624992150 Author: Brooks Davis AuthorDate: 2024-03-21 23:45:53 +0000 Commit: Brooks Davis CommitDate: 2024-05-20 22:26:02 +0000 msun/riscv: expose fe{disable,enable}except This is required for GCC to build. PR: 272759 Reported by: dgilbert@eicat.ca Submitted by: jrtc27 Differential Revision: https://reviews.freebsd.org/D44333 (cherry picked from commit 1947a9383ec3a048e334022365aa199a6ae55289) --- lib/msun/riscv/Symbol.map | 10 ++++------ lib/msun/riscv/fenv.h | 7 +++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/msun/riscv/Symbol.map b/lib/msun/riscv/Symbol.map index 2bc6215688bb..c3d72443cb2c 100644 --- a/lib/msun/riscv/Symbol.map +++ b/lib/msun/riscv/Symbol.map @@ -1,15 +1,13 @@ -/* - */ -FBSD_1.0 { -}; - FBSD_1.3 { fesetexceptflag; feraiseexcept; fegetenv; feholdexcept; feupdateenv; + fegetexcept; +}; + +FBSD_1.8 { feenableexcept; fedisableexcept; - fegetexcept; }; diff --git a/lib/msun/riscv/fenv.h b/lib/msun/riscv/fenv.h index 1971e976645c..36abb7b00b7d 100644 --- a/lib/msun/riscv/fenv.h +++ b/lib/msun/riscv/fenv.h @@ -216,14 +216,12 @@ feupdateenv(const fenv_t *__envp) #if __BSD_VISIBLE -/* We currently provide no external definitions of the functions below. */ - #ifdef __riscv_float_abi_soft int feenableexcept(int __mask); int fedisableexcept(int __mask); int fegetexcept(void); #else -static inline int +__fenv_static inline int feenableexcept(int __mask __unused) { @@ -232,7 +230,7 @@ feenableexcept(int __mask __unused) return (0); } -static inline int +__fenv_static inline int fedisableexcept(int __mask __unused) { @@ -241,6 +239,7 @@ fedisableexcept(int __mask __unused) return (0); } +/* We currently provide no external definition of fegetexcept(). */ static inline int fegetexcept(void) { From nobody Tue May 21 02:46:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjzN72blgz5Kgdr; Tue, 21 May 2024 02:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjzN7260jz58bL; Tue, 21 May 2024 02:46:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SVls2LDqjIE/FSlYCVXlSfU97Jsbuz1rG8C4aXvH1PY=; b=XwQCEK3eBw41rI2YQSUKK2f0p796rwmRJCWKnldwfeLiO7mJoTgtDyQz/exWMh7FRfDH7q PHHL9rtVTX1FRHf9qm0/tGzvdUdOs5/+Wn+OrWncy6Z9Q7EBEjAqXUkg1vNkm3kIHEGUik Q08k6aywcViRVNtZdREEarFzFPdcj1KOXSXbeOwH+V4gcOrizd9V1iUFLu+mUJX6oCnWjA l7uTY9y4GUwRvU17G61m4PAgktvjbjGf6An+hobvxzmN73pbTDvcQe9zaT5fUOeKiHWK9r 8IW1IXMIHbOVIL1jT3rxUHFN15bp0WnQiA3RIf1FDZwAfVmDcek2Aawb6bcFMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716259591; a=rsa-sha256; cv=none; b=prZP3cOTS/yBtbl9J4oAaOOE0bjmO5S8aqKlFqqEi9Oh5hcqjnxQX3ZAzncqwjksE28TnI xMK7NXqjJZ5DpOFSgSHs/7iJXgdgzf431nn5Jorg3azwcPLvxvNtp2enPw1hzpDoWPLqoq IdJ0THQEQaAO3R3CnjENzK+na/+eF7N4+CZoZ/0hkCbHs3+jFa1FASLcRnJuouChP2TC2U FnPvDd323/GqEYsTHeO1cQViN40JoaczufjG1awJgsaBZjkzgK1sajLgtcWr0C2C6jj66S XsJeiGCRy+/2EqaiuiabL4iDFNUxgTgqIzDw352vdkiIrt2/3a4DzFYq3F1P7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SVls2LDqjIE/FSlYCVXlSfU97Jsbuz1rG8C4aXvH1PY=; b=qLUO5OVkrobY6eizT3H/SUQcM7egmFHK1gr9vzBql05XG1v47FWRXdSeYvNaMzVcN6+izw eZer0uKoON6cqQ/t0WVKqYZBH8cS4tKU+yY2BCyB78Ob4FPMiO05dNA/oUdC2AOvJ4xd76 r0eIgbK9cid7FVot07yiyZVGma3vj4rvRo47jIXeRvgLJSLT/mGITa5hSbDO6LxpURystW BhlTmOcCbXdrUB6EnKKq8fIiXxHB7qYP4BknFzu4skeflxq6zHiTN4WCLGU6X5sPUtTofU RVPrtwAZvW0uMQVQH+SQixoIO6M5t4r8yf/2YQW52lFbKHJv1r2/ED5LQg4fKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjzN71Z1Sz14Cb; Tue, 21 May 2024 02:46:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L2kVN4082623; Tue, 21 May 2024 02:46:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L2kVCb082620; Tue, 21 May 2024 02:46:31 GMT (envelope-from git) Date: Tue, 21 May 2024 02:46:31 GMT Message-Id: <202405210246.44L2kVCb082620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 983aec544b03 - stable/14 - x86: Add Intel TD/HFI related MSR/CPUID defines to specialregs.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 983aec544b0300ad006b03d89c5a7f54bca06aa1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=983aec544b0300ad006b03d89c5a7f54bca06aa1 commit 983aec544b0300ad006b03d89c5a7f54bca06aa1 Author: Koine Yuusuke AuthorDate: 2024-05-06 02:17:29 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-21 02:45:59 +0000 x86: Add Intel TD/HFI related MSR/CPUID defines to specialregs.h (cherry picked from commit 338d53965d9f4bfb1a83c1bcff3ff78944ce3a9f) --- sys/x86/include/specialreg.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index 4886430c84b6..f78e04c714f0 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -347,6 +347,13 @@ /* Ecx. */ #define CPUID_PERF_STAT 0x00000001 #define CPUID_PERF_BIAS 0x00000008 +#define CPUID_PERF_TD_CLASSES 0x0000ff00 + +/* Edx. */ +#define CPUID_HF_PERFORMANCE 0x00000001 +#define CPUID_HF_EFFICIENCY 0x00000002 +#define CPUID_TD_CAPABLITIES 0x0000000f +#define CPUID_TD_TBLPAGES 0x00000f00 /* * CPUID instruction 0xb ebx info. @@ -585,6 +592,8 @@ #define MSR_TURBO_RATIO_LIMIT 0x1ad #define MSR_TURBO_RATIO_LIMIT1 0x1ae #define MSR_IA32_ENERGY_PERF_BIAS 0x1b0 +#define MSR_IA32_PKG_THERM_STATUS 0x1b1 +#define MSR_IA32_PKG_THERM_INTERRUPT 0x1b2 #define MSR_DEBUGCTLMSR 0x1d9 #define MSR_LASTBRANCHFROMIP 0x1db #define MSR_LASTBRANCHTOIP 0x1dc @@ -768,6 +777,14 @@ #define TOPA_INT (1 << 2) #define TOPA_END (1 << 0) +/* + * Intel Hardware Feedback Interface / Thread Director MSRs + */ +#define MSR_IA32_HW_FEEDBACK_PTR 0x17d0 +#define MSR_IA32_HW_FEEDBACK_CONFIG 0x17d1 +#define MSR_IA32_THREAD_FEEDBACK_CHAR 0x17d2 +#define MSR_IA32_HW_FEEDBACK_THREAD_CONFIG 0x17d4 + /* * Constants related to MSR's. */ @@ -838,6 +855,19 @@ /* MSR IA32_ENERGY_PERF_BIAS */ #define IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK (0xfULL << 0) +/* MSR IA32_HW_FEEDBACK_PTR */ +#define IA32_HW_FEEDBACK_PTR_ENABLE (0x1ULL << 0) + +/* MSR IA32_HW_FEEDBACK_CONFIG */ +#define IA32_HW_FEEDBACK_CONFIG_EN_HFI (0x1ULL << 0) +#define IA32_HW_FEEDBACK_CONFIG_EN_THDIR (0x1ULL << 1) + +/* MSR IA32_PKG_THERM_STATUS */ +#define IA32_PKG_THERM_STATUS_HFI_UPDATED (0x1ULL << 26) + +/* MSR IA32_PKG_THERM_INTERRUPT */ +#define IA32_PKG_THERM_INTERRUPT_HFI_ENABLE (0x1ULL << 25) + /* * PAT modes. */ From nobody Tue May 21 02:46:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjzN84Df3z5Kgqp; Tue, 21 May 2024 02:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjzN82hKgz58gZ; Tue, 21 May 2024 02:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2XLbhcVvkizPv6/IWMyufRCFX/NUsLcN+S8Aw0qHuJg=; b=GcTPE3stVdGyKOcQl/4sWtkhz6D0WoM6GeU1+Um1g4/wOnZyctLXTGlV2oPJtN8g3WnSte 9tOQoddTr/SRmV+TY9sKBI0jaJtEmnlseuWl6Eszs2q8Av/tEYd7YFvQBjoRIqhE80mcM8 fZ/4HVnbzYdMWkidMHhd6rJ1cV8wPUMFF4Yx0EPFLAhQGQUZud4XlwiRnbOAQyskcPvV1o xnurjOK8YAfcSv/Ktg54hxulDRFoC4VyKxBvZ4bauR3jirrjlyAcpsoit7KBkckP+NDWJU yIMCgpB6tbDt96eay+UsN2zIMqMguLDkMJYqBfI/tuw09UaYCknWiBtfQzEG1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716259592; a=rsa-sha256; cv=none; b=UtV6XLCwsgr9Qm5biNk1RPNd7EIic4kWOBBnrgDUFDPrL0zfkAolo6qmwfIOtuwPiVbVVw 3mS921MnwFSYaVpYQWGYdDWlJdHawUsUA1YBfaXqzPE9XPJkpKzIcHR25frRsFTlEKS39s LaGIhIfvwDQxHK6yLPzmyR0FluBoARsX1tRteAY+6X1LYn5v31ce29klXk9jOICAPsj5ZK Iqo43GyJg6SrBrYZvMaivgoPOKzLJjCQ4sdeBKVgpcM1DWkwnd+lwSNXPP+64OwKlv0qHt r9cDH8afZQT9qS9Xn9YG89pMHoaDuo7UgCq+3oNWXSRB5PgZLgi/bK1C5sdNVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2XLbhcVvkizPv6/IWMyufRCFX/NUsLcN+S8Aw0qHuJg=; b=tLf97SoMOODMYjjfk5RTCK2RAORdt2GGg4tt8JgLRpvjoNI9MNhbvq1H5xHc8iAwhAbbrI wy3A505gctUvv3p3+itGbOJ8GWal3B4Gsf7dt1DbHibgo1NYE3PXd0eiNmANFykjuPGJBD 2pnje0Z7V4FVZd3cBPgN2pPwTkV4SfrocnQ47ua1n60jlVb4VhODqgGj7DQVeLJyhYyhgI cyOo742R8yiNZqb3CabgJYHp3n/H5kJxz79GmLcAiA6o2V8vJ8EVaP0MvI6xoxnmdEDiWu W5XA9gzsaT5dnk6QSd6B/M13lky66QMEZOZ8KTvcllwKOBMu0kMgAmjm5fVOnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjzN82JGVz13V5; Tue, 21 May 2024 02:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L2kWBP082677; Tue, 21 May 2024 02:46:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L2kWsx082674; Tue, 21 May 2024 02:46:32 GMT (envelope-from git) Date: Tue, 21 May 2024 02:46:32 GMT Message-Id: <202405210246.44L2kWsx082674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f03a01194c11 - stable/14 - AMD CPUs: update bits and data from CPUID 0x8000_0008 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f03a01194c112d356ef0067e2b367355b8e38d07 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f03a01194c112d356ef0067e2b367355b8e38d07 commit f03a01194c112d356ef0067e2b367355b8e38d07 Author: Konstantin Belousov AuthorDate: 2024-05-13 23:02:16 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-21 02:45:59 +0000 AMD CPUs: update bits and data from CPUID 0x8000_0008 (cherry picked from commit c6113ac5a2c2bfee875979ebd40a007ef4d60069) --- sys/x86/include/specialreg.h | 17 +++++++++++++++++ sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 12 ++++++++++++ 3 files changed, 30 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index f78e04c714f0..16aa07c05e65 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -399,21 +399,31 @@ #define AMDFEID_CLZERO 0x00000001 #define AMDFEID_IRPERF 0x00000002 #define AMDFEID_XSAVEERPTR 0x00000004 +#define AMDFEID_INVLPGB 0x00000008 #define AMDFEID_RDPRU 0x00000010 +#define AMDFEID_BE 0x00000040 #define AMDFEID_MCOMMIT 0x00000100 #define AMDFEID_WBNOINVD 0x00000200 #define AMDFEID_IBPB 0x00001000 +#define AMDFEID_INT_WBINVD 0x00002000 #define AMDFEID_IBRS 0x00004000 #define AMDFEID_STIBP 0x00008000 /* The below are only defined if the corresponding base feature above exists. */ #define AMDFEID_IBRS_ALWAYSON 0x00010000 #define AMDFEID_STIBP_ALWAYSON 0x00020000 #define AMDFEID_PREFER_IBRS 0x00040000 +#define AMDFEID_SAMEMODE_IBRS 0x00080000 +#define AMDFEID_NO_LMSLE 0x00100000 +#define AMDFEID_INVLPGB_NEST 0x00200000 #define AMDFEID_PPIN 0x00800000 #define AMDFEID_SSBD 0x01000000 /* SSBD via MSRC001_011F instead of MSR 0x48: */ #define AMDFEID_VIRT_SSBD 0x02000000 #define AMDFEID_SSB_NO 0x04000000 +#define AMDFEID_CPPC 0x08000000 +#define AMDFEID_PSFD 0x10000000 +#define AMDFEID_BTC_NO 0x20000000 +#define AMDFEID_IBPB_RET 0x40000000 /* * AMD extended function 8000_0008h ecx info @@ -422,6 +432,13 @@ #define AMDID_COREID_SIZE 0x0000f000 #define AMDID_COREID_SIZE_SHIFT 12 +/* + * AMD extended function 8000_0008h edx info + */ +#define AMDID_INVLPGB_MAXCNT 0x0000ffff +#define AMDID_RDPRU_SHIFT 16 +#define AMDID_RDPRU_ID 0xffff0000 + /* * CPUID instruction 7 Structured Extended Features, leaf 0 ebx info */ diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index f3677d84570b..f19c557e270b 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -57,6 +57,7 @@ extern u_int cpu_max_ext_state_size; extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; +extern u_int cpu_procinfo3; extern char cpu_vendor[]; extern char cpu_model[]; extern u_int cpu_vendor_id; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 9c82f9f8a882..7df20053a9d1 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -102,6 +102,7 @@ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ u_int cpu_procinfo2; /* Multicore info */ +u_int cpu_procinfo3; char cpu_vendor[20]; /* CPU Origin code */ u_int cpu_vendor_id; /* CPU vendor ID */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ @@ -1085,19 +1086,29 @@ printcpuinfo(void) "\001CLZERO" "\002IRPerf" "\003XSaveErPtr" + "\004INVLPGB" "\005RDPRU" + "\007BE" "\011MCOMMIT" "\012WBNOINVD" "\015IBPB" + "\016INT_WBINVD" "\017IBRS" "\020STIBP" "\021IBRS_ALWAYSON" "\022STIBP_ALWAYSON" "\023PREFER_IBRS" + "\024SAMEMODE_IBRS" + "\025NOLMSLE" + "\026INVLPGBNEST" "\030PPIN" "\031SSBD" "\032VIRT_SSBD" "\033SSB_NO" + "\034CPPC" + "\035PSFD" + "\036BTC_NO" + "\037IBPB_RET" ); } @@ -1636,6 +1647,7 @@ finishidentcpu(void) cpu_maxphyaddr = regs[0] & 0xff; amd_extended_feature_extensions = regs[1]; cpu_procinfo2 = regs[2]; + cpu_procinfo3 = regs[3]; } else { cpu_maxphyaddr = (cpu_feature & CPUID_PAE) != 0 ? 36 : 32; } From nobody Tue May 21 02:46:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjzN94Qqnz5KgrD; Tue, 21 May 2024 02:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjzN93lmzz58bN; Tue, 21 May 2024 02:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+8Xov4xLD5wy60Xa6ocNX2ZuV6ksscqQkSWVLcinoVc=; b=wKMCbqiwTz1pPIWX1KEKEHp8FbhyMvMzCURFV2hIP8yIzhAnpN5ZTxbJP/wQkDpxRS487D CWK091DKgDLuBKVgopAYmWRL2jFVQUrQjTnKw6OSZzdh6FpnTBQvAMsVpVOn8mH4UsHj0t hGuv+Qkh0Nxi5L+P8Dv0jNSKFx4AuCyO1W4I3wsD9SsspG1strPe6MwWIf6PzCA9iFK2Tb tvlM8auwFddmMCfzTNeHCpX7tny4BcHXj/vcEe16uywVsNABZr5hdClu3hw62v+c6gc9qB S6igj/Z62aasRAixBrOL+NMyxe6wheDBR6cRoWOBWP0XC9BhZMoZ//9O5CtXdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716259593; a=rsa-sha256; cv=none; b=yxVRg5V7Zw4lB8urg1UhykzdfXHb0cWO1ny35gOW8IDJYQvkfiMw2ssCty3liSltSFmSBo 77hMvXt33+fE1xS6hzpPmycM1a5zM89fDCJSLKhz7wa0N+iIWAvmShBGNB45hApB4s477e xU53qKo41n7vNgXpOQpbZS9U3nW4nNJHvjodEYkEEK7YIKQXzsN0qEjw+GUy/GpepCuPvO xpoDgsTZBQKGV6yaUs8BsoCC116sv2gxMih0NTSPKyIgOknDlklweeSyIA52e4UEemTvYC ssmFMcZoj/QeuUuy+OgUOh60FZ/CMpdoUm2LH4o6j2++2RZb1gsmsEQs/DlF1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+8Xov4xLD5wy60Xa6ocNX2ZuV6ksscqQkSWVLcinoVc=; b=GpCWKDm0aNk7URI6E6juBnL3YuqgZv5XCacJIIeOl8a2DvesD/wbYavPkSTZL4jsyeGgog 2N+QK08csX722y0u2/bYPsaZC0vhj0JxXL0qk6/YNFTBBCLdT5q4KemK+TovodR2BmIHv1 x8m1fDiT5/uJvuGdCyzIPxPGJElfRQG4kyANEsNiS8gwafitNYK+HraZm8wQOpn2vkfX0x vxxC4/ezqX/4d89JxPxrxPXRs1Qj9jZp+s1Q94SQ8GxyDb9RXDc+AZtX75JYiHknxthfpD xnpAg0DA61bTQEiAdtVM8AHw/AsuJ1TmM4PwbwjX3j9lcJVqvEOkFz2ZvRxSRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjzN93LyPz14Cc; Tue, 21 May 2024 02:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L2kX59082719; Tue, 21 May 2024 02:46:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L2kX9Q082716; Tue, 21 May 2024 02:46:33 GMT (envelope-from git) Date: Tue, 21 May 2024 02:46:33 GMT Message-Id: <202405210246.44L2kX9Q082716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f148aa572a3b - stable/14 - nfs client comment typo fix List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f148aa572a3b7e744a316516fff4a1c375a358e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f148aa572a3b7e744a316516fff4a1c375a358e7 commit f148aa572a3b7e744a316516fff4a1c375a358e7 Author: Konstantin Belousov AuthorDate: 2024-05-18 22:49:59 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-21 02:45:59 +0000 nfs client comment typo fix (cherry picked from commit ff4480baf6f15551aee58707bffc9b15608d89d8) --- sys/fs/nfsclient/nfs_clbio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 43f3de8fa2d3..0e9c989e058b 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -369,7 +369,7 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread *td, struct ucred *cred) bool old_lock; /* - * Ensure the exclusove access to the node before checking + * Ensure the exclusive access to the node before checking * whether the cache is consistent. */ old_lock = ncl_excl_start(vp); From nobody Tue May 21 02:47:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjzPZ0D9Sz5Kgng; Tue, 21 May 2024 02:47: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjzPY6rVmz59N8; Tue, 21 May 2024 02:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1xae6oLZUa99GTJ9x08n8CNeFrRS1Tx51aJPK6thFOI=; b=L8WWhnQ7h1DTfzFEQhqYXUn55ZgNEqd2wr5WgfBOZJUFup3GEHCXmQZ/H+BhO1fPa+QJG0 OSUd4gIdvD5PMFk26IWFUl9YfDG34n3Np4dsBCMVeRAErDqVHQ6MFPZ/bHxQpcJ6LM+Cz4 S73oCJRcNWldwo0Rje11IR/7uY8AmkU216JEGfrQOi4vwZBbnQZATcDZfT6lTMASSVlU/d rriSOYs52klfQVGHwrxu8Vu6GC1IhUCIN+NI5qeibNFFiRCjGNcGxdv+3Dcr1awWE9pKeW iMfPj9nhWiIyvgj9lG5EPDibFOE6bp5iM+wVEQUM4jY+xaWz0v2dn05S8Wk3zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716259666; a=rsa-sha256; cv=none; b=DQJ3G6FU2yaT1k3VcyfEbI8/tMfePPmEvoGC7zxFh9meMULZdUSSeijoXo24X1t4fAs5Yd Na0CXAy0AiswYsbhas9XKANdGn/g5+IrQ/icaK5LOtBADR+ero80ai1+yBAakisNDMpTyA Yn+arCHlLxxdDZSJbejQa12MYRySTyxvKFNYifb/lRHcr/iLErulj/lO7ItvUvh7PWaM/m 1AhuqyxSl2k38Fr0wR7fIzXFoPEjcgi+Kyt/kEhhGbmm2UG/ow6fztIVtnFPy/HIVbxcHv Cgi2yKuNwXn6d3w65nZRFT456/s2wGLC0gAJgMlwiu5+x6azIi7Qa0QSkeCZuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1xae6oLZUa99GTJ9x08n8CNeFrRS1Tx51aJPK6thFOI=; b=M3KQ1G/SCHJk9ADyv/oOK+VgKxIPqn+PFy5qW+BG9L0mOEPe81TGzYZbDZ3G8faq8I6p3C ClkgummB3Yq8sSP6hgok8wJ6LvQfQUcumcYhVQHYZd+gKcJ+SG6qZIQaSOJI9Bs3yB5fqi nxRAY2Cvp/edgH9hNpf59syDRo1COibkBVIFZ/rE2MwjG7t0TZQoF1w3CGkfPpRB6Zu1fG SZ9W/AqGK6bYAaaly552dJSLWt1uMX1+DdGaVezmu/BuTsXVmmcNYbUMCMSktJm3N0eO9h MIBOfCSrV+suy4jvSK5NJX4rYlEYHOhvZgGIYTI0Vhf+uDiDUTZNtfUnpPiTTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjzPY6RnJz14MC; Tue, 21 May 2024 02:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L2lj7U083043; Tue, 21 May 2024 02:47:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L2ljMo083041; Tue, 21 May 2024 02:47:45 GMT (envelope-from git) Date: Tue, 21 May 2024 02:47:45 GMT Message-Id: <202405210247.44L2ljMo083041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c8b9ecc1a57d - stable/13 - x86: Add Intel TD/HFI related MSR/CPUID defines to specialregs.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8b9ecc1a57d20d49a174157f234cd26379d5a53 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c8b9ecc1a57d20d49a174157f234cd26379d5a53 commit c8b9ecc1a57d20d49a174157f234cd26379d5a53 Author: Koine Yuusuke AuthorDate: 2024-05-06 02:17:29 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-21 02:46:58 +0000 x86: Add Intel TD/HFI related MSR/CPUID defines to specialregs.h (cherry picked from commit 338d53965d9f4bfb1a83c1bcff3ff78944ce3a9f) --- sys/x86/include/specialreg.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index 4886430c84b6..f78e04c714f0 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -347,6 +347,13 @@ /* Ecx. */ #define CPUID_PERF_STAT 0x00000001 #define CPUID_PERF_BIAS 0x00000008 +#define CPUID_PERF_TD_CLASSES 0x0000ff00 + +/* Edx. */ +#define CPUID_HF_PERFORMANCE 0x00000001 +#define CPUID_HF_EFFICIENCY 0x00000002 +#define CPUID_TD_CAPABLITIES 0x0000000f +#define CPUID_TD_TBLPAGES 0x00000f00 /* * CPUID instruction 0xb ebx info. @@ -585,6 +592,8 @@ #define MSR_TURBO_RATIO_LIMIT 0x1ad #define MSR_TURBO_RATIO_LIMIT1 0x1ae #define MSR_IA32_ENERGY_PERF_BIAS 0x1b0 +#define MSR_IA32_PKG_THERM_STATUS 0x1b1 +#define MSR_IA32_PKG_THERM_INTERRUPT 0x1b2 #define MSR_DEBUGCTLMSR 0x1d9 #define MSR_LASTBRANCHFROMIP 0x1db #define MSR_LASTBRANCHTOIP 0x1dc @@ -768,6 +777,14 @@ #define TOPA_INT (1 << 2) #define TOPA_END (1 << 0) +/* + * Intel Hardware Feedback Interface / Thread Director MSRs + */ +#define MSR_IA32_HW_FEEDBACK_PTR 0x17d0 +#define MSR_IA32_HW_FEEDBACK_CONFIG 0x17d1 +#define MSR_IA32_THREAD_FEEDBACK_CHAR 0x17d2 +#define MSR_IA32_HW_FEEDBACK_THREAD_CONFIG 0x17d4 + /* * Constants related to MSR's. */ @@ -838,6 +855,19 @@ /* MSR IA32_ENERGY_PERF_BIAS */ #define IA32_ENERGY_PERF_BIAS_POLICY_HINT_MASK (0xfULL << 0) +/* MSR IA32_HW_FEEDBACK_PTR */ +#define IA32_HW_FEEDBACK_PTR_ENABLE (0x1ULL << 0) + +/* MSR IA32_HW_FEEDBACK_CONFIG */ +#define IA32_HW_FEEDBACK_CONFIG_EN_HFI (0x1ULL << 0) +#define IA32_HW_FEEDBACK_CONFIG_EN_THDIR (0x1ULL << 1) + +/* MSR IA32_PKG_THERM_STATUS */ +#define IA32_PKG_THERM_STATUS_HFI_UPDATED (0x1ULL << 26) + +/* MSR IA32_PKG_THERM_INTERRUPT */ +#define IA32_PKG_THERM_INTERRUPT_HFI_ENABLE (0x1ULL << 25) + /* * PAT modes. */ From nobody Tue May 21 02:47:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjzPb1sP0z5KgpJ; Tue, 21 May 2024 02:47: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjzPb09kQz59SZ; Tue, 21 May 2024 02:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xebunKKtm6i1UgfQi4CX2pFZyeeKhp/KoJ/zS2A8xPc=; b=CAre1c6Lq3zYpOz5SE7+o/bE5SEmYmvZ+XUo0/+7l7ehDcsxOYCfZSSSLKf9IwsGg5B1iD Dfjh37n1OMCHrA8F52QpNYRABqEhzWlb817t6rkPTwzw4TWbNWc1J7FX1r1P/nQwIwqpjw Qh4mQrHmXhS8h/O9W9TIWwKXd6xgKrTNbC4uvT8dzkVhPz1MDoHj6tPYjPA/UBDUjErcUl ZBmYinbonbPTcOaaQt/WfcOnD5f7Xi4q2PSUuo4QuCWJQzkok6K3VSh6AouWZp8h2ZY+Ri ujvQ9G7Jxcn4Y/mf1AZTKj4KSpTE5wm7uTC+GnO9ZmIdTLsZy7JWQkUpZIhAfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716259667; a=rsa-sha256; cv=none; b=spsc4s+097HuvOQVqfKNj0kMp7G8oIVV7ms7rOYnaVLsMJcPX9MgUGdFJQmnBzkyh918Xg sDOmM0AVkFspyHoonTS2b+G3uJfxpblxqQTbHrRXqQtsiqEeKoCrc7N0DiDxfY0LlnlEb6 k9UW7RBfVv0Ez5yRkGdx4kBQqd2VLPGgfIMT9gkqQfebyZdAtpBumZqpQIsQeg2zuuzaMH YFLpkPeSLKVBOtAVMEnoUVAC70DjcieYXdBjxGRrhRuYl14E0UU6zEAKcWmFMoVcVnCP5F M4+M3qds1siV/ZJegD34jVOJc23qw1/zMqfwM6LJE5fQ+eiOcD4P8uyYFdCzMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xebunKKtm6i1UgfQi4CX2pFZyeeKhp/KoJ/zS2A8xPc=; b=Eav2Pox6oy9kfpNlLY7p3hoyiugYYdReW7HGyCufK+wzNQSFca/Nn8qKeKOsItI0KFJAW1 eds5MYvu3CK+hUUIEHagDcd0Uto5nsgKE7/LRTmJeDf7zmaLGisOUqnvReWSo/o8XV66be JC6gEx17R7/4P7l0igsnGfogXqnTTFAKRSCQJJELjDFyO2U9E8/iXp3Ag/NQvzFfDJxXK5 bKyv8Jrm7r0Bqyaulp5pcsEME9OMm6pH/770QOAgT5xLVAReX3Rvepq1gOyxpFuqPeQeS5 SZdTbOrQLJi/2eF1EpXKd7OSdxCVg8F0StcrCOHTj8G20wEeP1QUs2gdJcQTqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjzPZ6vpNz13sJ; Tue, 21 May 2024 02:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L2lkje083101; Tue, 21 May 2024 02:47:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L2lkQp083098; Tue, 21 May 2024 02:47:46 GMT (envelope-from git) Date: Tue, 21 May 2024 02:47:46 GMT Message-Id: <202405210247.44L2lkQp083098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1fbc850bee39 - stable/13 - AMD CPUs: update bits and data from CPUID 0x8000_0008 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fbc850bee39208a6eaddd894e009b60c6dd243a Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1fbc850bee39208a6eaddd894e009b60c6dd243a commit 1fbc850bee39208a6eaddd894e009b60c6dd243a Author: Konstantin Belousov AuthorDate: 2024-05-13 23:02:16 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-21 02:46:58 +0000 AMD CPUs: update bits and data from CPUID 0x8000_0008 (cherry picked from commit c6113ac5a2c2bfee875979ebd40a007ef4d60069) --- sys/x86/include/specialreg.h | 17 +++++++++++++++++ sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 12 ++++++++++++ 3 files changed, 30 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index f78e04c714f0..16aa07c05e65 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -399,21 +399,31 @@ #define AMDFEID_CLZERO 0x00000001 #define AMDFEID_IRPERF 0x00000002 #define AMDFEID_XSAVEERPTR 0x00000004 +#define AMDFEID_INVLPGB 0x00000008 #define AMDFEID_RDPRU 0x00000010 +#define AMDFEID_BE 0x00000040 #define AMDFEID_MCOMMIT 0x00000100 #define AMDFEID_WBNOINVD 0x00000200 #define AMDFEID_IBPB 0x00001000 +#define AMDFEID_INT_WBINVD 0x00002000 #define AMDFEID_IBRS 0x00004000 #define AMDFEID_STIBP 0x00008000 /* The below are only defined if the corresponding base feature above exists. */ #define AMDFEID_IBRS_ALWAYSON 0x00010000 #define AMDFEID_STIBP_ALWAYSON 0x00020000 #define AMDFEID_PREFER_IBRS 0x00040000 +#define AMDFEID_SAMEMODE_IBRS 0x00080000 +#define AMDFEID_NO_LMSLE 0x00100000 +#define AMDFEID_INVLPGB_NEST 0x00200000 #define AMDFEID_PPIN 0x00800000 #define AMDFEID_SSBD 0x01000000 /* SSBD via MSRC001_011F instead of MSR 0x48: */ #define AMDFEID_VIRT_SSBD 0x02000000 #define AMDFEID_SSB_NO 0x04000000 +#define AMDFEID_CPPC 0x08000000 +#define AMDFEID_PSFD 0x10000000 +#define AMDFEID_BTC_NO 0x20000000 +#define AMDFEID_IBPB_RET 0x40000000 /* * AMD extended function 8000_0008h ecx info @@ -422,6 +432,13 @@ #define AMDID_COREID_SIZE 0x0000f000 #define AMDID_COREID_SIZE_SHIFT 12 +/* + * AMD extended function 8000_0008h edx info + */ +#define AMDID_INVLPGB_MAXCNT 0x0000ffff +#define AMDID_RDPRU_SHIFT 16 +#define AMDID_RDPRU_ID 0xffff0000 + /* * CPUID instruction 7 Structured Extended Features, leaf 0 ebx info */ diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index ed585c33e8a8..b764f1812264 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -57,6 +57,7 @@ extern u_int cpu_max_ext_state_size; extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; +extern u_int cpu_procinfo3; extern char cpu_vendor[]; extern char cpu_model[]; extern u_int cpu_vendor_id; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 1eb6bd6cac6f..992dbb421aa4 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -102,6 +102,7 @@ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ u_int cpu_procinfo2; /* Multicore info */ +u_int cpu_procinfo3; char cpu_vendor[20]; /* CPU Origin code */ u_int cpu_vendor_id; /* CPU vendor ID */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ @@ -1085,19 +1086,29 @@ printcpuinfo(void) "\001CLZERO" "\002IRPerf" "\003XSaveErPtr" + "\004INVLPGB" "\005RDPRU" + "\007BE" "\011MCOMMIT" "\012WBNOINVD" "\015IBPB" + "\016INT_WBINVD" "\017IBRS" "\020STIBP" "\021IBRS_ALWAYSON" "\022STIBP_ALWAYSON" "\023PREFER_IBRS" + "\024SAMEMODE_IBRS" + "\025NOLMSLE" + "\026INVLPGBNEST" "\030PPIN" "\031SSBD" "\032VIRT_SSBD" "\033SSB_NO" + "\034CPPC" + "\035PSFD" + "\036BTC_NO" + "\037IBPB_RET" ); } @@ -1692,6 +1703,7 @@ finishidentcpu(void) cpu_maxphyaddr = regs[0] & 0xff; amd_extended_feature_extensions = regs[1]; cpu_procinfo2 = regs[2]; + cpu_procinfo3 = regs[3]; } else { cpu_maxphyaddr = (cpu_feature & CPUID_PAE) != 0 ? 36 : 32; } From nobody Tue May 21 02:47:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VjzPc27nxz5Kghm; Tue, 21 May 2024 02:47: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VjzPc1S2nz59Fc; Tue, 21 May 2024 02:47:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MiqS5lDjMLNMiGP/k0SnolM1MmihjHK5ADXXOUkPtmE=; b=qm6KuQGnori1+ehjvtMliSLfvVCw0NJHOF9bYCitr56XMH0/lzS5Lb9RQgP/u80KaaWmPQ YeJcpu3KwEmpTsLHDIAbevhMgATiPwdJk+2JiyaLj5IZm2RGHb8AGxyEGpy4TylssPiC10 KkdhPrE8NWezvi6uwPxGIEidDbXFQg83QHILAuOkkqiEjds5SklsviKXDsMUr/0u0rT+Ki fHA61uDglG6th4StxLWNMgS4FkmGnaP9nKyMUeEUANxfrhhB1ve3/pckZwpISkbhzcZHxG BMxWP1k6p+bH7lWcyTIIDzHcH7tp0FNFRJ3vIAOKIi4qU6GpChR4QycWdum37Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716259668; a=rsa-sha256; cv=none; b=ipivtZmmM1gsCMod/aSFL5Q5sNyR6mLD4fQKkBUbDNxn2Y6wjl10BFe5qhjlGCrdxJ4Npr NwaKsor0Ei7OZpRAMrmcDI/JWB6/nv1PeeL9yFXhMYjdYBjhOigaV+Cmsq7MpJIsg8t4DE 0wFpehBzTKHjjIFVdvOzt6+PTuNfv7DkSdTCkhFccL6k7xa15+o5upxw7W2Q0CNdgNWoJo 1izDqo4CyjbRJXR8sY+Sdnj0MC7c9/byUZBUivuv3P05T163q6d/r6axUVMpCPodfgtgBo 7SJvUM/KDYPBVOWvBE9EdaSaWs4HtIEG7X7n8jZ+4KNYhDG20ObmzbYctfU7Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716259668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MiqS5lDjMLNMiGP/k0SnolM1MmihjHK5ADXXOUkPtmE=; b=W9uYcG6CMGHGHvetjqhORIGKzUJn9gem7bLRlXWjgiv4AZYwxBGwcvxLYowOOYM9TWs3cx IvmbScgcy4b3ToJeZFeJ2Ydm3pcpT1aeRR6O++83jNsn0qUcNbsEEJzHIhbnCCAsRHdkbr 7XNPbXobjPU0guZFi08kBQqA3rt0F9e19Vfr/ikDJw26VxBzYLmlpNk0bn4Du2K0LLXjHD pO5rKq1YPmxwTvRlU9QNFripr612+oVZ9oi/J9ne0Pe6mbSu2P8JFADTDtV5vD2AyDAP55 aC1/TJ86u3kRB5ppLhF6TDOADIcaS3hsb+XfgaHwCVZobeKwrAmZR4rH84pAOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VjzPc142Fz14MD; Tue, 21 May 2024 02:47:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L2lmmP083150; Tue, 21 May 2024 02:47:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L2lm8Y083147; Tue, 21 May 2024 02:47:48 GMT (envelope-from git) Date: Tue, 21 May 2024 02:47:48 GMT Message-Id: <202405210247.44L2lm8Y083147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 25aa002545c0 - stable/13 - nfs client comment typo fix List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25aa002545c033908cf8e0ff30800c02e2ea0e85 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=25aa002545c033908cf8e0ff30800c02e2ea0e85 commit 25aa002545c033908cf8e0ff30800c02e2ea0e85 Author: Konstantin Belousov AuthorDate: 2024-05-18 22:49:59 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-21 02:47:23 +0000 nfs client comment typo fix (cherry picked from commit ff4480baf6f15551aee58707bffc9b15608d89d8) --- sys/fs/nfsclient/nfs_clbio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 43f3de8fa2d3..0e9c989e058b 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -369,7 +369,7 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread *td, struct ucred *cred) bool old_lock; /* - * Ensure the exclusove access to the node before checking + * Ensure the exclusive access to the node before checking * whether the cache is consistent. */ old_lock = ncl_excl_start(vp); From nobody Tue May 21 03:27:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vk0HV308yz5L27c; Tue, 21 May 2024 03:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vk0HV2Dgdz438D; Tue, 21 May 2024 03:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z0z/NXGoXnF+hC6kr4kpSjZ28sv9TgHaZO8L6eAjJyg=; b=NtOORRId4AiSyyokfaYY4LZ0mDiatHw9R/qtt41mxGwwDh7A1lkhe4CcgaeATjYxU7592I i22H1HOgm7NubNWOlgwY1QP1o3p/c7HDQ4aviaGRF5Ic72FkAyh4ohTBbo5xVCCi8w0vip sbPFh1h7TUhMLfOMoGBxtEqvaowtREKOhyW0GBRRDSBgxkI1OhxpOXqdXFzQ6uOo05j3s6 1puwXw6KywBpm4MWIuSBm8j/7KzPbycToTnrcioN67cTv+CEhKIMP01CFLpj4rgHYa+Hbg sUCsKNP1TMzRuqps5XPbSvneHszoh3qbUUgMLIaDZjIRCjZ8/2Iv1b3y3zZ3BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716262054; a=rsa-sha256; cv=none; b=rcQ5A0bzTh40SCocDb+qI05AKU7I4SloqnS5jeQ8kqdrEkoqe6kmzqRCUr3yv0STpO4JeT jwJTuW8MSJjHHCvfDHOFBdlCIadDbAmP6sC3xiR627oCW2jn3+I5kZItwgQErkJHLKP0Jj yEQ/Qa5lf1lXnFuJlvN1NxVEKBFogC/0E6yHa4ZIEopMRdhYnKxXTuTNoVVfkebrG5Ude7 QZWZ4TKIU3uQuRykGwxcvsIGo53N7uZ+w/7waRooHqAIP+6pcBJCYF1JhKb9nkbpiL1w// Y0QLPvDPABtk8wkp/VE4vWOqczEwWPeY/uhl0FHr3ldYruc1nHlRRvcFLXXLKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z0z/NXGoXnF+hC6kr4kpSjZ28sv9TgHaZO8L6eAjJyg=; b=JhMhD9T+HhIBjuxSK8EJ+fdV0RfIVfCz6wwLOjZwYvGxHt/zBN6i2a7/VZ49yzDlNn3x2L DiESuoiT7lS3j3F0Tiqyd/ARpRaO4pJ/GYJEmLjvMhxR04Jh6rvvctyiibiCgrpKKkFnkj 1Nb3DWSxoPpArTQA6zXH7TVUHpztOjGVsc7jMxkyeTq6qOKgTHJStqYDfNZC6jC1Fd4t0+ ZOpZLgq3vFZb7TzukztGyoX5UykIdxglkbh/EqauB5ytHbw5XWgLGIekF911gSQjaV6Wiq OrFJz1Xlvu9i1tyAdbBf7toPro6legfK0ZPyOMoFbXXf5k/oUMX26SEDzvLbOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vk0HV1k3Kz15Fq; Tue, 21 May 2024 03:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L3RYSN052557; Tue, 21 May 2024 03:27:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L3RYK7052554; Tue, 21 May 2024 03:27:34 GMT (envelope-from git) Date: Tue, 21 May 2024 03:27:34 GMT Message-Id: <202405210327.44L3RYK7052554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e7d689faaf77 - stable/14 - sysexits: Tidy deprecated header and manual List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7d689faaf77d303d2b9d050e25d8f710719be4b Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e7d689faaf77d303d2b9d050e25d8f710719be4b commit e7d689faaf77d303d2b9d050e25d8f710719be4b Author: Alexander Ziaee AuthorDate: 2024-05-10 02:43:39 +0000 Commit: Warner Losh CommitDate: 2024-05-21 03:10:15 +0000 sysexits: Tidy deprecated header and manual was deprecated in the base system in a1432b4 for FreeBSD 8.0 and is retained only for backwards compatibility. Make that clear, since sysexits(3) suggested using it since it was in style(9) prior to this. MFC after: 1 week Co-authored-by: imp Fixes: a1432b4 Reviewed by: imp, pauamma (previous version) Pull Request https://github.com/freebsd/freebsd-src/pull/1195 (cherry picked from commit 5ccaab1797e5bdc404f2299ebaec1265547a4744) --- include/sysexits.h | 7 ++++--- share/man/man3/sysexits.3 | 43 ++++++++++++++++++------------------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/include/sysexits.h b/include/sysexits.h index 9eef5abebe93..44449e05ff06 100644 --- a/include/sysexits.h +++ b/include/sysexits.h @@ -37,9 +37,10 @@ /* * SYSEXITS.H -- Exit status codes for system programs. * - * This include file attempts to categorize possible error - * exit statuses for system programs, notably delivermail - * and the Berkeley network. + * This include file attempts to categorize error exit statuses + * for system programs, notably sendmail. These values exist only + * for interface compatibility, and are deprecated for FreeBSD + * base software. * * Error numbers begin at EX__BASE to reduce the possibility of * clashing with other exit statuses that random programs may diff --git a/share/man/man3/sysexits.3 b/share/man/man3/sysexits.3 index ef736192e439..62f79b286a16 100644 --- a/share/man/man3/sysexits.3 +++ b/share/man/man3/sysexits.3 @@ -1,7 +1,7 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 1996 Joerg Wunsch -.\" -.\" All rights reserved. +.\" Copyright (c) 1996 Joerg Wunsch. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,27 +23,20 @@ .\" (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 January 21, 2010 +.Dd May 9, 2024 .Dt SYSEXITS 3 .Os .Sh NAME .Nm sysexits -.Nd preferable exit codes for programs +.Nd legacy exit status codes for system programs .Sh SYNOPSIS .In sysexits.h .Sh DESCRIPTION -According to -.Xr style 9 , -it is not a good practice to call -.Xr exit 3 -with arbitrary values to indicate a failure condition when ending -a program. -Instead, the pre-defined exit codes from -.Nm -should be used, so the caller of the process can get a rough -estimation about the failure class without looking up the source code. -.Pp +Some commands attempt to describe the nature of a failure condition +by using these pre-defined exit codes. +This interface has been deprecated and is retained only for compatibility. +Its use is discouraged. +.Sh ERRORS The successful exit is always indicated by a status of 0, or .Sy EX_OK . Error numbers begin at @@ -112,8 +105,7 @@ The remote system returned something that was during a protocol exchange. .It Sy EX_NOPERM Pq 77 You did not have sufficient permission to perform the operation. -This -is not intended for file system problems, which should use +This is not intended for file system problems, which should use .Sy EX_NOINPUT or .Sy EX_CANTCREAT , @@ -131,12 +123,13 @@ parenthesis for easy reference. .Sh HISTORY The .Nm -file appeared somewhere after -.Bx 4.3 . +file first appeared in +.Bx 4 . .Sh AUTHORS This manual page was written by -.An J\(:org Wunsch -after the comments in -.In sysexits.h . +.An J\(:org Wunsch . .Sh BUGS -The choice of an appropriate exit value is often ambiguous. +.Bl -tag -width 0 -compact +.It This interface is not portable. +.It The choice of an appropriate exit value is often ambiguous. +.El From nobody Tue May 21 03:27:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vk0HW3SDjz5L27d; Tue, 21 May 2024 03:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vk0HW2q6fz42ld; Tue, 21 May 2024 03:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyL/hUjtaXJkh8hS5yx9JaH2t/Mb2jelejCjm3IpXIM=; b=PGT98XVjbZ4/4AGAiLx6U9fDxwdAt4dGGB8VZoxxNetBi1pUbl8NmnhCXmqjO9wbmfuZUS h+SX90nCC/oVb//Dh2y1zYRLSkeTIf0jjcGOpEEhc1UBEp8Qyz7Q4A6vWAAwLfxwIQXerh tVJqKcLyXYKZ/BLdDpFdQ7hV+Y11jCJUHro91G6LjeazXg93NkZvTIpLSakB6G0SzQH1L6 pGURCV3cDTnCrvsvKBINoH0CvL/NHfW8Bw8spYe4S2+gV+P+wbDCXFh52vnELEZxDEH5/G J9dO/97Ng62rvMYSsSUeZt/utDYpDmTCVbLK6h/ncRqYj76G0tyJJ34A4hOysg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716262055; a=rsa-sha256; cv=none; b=bhrsElrcSPKcS4mAmMfyS4JQw5jXCD8U8IQ3rFdMLKPJPOMlC7+hGiOM18Q0o/Sn3vEaeP JHnOntg4/DCfCUVPn+PsH7USHi8ZXCMnoNNEbACP5TxjHRAzWNTV0hmzQi+mgvZBugxPbD LpIT7hCWWlNap/Jn17LOKi23O1d7nXGZBm+rEUBNF209yWZbzcH3hnVHbHkfwbpR0LBcN1 5yZlOkTMvpDrDGr0F1MmJpFCRS7zcGf7U4Iqd+U4ghxuXOY501W/zr0daDCukqxOzR4/g7 +DuLG2upFx4f1Gk+9yBS1rktGGGwtvRD+qBMVdPgqz/6J4rEGMo2NRs8b1fdHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyL/hUjtaXJkh8hS5yx9JaH2t/Mb2jelejCjm3IpXIM=; b=lnytG8aSB4YSKkJkcry0FqqgEWHDH88juvoKKctjSDVVwlqy14w9HM5cJ0wakdmrmGRG9T nmtNWP6dq/wY9yiBEL9b9Dr/2L3tnC3ervNEQp6dGe9G1fG9vX++Tu+HnpQIBgKm5FHc9S aHRk5UEo7etYAS6tPcaMhZytVVnSFfMZHHWMoGrJ2LBACbAfIU/am1R7fmzv9gZWIADfKk s+TCTn1lAw0E2guOgiYQhjTLuBONXOQXiE2frjJ6VNAt88J/du7Gs2ddDjNQ9/xVSSIFzF AqpO3rJWSA+1ylNW77EeF3yKUFZ6T0o2An0FnW5d8ERFmgil0a5r2OwHNdeknw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vk0HW2QKDz1595; Tue, 21 May 2024 03:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L3RZNh052603; Tue, 21 May 2024 03:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L3RZWW052600; Tue, 21 May 2024 03:27:35 GMT (envelope-from git) Date: Tue, 21 May 2024 03:27:35 GMT Message-Id: <202405210327.44L3RZWW052600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7aba92287947 - stable/14 - sys/dev/irdma/irdma_cm: fix compile without INET List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7aba922879474189e5694ffb92a51ab387ad3dd6 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7aba922879474189e5694ffb92a51ab387ad3dd6 commit 7aba922879474189e5694ffb92a51ab387ad3dd6 Author: Lexi Winter AuthorDate: 2024-04-12 16:47:16 +0000 Commit: Warner Losh CommitDate: 2024-05-21 03:10:46 +0000 sys/dev/irdma/irdma_cm: fix compile without INET irdma_get_vlan_ipv4() calls ip_ifp_find() even if INET isn't defined, in which case this function isn't available. Stub this out for the non-INET case to return an error (0xffff) instead. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1156 (cherry picked from commit 0478a0356272ab3907af9d97711f0bb8b14bf38b) --- sys/dev/irdma/irdma_cm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/irdma/irdma_cm.c b/sys/dev/irdma/irdma_cm.c index 65cb5c643783..167e3c67390c 100644 --- a/sys/dev/irdma/irdma_cm.c +++ b/sys/dev/irdma/irdma_cm.c @@ -1664,9 +1664,11 @@ irdma_get_vlan_mac_ipv6(struct iw_cm_id *cm_id, u32 *addr, u16 *vlan_id, u8 *mac u16 irdma_get_vlan_ipv4(struct iw_cm_id *cm_id, u32 *addr) { + u16 vlan_id = 0xFFFF; + +#ifdef INET if_t netdev; struct vnet *vnet = &init_net; - u16 vlan_id = 0xFFFF; #ifdef VIMAGE vnet = irdma_cmid_to_vnet(cm_id); @@ -1676,6 +1678,7 @@ irdma_get_vlan_ipv4(struct iw_cm_id *cm_id, u32 *addr) vlan_id = rdma_vlan_dev_vlan_id(netdev); dev_put(netdev); } +#endif return vlan_id; } From nobody Tue May 21 03:27:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vk0HX4pjKz5L2BR; Tue, 21 May 2024 03:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vk0HX3x9Dz430Z; Tue, 21 May 2024 03:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmQDWnFE8u8xCqCvzM3U3a32T56mQHzF/Xa1HwnavUc=; b=Z6MIlFj0blr1SHS6MxAv5IjKE8306SkDE1wrU6MO61JfDTJY41elnRz/fiDnuO+1sP0BoJ WbBOw/6fWc4W2vXHa+6tr+7aPHe28QFWqrb2aMm54uTmHoljUb7aBWPeSboJiJewUpENtw kKlmUMOBEo22fHBaO8pZjBjVNHv3XDONS48Y/1Ju8lwqWFaLD6eKKmVPzQTC69He5UPE6I bCqrv68zcsjcGjWxTJwVxuCyfwZRLoQMhM/NWLQa0XTdLkTilJ7wYnoX5629Kj9aX8uMac c/y08toQJFhxbiTCxAlwwu37bBoa9R7De4QZ6v+vyryE+BaoyGH8OiDP4UYOEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716262056; a=rsa-sha256; cv=none; b=EONCID2pfAGJIok7f4XZvmM7ycmbDHnqDACb8Mwl4xx4TnySOaLHAUWe1d4VCP85VmepaB SLj4dZFqM8YK5w78M38vOk8C/LTUJfcULYKPb+2RDu6jPfNKcI5rRW+z0Xxbn0m0dMprqv NOHiTh4Gpo8j5gCD7wpwFYguEymMG0f89Ch8q10ZlMO9AjA+QpWak2m3eaW3IibVLnon4J tLhur6iTwxTe24bOY0/m0EF/oRTReKJeTedCHr13TxpN0lFxCgRLA21KdfHhfjUVjYmjlP e7GmyXwWzJAEfp8D6TB8uZobVaZ97CH4pnwD0no2zO5VopxuUL9T8Dmd2mrNFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmQDWnFE8u8xCqCvzM3U3a32T56mQHzF/Xa1HwnavUc=; b=Pu9okyIToCGrZgcVpCRJEDmzLdI3WYb90xytAVqSytfFtmIA0zzuYPHbmyQFQfT4OEGNaW zeXsaKpzD4HV+xrdK+gglE4YJTqWLhjKJO4IMnjnpqR40OXbV9GBOpa96HOold1hpfTWm6 91I0HzvDAl960/2FbzjPz1/R2YEJsbeEjRnDHXY1JmrbhgAamfcytoZhHRSGn/LMvpOQ0h MYFBnyYBre5iuLqNDPtCcAPnkR8Uulk4QNESdB36ml/ghZbfJU/iT3CFzmdfibeAiu/sLr T9NxI5cTlbjr9ghZXu3WQI78J0uXjXytjBuVynOITSqVg1mDjt9x4MqOXmmneQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vk0HX37Zlz15Bq; Tue, 21 May 2024 03:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L3Raru052657; Tue, 21 May 2024 03:27:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L3Ra7r052654; Tue, 21 May 2024 03:27:36 GMT (envelope-from git) Date: Tue, 21 May 2024 03:27:36 GMT Message-Id: <202405210327.44L3Ra7r052654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f30c2d86c39f - stable/14 - sys/netinet6/in6_pcb.c: fix compile without INET List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f30c2d86c39f8c3090e1f8967c13f2dd0d5d664b Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f30c2d86c39f8c3090e1f8967c13f2dd0d5d664b commit f30c2d86c39f8c3090e1f8967c13f2dd0d5d664b Author: Lexi Winter AuthorDate: 2024-04-12 16:54:24 +0000 Commit: Warner Losh CommitDate: 2024-05-21 03:12:04 +0000 sys/netinet6/in6_pcb.c: fix compile without INET in6_mapped_sockaddr() and in6_mapped_peeraddr() both define a local variable named 'inp', but in the non-INET case, this variable is set and never used, causing a compiler error: /src/freebsd/src/lf/sys/netinet6/in6_pcb.c:547:16: error: variable 'inp' set but not used [-Werror,-Wunused-but-set-variable] 547 | struct inpcb *inp; | ^ /src/freebsd/src/lf/sys/netinet6/in6_pcb.c:573:16: error: variable 'inp' set but not used [-Werror,-Wunused-but-set-variable] 573 | struct inpcb *inp; Fix this by guarding all the INET-specific logic, including the variable definition, behind #ifdef INET. While here, tweak formatting in in6_mapped_peeraddr() so both functions are the same. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1155 (cherry picked from commit 042fb58d009e7efc5b334b68fffbef9b1f620ec8) --- sys/netinet6/in6_pcb.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 5c4ef7570ddc..90f91eef1daa 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -579,13 +579,13 @@ in6_getpeeraddr(struct socket *so, struct sockaddr **nam) int in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam) { - struct inpcb *inp; int error; +#ifdef INET + struct inpcb *inp; inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_mapped_sockaddr: inp == NULL")); -#ifdef INET if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_getsockaddr(so, nam); if (error == 0) @@ -603,21 +603,23 @@ in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam) int in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam) { - struct inpcb *inp; int error; +#ifdef INET + struct inpcb *inp; inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_mapped_peeraddr: inp == NULL")); -#ifdef INET if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_getpeeraddr(so, nam); if (error == 0) in6_sin_2_v4mapsin6_in_sock(nam); } else #endif - /* scope issues will be handled in in6_getpeeraddr(). */ - error = in6_getpeeraddr(so, nam); + { + /* scope issues will be handled in in6_getpeeraddr(). */ + error = in6_getpeeraddr(so, nam); + } return error; } From nobody Tue May 21 03:27:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vk0HY5vZ9z5L20s; Tue, 21 May 2024 03:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vk0HY4XMqz430r; Tue, 21 May 2024 03:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ede3TN8mdvmdPYCZIqOD+lYJpHCQP6e1myQ8WykOt4w=; b=tKtJce2f4IOJPfGgfTHHgX+NdYWtLxHHVXiHmHsgIAM+ylvRIzkpVGDNQ93MI+VsWbZhXJ /vP2idA4pPLqfm52mqPkGmfw9i8/qDDSs6ZSqD5qxQ3IKA5e8zfu/I/j0iI5ftRG9HbtNJ TWlR+SP0Q6RVJetdsebEicXBzk5O24UyulOzUZgDe1o/88daqIcBz1sDOvYkaGiGGv2N4b v2jNmYE1aFry0W28FzAIm3EVgCtICHtbg+T9qbjTHWJpkErnpltmx4AU991PqVq8zu4W1Z 3HuKhDdZr3DucJCe20kZeNHOcoH9jgjT5q9UOGi2npb52lB/dLS6Z+wYOr055Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716262057; a=rsa-sha256; cv=none; b=phGITGCcf+oxcLyBigaNLXNoWgv09rgkiwFjYJBwYvlQMzCq2mC6W7v7q2eeXIDjkDbWy7 B7/EoTzLuxcMY98rv2Wvn5OEcViCyn7NVqEeWSVr+ZKSVcJ4H6CUQ5mCvMTxcKB4QoDpwx 5S3M8KtS6rb9I3rOcoC+X/2BwGdYwgp67zFUBlKMWw0m/SKuLIhn8/FuvRs4b5LnQ9r0Xy VY5XxfP9Dw9LpoFfjANStiMcho7wT6iL4eQYc62EjZCqfzK+oAX02hZqwArEa/GWXc+NKE HxrWzSsY6a/wYs40JKGCnRIoPUTY7XpwRZyoyCt5Uf3SqQTpMTcVt+jRV6u+Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ede3TN8mdvmdPYCZIqOD+lYJpHCQP6e1myQ8WykOt4w=; b=HsyS/zXcO/PxTF+cXaIjy+7qCmB7pkyIGhGB+iIL5S57iZ+RzBBUdOY7z3046LM2hyEePp AED5lyc6aEqNPpNbBpyh6TzUDE1MEBOutxf4kqxD4vpmRpgDr36T9nq7qnVi6kPAMQbF3W /mPbUFbHxGKGjMInvlBWDxysu4kR+MneSQInOlZx66BdDdHOoELPbqFqIbGhx8KnPDzL8p ITp9ZqFtjqoKeqFtv0lmkmZITocWPkbGx3vm78Cv3xI8zgnMyjuIyMEF/90FcSHdNo1K93 +6AvfEK2qiHV55gvPXsi94YvzG9GfFfFxUcXu96KOh2+y724Ra+StgAdGFPGqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vk0HY48N3z15Fr; Tue, 21 May 2024 03:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L3Rbf1052703; Tue, 21 May 2024 03:27:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L3RbWu052700; Tue, 21 May 2024 03:27:37 GMT (envelope-from git) Date: Tue, 21 May 2024 03:27:37 GMT Message-Id: <202405210327.44L3RbWu052700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 040a7e0dcbc2 - stable/14 - sys/modules/dpdk_lpm4: do not build without INET List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 040a7e0dcbc234aa66d0b4b53638db12b81a7b75 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=040a7e0dcbc234aa66d0b4b53638db12b81a7b75 commit 040a7e0dcbc234aa66d0b4b53638db12b81a7b75 Author: Lexi Winter AuthorDate: 2024-05-15 00:16:10 +0000 Commit: Warner Losh CommitDate: 2024-05-21 03:13:24 +0000 sys/modules/dpdk_lpm4: do not build without INET Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1236 (cherry picked from commit 304a03275a65cf811fb6c06fa1c37783d07c99a4) --- sys/modules/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index b6327ec224af..4b4534aee076 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -500,7 +500,7 @@ _ipfw_nptv6= ipfw_nptv6 _ipfilter= ipfilter .endif -.if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO} +.if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO} && ${KERN_OPTS:MINET} _dpdk_lpm4= dpdk_lpm4 _fib_dxr= fib_dxr .endif From nobody Tue May 21 03:27:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vk0Hb1NLZz5L2GC; Tue, 21 May 2024 03:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vk0HZ5XCMz438b; Tue, 21 May 2024 03:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EfoO+qWXvxqgzh4bUUgxfERTmQmLtahE0/Pmwjdg/Yw=; b=gs/Eb7K0iUQ2cvsEVFJENbVdFi4gIa1huVvDgrg+PxhPdeqaOPVMGqLZChNgMLj1WGP1qt +IffrPmnek7iCebfOm9Qc/awQ9UQ2cdKfXmlBw7FTaBvkL6UwXWSyasTusxagRLTvyFBXz RnZZTRUUAZPJ2uydRlU+7mYaJ+hFplxZUVI4RbhqwvejkurNgX5Mf0RsYTdzOvWTq7Sz+s rh1q9kbzqyTJJLbh6cV394EejpQ/YdoQKu2nnQpoShWl8obxVlD36ipRfQxHmRrBoR09g1 5NmfqiJ9JXX6oGQAap1opeTK0RtokRTHOk3K9ued/v68nlLLB9gMeBr3md+Hwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716262058; a=rsa-sha256; cv=none; b=tiqDE9Ot/njCy3pAHw2Z2ccmkJbVkOVCrOK9xYWKkfbtkuUB+QdaQ+tm08lb7GVS7weFCU hMlv9bG/OCFNjgVJkLjgJIaH7pR1bd3T3lejtDzCQYl9hZ7I82rN+9lf5yFCRDGLbpdWz3 APdM9AnClxq+GwONYC9t1HifJVSPIPBdxo+8LP4Lueh9aQmMncb4Jm9lRhePrynRIFOnr9 4xrAWn2uIsDUIZD2IYg3m6uC2Z9Swx45MnlP5QmVz/bOfbO5/DnDOnJ6+zWHuu0R/ifBoX FITbHLTuRFblVox4E33oLpHp5iZSZq7m0uow2qgJih85MWlTcf4wNZ9YBQXITw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EfoO+qWXvxqgzh4bUUgxfERTmQmLtahE0/Pmwjdg/Yw=; b=iE3qSudHwWbiDPqRmbnw5o2mpLTR0OE6A29kXUEWaV0tv+1kNiStyJJBnCm+9zVHrbqwd8 dgWVzAr+eO6IRTWWgkDXdDZ3LgaAsEaFtI0/3wsQ+pjThD/fVcGl8n9svv0WMSfuyIx7KH GnQie+Tx0E3ugetjNsxZhIOTdxFF/CoDIMq/TGWStMDIqSnxvIYELPBWvK4nxIkKixyojp 4aD61JX3YzUm4181VlIa69jCVZtfgl+zHcmQPL+2esj9DsmPKTMGJtpUb4i6IaHD2dqiCO Y1nFizWb+UYPjcLTtRJhSBsWxK32T7tGdN6N2V2BUP5y6darUNTMzQSRAyk9BA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vk0HZ57nRz15Br; Tue, 21 May 2024 03:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L3Rckx052747; Tue, 21 May 2024 03:27:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L3RcTh052744; Tue, 21 May 2024 03:27:38 GMT (envelope-from git) Date: Tue, 21 May 2024 03:27:38 GMT Message-Id: <202405210327.44L3RcTh052744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: cbe2436dda12 - stable/14 - intro.2: Add sys/syscall.h to SYNOPSIS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cbe2436dda127061a13e5565a5badec02249b2e5 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cbe2436dda127061a13e5565a5badec02249b2e5 commit cbe2436dda127061a13e5565a5badec02249b2e5 Author: Alexander Ziaee AuthorDate: 2024-05-04 14:54:20 +0000 Commit: Warner Losh CommitDate: 2024-05-21 03:14:13 +0000 intro.2: Add sys/syscall.h to SYNOPSIS MFC after: 1 week Co-authored-by: brooks Reviewed by: brooks, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1192 (cherry picked from commit 69ff2d754c1c8bd9c2b6cea28aa754e9f92f9613) --- lib/libc/sys/intro.2 | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2 index 1b84b219fe0e..5b8f437567b8 100644 --- a/lib/libc/sys/intro.2 +++ b/lib/libc/sys/intro.2 @@ -36,6 +36,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS +.In sys/syscall.h .In errno.h .Sh DESCRIPTION This section provides an overview of the system calls, From nobody Tue May 21 03:27:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vk0Hc1tVJz5L27p; Tue, 21 May 2024 03:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vk0Hb73NGz43DC; Tue, 21 May 2024 03:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pWKOp442EqQRb3Twa7RmHS8Zl6WWAa4KsVenf/LezGI=; b=g+l6Q0I2x+doqZ+EWt3oOtYcHc/TM0va4jSIP7lm8TKn3gqrjMqGpigeeXH7hISfqLPLKs v321o2RTTVWQVZWUnOicswRAxdy0kpMUtk/U2NLcfnx85Cyy/Ei6deM3U57+6zF/MePQBl zkcCSGQBiKlccqDdu6T7D2QcKxtOFRi9U57R+ke58rMk4oZvxoz3nTHFadZ/b3IOTF3P73 +YamnbGYifw2ljgsDCERbsYF3AtQnVA49BxmIKlerOhADenEhNjKPIrhFWtlm2yfdFHv0X POW7uFjDGqTBw7MeVWZc9VYr+na+hXo7T8PFru77BUbw9zzMGKg9DriFYXmuTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716262060; a=rsa-sha256; cv=none; b=OftysEoEGk7CK/k78KmOUEj1v+YqHg5HCAW4/ss5FY+FuJv6HkyMSeoTs/Ah8fYEe1EULG /H2r2TL57C0QMX8fI5D892R3w06t6CZPACNQ1vHW+8JlH14nTEPzbF03VAIDrzuTeJF9KI gr6lS9e3XHQnR09qV7VAQXwXQavTnV8XV7ocuP9OnjpIP3afnh1MxvvoF3CwzJolH7J3W8 VJmUUI3CE4pfpHnso/qtBdjQSXMCT2vWnDcDvb8AVDpiT9vPZxu9xbHB6hkTRp7kETqL2z o5hli4B3hrCWksgmh6YJAJ/Tiz72vH4rG63OE9156CM+sfTIwboixnyI+ytzfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pWKOp442EqQRb3Twa7RmHS8Zl6WWAa4KsVenf/LezGI=; b=Q4RuRFSgcKdd6jXvCx4aoHDOKwOviBp/VfP1mTsvgxtBRovaXjBARNySNRqovD4SU2SkOP duc/FCzO99pTzYtpzE+xnru3op1hDWo77jnp1BiCnfz92I+HBFcVVUzboQ/bdgQpT/IjsR 4OqxqfwL0xzcQPmCAKhRlygwLH9SXvIxVemPmpGwEt/Uq4eRcgPI8bj0QsQ1sPQIlN/TN7 tRVVTdlzb0yZq/cW0y53aQLdAcK0gjElq/6rS6R1M9FJz36QgHZ7sv2GaaLgZZXME3dSkj +MbSyaTb961dG4HUIMWzubdr0CFo6s+QogKz0AVGn0ke66Wftu1jVWueQbfsxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vk0Hb69xXz15NX; Tue, 21 May 2024 03:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L3Rdjo052798; Tue, 21 May 2024 03:27:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L3Rdv1052795; Tue, 21 May 2024 03:27:39 GMT (envelope-from git) Date: Tue, 21 May 2024 03:27:39 GMT Message-Id: <202405210327.44L3Rdv1052795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 828e648b26ea - stable/14 - intro.2 as errno.2: Update maximum hard link limit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 828e648b26ea1d3d77a63eea395bba56b5109f2d Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=828e648b26ea1d3d77a63eea395bba56b5109f2d commit 828e648b26ea1d3d77a63eea395bba56b5109f2d Author: Alexander Ziaee AuthorDate: 2024-05-04 14:54:20 +0000 Commit: Warner Losh CommitDate: 2024-05-21 03:15:00 +0000 intro.2 as errno.2: Update maximum hard link limit MFC after: 1 week Co-authored-by: brooks Reviewed by: brooks, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1192 (cherry picked from commit 6dfbe695c3223822734dddc926415a3ba347b42c) --- lib/libc/sys/intro.2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2 index 5b8f437567b8..2232d56707a7 100644 --- a/lib/libc/sys/intro.2 +++ b/lib/libc/sys/intro.2 @@ -229,8 +229,13 @@ system call was issued on a socket, pipe or An attempt was made to modify a file or directory on a file system that was read-only at the time. .It Er 31 EMLINK Em "Too many links" . -Maximum allowable hard links to a single file has been exceeded (limit -of 32767 hard links per file). +Maximum allowable hard links to a single file has been exceeded. +This limit is a filesystem dependent variable +.Po +.Va UFS_LINK_MAX No on Xr ufs 4 , +.Va FUSE_LINK_MAX No on Xr fusefs 4 , and +.Va TMPFS_MAX No on Xr tmpfs 4 +.Pc . .It Er 32 EPIPE Em "Broken pipe" . A write on a pipe, socket or .Tn FIFO From nobody Tue May 21 03:27:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vk0Hd19x1z5L1xl; Tue, 21 May 2024 03:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vk0Hd0Yrmz43K6; Tue, 21 May 2024 03:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hKOSXIccseZuPeaJYz6deNvNUtj5u/BXBuhgpdfQsMo=; b=qXNXHMPkY4yGoQz+K8NTkRhPVpc5+8OJ075p1hyW/zAul0ca4y6B1cSlTkUcoi4MbIBW6Q 3yydGxIEn8hsBPH2vDBHGkjOcweqm2gKcELPdLpT76UFM64TDgnWNycEM1IhQGEy5LKMxC v6EEBM6GAJ3Hdl1Xwhh2cHKDGhFDv+ojGD5oralIeh0FjlrymGvWNe+SZqQ6wKoMWk95cx SrwBlPx19eJngs5lsIYRxARcA0bfluK8GNSvkB7+42CEcqHhKZgSp0rSkvR5SjyZvVRg6j 6Xxv4SZY5SzdnCU2n+Xj9Azn+PK5rYyUmkh+ddy6wdYeiWcFNnMCIK1/V+sKIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716262061; a=rsa-sha256; cv=none; b=ydIVLJRMkEpbFVkcsS8SGt3wkbVK86CTV82ermqKfTlut0M0g65/HzxJ11zHG4LEG7XB+U ebAHSAyA8YE0eFBa4KYYq77s9aOTxcfkqF56H7Nw9yJRht9+T55+p4hRNofuUc6SQdFIhq aobMgj2/13dfG5GpVVXEKTkeZP6C5/zQYyZSxGBVhXYiL19jZxTVGqTEvX97viHKk1IfXA HtYbmv8WPB2nUNfujmJf9SInkJ0X9w/gFzxEpj7lnrfaQw4SY9YeE7iT7zXHBU59q7Pbd4 bOPq1nzBnBl/j/jUBtSDLMl20C3rtaGA7rOdU32QDvKHkSvgZTIs9WQsuLFL1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716262061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hKOSXIccseZuPeaJYz6deNvNUtj5u/BXBuhgpdfQsMo=; b=Rxt7FK9VrSoa3uZeqxrptMoUmAy6qEAhb3D3hwng7nv6dUHIguzudQgiwckPj6dVnel6OP tV/CLTQ6Pn0AKd/XBkrcX4By8axK9VZSG866e5Np+xUdRImvXpud0clwjyFTJuXtLtqA2s g92VLhxGy/WbutF4R1asoPvuj2D7hWcEqH7SxAxs/2FBA/ePoz6TigYxBik1bpK/q8Ua49 72PVTaPnPBSvQcYzG3FMdpZQUyV/4/Ur/Eiob8wzdizDhJ5noh8BGMLxBOb6n89pFSz1ua +CdHlPGCLvHQo7+HFUQmywfvk++0kaXCY/poY1R2qTkKr26QnRbSdokofECX6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vk0Hd03t0z14kK; Tue, 21 May 2024 03:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44L3Re74052843; Tue, 21 May 2024 03:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44L3ReCf052840; Tue, 21 May 2024 03:27:40 GMT (envelope-from git) Date: Tue, 21 May 2024 03:27:40 GMT Message-Id: <202405210327.44L3ReCf052840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5dced4143910 - stable/14 - networking.7 : create network quickstart guide List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5dced41439109368a8f3c9a818fe518542d7063e Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5dced41439109368a8f3c9a818fe518542d7063e commit 5dced41439109368a8f3c9a818fe518542d7063e Author: Alexander Ziaee AuthorDate: 2024-04-17 15:51:35 +0000 Commit: Warner Losh CommitDate: 2024-05-21 03:16:16 +0000 networking.7 : create network quickstart guide Now that the handbook has been moved to ports, I think it's very nice to have a network quickstart guide in-band, in base, in the system manual. If the user uses any of the following terms "man -k {network,networking,wifi,quickstart}" this page will come up, which is I think a very common use case for new users. Currently, this document explains connecting to a basic Ethernet network, a basic wifi network, scanning for wifi networks, and airplane mode, as well as linking to other sections, including the handbook Co-authored-by: Graham Perrin Reviewed by: imp, bcr, freebsd@igalic.co Pull Request: https://github.com/freebsd/freebsd-src/pull/833 (cherry picked from commit 75eda0096bf83b9b88996d9903b5d4e504047eba) --- share/man/man7/Makefile | 5 +++ share/man/man7/networking.7 | 101 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 11246195201c..7f506c1dfc5f 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -47,6 +47,11 @@ MLINKS+= c.7 c11.7 MLINKS+= c.7 c17.7 MLINKS+= c.7 c2x.7 +.if ${MK_INET} != "no" +MAN+= networking.7 +MLINKS+= networking.7 wifi.7 +.endif + .if ${MK_TESTS} != "no" ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/doc diff --git a/share/man/man7/networking.7 b/share/man/man7/networking.7 new file mode 100644 index 000000000000..869812c05a9b --- /dev/null +++ b/share/man/man7/networking.7 @@ -0,0 +1,101 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 Alexander Ziaee +.\" +.Dd April 17, 2024 +.Dt "NETWORKING" 7 +.Os +.Sh NAME +.Nm networking , +.Nm wifi +.Nd quickstart guide to connecting to a network +.Sh DESCRIPTION +In the following examples, it is assumed that we are connecting to Ethernet +with the first interface found by the +.Xr em 4 +driver, and Wi-Fi with the first interface found by the +.Xr iwn 4 +driver, though your hardware will vary. +.Sh EXAMPLES +.Bl -tag -width 0n +.It Sy Connecting to an Ethernet network with DHCP: +.Bd -literal -offset 2n +.Ic # dhclient em0 +.Ed +.It Sy Connecting to a cellular network with USB tethering: +.Pp +Load the USB tethering driver, +.Xr urndis 4 : +.Bd -literal -offset 2n +.Ic # kldload urndis +.Ed +.Pp +Ask for a DHCP lease on the USB tethering interface: +.Bd -literal -offset 2n +.Ic # dhclient ue0 +.Ed +.It Sy Connecting to a Wi-Fi network: +.Pp +Identify your Wi-Fi hardware: +.Bd -literal -offset 2n +.Ic % sysctl net.wlan.devices +.Ed +.Pp +Configure your Wi-Fi hardware as wlan0 interface: +.Ed +.Bd -literal -offset 2n +.Ic # sysrc wlans_iwn0="wlan0" +.Ed +.Pp +Set that interface to negotiate a DHCP lease with +.Xr wpa_supplicant 8 : +.Bd -literal -offset 2n +.Ic # sysrc ifconfig_wlan0="WPA SYNCDHCP" +.Ed +.Pp +Enter the details of the Wi-Fi network: +.Bd -literal -offset 2n +.Ic # wpa_passphrase \(dqmyssid\(dq \(dqmypassphrase\(dq >> wpa_supplicant.conf +.Ed +.Pp +Restart the network interface daemon: +.Bd -literal -offset 2n +.Ic # service netif restart +.Ed +.Pp +.It Sy Scanning for Wi-Fi networks: +.Bd -literal -offset 2n +.Ic % ifconfig wlan0 scan +.Ed +.It Sy Airplane mode: +.Bd -literal -offset 2n +.Ic # service netif stop +.Ed +.El +.Sh SEE ALSO +.Xr bsdconfig 8 , +.Xr dhclient 8 , +.Xr ifconfig 8 , +.Xr wpa_passphrase 8 +.Pp +The Advanced Networking chapter of the +.Fx +Handbook. +.Sh CAVEATS +Shell Special Characters in the +.Ar SSID +or +.Ar passphrase +will need to be escaped for +.Xr wpa_passphrase 8 , +commonly using +.Ql \e , +see the manual page for your shell for more details. +.Pp +Currently +.Ql Ic service netif restart +does not restart routing. +A common workaround is to issue +.Ql Ic service netif restart && service routing restart +instead. From nobody Tue May 21 17:53:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkMW64gv5z5Ltn1; Tue, 21 May 2024 17:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkMW646mDz4rGY; Tue, 21 May 2024 17:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qUHgV+dvTAZhZcffN0nKM/1XFfQGiZR9DD/U23+2cpk=; b=UOFBk6xYSM2TM5Gv0lfmv/f1wyT/PU5RbWxF1dFxIq41TQDnrJ/qbUQDDb4uk+0Gb5SNwN ODaTSRyx5GOcX/MCOBylKLQSMTf3Luu0d0BR6sfguK4UlfRMP5ERLzO0bIqVspQ76/UaYl 64rArAybvEyxcYEQqriNqrCsjy9Fr6NSqF55jrpScXXx2aT+/ej0Ff+rkIbW/5mfydkYZg uIRKVRBIHMnm7GVA296Ls0q8BZ6Y56kaceJv0tl9i3LwG8sZjVlGNQB5lpcWxG34jDNHKQ jefLQniKAK6DTAfS0+KrNMZ/YpGSQnC/HSZlLs2KK5laG4R9rGrEMesidlCkGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716314034; a=rsa-sha256; cv=none; b=X5A9zMFA1ejvVQPxawIzfD8Cel3yVgGaaZBNK/64XTDjBvfJNQcBtgTHqY/0JX6kc3XYDX 6j1R5LfP2q0d9CtHG0ljHwP8zmfO3pNCd0iI3bhecQGmlkO4XsSK6Ex6K+bjhmXZgLC3sg rkDQw++Imth4Gz5aNKeCKqMqGqZhNiF/BR4Uvv9GVepXGGPAO6rw0pEHEA9e8f8qzutstq igFmnTkHpMvUBLGq6lwU4Zda5bkhv9DOdg2hbG2Y27YGVjwkwAb5SaWN2q44CWP3YGOq2D CxLwIowNfDTRtha4G+oYicvg/yA3iIA48ODj9P2lWDSn3KhyfjpPqvikiylG2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qUHgV+dvTAZhZcffN0nKM/1XFfQGiZR9DD/U23+2cpk=; b=E7uAUHIiQcqXSxJt4V6yrFxtwYIn2SL0E8OVrFAu1MHB7PahuduXz/jcWvviWPMYvBBk3f T1bPcWN8/4+f7aonSCIxG/FrbVHmwg5LA2HzkafPWkJVZi4tVctrbvXEMLKiiGT07Ufewh aUhHI8GB2tbf7IG7xB7lx+QuN9M0CPnqS6pVilH89T27HQ8sSNLwqJ6w5mjpFSpWiOYDL8 mplNkrB5Y6+ZKNXnItlrayO3CkY66aNtqMIWw5GqxyjDgDelMIuUABoCy5Q8c+X7+cUvjA a2bZo34i06PDOldpmp9C0Y0NtLYx14VAURRfhTJnc+TnQPEVi4TRsEaBnQwMxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkMW63jm4zXbJ; Tue, 21 May 2024 17:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LHrsml021605; Tue, 21 May 2024 17:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LHrsWA021602; Tue, 21 May 2024 17:53:54 GMT (envelope-from git) Date: Tue, 21 May 2024 17:53:54 GMT Message-Id: <202405211753.44LHrsWA021602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8a15d5e7223d - stable/14 - sound: Get rid of redundant assignments in chn_init() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8a15d5e7223d0df2cbba63ad0b1ea453d528e711 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8a15d5e7223d0df2cbba63ad0b1ea453d528e711 commit 8a15d5e7223d0df2cbba63ad0b1ea453d528e711 Author: Christos Margiolis AuthorDate: 2024-05-20 14:14:17 +0000 Commit: Christos Margiolis CommitDate: 2024-05-21 17:45:30 +0000 sound: Get rid of redundant assignments in chn_init() c is allocated with M_ZERO. Reported by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45273 (cherry picked from commit 2db2292dac7331be5414f86c3ef7863c7b6a4ac6) --- sys/dev/sound/pcm/channel.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 846885b9d729..039d9abb9da2 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1261,8 +1261,6 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, bs = NULL; CHN_INIT(c, children); CHN_INIT(c, children.busy); - c->devinfo = NULL; - c->feeder = NULL; c->latency = -1; c->timeout = 1; From nobody Tue May 21 17:53:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkMW75PyHz5LtpX; Tue, 21 May 2024 17:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkMW74lCdz4rBX; Tue, 21 May 2024 17:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Dv8lWNAK85oNlprZwpGG8BCLI1rrJK3rTAo9D6TDJM=; b=QsR1pRqF66vWSH+1xRAFbXmmZ27avLMeCanWf1e69wuVlGGGznDsB3ENI4Po+1nAOJYwRe 2vAEJs/zsZz5nsovH+7SOqpHh26GWzPajwF+lkIPZZT3RchpW8F/qyvhKewJqd8FFTjzyh 9w+Ko8zYlqYgm6C0Q3co1Wpj+/wYRkFY0Y+eXQ5XZM0zlJ8ipmFJZfCt14Xn6vpkgOL462 sIhBYMqngLa7erV4HlcKvRpiM0tR3A84QhpSCOKqm2lMNtMkcM+MC2pEEfAyVcd6ea+cAy EkMH5vDUS5ITe4yNrMlNpXnF7Hk5eC4ZrKECrJWQ+acRO1OkitqFcRekvT9Q3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716314035; a=rsa-sha256; cv=none; b=tyzR8cLtZNP0a+r/77TCWBVyxSvJOmDkoLLuvnX8QyLDWmNpxD5rmh+aocI8E1kkL2EZJl fEegfqv2AnP7tcoJUW9s4SjQtknNco3UCp7LWdmJxYMm/NhFdxip++Ll7CcFMaFzgKwzG5 zONoBjEOne/a9Rn8fqbCxmnLRWgA0ccpuipZsA5u89hzaa6bZa6DGKN4oMm1TPpObR5Crs WS6+9SDUUMm+xIWWuX1BINl+EkByK/rjCyye+j+FzFW7oSrfguJyFGLYsH32WHKvrh8Wbh yOf/WsK27ngNutnmkDi+K+wFRI1rOQt1Yg4ugTMiMOi+EtSKshPneb5MSH32lA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Dv8lWNAK85oNlprZwpGG8BCLI1rrJK3rTAo9D6TDJM=; b=xFq5aREioxVKHrBB9D0+FVDyguw7zHV2d6uqAenUEKMVY3TZU6PICVJpQrU+TqZ2hPhqv8 wBMaPJ+z+Wh6BYfzoSZ5DqJ0IUUQfnjRAKfwhe18zPfQB2+P+QJGB7g9w3SAsNzsNX3RsQ mDKB7uEJcLfSH6Je5Ffx7zpaqrtZkZQyaMPHLl6gemfwvIHzf635PfIHBmncxBmQzn9qzH G3XMHs/dONPo9PdAFGsFZlOHLJaJnU5fiX0PEo9BrNofKlAkFFq6ttWdfvgmZ8X2vMnQQb UIxtfRCtr9YirmcbTq4Mlk6pYKPOaxHQANGk1bwpyfB0tmk1wfQr+7Kxv9qS5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkMW74Lg5zWmr; Tue, 21 May 2024 17:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LHrtud021661; Tue, 21 May 2024 17:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LHrtlf021658; Tue, 21 May 2024 17:53:55 GMT (envelope-from git) Date: Tue, 21 May 2024 17:53:55 GMT Message-Id: <202405211753.44LHrtlf021658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: bca6f391aed9 - stable/14 - sound: Prevent uninitialized variable destruction in chn_init() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bca6f391aed9ecc01d6b7f496ddb6a17311e4c2c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bca6f391aed9ecc01d6b7f496ddb6a17311e4c2c commit bca6f391aed9ecc01d6b7f496ddb6a17311e4c2c Author: Christos Margiolis AuthorDate: 2024-05-20 14:14:25 +0000 Commit: Christos Margiolis CommitDate: 2024-05-21 17:45:41 +0000 sound: Prevent uninitialized variable destruction in chn_init() If dsp_unit2name() fails, we'll get to out2 with b, bs and devinfo uninitialized, which will result in a panic. Reported by: Pierre Pronchery Reported by: Coverity Scan CID: 1545029, 1545025 Pull-request: https://github.com/freebsd/freebsd-src/pull/1240 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45272 (cherry picked from commit 5d1a5d6f1f599a4fbea9634cbe5c77f7370e1a5d) --- sys/dev/sound/pcm/channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 039d9abb9da2..a18ef1cf4234 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1236,6 +1236,8 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, } PCM_UNLOCK(d); + b = NULL; + bs = NULL; c = malloc(sizeof(*c), M_DEVBUF, M_WAITOK | M_ZERO); c->methods = kobj_create(cls, M_DEVBUF, M_WAITOK | M_ZERO); c->type = type; @@ -1257,8 +1259,6 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, snprintf(c->name, sizeof(c->name), "%s:%s:%s", device_get_nameunit(c->dev), dirs, devname); - b = NULL; - bs = NULL; CHN_INIT(c, children); CHN_INIT(c, children.busy); c->latency = -1; From nobody Tue May 21 17:53:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkMW90HwXz5LvBl; Tue, 21 May 2024 17:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkMW85xK1z4rGj; Tue, 21 May 2024 17:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FBkqCSTxQ4EYyGht9D3VaLG0TWlZ+qwNchLwL3YI91U=; b=mYVU16DmdzEEOvWHHaP2PArsI/daHRzc1rMIuEZFLAbXXOE/dvOa5FEXykDE0p5nb5rvbS st5IikH8f3vQ5cNX52J+jR5axYTLR6V6hOJqaSj4JYS/73zawHEHiaBGVxMTAWRCw8cXAT izvoXQnNE2M/z9N6j1aI1c/YpyhEtKy7a+zzlArKV2DbjCF65bFPv5FA7hAfOSfBnYCyAZ OxxqNIA5k21PZ+0SWcEOx80Iaz8qP/rcDDetwIGqu8BwCf2EDJNITzfaV8R30fx5dHfDWQ FLTAakZpEDD2IP+tJ7+TP52QkeCG3Z5FXP0qoTE0e4Ce9yr8Qm2CbEN2/BlsdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716314036; a=rsa-sha256; cv=none; b=jYKC8VN2VW0nvO+FxgpSmavQVndGtGDq9XbqsydlIgxpE6EqV24GhDrtIXMaN4P0vYc2jE ruDIUMv3tcWdEll9y/9vfTy5pwrY6n/0mr14IatO0h8EnoJVvP7ZUgSAJsTC9zfERP1ZYi 63TLZZrVP9VBHv/zizFjSzZwKUUCeHIMUIULWkUXm86I9yALAVlRIiOSxnswmi843MmKCr hcID6I+gz5Iocxitx9fgUKgHhhxPK69MQnzI5eyw1BNuLICuSHB0IDgEjFlfiSvB8oiH85 V/5Hc7l7ZSlJeCVp05i6LfC4XHzY5JDzgJ3ixpT4Bzu7+mnqYt93IP3OSLSxww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FBkqCSTxQ4EYyGht9D3VaLG0TWlZ+qwNchLwL3YI91U=; b=e7niZbPh2dqdvfGIdrUDcIaeKu8dG/wjopUDWh632YjIp120lyvrhMQavs/XcytIsZnQwU KHjvKsXvh/2nRMmwy0Havpk+CNm+PvoF4K17pgQ0YvPlYIZpfDBMwBzDpftQDBTgv0R78B TwGT2HLdMY6b8vCoP1xpJ8ABsciUrbEVVfY3UVQy++6JoL50CewEA0N3sJ+CiwXLBQmIWv YrFVGJid0XmSQZMK6hkE/RPONiue0gCmryDGFuOQbPTxBfEVpDyoPsgafqwd2YjoLw8oR4 cOYxJVZFk+vf14MBSVEKvfghlI2ne2L6T46HTlpCyK+A/o4vEVio7mRDYuBkKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkMW85Y7lzXdK; Tue, 21 May 2024 17:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LHruGD021710; Tue, 21 May 2024 17:53:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LHrunh021707; Tue, 21 May 2024 17:53:56 GMT (envelope-from git) Date: Tue, 21 May 2024 17:53:56 GMT Message-Id: <202405211753.44LHrunh021707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 5830a00c2c54 - stable/14 - sound: Check user-supplied size passed to SNDSTIOC_ADD_USER_DEVS* List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5830a00c2c5485ec17900558e4f29c459c6a1f3e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5830a00c2c5485ec17900558e4f29c459c6a1f3e commit 5830a00c2c5485ec17900558e4f29c459c6a1f3e Author: Christos Margiolis AuthorDate: 2024-05-20 14:18:28 +0000 Commit: Christos Margiolis CommitDate: 2024-05-21 17:45:49 +0000 sound: Check user-supplied size passed to SNDSTIOC_ADD_USER_DEVS* SNDSTIOC_ADD_USER_DEVS* expects a user-supplied sndstioc_nv_arg->nbytes, however we currently do not check whether this size is actually valid, which results in a panic when SNDSTIOC_ADD_USER_DEVS* is called with an invalid size. sndstat_add_user_devs() calls sndstat_unpack_user_nvlbuf(), which then calls malloc() with that size. PR: 266142 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D45236 (cherry picked from commit 074d337ad618f9cc2a1d5ab18b484928e57bd72b) --- sys/dev/sound/pcm/sndstat.c | 5 +++++ sys/sys/sndstat.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index edb33e92ade9..f310d8f3bff3 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -864,6 +864,11 @@ sndstat_add_user_devs(struct sndstat_file *pf, caddr_t data) goto done; } + if (arg->nbytes > SNDST_UNVLBUF_MAX) { + err = ENOMEM; + goto done; + } + err = sndstat_unpack_user_nvlbuf(arg->buf, arg->nbytes, &nvl); if (err != 0) goto done; diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index f0e4d352242f..8a49042b0453 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -74,6 +74,11 @@ struct sndstioc_nv_arg { #define SNDST_DSPS_SOUND4_PVCHAN "pvchan" #define SNDST_DSPS_SOUND4_RVCHAN "rvchan" +/* + * Maximum user-specified nvlist buffer size + */ +#define SNDST_UNVLBUF_MAX 65535 + #define SNDSTIOC_REFRESH_DEVS \ _IO('D', 100) #define SNDSTIOC_GET_DEVS \ From nobody Tue May 21 17:53:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkMWB3CzLz5Lv0y; Tue, 21 May 2024 17:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkMW96yKbz4r6G; Tue, 21 May 2024 17:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1qfZyL+IqSkiwEZYcfKFT7j6gRxaarXn+iKxg88OoVk=; b=i8IUxiJrLL7Hgo64pN0zRfsueIsvlgc8jQSQOb1ObM/SMXh/WwRSPmYN7+RvcWtm45R4yf w9KiD4pH88sdifL42cs7BOpsHrFcXSgrurPyVWf1AA6udGdgckzO2hQMqYTTEdZVrhQKNr J7ndPY3KVJ8mk01BRKwfJiz2smVzC4zbUKHuW102pQNwvyO34EnFEoQWNy0sHQxkDeyXr0 EOlfO78uH87gmJMufv17UwbZUq8rjE4U0z8YOV5f//itrc4n5DVbM2E3ULi+awru9Z/KNn 0jeJmAqfUUbLoDCZ0z6zfH578etKTCycXklQA+yKZG/dsqE4s8BjmI+YzY1W+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716314038; a=rsa-sha256; cv=none; b=oKi3idVndtWcI/jRX3Bx8LxZgRb4vBUcHfz5uR2S93xuRy3WFnKAlnj7VvDWTt0PxOH6ET D0XU6wHGIyd5cQyMYtlyhpg2SFaaS1ZQIbnXfeBEbaLBfS9OHoh7EbBXTnsSGrazz+2029 l+A/wyXcGbAZJ8BUHhabUgIqEMQ6VlxWbbLOhyVwjR5anjR+FUPHhr2cLWOimgOwwsg/B9 emjCWv0l51dbTrSQcyJR4XRN0rCaROe73IE/tXZT1BGQAw2Lrl8AnsCd/uAp9hfbesG2lM Gu3/vNwo6Rb24xcDhVkkkmCMHCF3FFRldYHhWLgl4xSlsnBBVQsWox5rGAqaJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1qfZyL+IqSkiwEZYcfKFT7j6gRxaarXn+iKxg88OoVk=; b=IX9lXCZrSBQJdqwyGWnAufkUjVOabNqHHVp/SVDv/W3MZJanrDILIaYt1u7ghm0kXefbij J9bVL9K+6gZrZw+OY8N7A23cbqauQgn5hw6E4+FvO6k479/NWA86PIygCVfdz+un8ec4sT 93dm4bREqpv+CZrAj7+ZCZyMs1/MS3lsbrNZCsjCtynyMp9ETSBPkoN6HKGybOrdVFVqC5 a0lEo14p9fTLZOP+IbzjwfbJ792fufxwF6RlMquIhTUd8axdEDTCkmMHb63a3ujK6W5W8f n2gKcuJMmB1awPk7pY7zo64mjn14GT9tZDpVHFM1M+7UtRYtUhVpaXcCVjLJeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkMW96ZflzXpR; Tue, 21 May 2024 17:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LHrv83021752; Tue, 21 May 2024 17:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LHrvqm021749; Tue, 21 May 2024 17:53:57 GMT (envelope-from git) Date: Tue, 21 May 2024 17:53:57 GMT Message-Id: <202405211753.44LHrvqm021749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 45feaa73c680 - stable/14 - sound: Correctly check nvlist_unpack() error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 45feaa73c68011bbba647d1eb6f86a166a0453e9 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=45feaa73c68011bbba647d1eb6f86a166a0453e9 commit 45feaa73c68011bbba647d1eb6f86a166a0453e9 Author: Christos Margiolis AuthorDate: 2024-05-20 14:18:33 +0000 Commit: Christos Margiolis CommitDate: 2024-05-21 17:45:55 +0000 sound: Correctly check nvlist_unpack() error The current check is never false and if nvlist_unpack() fails, we might panic later down the road. PR: 266144 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45237 (cherry picked from commit 64f4e2db6d19d8ab520903a197fcaa8cc7ab9f9a) --- sys/dev/sound/pcm/sndstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index f310d8f3bff3..bbcb2fda7c29 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -705,7 +705,7 @@ sndstat_unpack_user_nvlbuf(const void *unvlbuf, size_t nbytes, nvlist_t **nvl) } *nvl = nvlist_unpack(nvlbuf, nbytes, 0); free(nvlbuf, M_DEVBUF); - if (nvl == NULL) { + if (*nvl == NULL) { return (EINVAL); } From nobody Tue May 21 17:53:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkMWC3SXqz5Lv10; Tue, 21 May 2024 17:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkMWC11lnz4rPy; Tue, 21 May 2024 17:53:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iNvWCtvvKybhuw4z83o5PNcqc4XrGwxaChgClzYhFc8=; b=Y1ie9EBVw5T7xPFpzgGTvmjdx+J1qS8KTJw4WQCu4pRE92nAhEkAEY3aqfJB1UUaga341X yMKpHeM8tZlOIlV7+5iB94ujuV4hN/+fWVaZyYwaFSlT3yHy/5liy7oTvL7h/AoJKtyZ8z Hlq/0XXqZZIWuFF3N2MC7yY99IZBMtFdrPtKqBqYd0n2IZdfP1+uOE+Zi7ofwlxphluQR3 FN82DQRT5JOl8Ku/mFt/dcN65xnstuXzNpnvYayBqkHPvdfr9ddIgZkcTbkCQ4uUhw1uGX rN/qRx1XgqPpYqpBkiRh8pJbE/PNsR1byldhwX04qcn4QmxNvJ1PedIlo5Oqrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716314039; a=rsa-sha256; cv=none; b=Qpd2NaFPwxd6J06sxW+c0Vw9VGvBWnQnQLoPik/pOXGMqVoJuds6CCUQWmDySxdw5VQDmA Kc82yrCPzYUB3PT2wjqrWXHX7KkEkj8c68whxerkxgNBogc9vyddMcPjJXlGQ5kdJY8TRe f5vPCG/Xp4rNOrWp7dzodxoZ3jKbRBNXedAAPEY85XgrWG6nxe/uU3V94QvIdolF63YqEx QR9sXWdQuHTmGtfMwWxRPtHeKuucCDlvQuXzMSPPtfNEPtJY3eNKgPe9tgptYV2BTjTosn pxPwK62s6ASXxtQCKpYt5Ig1SSMibVh3FroEzSCGHfMwLl44fZOQaSsjYrX7cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716314039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iNvWCtvvKybhuw4z83o5PNcqc4XrGwxaChgClzYhFc8=; b=LifLNnsB5Sr1xSPGXEJsS/7ngOKFRNIw7Wi36k0nEtvt1K9UPAoRixpbyRUYwGsexlA7eK Ld3L9wW4+plVaaPURxSRfTrStlJtTT8/cc6XH8+w7wd2jTsd81m/U2lgdd4ZOg0kD4uOMQ FT/w7K3KFboVyJJ/FCfEWdLWSx4cOAhOBys8jPg0+OVqJsbuTaN++lrP89MVOsOS9Sw3tT WKg8H6EW5XWPSnXvDDqThOnFX1kiKTq6YQWydIoZCauhsMXW08rvN5Q/8RUmX2auanWij2 cgC1TrP9iPZ+H0uA7zNxieGsf6/YiLE2KBg5lCWGHnwdBWA9OUCMDU/ZliCasA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkMWC0VnbzXqD; Tue, 21 May 2024 17:53:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LHrwk6021800; Tue, 21 May 2024 17:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LHrw8t021797; Tue, 21 May 2024 17:53:58 GMT (envelope-from git) Date: Tue, 21 May 2024 17:53:58 GMT Message-Id: <202405211753.44LHrw8t021797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: eba949c37e64 - stable/14 - sound: Make SNDST_UNVLBUF_MAX a power of two List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eba949c37e6473a07a6e3a386f239aa0f49a4c93 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=eba949c37e6473a07a6e3a386f239aa0f49a4c93 commit eba949c37e6473a07a6e3a386f239aa0f49a4c93 Author: Christos Margiolis AuthorDate: 2024-05-20 17:41:18 +0000 Commit: Christos Margiolis CommitDate: 2024-05-21 17:46:01 +0000 sound: Make SNDST_UNVLBUF_MAX a power of two Fixes: 074d337ad618 ("sound: Check user-supplied size passed to SNDSTIOC_ADD_USER_DEVS*") Reported by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45277 (cherry picked from commit d59058f3b31353442497e728dd5beb80585ad8d2) --- sys/sys/sndstat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index 8a49042b0453..e0e403b1a72a 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -77,7 +77,7 @@ struct sndstioc_nv_arg { /* * Maximum user-specified nvlist buffer size */ -#define SNDST_UNVLBUF_MAX 65535 +#define SNDST_UNVLBUF_MAX 65536 #define SNDSTIOC_REFRESH_DEVS \ _IO('D', 100) From nobody Tue May 21 19:50:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQ596zyhz5M7GR; Tue, 21 May 2024 19:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQ5968SRz46yl; Tue, 21 May 2024 19:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716321005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6OhIc9BbZxRtnq63E3h6nJGX6Rktvebnq3f5ecfoVAY=; b=qvWYT9o/D1jO17+PrJsLrIE4pBX6GI4BA2ykkPTJ+NPK/H3kMrWoF1bgYkbn31YVXyFoUT 5uQWdWDKov9pDAmHND6R/2rEMAWrGWJaqQNzVbf/Nyb6C5LtdJXOUtEAtRSYVrolR0ULCY dE1j0WgW5zQ3i8MVRCvn9oon+zltdOw5REi2M5eiuM68aDeb/y3GVfpfz+Xc6wfPYcGpbZ /X339c1WYS9Pky2C73WjgA51OtxvexWF9hlYcAzqZCjMRZV/fDGDeKhMDdFVXHuN0A8NLz FiFq2vc3Oa+wHcAw3j315NqthrviItDtttzpLunAX5r9OEFJwmN+tIugDmy2gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716321005; a=rsa-sha256; cv=none; b=NBCenC8hcNEo2bfQNslbcgx9ZGp2XnaWLXLGSTQMLiGIhXBSaoxa5X8lMGMmqa0IDeQcK5 VD0HjOGzF73YKQI7hZyCnN+/wYsT2iXRaU0IJ2ew+X0LElcOIV5lnNzgL55jr7aljZrz5M AeOoEP2xK2IGlBnK2x3jxs/fg2pLorb1bsiw3MpEEmbVLvIevqN9pvrTlQA3uWOIKekief NQrK7958ZR4WDIp37L7X7PELGyPe7qELuTz3DVWB/Z02Wr3uA6mSvUa965zwxDdE2ZxNBM 5UmKio4FtlkfCIuEmZaYUZ6HGbESxxAz22RHvRBDUF7Nrl5h52Xl4bhfwadH1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716321005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6OhIc9BbZxRtnq63E3h6nJGX6Rktvebnq3f5ecfoVAY=; b=SPqnTEBN/xhKcDe/ovjhq4R27pjK0sGw7udzrCAu5Sb5yRfADYWpIMPD7YKy/w3OpSH7KQ /NRog2jkkp+aZ58jokvoa0KcOzRJY1HNZNk9BFakpnU8uwRLHE6l5V0usCeZgsPXXZVxRf 3JInHlNL+p2wJ5XmbM0jgfR5Z4kmmYzMQ+l+qUIgSM/GXdYn7tE8zxFFW7MzwhsPRQsief Nc8xq8nYImPk8k6WngM3IOnmA7MOGMJsbGc+bMgy8fj69mKGdUnEvR14+Ocdf168M7kRI7 NimBJtrklesFXwECj406cfYKWr3W6ARBzG9v8v4Uy27mej1y1eXH3ccFzWkQeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQ595lwHzbJj; Tue, 21 May 2024 19:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LJo5LS010798; Tue, 21 May 2024 19:50:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LJo59u010793; Tue, 21 May 2024 19:50:05 GMT (envelope-from git) Date: Tue, 21 May 2024 19:50:05 GMT Message-Id: <202405211950.44LJo59u010793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 07f3a9eb1c35 - stable/14 - alc(4): disable MSI-X by default on Killer cards List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 07f3a9eb1c35cab2d371895f9ed5bc33d27e1815 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=07f3a9eb1c35cab2d371895f9ed5bc33d27e1815 commit 07f3a9eb1c35cab2d371895f9ed5bc33d27e1815 Author: Lexi Winter AuthorDate: 2024-04-22 22:09:26 +0000 Commit: Warner Losh CommitDate: 2024-05-21 19:43:34 +0000 alc(4): disable MSI-X by default on Killer cards Several users with alc(4)-based "Killer" Ethernet cards have reported issues with this driver not passing traffic, which are solved by disabling MSI-X using the provided tunable. To work around this issue, disable MSI-X by default on this card. This is done by having msix_disable default to 2, which means "auto-detect". The user can still override this to either 0 or 1 as desired. Since these are slow (1Gbps) Ethernet ICs used in low-end systems, it's unlikely this will cause any practical performance issues; on the other hand, the card not working by default likely causes issues for many new FreeBSD users who find their network port doesn't work and have no idea why. PR: 230807 MFC after: 1 week Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1185 (cherry picked from commit 05a95d19cb248203acdd4e069d3eedfe597c3b49) --- share/man/man4/alc.4 | 6 +++++- sys/dev/alc/if_alc.c | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/share/man/man4/alc.4 b/share/man/man4/alc.4 index 478558657799..5ce5ce97d68a 100644 --- a/share/man/man4/alc.4 +++ b/share/man/man4/alc.4 @@ -136,7 +136,11 @@ This tunable disables MSI support on the Ethernet hardware. The default value is 0. .It Va hw.alc.msix_disable This tunable disables MSI-X support on the Ethernet hardware. -The default value is 0. +The default value is 2, which means to enable or disable MSI-X based on the +card type; for "Killer" cards (E2x00) MSI-X will be disabled, while on other +cards it will be enabled. +Set this to 0 to force MSI-X to be enabled, or 1 to force it to be disabled +regardless of card type. .El .Sh SYSCTL VARIABLES The following variables are available as both diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index be52822e1c51..2943be7063b5 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -92,8 +92,14 @@ MODULE_DEPEND(alc, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; -static int msix_disable = 0; TUNABLE_INT("hw.alc.msi_disable", &msi_disable); + +/* + * The default value of msix_disable is 2, which means to decide whether to + * enable MSI-X in alc_attach() depending on the card type. The operator can + * set this to 0 or 1 to override the default. + */ +static int msix_disable = 2; TUNABLE_INT("hw.alc.msix_disable", &msix_disable); /* @@ -1411,6 +1417,14 @@ alc_attach(device_t dev) case DEVICEID_ATHEROS_E2400: case DEVICEID_ATHEROS_E2500: sc->alc_flags |= ALC_FLAG_E2X00; + + /* + * Disable MSI-X by default on Killer devices, since this is + * reported by several users to not work well. + */ + if (msix_disable == 2) + msix_disable = 1; + /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: if (pci_get_subvendor(dev) == VENDORID_ATHEROS && @@ -1440,6 +1454,14 @@ alc_attach(device_t dev) default: break; } + + /* + * The default value of msix_disable is 2, which means auto-detect. If + * we didn't auto-detect it, default to enabling it. + */ + if (msix_disable == 2) + msix_disable = 0; + sc->alc_flags |= ALC_FLAG_JUMBO; /* From nobody Tue May 21 19:50:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQ5C0cZqz5M7DM; Tue, 21 May 2024 19:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQ5B6vmWz46sv; Tue, 21 May 2024 19:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716321007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FHwcVaaB71wgsEHwoN00KH+0FN18TNUAYNPov/7Y9qQ=; b=rLh2HoPGdWr+Bx7nKGmtYb590bWUCRZxv9sbhszmP9Rtt6GTobWSexuUR8PmUEUEo7pTnP RstQh+x1yJRgQxWnUStg6rebxxa4+PG6RfWEaxbTlcY7dOHMB5/Mpcne1EEOo2Qk0yT4N3 BTGVZvje1US6SG09EgMSECQAQtnrYhMURmZmKG8KeS+GNylj0yycYYZtDbTqVWShqLfD4J o2vQqEV57cnCkq3WBybJDMHs6H9A21F/M0hCj9tRgWo4mJkYPMdUtaWZdJl9KT/FnWNxU6 SyNKvQJlhTnA5YGCFuGaH6an+jfpILuiLMZu+fPkWv8E1CQ7SVSwdkzqHSiP9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716321007; a=rsa-sha256; cv=none; b=OWf3SxFGmVoo5LwrEmlql5XuSP+rlzv4DENUZPQP+ObNyixGzUuWHcp3edG3UPEMtXtYdF ezW46MKyNcI9ounWYfM88J26JQXzniWNICzv/Df+HAJrvPioGE365EW21bRpgBxnFJPj16 No5iFvCXDA5hdhN+WJ5jXq6tekPHBkRrSadQNoO+VG0mLFFE7XUtGsdKlkR/Bw3T9Nuey7 VclONxPZx3wIYPLeulzbkQLyLtYmEd29GL6BueEvFpINeQHJAaMljPyWvERF3VrlFxdz2f 39FeOKAR8xUtvcxJEtKoQNC6AGjvZX0DvHAEK4voZgQxfqm5Nmn8SHf33YIAKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716321007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FHwcVaaB71wgsEHwoN00KH+0FN18TNUAYNPov/7Y9qQ=; b=IFfs7/VAmj4AATkh7ucxmEjtJpbuZ9PMM7C2FwQBfv4rgbmHcdDsDQXozfezo0j1jGwdvh G32LInIXoaOqIlR/aBw37TNuczy4wT5XFyQH1TBKlxTdnpODlpX/SvrVJdFtSRJsCB0nZG OB6lxAM4KLHXf/xocWONUbg8RC9PgqRVgVu7UtIQN5se/iuNQ72gNKRW9nUP4WSpsHNm8K oL5rKXGBfeT6veIPY4EPrnZLb3/7VaENeHdUc7Vbd00a3VOHJw4SkadedHisAuWvnXGlMJ 7dQc73GvtGete23IAyENzT+E4bU4o9C/dJA29rkprLgA1uajVj1DajXOSrsn2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQ5B6WDzzbXp; Tue, 21 May 2024 19:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LJo6Xm011079; Tue, 21 May 2024 19:50:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LJo6gv011075; Tue, 21 May 2024 19:50:06 GMT (envelope-from git) Date: Tue, 21 May 2024 19:50:06 GMT Message-Id: <202405211950.44LJo6gv011075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5cbccac9f3d1 - stable/14 - ifconfig tunnelfib is implemented in wg(4) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5cbccac9f3d1484bff55dd53361c50cdbe8011c0 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5cbccac9f3d1484bff55dd53361c50cdbe8011c0 commit 5cbccac9f3d1484bff55dd53361c50cdbe8011c0 Author: Gregory Shapiro AuthorDate: 2024-04-22 22:10:00 +0000 Commit: Warner Losh CommitDate: 2024-05-21 19:43:34 +0000 ifconfig tunnelfib is implemented in wg(4) MFC After: 1 week Reviewed by: imp, zlei, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/1186 (cherry picked from commit f578d0199761136e82850d8f086b8806f2dbad8d) --- sbin/ifconfig/ifconfig.8 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 471d37ac1779..fa463ad8af5d 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -565,9 +565,10 @@ A FIB .Ar fib_number is assigned to all packets encapsulated by tunnel interface, e.g., .Xr gif 4 , -.Xr gre 4 +.Xr gre 4 , +.Xr vxlan 4 , and -.Xr vxlan 4 . +.Xr wg 4 . .It Cm maclabel Ar label If Mandatory Access Control support is enabled in the kernel, set the MAC label to From nobody Tue May 21 20:09:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQWG3ZZzz5M8wL; Tue, 21 May 2024 20:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQWG1yZBz4DZn; Tue, 21 May 2024 20:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KfhKnwzE+KoiHBcGFi17onb1fUzqImiFgQGW7qCSBRU=; b=YwieXZiFqx/qEvDrlfJUXtR+KvT88vVegdL8smsNkNbDCmzFFgEJh6oLmEnbvHUR5GCVYS H67+xs+3IIDp+7m3bD8jsaB4Ld+tIqb5m75fDpa6SlFACGak7qmJGzEgLbTefsVdLJMJND 1q+4xgdiQWeYDNXOddJWE9NIQhuSpam9dzafDiu/3EvhoPmB7nvyZuCXtTHh0p8eVxy/g9 R6tiQ/zZhsx24MFC9bsebYedRp8WXG7UgABtKlhxLcDbyqxiA/ArfCQBbpHbzhTcm2JULV 9ryF6meg8hwYh3SbWxHthYivVC1e/MB7WmCCKi2EOznLWCi5UHh9tcs7kqkVyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322154; a=rsa-sha256; cv=none; b=JzqEFOBsQTiCNfrm56NAO8tZvEDikOdvKfPnaIa8HTqOk3Ybc9jb9c5FiAtSjGpFJOrkVI mzJq/MS27CPc5VHE2GKMDwDeVyA5trrVLDQzfp3yQ+hQj8CiOSsRjvwYtYmJzSkWXdpzY7 qOJmh/TCPSGjmDRgLcOerWHatH+Cgb46VrMXRFikjms9rKkl0ACeMzqUvzpqm6s2TUslHa 0CWTHD2IBNgIm3yrAD/kbLrRjkYWvLbGOnHxx83gXhUHSKmQXtcQJiNlyasRuc78DZnQ6f IiSYfnPsGCqYazmLZISw3GKa8XVTim7Wz5e7t2c3YbVCZTb2eEVIU3dVG2cDkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KfhKnwzE+KoiHBcGFi17onb1fUzqImiFgQGW7qCSBRU=; b=LUepIKKDeK69BaJv3gkO7o8JH7S1yN8WLAXm+SiXhduZojLyZJLyWsNbeQXfxGR5bdRjTI R7xFeHijJJWAs3AcrIVwTwr2iNMqQ2DwqXVD5i23f8SqwaqkZMwKzpbVAbo2R5anuYxHjt Yr1lHpyQO9kkgBqW9A+4qg8bsyHTVjtwpFSwavJfM6jk4hJSmsOBTYp3tqI4GKPfuOt/L9 1miyNzamxV9r9mnVJO2v1uvEpcl6hrUwK7Q+wDSsjlkhxb1QzIYMvVg8J3Fx0VU2DOJ7FX ZvmdQJIHFibU/bHz6M/I00jeeR6KBsvq5WX97hmfg9kkZx27E8ovWFEIClTn1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQWG1Z2Tzc59; Tue, 21 May 2024 20:09:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9EDt043660; Tue, 21 May 2024 20:09:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9ENa043657; Tue, 21 May 2024 20:09:14 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:14 GMT Message-Id: <202405212009.44LK9ENa043657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e8adcfd14a09 - releng/14.1 - stand: Spell LUA_COMPILE_SET correctly. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: e8adcfd14a0979ca6874967d99db369644d9bfc5 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e8adcfd14a0979ca6874967d99db369644d9bfc5 commit e8adcfd14a0979ca6874967d99db369644d9bfc5 Author: Warner Losh AuthorDate: 2024-05-11 18:05:53 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:08:28 +0000 stand: Spell LUA_COMPILE_SET correctly. MFC After: 2 days Sponsored by: Netflix (cherry picked from commit e63d20b70ee1dbee9b075f29de6f30cdcfe1abe1) (cherry picked from commit 5dd6fb108dd9f5abbacbdc73197ef8468b93b958) Approved-by: re (cperciva) --- stand/liblua/lutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/liblua/lutils.h b/stand/liblua/lutils.h index ea715096df09..7fff8d3ae83d 100644 --- a/stand/liblua/lutils.h +++ b/stand/liblua/lutils.h @@ -34,7 +34,7 @@ int luaopen_pager(lua_State *); #include typedef void lua_init_md_t(lua_State *); -#define _LUA_COMPIE_SET Xlua_compile_set +#define _LUA_COMPILE_SET Xlua_compile_set #define LUA_COMPILE_SET(func) \ DATA_SET(_LUA_COMPILE_SET, func) #define LUA_FOREACH_SET(s) \ From nobody Tue May 21 20:09:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQWH3XCPz5M8wM; Tue, 21 May 2024 20:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQWH2xryz4Dlk; Tue, 21 May 2024 20:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7k3ARsHqeo57m/anayCQ6XEtJ/+A4skF3yOBVPcqD08=; b=DWcV7CUBtGIlohynX3UmLOfScSg8/KbobYfilAfgazmBjm/JduxZUGh7/GA0kljFZ3wuDC v1RW1ri83ekupA1ivSQXol/aTtp7Vkr7NG7PJmBCCimJ8XijDJamXE++G9WIBiQi+KYAHI +WcfiaDh7rP+erHN5LZ08fOWcEHzcTEssyltrzZdckAprQCPJ+Aa53FKrsHQ+0s4BLN0Za 3+JbajMCdhebfbpjq8J9FvVp41uSn+QeOuOn16oIfbTPgXKVJsbORFZutwNVxVcOud1lO5 JkUEazNjXTfMhUmHtZanQnaa0XPg8AuTFXs8AhqzWHI2tCB4WTX5d1tXc+wPEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322155; a=rsa-sha256; cv=none; b=OUqSZY5973C2nNyi+EC8AsNBbkch1ubX7QGc5r92G31OCudHZgK4id1ipy18gFKKywY+e1 +niCpd+VgzlUS8ghHcROAY9/hKiH9EtPeEOew13UmEbpEt3sQCUK9RY13PMRSqE0NNmYzZ v9XHRuIdar/MupxHp8CgxvZnMQoiHilf81YoHFhR9IEXwOybxN1qcCXfZQXq7CoobKieJ0 j5w5R2bUXbbhgsh+zYp6cOoQEqxzI4pr7HetcBZrBc+JHZJEdVuwxXiYLtN/z4DmqPg/3y gNwgGfYF9ILc7s50jKr0SUvHsaBknfdPaJyt7uEMFv1y9KY0tp8hzKdhYQJ0Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7k3ARsHqeo57m/anayCQ6XEtJ/+A4skF3yOBVPcqD08=; b=J/Y3ZG0w2X0A3/HT/F2UF2O9s5JNzE8jYw1b6hfBG9DG1f0YLwXWhEfxela8Wu7RuzjQzq LwldAa6RybEZFtp8ApB6fnQTTzDvCStm7DLx4kDGfzmf31OHHwGV42F6mYUhoQigRrwrFO C291uxPhyaOJjpHBvIusJrQNhhxjTnrPdm72zG45YlX6XATvX3Ru51wCt5pgLVmW5s9DFC D56Is0pO3VnriorCrDBMdLAmO3FeNzlGkHJPVw91rf/In5OoJJe49X9vEZ9/+QJoUFaSzX BY2nh4Z1Huq0QHlhbZHSefpAUe4o70oDbQAzyAR2eQExxbPNc+36TMBA7N78TA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQWH2XsRzbc4; Tue, 21 May 2024 20:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9FEx043702; Tue, 21 May 2024 20:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9F1o043699; Tue, 21 May 2024 20:09:15 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:15 GMT Message-Id: <202405212009.44LK9F1o043699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 78ccc5af3d23 - releng/14.1 - sys/dev/irdma/irdma_cm: fix compile without INET List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 78ccc5af3d23fe6c7d87c5f40cf6ab2b1d9d6fb2 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=78ccc5af3d23fe6c7d87c5f40cf6ab2b1d9d6fb2 commit 78ccc5af3d23fe6c7d87c5f40cf6ab2b1d9d6fb2 Author: Lexi Winter AuthorDate: 2024-04-12 16:47:16 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:08:35 +0000 sys/dev/irdma/irdma_cm: fix compile without INET irdma_get_vlan_ipv4() calls ip_ifp_find() even if INET isn't defined, in which case this function isn't available. Stub this out for the non-INET case to return an error (0xffff) instead. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1156 (cherry picked from commit 0478a0356272ab3907af9d97711f0bb8b14bf38b) (cherry picked from commit 7aba922879474189e5694ffb92a51ab387ad3dd6) Approved-by: re (cperciva) --- sys/dev/irdma/irdma_cm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/irdma/irdma_cm.c b/sys/dev/irdma/irdma_cm.c index 65cb5c643783..167e3c67390c 100644 --- a/sys/dev/irdma/irdma_cm.c +++ b/sys/dev/irdma/irdma_cm.c @@ -1664,9 +1664,11 @@ irdma_get_vlan_mac_ipv6(struct iw_cm_id *cm_id, u32 *addr, u16 *vlan_id, u8 *mac u16 irdma_get_vlan_ipv4(struct iw_cm_id *cm_id, u32 *addr) { + u16 vlan_id = 0xFFFF; + +#ifdef INET if_t netdev; struct vnet *vnet = &init_net; - u16 vlan_id = 0xFFFF; #ifdef VIMAGE vnet = irdma_cmid_to_vnet(cm_id); @@ -1676,6 +1678,7 @@ irdma_get_vlan_ipv4(struct iw_cm_id *cm_id, u32 *addr) vlan_id = rdma_vlan_dev_vlan_id(netdev); dev_put(netdev); } +#endif return vlan_id; } From nobody Tue May 21 20:09:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQWJ4d85z5M98G; Tue, 21 May 2024 20:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQWJ3znlz4DbC; Tue, 21 May 2024 20:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fsjNkQ5WkujE2GT4CL2W1cOw3quOb3SsSiJwl4botuA=; b=K0niKoGtNK4eH80dN4PWrx4Cq3XikGIlW3NKG3VEuopi8MtbTvdOL4FvBxJMyFj3MHE16N Q7oD0mFFtP6JtmcMt0fMq3/QD75dTyqxhhNF5p+W2dSugZn7QLwGDvrzalitXScgXxa9xG WYRxRe16mgjOAM31JBp+zkiLOklGETJPr2tnlI8eS6TDIDJ8QyE1I/kzy2c/+4BoO7ezw4 ZwnpF7EDXP2kGhaBI+LJlCIY8jqdPi1zo4XMrfrjNuFiakzbwnA+JqbP4so1ukcXnLRUWh Jgev/GlSWFTaYRDUMwXwBovZVejSM2SMV9up/4mRoYht/5tki0epe9IefZkSmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322156; a=rsa-sha256; cv=none; b=dqFS2NUaFh4MRiOa6bGKqCFGe7BE5SAcqI+f75x6AjcQ/hS/w28vrh69mHi9KYkL81hRcK 8qLVfltssf4uijIDqtmAy2GLbdIytrJrd6jUvW5OIRs97ki93rLJdfT5NIymnBhIXafJV6 ZGfK/5giSu5n0Cc6rNUxp4aKPXBSVyhRZ4qVjME3HaJDdnGy3LcsyFJhXLfhxUEg/Q9rYz vpfw93TzwJvsqgYt8sJPqNbJnxqjXjss965OxfWBpvlBJYxaaqQszDxdsfS30ZaAzHh6hP WA1JUAv3YqeGZXlatOg68Qsf+qgyHFTIPS8t4wFOM6DFKGfOOVeBWqKZa+u9yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fsjNkQ5WkujE2GT4CL2W1cOw3quOb3SsSiJwl4botuA=; b=AF5YPEQtCOhiT9aBW0Ipf5Q6slY6X6SgKqzBSc4U5CHnpiy5qJn0REfM7+jeQ7DK4YNw5y 4sc1Au2q0deKsu1Fl58HS2QqJpY5S5H+a5kim+nktQd1C3S5GiAf1iGOYJdWajB/Zweq4N YIc4xb71lIZYF+hvF7zGjvLPrGpEwpKDV4zPw89lQFNXRMC57ACQfBfU6/g/Ra1+wOgO1V vklmOC7HsSn1aGsNMpUx2O9VX7Gs4vDsQnzlZ30BjZuQ+AmPd3kvBSHLDDaojvzeq/3hxR /AHP/Xby5ZGVA6O02BcUHwRne43Zj9pmVSYLhYc0om9m9WHKMcLIli+t8vl17Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQWJ3HNzzbtC; Tue, 21 May 2024 20:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9Gu0043748; Tue, 21 May 2024 20:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9GQ8043745; Tue, 21 May 2024 20:09:16 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:16 GMT Message-Id: <202405212009.44LK9GQ8043745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6df9fa1c6b83 - releng/14.1 - sys/netinet6/in6_pcb.c: fix compile without INET List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 6df9fa1c6b8391e09bf74195d302ab12286a1d8a Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6df9fa1c6b8391e09bf74195d302ab12286a1d8a commit 6df9fa1c6b8391e09bf74195d302ab12286a1d8a Author: Lexi Winter AuthorDate: 2024-04-12 16:54:24 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:08:41 +0000 sys/netinet6/in6_pcb.c: fix compile without INET in6_mapped_sockaddr() and in6_mapped_peeraddr() both define a local variable named 'inp', but in the non-INET case, this variable is set and never used, causing a compiler error: /src/freebsd/src/lf/sys/netinet6/in6_pcb.c:547:16: error: variable 'inp' set but not used [-Werror,-Wunused-but-set-variable] 547 | struct inpcb *inp; | ^ /src/freebsd/src/lf/sys/netinet6/in6_pcb.c:573:16: error: variable 'inp' set but not used [-Werror,-Wunused-but-set-variable] 573 | struct inpcb *inp; Fix this by guarding all the INET-specific logic, including the variable definition, behind #ifdef INET. While here, tweak formatting in in6_mapped_peeraddr() so both functions are the same. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1155 (cherry picked from commit 042fb58d009e7efc5b334b68fffbef9b1f620ec8) (cherry picked from commit f30c2d86c39f8c3090e1f8967c13f2dd0d5d664b) Approved-by: re (cperciva) --- sys/netinet6/in6_pcb.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 5c4ef7570ddc..90f91eef1daa 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -579,13 +579,13 @@ in6_getpeeraddr(struct socket *so, struct sockaddr **nam) int in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam) { - struct inpcb *inp; int error; +#ifdef INET + struct inpcb *inp; inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_mapped_sockaddr: inp == NULL")); -#ifdef INET if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_getsockaddr(so, nam); if (error == 0) @@ -603,21 +603,23 @@ in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam) int in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam) { - struct inpcb *inp; int error; +#ifdef INET + struct inpcb *inp; inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_mapped_peeraddr: inp == NULL")); -#ifdef INET if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_getpeeraddr(so, nam); if (error == 0) in6_sin_2_v4mapsin6_in_sock(nam); } else #endif - /* scope issues will be handled in in6_getpeeraddr(). */ - error = in6_getpeeraddr(so, nam); + { + /* scope issues will be handled in in6_getpeeraddr(). */ + error = in6_getpeeraddr(so, nam); + } return error; } From nobody Tue May 21 20:09:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQWK68H0z5M98K; Tue, 21 May 2024 20:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQWK4Ynfz4Dd9; Tue, 21 May 2024 20:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hWXU9AB5+7UKk9sQafPPyREsR5YP2/Q+LPaKNMOEPgc=; b=epXDACnxjKg1H6wiLV5aWG+oSwRR96bAyhhCq9Ec1C9UpfmxEwkbrVjVbJsPzqF7oDqsxT w1CAmLRV51G+sztrxqohUMoKFnORJNW5jyoPWGx8/TzVjek2xsABQ5JfcWd0NEC1jw8HXu v9a0AyWzsBrQz3CODxikt8BpBrxsOU+Qjjz0hIyFI9kBIPq4x+2y4Loft0EUMFFbGVAXF8 zdPu+3yhLwZZB28e4KwF8Ty+JOaRv77WXz8702ojJ2tD+yu02U4+LgPat83parLlquE+BV UKPK8q7+GFTUpAzL8m8G8O4EF0egEuBsEnP2mk2a47FTMyezKCx48avQsj77ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322157; a=rsa-sha256; cv=none; b=FiuG04hrrZ10s+rGe+K6ywNdio/z8N87Eim4jDBAcs3GXefqclrTi0CZX+XA3LbrPyAVdj myMHNZVAkvlNORf6LcmmFoxSDPGOEmtlqIxO4sbnxatC4RJsUf4nrpvrYR5rhYwnX8FT+h 0AR1+7KYBQzm6u4OrC0/DobC3NCeXCuloC93SHkKaQZ9VoNJCcaWvYpTUIdjnpf9D+q5iN nk+Qs3lYUtXtk6ipwvap7JojMLgzOWzTR51f7cpd5PWxIY5oOhU/OgqdvgC4LcZW3YbgVd Csc+/yQ7jn+lY50ku9rJR/vrkDNUVWizTWEGBoSYdc1O3QF298n3yVHXrtyayA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hWXU9AB5+7UKk9sQafPPyREsR5YP2/Q+LPaKNMOEPgc=; b=OiXU6QgkAmC26GZ6CU/h/2CKRLBRC3Us788LeY27A4w/hwEHrFICqDpOSqYDTzuQmnAvrb Jm+F0AhGJkgzVTE7e3imFomPwE8j31+ABAbHbJDYKjZvt0Yl/NRANLUYzgOh0TNRgFGRgi gVI8UsqWXveQO/b8JoLlyBQsisBN4OxdPpEdbDwcPRMFpC8AScn0HZUSA7BpDqbNDqy3Db hTRO1R8LE4mVWlgauMeIO3oJBNqncs+SBRNdrJtTJQOO1tgN61YI+X6B6SYE2KIH3ggY5a 5A75kcMrQVvG9CCuUFR4BO5jn9Dj/CeWRBBf1aoARYh/ueWCZwo9FgwyQc1utA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQWK4854zbQV; Tue, 21 May 2024 20:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9HJD043799; Tue, 21 May 2024 20:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9Hrc043796; Tue, 21 May 2024 20:09:17 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:17 GMT Message-Id: <202405212009.44LK9Hrc043796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 2507479f70df - releng/14.1 - sys/modules/dpdk_lpm4: do not build without INET List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 2507479f70df850742c750a25dace99b13740582 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2507479f70df850742c750a25dace99b13740582 commit 2507479f70df850742c750a25dace99b13740582 Author: Lexi Winter AuthorDate: 2024-05-15 00:16:10 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:08:48 +0000 sys/modules/dpdk_lpm4: do not build without INET Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1236 (cherry picked from commit 304a03275a65cf811fb6c06fa1c37783d07c99a4) (cherry picked from commit 040a7e0dcbc234aa66d0b4b53638db12b81a7b75) Approved-by: re (cperciva) --- sys/modules/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index b6327ec224af..4b4534aee076 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -500,7 +500,7 @@ _ipfw_nptv6= ipfw_nptv6 _ipfilter= ipfilter .endif -.if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO} +.if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO} && ${KERN_OPTS:MINET} _dpdk_lpm4= dpdk_lpm4 _fib_dxr= fib_dxr .endif From nobody Tue May 21 20:09:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQWM0YWrz5M8wS; Tue, 21 May 2024 20:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQWL5SY4z4DVv; Tue, 21 May 2024 20:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+F+xfC3QBmFcK3eUxNlge8PjuTWO9y78heCzydccqAU=; b=EYiD6MK+erQMZZlqrag1/VUOXAjFO+GKAhuAR6N1d8jEwA0jeC5VF4Z0gojDdfuqriCRDZ 0xW6+YBBVs1hYAoZDilOI6e+ZVGW9ugzLQL7MhI+6UkU5Xc14TStB063DAwklawQ3b66Zs wJ+RDlpxOLbZJSzVa8QUIaukPWWmEXG3hpZYcr2kAIx9AUT0fb3DP03jIOAP4CMyJwtgJV ZvcKKJ9Z0/l5ImeunsaLlMY+qBRF9OTYm+nPs0kQwMqaw+75kMxCOWOuTkPqgxtEC357TM TdZUUepWHt3bfN2AmItQMzvpb4T3zwIylWIZ8jJJXxCqSUk4F6ku/sFKh9zP4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322158; a=rsa-sha256; cv=none; b=f2+DJi3OUAR144VZ2l++4vMAT0pLM141anjZLWqVikK63X1DkzVV6u9MHZOgZlH47oOh// rZnB3icv8CfUS9ID3XLFq7OavYrr70izjamGHzmqIAWUptLCoUvA/4E0Vpja/s5ziMAqS9 MqoIIkF8TKq2r4hasbWL8TR4lapEItrZ/yhg5SejnU5J+VWg2spoFlOoy+cbkLwIFPUn/W J5Dp/arQL/5BHgsM+bL4DSCK8G3HzmStzH3NnU5VrBHq3emLHoX2neBxFHIcbQ617IPzZ/ X/eO2aZB6/C7m9k2o0pcnpZigC2jNtsfy2LBKd+W3Nm/Em4Izne5/PU4Rtuhjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+F+xfC3QBmFcK3eUxNlge8PjuTWO9y78heCzydccqAU=; b=wH2iBP839sT+4QgOETuIbMknoCwRJNROjd7fq0L5t2PfOhDyMrS0Yu+e2+e7+RfiVtmy0J DZUQCF//NE/gshjbqMer8HEKj95xp2cB2ZqL4JxCcdOfeFsEou5uarVJa+GpqK8uWRAkIg t8u0uM7Z/jL3TISjtb5kLALndyfm9YRIjQvH4xQEfL/IiWzvgUAvzVk4c2r0+TAYii7c4k OW99UTwFqLEvoIeDQkErrr0gcVt89nqTyaRXM1z+Pa2Gu4+zUqSu7TSi5KlWL97Mv5IIED 2/LCsgq7JrL4CeKB+4mZLGzhlpgsiBFjWRi0pAPb+cr2SNWH1H3x9NIRqGO2eA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQWL536yzbtD; Tue, 21 May 2024 20:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9IXQ043844; Tue, 21 May 2024 20:09:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9IkF043841; Tue, 21 May 2024 20:09:18 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:18 GMT Message-Id: <202405212009.44LK9IkF043841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e59ebcf36f41 - releng/14.1 - intro.2: Add sys/syscall.h to SYNOPSIS List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: e59ebcf36f410f37aae47f6712066625e9dfdeae Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e59ebcf36f410f37aae47f6712066625e9dfdeae commit e59ebcf36f410f37aae47f6712066625e9dfdeae Author: Alexander Ziaee AuthorDate: 2024-05-04 14:54:20 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:08:53 +0000 intro.2: Add sys/syscall.h to SYNOPSIS MFC after: 1 week Co-authored-by: brooks Reviewed by: brooks, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1192 (cherry picked from commit 69ff2d754c1c8bd9c2b6cea28aa754e9f92f9613) (cherry picked from commit cbe2436dda127061a13e5565a5badec02249b2e5) Approved-by: re (cperciva) --- lib/libc/sys/intro.2 | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2 index 1b84b219fe0e..5b8f437567b8 100644 --- a/lib/libc/sys/intro.2 +++ b/lib/libc/sys/intro.2 @@ -36,6 +36,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS +.In sys/syscall.h .In errno.h .Sh DESCRIPTION This section provides an overview of the system calls, From nobody Tue May 21 20:09:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQWN0dYwz5M92M; Tue, 21 May 2024 20:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQWM6TzQz4Dmg; Tue, 21 May 2024 20:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbBYpv0Pitn0Adnh9VY7BT121uW8BMFYGuZGCRhsdI8=; b=d6xCxpG/iRaijRKBEDN5dlHeM7F3XtTbzjpi9Q2UAeUCfluzrZ/A2bweF3JgM7iZCtQ5Sy a6s7JIgMVDijMmaD6zga3m1d76jnHvoM5utZ2kK4wdAMLNr4Mv9jCn5bPTY4nbKPdrNa1B nkR+BYuyhUIYoOG/aF9G5DWePXKpWYAC/iOwvEZD+mhYGpcqCFokJlmzYk3/nmy3bPVF7r qcFzixGfcSp8BKHG6uImNjUuiMcxmo1WNxXia+9vKtTLBGRBf6QDAAPP2Y6IOAhDqtb8XU xiLXSjt8IzVyf0+Ad6HTwOhUYPD8lvGB2aCpDL0RB/aKT/atxg/1v2SwIM1n3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322159; a=rsa-sha256; cv=none; b=rBfzI2EikUBlirgJrGnS9c6UuD4MncRN9zna/b7sfWFty5peOZnX4Eap6TiL2JKPaF6EUV FxWAHj35Oqq8gjVlwSkF0uGr7gAR1DvxEu2f0W+oahzYW8WJzj5VkwcC2wKFPbhtHHm5HB 5AWqEtFrJvhcYg8ZjTY4LgCHhDQm7O2cj8kR2vuQ/bGqkPEkV9Zfx3j1dJvABvRcj6EsLn 2kaX/T9ge20OEnFgRqLWIr06zVb7nDIDu2d25WMq9qApc1bZdo8IgVM8Yw+faRiRdKY/fR 6S2tgtFrRHpsVIxoPcjAR1SRyHbZU6h5shmAOpzK4O9ECJXwQxFfAgE/E4WBYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbBYpv0Pitn0Adnh9VY7BT121uW8BMFYGuZGCRhsdI8=; b=TJHhi9OTpMBEbzBMENDm5lkfNV5IqVzEEKxRxhq7rNbYTY0I2hCbhgfAH7yn0dhwzo1m9A 1mTRiav8J8G9jkyWOfSAQNAnGvIBZFhWCh8Q0KNYNsBuH+8fpedTVxY9mf5tfFcFIQGW1x TrfC8TUpCCD0wqL/+pdrSuIuKl/N6TOfGQRysekce+hJl9h0nwJp1WCZ51Ha+9WeRTl8Ks XrBLcB+yRaRmrVD+bPjW+dxGWLQT3ILIEH18v8C97QOv9+WY5KUxyT1dMXlsnqeC9Y4v4s Zo72B6iW+HSbubDglbcYuxRreeQWydGgh4w/1Vi63k8WNGTQY0iJ3NYsaN64Ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQWM65Pszbry; Tue, 21 May 2024 20:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9JCu043895; Tue, 21 May 2024 20:09:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9JXf043892; Tue, 21 May 2024 20:09:19 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:19 GMT Message-Id: <202405212009.44LK9JXf043892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 839a522e2ec3 - releng/14.1 - intro.2 as errno.2: Update maximum hard link limit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 839a522e2ec3577de877bfc4e8baa363ff4a8f08 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=839a522e2ec3577de877bfc4e8baa363ff4a8f08 commit 839a522e2ec3577de877bfc4e8baa363ff4a8f08 Author: Alexander Ziaee AuthorDate: 2024-05-04 14:54:20 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:08:58 +0000 intro.2 as errno.2: Update maximum hard link limit MFC after: 1 week Co-authored-by: brooks Reviewed by: brooks, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1192 (cherry picked from commit 6dfbe695c3223822734dddc926415a3ba347b42c) (cherry picked from commit 828e648b26ea1d3d77a63eea395bba56b5109f2d) Approved-by: re (cperciva) --- lib/libc/sys/intro.2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2 index 5b8f437567b8..2232d56707a7 100644 --- a/lib/libc/sys/intro.2 +++ b/lib/libc/sys/intro.2 @@ -229,8 +229,13 @@ system call was issued on a socket, pipe or An attempt was made to modify a file or directory on a file system that was read-only at the time. .It Er 31 EMLINK Em "Too many links" . -Maximum allowable hard links to a single file has been exceeded (limit -of 32767 hard links per file). +Maximum allowable hard links to a single file has been exceeded. +This limit is a filesystem dependent variable +.Po +.Va UFS_LINK_MAX No on Xr ufs 4 , +.Va FUSE_LINK_MAX No on Xr fusefs 4 , and +.Va TMPFS_MAX No on Xr tmpfs 4 +.Pc . .It Er 32 EPIPE Em "Broken pipe" . A write on a pipe, socket or .Tn FIFO From nobody Tue May 21 20:09:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQWP1kNwz5M9F2; Tue, 21 May 2024 20:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQWP07rmz4DkQ; Tue, 21 May 2024 20:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SYaYT/tdIP8028DDS/UpfbYmpwLVi/VLpDe0YuANaAE=; b=fuTYuazN5XYVDqnSchDw0+9dT8UW6JLOdyWTkmbcgCK6vQe5PikDAP9zCxUizlL0wtI1Sf e5l9whlT7kYSrlBcwtX01HMYURB45onoA+8oxONMo8MwdmNHtVyxAEEk+KiCv1gNeBlVjw mtAkXrJtZxCi4EERAH2SWuYi6XPKAzJ6aGVhgQnSU3BVVLvGhll48pdYf51E6/HAbLkuMp VWca3iVhXbM+u/8JaUfeWbJNgRAEd5JH3o8fPUbuU3iJ3lwxsTyTFhQgx6iSWx35BieN08 AmG2BTRsbfw+C9AtEEWAq/njS+F/r4BJWUOUqhh5m03AshWc145/hYX40ELaHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322161; a=rsa-sha256; cv=none; b=GDT7tybjSnjGd5vcgayYU/Zaw9jyWZnS+tkK4SYri5gMR8/OyJO23Z2DNGAYkHBfaC2bkN 4UjMH1E4GAsIbqCLJ6CgxK40uZ/cDPSMgaPqCZGEPPSg7eIkCipSkVycBG4cu9qkubIk7+ M+dEfz7sVFRKNOIk0/g2+SwLNtnnbLZ9QTNFINmUiBqHbcA+7s2JdBolB0r8YivA/4XSy/ hn6J3V2wRcwLmK7P9eO+B6LuBai8XPMhlyCPTLjZNJvTnoerQgV7m3mnblqdQ6/Jnmi2cv rkNXzh0vd0EIrlAe51ESn4kSGPVk4rsIN4+Dv/SeRfrkxsK8a6ly05dS5KroMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SYaYT/tdIP8028DDS/UpfbYmpwLVi/VLpDe0YuANaAE=; b=c+r9xICSLZfUOIYf74cu8Y9UPQYeEZC4xsYUOhafT9guT7ZCOfNQCpLwKYKu+KCPnp0ddn EeSlHr1jHbPKrvZfBAfxnU+lsBVXGnGKFpGYwYU+jxXm+uhc2orfQyNIw0dbqSzaw359mZ DSuQohjcEqxap3PowhmLcWkH+PIgEVRL41SVfaS+rrjVpg1uTCVZWadB8Cd8e7kZaLegR0 yuR0A4Kc9OxeEUCjTO+iZBz/v36rWBQH3maKWpOwwrTvuuSSWgDxEu5ofV+s85vrzaLxNy 6jsoPNADjhKyzGCmz1vdlwBPbZCl+KxA8bSgSKXqyg8+DdgEHj8VK8uAPMLhQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQWN6sqFzbs0; Tue, 21 May 2024 20:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9KM3043942; Tue, 21 May 2024 20:09:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9KYv043939; Tue, 21 May 2024 20:09:20 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:20 GMT Message-Id: <202405212009.44LK9KYv043939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 39f92a4c4c49 - releng/14.1 - networking.7 : create network quickstart guide List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 39f92a4c4c49490e8a3a4549fae054c0e59f6459 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=39f92a4c4c49490e8a3a4549fae054c0e59f6459 commit 39f92a4c4c49490e8a3a4549fae054c0e59f6459 Author: Alexander Ziaee AuthorDate: 2024-04-17 15:51:35 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:09:04 +0000 networking.7 : create network quickstart guide Now that the handbook has been moved to ports, I think it's very nice to have a network quickstart guide in-band, in base, in the system manual. If the user uses any of the following terms "man -k {network,networking,wifi,quickstart}" this page will come up, which is I think a very common use case for new users. Currently, this document explains connecting to a basic Ethernet network, a basic wifi network, scanning for wifi networks, and airplane mode, as well as linking to other sections, including the handbook Co-authored-by: Graham Perrin Reviewed by: imp, bcr, freebsd@igalic.co Pull Request: https://github.com/freebsd/freebsd-src/pull/833 (cherry picked from commit 75eda0096bf83b9b88996d9903b5d4e504047eba) (cherry picked from commit 5dced41439109368a8f3c9a818fe518542d7063e) Approved-by: re (cperciva) --- share/man/man7/Makefile | 5 +++ share/man/man7/networking.7 | 101 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 11246195201c..7f506c1dfc5f 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -47,6 +47,11 @@ MLINKS+= c.7 c11.7 MLINKS+= c.7 c17.7 MLINKS+= c.7 c2x.7 +.if ${MK_INET} != "no" +MAN+= networking.7 +MLINKS+= networking.7 wifi.7 +.endif + .if ${MK_TESTS} != "no" ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/doc diff --git a/share/man/man7/networking.7 b/share/man/man7/networking.7 new file mode 100644 index 000000000000..869812c05a9b --- /dev/null +++ b/share/man/man7/networking.7 @@ -0,0 +1,101 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 Alexander Ziaee +.\" +.Dd April 17, 2024 +.Dt "NETWORKING" 7 +.Os +.Sh NAME +.Nm networking , +.Nm wifi +.Nd quickstart guide to connecting to a network +.Sh DESCRIPTION +In the following examples, it is assumed that we are connecting to Ethernet +with the first interface found by the +.Xr em 4 +driver, and Wi-Fi with the first interface found by the +.Xr iwn 4 +driver, though your hardware will vary. +.Sh EXAMPLES +.Bl -tag -width 0n +.It Sy Connecting to an Ethernet network with DHCP: +.Bd -literal -offset 2n +.Ic # dhclient em0 +.Ed +.It Sy Connecting to a cellular network with USB tethering: +.Pp +Load the USB tethering driver, +.Xr urndis 4 : +.Bd -literal -offset 2n +.Ic # kldload urndis +.Ed +.Pp +Ask for a DHCP lease on the USB tethering interface: +.Bd -literal -offset 2n +.Ic # dhclient ue0 +.Ed +.It Sy Connecting to a Wi-Fi network: +.Pp +Identify your Wi-Fi hardware: +.Bd -literal -offset 2n +.Ic % sysctl net.wlan.devices +.Ed +.Pp +Configure your Wi-Fi hardware as wlan0 interface: +.Ed +.Bd -literal -offset 2n +.Ic # sysrc wlans_iwn0="wlan0" +.Ed +.Pp +Set that interface to negotiate a DHCP lease with +.Xr wpa_supplicant 8 : +.Bd -literal -offset 2n +.Ic # sysrc ifconfig_wlan0="WPA SYNCDHCP" +.Ed +.Pp +Enter the details of the Wi-Fi network: +.Bd -literal -offset 2n +.Ic # wpa_passphrase \(dqmyssid\(dq \(dqmypassphrase\(dq >> wpa_supplicant.conf +.Ed +.Pp +Restart the network interface daemon: +.Bd -literal -offset 2n +.Ic # service netif restart +.Ed +.Pp +.It Sy Scanning for Wi-Fi networks: +.Bd -literal -offset 2n +.Ic % ifconfig wlan0 scan +.Ed +.It Sy Airplane mode: +.Bd -literal -offset 2n +.Ic # service netif stop +.Ed +.El +.Sh SEE ALSO +.Xr bsdconfig 8 , +.Xr dhclient 8 , +.Xr ifconfig 8 , +.Xr wpa_passphrase 8 +.Pp +The Advanced Networking chapter of the +.Fx +Handbook. +.Sh CAVEATS +Shell Special Characters in the +.Ar SSID +or +.Ar passphrase +will need to be escaped for +.Xr wpa_passphrase 8 , +commonly using +.Ql \e , +see the manual page for your shell for more details. +.Pp +Currently +.Ql Ic service netif restart +does not restart routing. +A common workaround is to issue +.Ql Ic service netif restart && service routing restart +instead. From nobody Tue May 21 20:18:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQjy4Xpsz5M9hg; Tue, 21 May 2024 20:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQjy2BgSz4HGw; Tue, 21 May 2024 20:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxTs6eVzzn7Hs+dXlp5zwxLbyblB7KM9B2VaCC7w/cY=; b=XDxIjiAWFChVyGCu/ttHZ3DjBnywNh4EYKW8rmHpbLBR7z4kYbtdaTESwFjuVq/NDIVDI8 S+cfwuzurj5GTqIFL1X0S1ZZnciMxs18CeuUN+8kZ4OvvIENwMnbu2TEEdw0uOLhsmSiQp eBThj+wJoHlC6rtfhA1q8meY7IUglol3rc+o08uxeXnltZkXrruAXS62eJMl+OsLM3tRIy NbtqC0usiOicmv6Fb+ysgbS8ossghHym32Q60FO/w39fRVtRpVMMHX3fGfCUfHS9Ne9hHS z2Qd/wm1raTSeNatL+IBNfW6uVZEnTR1M6tRWtsSVXRj8FCiOUI1skVFjrq0mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322710; a=rsa-sha256; cv=none; b=TrUn303j+Rc+OSN75jGXAUc6fhpzzIoch3eU9E6fGmLTCrb+DdSADUBTAE+pAF4pFwWuTY phN5IMq4i/Qqe+0QMsQVckxkfbQS5QZ4KpJJPeZkHTKvqg6fd5oPXI2j9URpVAbjNjXj+8 w2Z8kesqCUTevn4jlqBmq+ahNqMeYJUQ0vu+6wIYCNz77mOLhWGYdQ/E1RxJ+vveQ9BFkP BWd+QdztCqfvM7FASMs2NVy5yfNvV6xUPDjGHz1fccsX2R2+sG8ksbB+bhBWHRvcoBs97D mRqkEpXmrmd8RjRyJNM/TP8EQasmRNf5M5+hlQoPPqjKzJnsnzv0hE0U8F3/LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxTs6eVzzn7Hs+dXlp5zwxLbyblB7KM9B2VaCC7w/cY=; b=rwHIpK3Kde95V6TiV4TnLLK76t5Uh+uTMD+NDNq3PrNe8Q/RBKDRwYC19puotablIEFSlO yz3ekBt1FyTmz8DQN2zILb1u2sCT5J5Jg2t4adRE4y4VP6WCZrM3heztVVIoL85bOVXHGl hM/iQ74ZzB42yTxdyQCgtNB3bFMyrb4ZmfcIT48kpTdD5K6aO1qXPeYrV81vL/O7B2fXmr 4I2XZRy6GFd/fIVB44EVdI9EcpidsPK1fZQX25iI0EuGhPzJRj/U0Cf4A7XIhZr6CqjEH4 hv4QBnRn/SaBLK8psHNhs5XqDH4abwm2esMZuu42ZIT+NvwaKwAQkZjmE0BGIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQjx6wchzc7V; Tue, 21 May 2024 20:18:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LKITrn060298; Tue, 21 May 2024 20:18:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LKISXW060294; Tue, 21 May 2024 20:18:28 GMT (envelope-from git) Date: Tue, 21 May 2024 20:18:28 GMT Message-Id: <202405212018.44LKISXW060294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: dcde37c4170b - releng/14.1 - unbound: Vendor import 1.20.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: dcde37c4170b6c71a8b424b53180ff8c8e335435 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dcde37c4170b6c71a8b424b53180ff8c8e335435 commit dcde37c4170b6c71a8b424b53180ff8c8e335435 Author: Cy Schubert AuthorDate: 2024-05-10 20:56:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-21 20:17:21 +0000 unbound: Vendor import 1.20.0 Release notes at https://www.nlnetlabs.nl/news/2024/May/08/unbound-1.20.0-released/ Security: The DNSBomb vulnerability CVE-2024-33655 Merge commit 'c2a80056864d6eda0398fd127dc0ae515b39752b' into main (cherry picked from commit 335c7cda12138f2aefa41fb739707612cc12a9be) (cherry picked from commit 7a2bb28f8e6d85ab82712d0f37261f388fbf7775) Approved by: re (cperciva) --- contrib/unbound/Makefile.in | 16 +- contrib/unbound/{ac_pkg_swig.m4 => ax_pkg_swig.m4} | 110 +- contrib/unbound/ax_pthread.m4 | 444 +- contrib/unbound/cachedb/cachedb.c | 133 +- contrib/unbound/cachedb/cachedb.h | 16 + contrib/unbound/config.h.in | 105 +- contrib/unbound/configure | 12872 +++++---- contrib/unbound/configure.ac | 16 +- contrib/unbound/configure~ | 26616 +++++++++++++++++++ contrib/unbound/contrib/rc_d_unbound | 9 + contrib/unbound/contrib/unbound.init | 1 + contrib/unbound/contrib/unbound.init_fedora | 1 + contrib/unbound/contrib/unbound.init_yocto | 1 + contrib/unbound/daemon/cachedump.c | 23 +- contrib/unbound/daemon/daemon.c | 26 +- contrib/unbound/daemon/remote.c | 130 +- contrib/unbound/daemon/unbound.c | 39 +- contrib/unbound/daemon/worker.c | 35 +- contrib/unbound/doc/Changelog | 187 +- contrib/unbound/doc/README | 2 +- contrib/unbound/doc/example.conf.in | 28 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 6 +- contrib/unbound/doc/unbound-control.8.in | 8 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 72 +- contrib/unbound/doc/unbound.doxygen | 2931 +- contrib/unbound/edns-subnet/subnetmod.c | 40 +- contrib/unbound/iterator/iter_fwd.c | 119 +- contrib/unbound/iterator/iter_fwd.h | 60 +- contrib/unbound/iterator/iter_hints.c | 95 +- contrib/unbound/iterator/iter_hints.h | 54 +- contrib/unbound/iterator/iter_utils.c | 62 +- contrib/unbound/iterator/iter_utils.h | 6 +- contrib/unbound/iterator/iterator.c | 295 +- contrib/unbound/libunbound/context.c | 8 + contrib/unbound/libunbound/libunbound.c | 5 + contrib/unbound/libunbound/libworker.c | 21 +- contrib/unbound/services/authzone.c | 10 + contrib/unbound/services/cache/dns.c | 52 +- contrib/unbound/services/cache/infra.c | 170 +- contrib/unbound/services/cache/infra.h | 28 + contrib/unbound/services/cache/rrset.c | 87 + contrib/unbound/services/cache/rrset.h | 31 + contrib/unbound/services/listen_dnsport.c | 51 +- contrib/unbound/services/listen_dnsport.h | 8 +- contrib/unbound/services/localzone.c | 6 +- contrib/unbound/services/mesh.c | 106 +- contrib/unbound/services/mesh.h | 6 + contrib/unbound/services/rpz.c | 342 +- contrib/unbound/services/rpz.h | 8 + contrib/unbound/services/view.h | 3 +- contrib/unbound/smallapp/unbound-anchor.c | 70 +- contrib/unbound/smallapp/unbound-checkconf.c | 13 +- contrib/unbound/smallapp/unbound-control.c | 5 +- contrib/unbound/testdata/cachedb_expired.crpl | 324 + .../testdata/cachedb_expired_client_timeout.crpl | 343 + .../testdata/cachedb_expired_reply_ttl.crpl | 259 + .../unbound/testdata/cachedb_subnet_change.crpl | 304 + .../unbound/testdata/cachedb_subnet_expired.crpl | 322 + .../testdata/cachedb_subnet_toecs_timeout.crpl | 229 + contrib/unbound/testdata/iter_dname_ttl.rpl | 39 - .../testdata/iter_ghost_grandchild_delegation.rpl | 256 + contrib/unbound/testdata/local_cnameother.rpl | 67 + contrib/unbound/testdata/rpz_clientip_override.rpl | 269 + contrib/unbound/testdata/rpz_cname_handle.rpl | 779 + contrib/unbound/testdata/rpz_nsdname_override.rpl | 325 + contrib/unbound/testdata/rpz_nsip_override.rpl | 332 + contrib/unbound/testdata/rpz_passthru_clientip.rpl | 90 + contrib/unbound/testdata/rpz_qtype_cname.rpl | 120 + .../testdata/rpz_reload.tdir/example.org.zone | 2 + .../testdata/rpz_reload.tdir/rpz.example.com.zone | 6 + .../testdata/rpz_reload.tdir/rpz_reload.conf | 30 + .../testdata/rpz_reload.tdir/rpz_reload.dsc | 16 + .../testdata/rpz_reload.tdir/rpz_reload.post | 12 + .../testdata/rpz_reload.tdir/rpz_reload.pre | 26 + .../testdata/rpz_reload.tdir/rpz_reload.test | 109 + contrib/unbound/testdata/subnet_cached_size.crpl | 308 + contrib/unbound/testdata/ttl_max_negative.rpl | 206 + contrib/unbound/testdata/ttl_min_negative.rpl | 204 + contrib/unbound/testdata/val_cnameqtype_qmin.rpl | 784 + contrib/unbound/testdata/val_dnameqtype.rpl | 689 + contrib/unbound/testdata/val_dnameqtype_qmin.rpl | 859 + contrib/unbound/util/config_file.c | 39 + contrib/unbound/util/config_file.h | 19 + contrib/unbound/util/configlexer.c | 8195 +++--- contrib/unbound/util/configlexer.lex | 7 + contrib/unbound/util/configparser.c | 4502 ++-- contrib/unbound/util/configparser.h | 508 +- contrib/unbound/util/configparser.y | 83 +- contrib/unbound/util/data/msgparse.h | 2 + contrib/unbound/util/data/msgreply.c | 33 +- contrib/unbound/util/module.c | 11 +- contrib/unbound/util/module.h | 18 +- contrib/unbound/util/net_help.c | 36 +- contrib/unbound/util/netevent.c | 8 +- contrib/unbound/util/netevent.h | 2 + contrib/unbound/util/storage/lookup3.c | 2 +- contrib/unbound/util/storage/lruhash.c | 34 + contrib/unbound/util/storage/lruhash.h | 11 + contrib/unbound/util/storage/slabhash.c | 7 + contrib/unbound/util/storage/slabhash.h | 12 + contrib/unbound/validator/val_utils.c | 40 +- contrib/unbound/validator/validator.c | 36 +- lib/libunbound/config.h | 6 +- 107 files changed, 53017 insertions(+), 13503 deletions(-) diff --git a/contrib/unbound/Makefile.in b/contrib/unbound/Makefile.in index 22fb75c123bd..f30ca81a84f8 100644 --- a/contrib/unbound/Makefile.in +++ b/contrib/unbound/Makefile.in @@ -1278,7 +1278,8 @@ daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/edns.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h \ - $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h + $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ @@ -1355,7 +1356,7 @@ testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/test $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h $(srcdir)/daemon/worker.h testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h @@ -1428,7 +1429,7 @@ fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/t $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/daemon/remote.h + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/daemon/remote.h $(srcdir)/util/storage/slabhash.h $(srcdir)/daemon/daemon.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ @@ -1484,7 +1485,8 @@ context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbou $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/unbound-event.h config.h $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ @@ -1496,7 +1498,8 @@ libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbou $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h + $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ @@ -1510,8 +1513,7 @@ libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/li $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \ $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/str2wire.h + $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/str2wire.h unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \ diff --git a/contrib/unbound/ac_pkg_swig.m4 b/contrib/unbound/ax_pkg_swig.m4 similarity index 55% rename from contrib/unbound/ac_pkg_swig.m4 rename to contrib/unbound/ax_pkg_swig.m4 index 87f99fb2fe98..7a4196ff5dff 100644 --- a/contrib/unbound/ac_pkg_swig.m4 +++ b/contrib/unbound/ax_pkg_swig.m4 @@ -1,39 +1,43 @@ # =========================================================================== -# http://autoconf-archive.cryp.to/ac_pkg_swig.html +# https://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html # =========================================================================== # # SYNOPSIS # -# AC_PROG_SWIG([major.minor.micro]) +# AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found]) # # DESCRIPTION # -# This macro searches for a SWIG installation on your system. If found you -# should call SWIG via $(SWIG). You can use the optional first argument to -# check if the version of the available SWIG is greater than or equal to -# the value of the argument. It should have the format: N[.N[.N]] (N is a -# number between 0 and 999. Only the first N is mandatory.) +# This macro searches for a SWIG installation on your system. If found, +# then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is +# found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd. # -# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that -# the swig package is this version number or higher. +# You can use the optional first argument to check if the version of the +# available SWIG is greater than or equal to the value of the argument. It +# should have the format: N[.N[.N]] (N is a number between 0 and 999. Only +# the first N is mandatory.) If the version argument is given (e.g. +# 1.3.17), AX_PKG_SWIG checks that the swig package is this version number +# or higher. # -# In configure.in, use as: -# -# AC_PROG_SWIG(1.3.17) -# SWIG_ENABLE_CXX -# SWIG_MULTI_MODULE_SUPPORT -# SWIG_PYTHON +# As usual, action-if-found is executed if SWIG is found, otherwise +# action-if-not-found is executed. # -# LAST MODIFICATION +# In configure.in, use as: # -# 2008-04-12 +# AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ]) +# AX_SWIG_ENABLE_CXX +# AX_SWIG_MULTI_MODULE_SUPPORT +# AX_SWIG_PYTHON # -# COPYLEFT +# LICENSE # # Copyright (c) 2008 Sebastian Huber -# Copyright (c) 2008 Alan W. Irwin +# Copyright (c) 2008 Alan W. Irwin # Copyright (c) 2008 Rafael Laboissiere -# Copyright (c) 2008 Andrew Collier +# Copyright (c) 2008 Andrew Collier +# Copyright (c) 2011 Murray Cumming +# Copyright (c) 2018 Reini Urban +# Copyright (c) 2021 Vincent Danjean # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -46,7 +50,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -57,17 +61,21 @@ # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. -AC_DEFUN([AC_PROG_SWIG],[ - AC_PATH_PROG([SWIG],[swig]) +#serial 15 + +AC_DEFUN([AX_PKG_SWIG],[ + # Find path to the "swig" executable. + AC_PATH_PROGS([SWIG],[swig swig3.0 swig2.0]) if test -z "$SWIG" ; then - AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org]) - SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' - elif test -n "$1" ; then - AC_MSG_CHECKING([for SWIG version]) + m4_ifval([$3],[$3],[:]) + elif test -z "$1" ; then + m4_ifval([$2],[$2],[:]) + else + AC_MSG_CHECKING([SWIG version]) [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] AC_MSG_RESULT([$swig_version]) if test -n "$swig_version" ; then @@ -77,12 +85,12 @@ AC_DEFUN([AC_PROG_SWIG],[ if test -z "$required_major" ; then [required_major=0] fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`] [required_minor=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_minor" ; then [required_minor=0] fi - [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`] [required_patch=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_patch" ; then [required_patch=0] @@ -103,30 +111,28 @@ AC_DEFUN([AC_PROG_SWIG],[ if test -z "$available_patch" ; then [available_patch=0] fi - [badversion=0] - if test $available_major -lt $required_major ; then - [badversion=1] - fi - if test $available_major -eq $required_major \ - -a $available_minor -lt $required_minor ; then - [badversion=1] - fi - if test $available_major -eq $required_major \ - -a $available_minor -eq $required_minor \ - -a $available_patch -lt $required_patch ; then - [badversion=1] - fi - if test $badversion -eq 1 ; then - AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org]) - SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' + # Convert the version tuple into a single number for easier comparison. + # Using base 100 should be safe since SWIG internally uses BCD values + # to encode its version number. + required_swig_vernum=`expr $required_major \* 10000 \ + \+ $required_minor \* 100 \+ $required_patch` + available_swig_vernum=`expr $available_major \* 10000 \ + \+ $available_minor \* 100 \+ $available_patch` + + if test $available_swig_vernum -lt $required_swig_vernum; then + AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version.]) + SWIG='' + m4_ifval([$3],[$3],[]) else - AC_MSG_NOTICE([SWIG executable is '$SWIG']) - SWIG_LIB=`$SWIG -swiglib` - AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB']) + AC_MSG_CHECKING([for SWIG library]) + SWIG_LIB=`$SWIG -swiglib | tr '\r\n' ' '` + AC_MSG_RESULT([$SWIG_LIB]) + m4_ifval([$2],[$2],[]) fi else AC_MSG_WARN([cannot determine SWIG version]) - SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' + SWIG='' + m4_ifval([$3],[$3],[]) fi fi AC_SUBST([SWIG_LIB]) diff --git a/contrib/unbound/ax_pthread.m4 b/contrib/unbound/ax_pthread.m4 index ff7d2a67e11f..9f35d139149f 100644 --- a/contrib/unbound/ax_pthread.m4 +++ b/contrib/unbound/ax_pthread.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# https://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS @@ -14,24 +14,28 @@ # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) +# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is +# needed for multi-threaded programs (defaults to the value of CC +# respectively CXX otherwise). (This is necessary on e.g. AIX to use the +# special cc_r/CC_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with +# but also to link with them as well. For example, you might link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # -# If you are only building threads programs, you may wish to use these +# If you are only building threaded programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" +# CXX="$PTHREAD_CXX" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with @@ -55,6 +59,7 @@ # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. +# Copyright (c) 2019 Marc Stevens # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -67,7 +72,7 @@ # Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program. If not, see . +# with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure @@ -82,35 +87,41 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 21 +#serial 31 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). +# requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) + AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) AC_MSG_RESULT([$ax_pthread_ok]) - if test x"$ax_pthread_ok" = xno; then + if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different @@ -118,12 +129,14 @@ fi # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. -ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: @@ -132,82 +145,163 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case ${host_os} in +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], + [ +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + ], + [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) + ;; + solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" + ;; +esac + +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC + +AS_IF([test "x$GCC" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) + +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + +AS_IF([test "x$ax_pthread_clang" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread"]) - ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" ;; - darwin*) - ax_pthread_flags="-pthread $ax_pthread_flags" + aix*) + ax_pthread_check_macro="_THREAD_SAFE" ;; -esac -# Clang doesn't consider unrecognized options an error unless we specify -# -Werror. We throw in some extra Clang-specific options to ensure that -# this doesn't happen for GCC, which also accepts -Werror. + *) + ax_pthread_check_macro="--" + ;; +esac +AS_IF([test "x$ax_pthread_check_macro" = "x--"], + [ax_pthread_check_cond=0], + [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) -AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) -save_CFLAGS="$CFLAGS" -ax_pthread_extra_flags="-Werror" -CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], - [AC_MSG_RESULT([yes])], - [ax_pthread_extra_flags= - AC_MSG_RESULT([no])]) -CFLAGS="$save_CFLAGS" -if test x"$ax_pthread_ok" = xno; then -for flag in $ax_pthread_flags; do +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do - case $flag in + case $ax_pthread_try_flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) + ;; + -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - if test x"$ax_pthread_config" = xno; then continue; fi + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we @@ -218,8 +312,18 @@ for flag in $ax_pthread_flags; do # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include - static void routine(void *a) { *((int*)a) = 0; } +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); @@ -227,101 +331,187 @@ for flag in $ax_pthread_flags; do pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) + [ax_pthread_ok=yes], + []) - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = xyes; then - break; - fi + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [ac_link="$ax_pthread_2step_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [break]) + ]) + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + ]) + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + + + # Various other checks: -if test "x$ax_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $attr; return attr /* ; */])], - [attr_name=$attr; break], - []) - done - AC_MSG_RESULT([$attr_name]) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case ${host_os} in - aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; - osf* | hpux*) flag="-D_REENTRANT";; - solaris*) - if test "$GCC" = "yes"; then - flag="-D_REENTRANT" - else - # TODO: What about Clang on Solaris? - flag="-mt -D_REENTRANT" - fi - ;; - esac - AC_MSG_RESULT([$flag]) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi + AC_CACHE_CHECK([for joinable pthread attribute], + [ax_cv_PTHREAD_JOINABLE_ATTR], + [ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $ax_pthread_attr; return attr /* ; */])], + [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], + []) + done + ]) + AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"], + [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], + [$ax_cv_PTHREAD_JOINABLE_ATTR], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + ax_pthread_joinable_attr_defined=yes + ]) + + AC_CACHE_CHECK([whether more special flags are required for pthreads], + [ax_cv_PTHREAD_SPECIAL_FLAGS], + [ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + ]) + AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"], + [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes]) AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) + [ax_cv_PTHREAD_PRIO_INHERIT], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT; + return i;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) + ax_pthread_prio_inherit_defined=yes + ]) - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant - if test "x$GCC" != xyes; then + if test "x$GCC" != "xyes"; then case $host_os in aix*) AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], - [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [ + AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) + AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) + ], + [ + AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) + AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) + ] + ) + ]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) +AC_SUBST([PTHREAD_CXX]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$ax_pthread_ok" = xyes; then +if test "x$ax_pthread_ok" = "xyes"; then ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else diff --git a/contrib/unbound/cachedb/cachedb.c b/contrib/unbound/cachedb/cachedb.c index b912be8ed54f..95ac28904693 100644 --- a/contrib/unbound/cachedb/cachedb.c +++ b/contrib/unbound/cachedb/cachedb.c @@ -50,6 +50,8 @@ #include "util/data/msgreply.h" *** 83298 LINES SKIPPED *** From nobody Tue May 21 22:50:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkV595Zklz5L0pG; Tue, 21 May 2024 22:50:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkV5952Djz4YVg; Tue, 21 May 2024 22:50:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716331821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RJtUjCndpQF2Jd7qJAOmiPto/0XF7U98OARfb7hlIkQ=; b=isWZCSqTTUtQpf+oyVv6DmjjNMrQedPuu+QwWAlFw+zFBxGampVsaee4J/JwKF/1pgbD7w 1PJGV0RQLv3VqY3s59113vnGz3McmK4RddjrFRMzYFehSKOnU37U08BW9a1t5ifGVdUfwv sNYpwsPVbulm6/0mDFCYdImUX3bTRZEQbLXdMxZGZAHsuVZXcHR4pEmtjYcrCKughh8s27 XI+zawPZK+B2yidWAoskbEv0t8uzQg8/jauqS5WwIa2x75cZo7T08HP02XcM9d3xChd/nu iGeTvVkgAyScSUnpC9SBiDle5gFbxXXmQ//YGNIGbFK0fPzQq9n7d/XNcRZbVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716331821; a=rsa-sha256; cv=none; b=Hm7pWyBC417vDdozGzOWbUsnyh1HV+8JQF3S6J37AD/KSXHr5zC8W2ylC5rdDRxpNjNjEG Rb+Y1Dqjq7WpJqwvHqauMDWkfUotI4Y8IZ7tlQKsAIumjwn/ASfF7PjOPHYIWsLbU/1akA yRWriepWlMrJHv/KG3pChtkpJFtpskKQDqPWU0QVS34JINuZpoWnLcC/+C3XrbaGocpq4M pBG9rbCti23TSclc37nAp0dQZWY0S2MBb7OXusSLolhiF+XVhWW0nMrrzIjWO+4OD1IOZl TzqdxK9gY+l25Gq8BQ9QO7fZ/O7KIu5vH9lkaqLki0Wfpb55DTCRSEhP+wM7RQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716331821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RJtUjCndpQF2Jd7qJAOmiPto/0XF7U98OARfb7hlIkQ=; b=aNuUlh0HCfQB0cifCPKKreHD52Yun22qRw4zrKUOXz3AW7PZty65Ddpw8TgajM4jTtefQC Cnb202T06SxAD/15Yprlw/ZKbNbCekK/lCijQGrEbuEJvWYENinC9BJEqTiiC7/srx49rs Gvj2sFBEWVkNVkgV6oB9y2i8LGjBceQaeN7LsiY287KCxn4NKAmppH/Xs3AAIjrt5QrvsY BA/zr2s+Oe3lUuLpYjIvobPw7SWT3gCvT5xCCNcLBA/kzV3RkQJrezjTEb6ZWUtbW+CybH AgV0+wY0HG1quMDL+uF7BQVRhXdKcPWU79eZ/LBjz1Ozs1EAbDxH+CkzGvv5zQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkV594Kdjzh1N; Tue, 21 May 2024 22:50:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LMoLVc021509; Tue, 21 May 2024 22:50:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LMoLEI021506; Tue, 21 May 2024 22:50:21 GMT (envelope-from git) Date: Tue, 21 May 2024 22:50:21 GMT Message-Id: <202405212250.44LMoLEI021506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f9b66c0040bf - stable/14 - umount: Add -d option to detach md devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f9b66c0040bf03e5abe96df21690c51e881d72ed Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f9b66c0040bf03e5abe96df21690c51e881d72ed commit f9b66c0040bf03e5abe96df21690c51e881d72ed Author: Ricardo Branco AuthorDate: 2024-02-03 00:29:48 +0000 Commit: Warner Losh CommitDate: 2024-05-21 22:49:52 +0000 umount: Add -d option to detach md devices Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/972 (cherry picked from commit 840a802750a464355c52b314c17fb067b317da8c) --- sbin/umount/umount.8 | 14 ++++++---- sbin/umount/umount.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/sbin/umount/umount.8 b/sbin/umount/umount.8 index b5a7d7230269..086980151d60 100644 --- a/sbin/umount/umount.8 +++ b/sbin/umount/umount.8 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)umount.8 8.2 (Berkeley) 5/8/95 -.\" -.Dd June 19, 2020 +.Dd January 16, 2024 .Dt UMOUNT 8 .Os .Sh NAME @@ -35,7 +33,7 @@ .Nd unmount file systems .Sh SYNOPSIS .Nm -.Op Fl fNnv +.Op Fl dfNnv .Ar special ... | node ... | fsid ... .Nm .Fl a | A @@ -73,6 +71,11 @@ except for those mounted at .Pa / or .Pa /dev . +.It Fl d +If the filesystem is mounted on an +.Xr md 4 +device (a memory disk), detach it after +.Xr unmount 2 . .It Fl F Ar fstab Specify the .Pa fstab @@ -184,7 +187,8 @@ file system table .Xr unmount 2 , .Xr fstab 5 , .Xr autounmountd 8 , -.Xr mount 8 +.Xr mount 8 , +.Xr mdconfig 8 .Sh HISTORY A .Nm diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index aca7c201bc9b..d1471076359c 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -62,10 +62,20 @@ static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95"; #include "mounttab.h" +/* used by md_detach() */ +#include +#include +#include +#include + +#define DEV_MD _PATH_DEV MD_NAME +#define DEV_MDCTL _PATH_DEV MDCTL_NAME + typedef enum { FIND, REMOVE, CHECKUNIQUE } dowhat; static struct addrinfo *nfshost_ai = NULL; -static int fflag, vflag; +static int dflag, fflag, vflag; +static int all; static char *nfshost; struct statfs *checkmntlist(char *); @@ -82,17 +92,18 @@ int checkname (char *, char **); int umountfs(struct statfs *sfs); void usage (void); int xdr_dir (XDR *, char *); +int md_detach(const char *); int main(int argc, char *argv[]) { - int all, errs, ch, mntsize, error, nfsforce, ret; + int errs, ch, mntsize, error, nfsforce, ret; char **typelist = NULL; struct statfs *mntbuf, *sfs; struct addrinfo hints; nfsforce = all = errs = 0; - while ((ch = getopt(argc, argv, "AaF:fh:Nnt:v")) != -1) + while ((ch = getopt(argc, argv, "AadF:fh:Nnt:v")) != -1) switch (ch) { case 'A': all = 2; @@ -100,6 +111,9 @@ main(int argc, char *argv[]) case 'a': all = 1; break; + case 'd': + dflag = 1; + break; case 'F': setfstab(optarg); break; @@ -467,6 +481,16 @@ umountfs(struct statfs *sfs) clnt_destroy(clp); } free(orignfsdirname); + + if (dflag) { + if (md_detach(sfs->f_mntfromname) == 0) { + if (vflag) + (void)printf("%s: detached\n", + sfs->f_mntfromname); + } else if (!all) + return (-1); + } + return (0); } @@ -649,7 +673,47 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: umount [-fNnv] special ... | node ... | fsid ...", - " umount -a | -A [-F fstab] [-fnv] [-h host] [-t type]"); + "usage: umount [-dfNnv] special ... | node ... | fsid ...", + " umount -a | -A [-F fstab] [-dfnv] [-h host] [-t type]"); exit(1); } + +int +md_detach(const char *device) +{ + struct md_ioctl mdio; + char *eptr; + int fd; + + memset(&mdio, 0, sizeof(mdio)); + + mdio.md_version = MDIOVERSION; + mdio.md_options = fflag ? MD_FORCE : 0; + + if (strncmp(device, DEV_MD, sizeof(DEV_MD) - 1)) { + if (!all) + warnx("invalid md device: %s", device); + return (-1); + } + + mdio.md_unit = strtoul(device + sizeof(DEV_MD) - 1, &eptr, 0); + if (mdio.md_unit == (unsigned)ULONG_MAX || *eptr != '\0') { + warnx("invalid md device: %s", device); + return (-1); + } + + fd = open(DEV_MDCTL, O_RDWR, 0); + if (fd < 0) { + warn("%s", DEV_MDCTL); + return (-1); + } + + if (ioctl(fd, MDIOCDETACH, &mdio) < 0) { + warn("%s", DEV_MD); + close(fd); + return (-1); + } + + close(fd); + return (0); +} From nobody Tue May 21 22:50:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkV5B6Yw3z5L0ts; Tue, 21 May 2024 22:50:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkV5B5hK8z4YSp; Tue, 21 May 2024 22:50:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716331822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BcTJ7Me4QghMx3dLJFCNz0muFWDxPiMf1kJ8rv1xXa8=; b=Q/IRKw8uCnPs+7jxKaxre7Z1du1U9e05xJaq/51Eeqzm4xFmdn7Pd/kxDKs0AYQ/DspDzE HWk2Dvv/fLC+xdUOYAOefFOr/ntwntmVIZ3YDsQ2IVD2lSbQUtb5DMD00E1rLmCCe4Q22b sYREWuIvBhaD0r6ICbsQFZCR3g+NRZyKBp/+jpC+JvX06B8gFVJLMuEWCth/WgGlkQyMqF HsTEhYcrPmGEk5NJ5tNvBgnOxP1ZbFWpjSb/U3hnv1YmC2LIzizOKGgqRfQgZGnDy9uEwy oqJUEWwHuneZoiFe2c26cRJ8VfWqIvx+07WLQpznQI7UwN1HXpCdVwK6PeUeoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716331822; a=rsa-sha256; cv=none; b=Zg/nxmuwqByU06KRhxzjZxmLe5TsKuOTBo7IEQB6nO8U9i9fLHSjWx2VVH7D+cBwEtBVsc evSO1g2q6FKOcjeLBq7VM7ekrM4zpGIeF3fQynkhHa64Z0mokZOgD7iq0v8fI3dnp8Yxdp Nq7oZ+y+nMf5R0cEJ9zWDu5IgeKjdWF8u2ccI5x2dYrnQ+O5gJx2fOr1WfCSA3cQkhm7CF shCfrIFE6U74TlLuchREXs+DOYnilDZyF1vOhj9rE2soZscEr6PWqvzXnp6cmZuCzLKZt1 /huVBoZrxqwDOOI0JMQ0Z7Yz7oKxCACMc4nIgEKiNHdAibTdbqxOxm6MbU6+EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716331822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BcTJ7Me4QghMx3dLJFCNz0muFWDxPiMf1kJ8rv1xXa8=; b=rfk71LTJ4CCRnvygk8jZQyuOlhzZ/FoP6EWbnldgS3m0ol/C4aECtKMdy3W0HtgisPiuhw Blvzz0uvaiKcoPjisLmSOayjSS9qRGkyL+ha4qauRgoGeg2vqyyOufpfVvZd4Iar8i6Wnz krP8Cz93xoVylRg7KL7CNCMk21GVUTuWKOGNv/bXWhgTppQCpD8NOc3XrQxdDwvyzANE+Q BgwNKVRel/5Ll6SbwAM4TPLJHWW3LdorLo5XeOZqQH6q9Cfelq48Flb23H5//Pqvy0gTvq ITwNZYUSPqCtfDkmnqfLHhT9GI7BzQZtLPI5ja2hyvcfVG1/HmzebmWiKfc7zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkV5B5J7bzh1P; Tue, 21 May 2024 22:50:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LMoMF8021567; Tue, 21 May 2024 22:50:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LMoM6d021564; Tue, 21 May 2024 22:50:22 GMT (envelope-from git) Date: Tue, 21 May 2024 22:50:22 GMT Message-Id: <202405212250.44LMoM6d021564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 4de324578f4f - stable/14 - umount: Support partitions & slices with -d option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4de324578f4f7d08ef5b2d3dbebe4f253c9511d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4de324578f4f7d08ef5b2d3dbebe4f253c9511d3 commit 4de324578f4f7d08ef5b2d3dbebe4f253c9511d3 Author: Ricardo Branco AuthorDate: 2024-04-22 22:08:58 +0000 Commit: Warner Losh CommitDate: 2024-05-21 22:50:01 +0000 umount: Support partitions & slices with -d option Signed-off-by: Ricardo Branco Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1183 (cherry picked from commit e96d0d7468446d7cabd76ae213889297711bb144) --- sbin/umount/umount.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index d1471076359c..4050524b9f2c 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -685,19 +685,17 @@ md_detach(const char *device) char *eptr; int fd; - memset(&mdio, 0, sizeof(mdio)); - - mdio.md_version = MDIOVERSION; - mdio.md_options = fflag ? MD_FORCE : 0; - if (strncmp(device, DEV_MD, sizeof(DEV_MD) - 1)) { if (!all) warnx("invalid md device: %s", device); return (-1); } + memset(&mdio, 0, sizeof(mdio)); + mdio.md_version = MDIOVERSION; + mdio.md_options = fflag ? MD_FORCE : 0; mdio.md_unit = strtoul(device + sizeof(DEV_MD) - 1, &eptr, 0); - if (mdio.md_unit == (unsigned)ULONG_MAX || *eptr != '\0') { + if (mdio.md_unit == (unsigned)ULONG_MAX || eptr - device == sizeof(DEV_MD) - 1) { warnx("invalid md device: %s", device); return (-1); } From nobody Wed May 22 06:52:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkhn32DP8z5L2l7; Wed, 22 May 2024 06:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkhn31fX4z4SQ3; Wed, 22 May 2024 06:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716360727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4NYxT1FvcEp/SgFT4YYy6Ati8wjA36qsfocI3K4QXU4=; b=LHzQa0ce5LhsAqKhrckxnHUmkR0CuL0bqj9ggcj7wJgIl7hXpSWkkepjfD1QpGZcgzfuZK URGcVLWu2QdMb1mCbd3944BkXczX/q/9yKyoNM7hlp/aXvnUa3K6nc/klEHaBFjN7QF6a2 Zx81PAmoHGN7QZ/mUDc4GeFAFGvYrFQE5+RWwI4PmOBNQ3LjPQz5dQjrU2OZcIVL6KSepg dSlf8GvZkINAl8R7oFm3DMfvYWo0b6xHkljJTiAUk7FNIBzgKEeZbrjwCavub0WXBf3GHn 61TPvnrzj9r+SBMALPO9jIUdXNwpsS4mWq4Hi3lOMYXnHq6yUNGlsdKHcEvOkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716360727; a=rsa-sha256; cv=none; b=HAP7tx5lgK1dTykFF85y9HUZ3uNDbr1pmAAHPtCaVDcBMGMrOAP3wLnqfDkbBJKmFHhFjp fCTLVrluzY/5MzxUNB7TkqaLmZMExigcpkHKOpxK50YhS321HC4ibrHGEjRCfpstdIIdgf t+R79fZA/FxGeGs+D7r92hAF91MuKmzZReRPvNkwsnhZWrkHiD/hXtYfjI+yYIDNjOSfdP iAkMPkyUb+buir1nJYacTI5Wr2ZueSZKxk1I7E9uNhUrK8LnQLRgRIl5AjznaqcazG7YWB Kz1FLEKODtknLNjNkN/8U+A4P5z9eA4JF2M0nrCiZhZ8ZE1KEj1psmbHdIqouA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716360727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4NYxT1FvcEp/SgFT4YYy6Ati8wjA36qsfocI3K4QXU4=; b=oCcux7OC94NdDPmIZcl8lHp7I/Vz0GxNxyCV6Ef1jbUcJQB+FOPMPBVo15oPYESJ658io3 v8yKyx3O/e3Riq8AdVFWhJr1sBYYMkJOCmZfT4O+8gH99+KzqFenydtc7/mlfUI7bgKHtO 4EE+4Ll7++PPRuWNvRs5ftdOQIP7PJqrYIeJ4jhZEJ9ZlATfi9IhHeBeX+aCyBOb0lG15V qPw5YecPZu6MtM8cRgOPdLoltB5ZYMJSBFZgxiALzzpFe+TfAYx6dgzTtLsT/QjbEhkkxp fI5Qm/maQ0PHYpa30obEemP23oO6icWNw/xYWQYvS7TmZ8ht820A+27OnXK68g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkhn31C5xzvp2; Wed, 22 May 2024 06:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44M6q7BI040352; Wed, 22 May 2024 06:52:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44M6q76w040349; Wed, 22 May 2024 06:52:07 GMT (envelope-from git) Date: Wed, 22 May 2024 06:52:07 GMT Message-Id: <202405220652.44M6q76w040349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 5601feb7204b - stable/14 - fix (nuageinit): SSH keys are not handled in metadata but in userdata List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5601feb7204b2ebb4c351b534105da8fc22213fd Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5601feb7204b2ebb4c351b534105da8fc22213fd commit 5601feb7204b2ebb4c351b534105da8fc22213fd Author: Jeremy Collin AuthorDate: 2024-05-21 14:52:23 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-22 06:51:33 +0000 fix (nuageinit): SSH keys are not handled in metadata but in userdata MFC After: 1 day (cherry picked from commit 48edad2edf6eb7a539e40dad8e1f87e3fa4973fd) --- libexec/nuageinit/nuageinit | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 08224061d1b1..df637bbc5064 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -164,13 +164,6 @@ if citype == "config-2" then nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) end local obj = parser:get_object() - local sshkeys = obj["public_keys"] - if sshkeys then - local homedir = nuage.adduser(default_user) - for _,v in pairs(sshkeys) do - nuage.addsshkey(root .. homedir, v) - end - end nuage.sethostname(obj["hostname"]) -- network From nobody Wed May 22 13:23:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VksSM0ZJ6z5Ljd0; Wed, 22 May 2024 13:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VksSL6srFz43Fw; Wed, 22 May 2024 13:23:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OW4zJAG1qWMpECGjbvXrd5yadnz3dwLcMxZu1l4UdNA=; b=Iswn1tppIfT+EaklcHZu7FtKUOXGgdgJOV1LA03k4ouAmIG1gJbcyayjrRLwT+1Y8cMYoe HlLnj1xkn787IZIfmeGA5LWNpbbLmQ/+wtzZaaYV0w9l/mAFot5l4dI758I7arlkPYbfPY BjwRmgd1iG6hfxeMgKaYsNnYl0ckC789QXH6p/K5nwVAIhBXD+d23XyzILb2NjV5djRYSw TZvPjrXcPR8YaplMOtK+Yu++mwTSGhjJlbH5rxzd/TjrGcUt8ZAZD6yZ3JPLsSnpfLsPnE tTj3I/k+3NgbisZBZOpAUI7SSDSxj5u5gFPFXGY9KYYsQGZbUNY8m4LsdEx25g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716384195; a=rsa-sha256; cv=none; b=MR20kOxb3TQgsklu2Xtsz0kFISlXu7yajl7GNaB+rQ0EOg/ceucKL4WssEzgNv16PXnCRT qx7GauDkJ5ErrYyqhDKvP9zIboFbO5p5JJMlp6aMdhcYKJbydWNCZpMH87I0S7MP2MvCI1 DVRqeGdg+4jO9MXYvhvPE1OX2wVlF2/Up0dIESX84WD6+XBjX/XKzuddMBkr7GUvjzj45H 42npbXcDCfoEYOTXBR2LzMS1RWVNZ3ah0WIRnltzMGD90PO9xT5UQ6PLlZKTl3oiqu2DQh rBws7qwbSZjT4Lt3dx8crA7btkGNsWohom50kG8EY7qZYoOSL5EwmD2uaxU3hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OW4zJAG1qWMpECGjbvXrd5yadnz3dwLcMxZu1l4UdNA=; b=a3NUpfB3ALL55ybYYoXHz43lYsNTtIs8VnTko6GWsHtS1aunp+YGGZU2iW105QzfuohvPf H6bm8M7NB6eumSS3PDhIcNCwxo86W1Ep310Io4VbwFvL2d1Y73TcZIqEXxBv9IxAslqqxF pyecpmcYDh6EXDy/oBa+0eOhfhjV3luN1JGulZCEyUkTdWOMTfFIUToLMzQiRHY1Tev6iK bP13Bz3ex10/fSogMnDlYGGxRxyaEFQt4aB5AoEGTkYb3bu3tcx4vcP37PAAUDZQbYMuh4 ARgAVtZlW9v1mFHazkeZIPNJ0H1M9Jjtn/v69Ia1GKb65RN7LAqUtV+tHZdsCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VksSL6SY3z16ZN; Wed, 22 May 2024 13:23:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MDNEFA098555; Wed, 22 May 2024 13:23:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDNE3s098553; Wed, 22 May 2024 13:23:14 GMT (envelope-from git) Date: Wed, 22 May 2024 13:23:14 GMT Message-Id: <202405221323.44MDNE3s098553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: a4a473104ec4 - releng/14.1 - sound: Remove nmix variable from mixer_oss_mixerinfo() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: a4a473104ec4a42c66f1b9a09736954ebad43e7e Auto-Submitted: auto-generated The branch releng/14.1 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a4a473104ec4a42c66f1b9a09736954ebad43e7e commit a4a473104ec4a42c66f1b9a09736954ebad43e7e Author: Christos Margiolis AuthorDate: 2024-05-09 19:07:48 +0000 Commit: Christos Margiolis CommitDate: 2024-05-22 13:20:42 +0000 sound: Remove nmix variable from mixer_oss_mixerinfo() nmix is used to compare against oss_mixerinfo->dev, which is a user-supplied value to select the mixer device (if not -1, in which case we'll select the default one) we want to fetch the information of. It is also used to set oss_mixerinfo->dev in case it is -1. However, nmix is at best redundant, since we have the loop counter already (i), and confusing at worst. For example, suppose a system with 3 mixer devices. We call SNDCTL_MIXERINFO with oss_mixerinfo->dev=1, meaning we want to get information for /dev/mixer1. Suppose /dev/mixer0 detaches while inside the loop, so we'll hit the loop's "continue" case, and nmix won't get incremented (i.e will stay 0 for now). At this point nmix counts 1 device less, so when it reaches 1, we'll be fetching /dev/mixer2's information instead of /dev/mixer1's. This is also true in case the mixer device disappears prior to the call to mixer_oss_mixerinfo(). Simply remove nmix and use the loop counter to both set oss_mixerinfo->dev and check against it in case a non -1 value is supplied. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45135 (cherry picked from commit 2f31a5eb75f1e47b5c49f574e8ce48d2c863e9d3) (cherry picked from commit 8b4e2ba31d1b171f688cb630f1827ec397ecaacb) Approved by: re (cperciva) --- sys/dev/sound/pcm/mixer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 0645089ac503..31a633afb380 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -1430,7 +1430,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) { struct snddev_info *d; struct snd_mixer *m; - int nmix, i; + int i; /* * If probing the device handling the ioctl, make sure it's a mixer @@ -1441,7 +1441,6 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) d = NULL; m = NULL; - nmix = 0; /* * There's a 1:1 relationship between mixers and PCM devices, so @@ -1461,7 +1460,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) if (d->mixer_dev != NULL && d->mixer_dev->si_drv1 != NULL && ((mi->dev == -1 && d->mixer_dev == i_dev) || - mi->dev == nmix)) { + mi->dev == i)) { m = d->mixer_dev->si_drv1; mtx_lock(m->lock); @@ -1473,7 +1472,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) * sure to unlock when existing. */ bzero((void *)mi, sizeof(*mi)); - mi->dev = nmix; + mi->dev = i; snprintf(mi->id, sizeof(mi->id), "mixer%d", i); strlcpy(mi->name, m->name, sizeof(mi->name)); mi->modify_counter = m->modify_counter; @@ -1537,8 +1536,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi) mi->legacy_device = i; */ mtx_unlock(m->lock); - } else - ++nmix; + } PCM_UNLOCK(d); From nobody Wed May 22 13:23:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VksSN2JrRz5Ljd1; Wed, 22 May 2024 13:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VksSN0NTkz4396; Wed, 22 May 2024 13:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vh98dy3arB81QILCOpX6g9b81TSZolo7ozORMQoZIaI=; b=PcK2Ho0oqVZGNqTp+khxXzw+zKDQQTffx1HRxIa+HTvtcsl80iwRxQvibnhLLay78UUPfl nRomRJLyYkPT6cO31f48Ryh/dXWHi34eWvzbG4truhHLLtjX5+EstGI8AerM8xcXfQk0uO gP66dx3pAYy6qUECHwdrUhlYE/x/zdjjmx6LOK4gthiuGu8SfbECh1M3IUgkcTKCuSAT23 Ir8Tng1AKiCXmPqDZWn1C4dHFdnjOOKae4D1VH1YtzL2QRlBCyT3/3PQ5IwHY8tN3plbvg QaEo7wogjzy1/WuNicMU33Zp+LIdQJfi4j+uee9BRuavt+6D1NZt+YExkd6q6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716384196; a=rsa-sha256; cv=none; b=XMkHit6PfoE9ty0GJ4xcJpN3q26lnytLOFCVKt5PtxETl0wxCjZC98kYQ11ytas/4MBxNY 8BUs3Znj0Vz1DQ3/nhkZdR8X/jBLl49OqeVzafTw5UeZrBdhDLm15FCRfhAjURvKpKmxSf adztRUphp3wAK41iKyRIWLz0xtscwkQntoX/vxoIKjxemi+P8WXiS+2NBbWlCROIcnvrGh NHJwxma99jR3CyLhinZXD5awYB8OatPstCjVRCBWsA4pkKJ3KC0zjJFb/DXlz6uTf2hIYQ 9j5zb/fwEE9RuKlApQ6e7ViuJXMiFpYrPFYkZy3llgsJh8gLKKMaERhVXPQiFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vh98dy3arB81QILCOpX6g9b81TSZolo7ozORMQoZIaI=; b=PbvjVMM4JUcMjy2ScFlSDAet5flzP6tWHJwXIZNMjAoMCBdTwHKeOGxg3/Qzwe1QCwy4Xp 1q0iuHcIHUWjVQKrQrQ9jgcz5pIbVGWmVw08a59zB3H3ib17qHI9SbPg8o6AeZ+6VQeCf4 kG8uy+fqP7sNEzeAv6fnG5HfRGw8156I4R1+7iGvO6WtdIiCE+BbpuFcWO3oEq25Fz/mea mhDlv0UZwDYhjukmhMk7TDS8cx4M5cAcdt0E9ZBeRzbnWtW5DEWIztS8azMpE6dyXMIlBn Bp2lTIrU4JmVKljShVaCZoauiVG6ee9W5uk8VCYEQdphcSuKHU35nrDZppRarQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VksSM75L7z16PS; Wed, 22 May 2024 13:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MDNFwE098591; Wed, 22 May 2024 13:23:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDNFJm098588; Wed, 22 May 2024 13:23:15 GMT (envelope-from git) Date: Wed, 22 May 2024 13:23:15 GMT Message-Id: <202405221323.44MDNFJm098588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: a0ff4e0f3e02 - releng/14.1 - sound: Fix oss_sysinfo->numcards List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: a0ff4e0f3e02d31e01844295f216ec87826130de Auto-Submitted: auto-generated The branch releng/14.1 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a0ff4e0f3e02d31e01844295f216ec87826130de commit a0ff4e0f3e02d31e01844295f216ec87826130de Author: Christos Margiolis AuthorDate: 2024-05-09 19:08:01 +0000 Commit: Christos Margiolis CommitDate: 2024-05-22 13:21:36 +0000 sound: Fix oss_sysinfo->numcards According to the OSS manual, oss_sysinfo->numcards holds the number of detected audio devices in the system, while the current ncards variable, whose value is assigned to oss_sysinfo->numcards, holds the number of currently registered devices only. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45136 (cherry picked from commit 59d98edae3e1a6fffd292e4393c49862d624f25f) (cherry picked from commit 2b3698288771f6d236212f80b1a259aa86e09fa8) Approved by: re (cperciva) --- sys/dev/sound/pcm/sound.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 2057c7572ad6..78a2312e56eb 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -1107,9 +1107,7 @@ sound_oss_sysinfo(oss_sysinfo *si) struct snddev_info *d; struct pcm_channel *c; - int i, j, ncards; - - ncards = 0; + int i, j; strlcpy(si->product, si_product, sizeof(si->product)); strlcpy(si->version, si_version, sizeof(si->version)); @@ -1118,7 +1116,7 @@ sound_oss_sysinfo(oss_sysinfo *si) /* * Iterate over PCM devices and their channels, gathering up data - * for the numaudios, ncards, and openedaudio fields. + * for the numaudios and openedaudio fields. */ si->numaudios = 0; bzero((void *)&si->openedaudio, sizeof(si->openedaudio)); @@ -1138,7 +1136,6 @@ sound_oss_sysinfo(oss_sysinfo *si) PCM_LOCK(d); si->numaudios += d->devcount; - ++ncards; CHN_FOREACH(c, d, channels.pcm) { CHN_UNLOCKASSERT(c); @@ -1169,7 +1166,7 @@ sound_oss_sysinfo(oss_sysinfo *si) si->nummidis = 0; si->numtimers = 0; si->nummixers = mixer_count; - si->numcards = ncards; + si->numcards = devclass_get_maxunit(pcm_devclass); /* OSSv4 docs: Intended only for test apps; API doesn't really have much of a concept of cards. Shouldn't be used by applications. */ From nobody Wed May 22 13:23:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VksSP1nGyz5Ljf2; Wed, 22 May 2024 13:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VksSP160Xz439F; Wed, 22 May 2024 13:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCtrZx+h40Ka9PFpJ+gzOgIQ45YWEuf42mTogHb+wac=; b=MGMfcQdnrMIlZj2y7K/OmYkF073AiuRnZKoDkB8qIDGVWI7pqbEBLKMwNOfIPGs/CD+SBG wulitG8QLPXKXfmSwFSyEpsyGYWS692um4IYiu53nvJNgJClwKa8KYI2uC89B7vs75kgkY 8Jc9zrouGTpsLw+G7a53kZbcrUKGkOjM3gz6xOJKhLUNsMlWWzbok7CF11Ko75HoMeGwFU 3oEPa/HNBFd6wbfGLAxT14/Z9wCfXMqqc287+IXoidQNFgfnFBWnhOnXfDr77qOvziDGOF waWQ/IYEswkXMSEy3iJauylmJeEqYTAIrF7RBikeMefmz667XI5Gc6an72MStQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716384197; a=rsa-sha256; cv=none; b=nHIQ356j6RJ6ZB8ezRDHex8ioEo7E/bFEdW/PMqZFKZvMimODvNTOstkRtxjy3qER3hynE ABtH73gA4ccIBLSjEEICFv3ArabQQ+aPBUiTD2f/JslscQ+QCbGycAfcxGQqIbdXaXCNso 2gV7tgG4oxFbBAcTefZauEOczL+mzvevP/9X4el9EfcCxoKfhznNGjhlneHBwthtom07L9 9vP2GBjm4gPj8+ckiOu4MmEqnjJsuGaAC0fy2YdmQdxiC2S3eczbg2ri24G0R2/XM7YLaG 2V4pRYlgxjyhjWSfiHkVzuG1dsYi6YgYxhH6t221E2aq/c9TgWTDOON8INO9qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCtrZx+h40Ka9PFpJ+gzOgIQ45YWEuf42mTogHb+wac=; b=nH4DQSo1XRqEWjRQicgWrP4F1c3eeCA16k0Pqqz7bUg1vc9R/QTf6xZdXZ6+vI+gE51Qh9 Wcak1eZ7XzBcgWhrzuFuhFnkFhO2D1S1utCdTxDrCFFj8VabN7/IoXIblE/Lcvm4YFI80p 1UYpp7f6Tju3kXz7lUDn0TY6b7batFHeRfEQVO7w27SizGrpmPHhtXjjKYvUFD7XlG0tDv MYhHI88LXdvQhTRVn5CIYXDp5Iwg7SXagiuQVrRzXA8LfI3cdJF2U0Pb8JSqqr1DkH6RXs 6D5j4h+EtjkzNMI6QnXG5LiYOBbw7i9JUj+uaPZu1y0tq/zwmfmGUJOfLN/sOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VksSP0jB7z16rr; Wed, 22 May 2024 13:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MDNHKJ098649; Wed, 22 May 2024 13:23:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDNHsO098646; Wed, 22 May 2024 13:23:17 GMT (envelope-from git) Date: Wed, 22 May 2024 13:23:17 GMT Message-Id: <202405221323.44MDNHsO098646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: cb23e0eebfe2 - releng/14.1 - snd_hda: Add patch for Lenovo Ideapad 3 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: cb23e0eebfe21d64c2a478bdd4ebfa56d31a37e4 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cb23e0eebfe21d64c2a478bdd4ebfa56d31a37e4 commit cb23e0eebfe21d64c2a478bdd4ebfa56d31a37e4 Author: Christos Margiolis AuthorDate: 2024-05-14 13:42:04 +0000 Commit: Christos Margiolis CommitDate: 2024-05-22 13:21:56 +0000 snd_hda: Add patch for Lenovo Ideapad 3 Reported by: bsd-lists@bsdforge.com Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45100 (cherry picked from commit 54cc353f505dbc5f19168b6b1417b6736433d9ae) (cherry picked from commit 9a620018afb2da062fce11e866a2154765886983) Approved by: re (cperciva) --- sys/dev/sound/pci/hda/hdaa_patches.c | 3 ++- sys/dev/sound/pci/hda/hdac.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index 3a7dfc63637a..76f677d69614 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -318,7 +318,8 @@ hdac_pin_patch(struct hdaa_widget *w) } } else if (id == HDA_CODEC_ALC257 && (subid == LENOVO_L5AMD_SUBVENDOR || - subid == LENOVO_L5INTEL_SUBVENDOR)) { + subid == LENOVO_L5INTEL_SUBVENDOR || + subid == LENOVO_I3_SUBVENDOR)) { switch (nid) { case 20: patch_str = "as=1 seq=0"; diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 4dd589ed2a09..12552286bd8c 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -383,6 +383,7 @@ #define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f) #define LENOVO_3000_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_I330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) +#define LENOVO_I3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From nobody Wed May 22 13:23:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VksSQ3q29z5Ljd6; Wed, 22 May 2024 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VksSQ2H2Zz43Sc; Wed, 22 May 2024 13: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=1716384198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bMchj6Xbb86ejyIvLnzR/UJui386zC13U7OxxgBiXSo=; b=swNKHGe6SGDkwPICVx9wCHSiOV4kBBj7YcO9adWiNFX612nAmBF+IVP8/45lCRxWxTn1J8 QKXWm+0ib1VPSJ9kWK1qNIQbpxxCexDcu85LoAn7AReXgYd0rZXm1bYqSdv2cQOZX4QcV6 N83bimTWx/hF7Dysq8RvKF4TWEPKIXARmA5WPac71XKi8xq6NALmAAMe6+Qqh5i44xU13N TtdYnxKDmZRkz/fNUMRMzXWV+i3AAFS9CWaNTqnHJTEJlb24TcHmr8oNEe2Mu7gVO7jwdC gMA4UXPgLOoP2mPWFIzTNR9S/3qZHN+M8yt5+4ntXHvPQS9XnZ6Y3cxGJgevTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716384198; a=rsa-sha256; cv=none; b=M7PPE1gbbk3xtePtFQlyv3kYt6IwNmKWGTn1QEWWlpfNPDVasI2bvVFgZcvVOz8YVWlXY1 nEMldl5O4IiPDouX66mOoExjtTfvz21l5ryGCKrzyp/wS5uwBqx8+5onPx9UeHW13vsnb2 uv2XpgPnrdgI2Mk0XPZounnncYhhI/j7KwN/REugpEL2esLVGvePHn554xg1YU4mSyhTs+ u/vTJAMYbQmBLFYzavs4wg5QHKeQh1lS/LECt1xsZ7TohQ5thYkvPbch0k/WYqDbnBQlOx ur8QChk5sXTiT4uznrpVafdQUg8C2FKHyJIT32/sv7c3HVFiIZk3VZ43swu/YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bMchj6Xbb86ejyIvLnzR/UJui386zC13U7OxxgBiXSo=; b=lbrRqUbdZoFNSlDHGXkAt3A0kKzBNzjF6ZjEAC8V/z7jPYF2gyhnh08uBA/lih3WJCpyZF xJf4Dhnn4fm0dsQ2Zoe6VCkALVWqJG6YPKXMgV0DTVPwN8XkYKm3tM8TFjCMwOqpvWy80U xJSVtyFOXi+hRyy/bxq0QlSkt8B5sMG8jcdWAYDIlbfJDHltBZ1oWJPJsnrSUZvAsV5bAM PwVSZsOtHvHP7uzFjrU3eeiUtAG47ymNREI013n4PWUMQU3+IwLxWM5YejdlbfUQipmONH zITXhFS4iDqIgb0y0CJ2V+AFXKK6UPPCRhX2fQ3cX8B7vzJsofjoIZEAhzh4LA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VksSQ1sSrz15mH; Wed, 22 May 2024 13:23:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MDNIYA098695; Wed, 22 May 2024 13:23:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDNIYB098692; Wed, 22 May 2024 13:23:18 GMT (envelope-from git) Date: Wed, 22 May 2024 13:23:18 GMT Message-Id: <202405221323.44MDNIYB098692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 5a9a2f5eed47 - releng/14.1 - snd_hda: Rename LENOVO_I* to LENOVO_IDEAPAD* List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 5a9a2f5eed47f76e953b546a38d5f368eaee4828 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5a9a2f5eed47f76e953b546a38d5f368eaee4828 commit 5a9a2f5eed47f76e953b546a38d5f368eaee4828 Author: Christos Margiolis AuthorDate: 2024-05-14 13:42:15 +0000 Commit: Christos Margiolis CommitDate: 2024-05-22 13:22:10 +0000 snd_hda: Rename LENOVO_I* to LENOVO_IDEAPAD* Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45105 (cherry picked from commit 278953360e0e6187c3f7c688cb49254df1567f0b) (cherry picked from commit 7814ed2bd321dff2bbec8408c5b64cb7f4f2dfc5) Approved by: re (cperciva) --- sys/dev/sound/pci/hda/hdaa_patches.c | 4 ++-- sys/dev/sound/pci/hda/hdac.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index 76f677d69614..9f3532562252 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -319,7 +319,7 @@ hdac_pin_patch(struct hdaa_widget *w) } else if (id == HDA_CODEC_ALC257 && (subid == LENOVO_L5AMD_SUBVENDOR || subid == LENOVO_L5INTEL_SUBVENDOR || - subid == LENOVO_I3_SUBVENDOR)) { + subid == LENOVO_IDEAPAD3_SUBVENDOR)) { switch (nid) { case 20: patch_str = "as=1 seq=0"; @@ -340,7 +340,7 @@ hdac_pin_patch(struct hdaa_widget *w) break; } } else if (id == HDA_CODEC_ALC230 && - subid == LENOVO_I330_SUBVENDOR) { + subid == LENOVO_IDEAPAD330_SUBVENDOR) { switch (nid) { case 20: patch_str = "as=1 seq=0 device=Speaker"; diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 12552286bd8c..6a3314280a22 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -382,8 +382,8 @@ #define LENOVO_L5AMD_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x381b) #define LENOVO_L5INTEL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x380f) #define LENOVO_3000_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) -#define LENOVO_I330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) -#define LENOVO_I3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) +#define LENOVO_IDEAPAD330_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3808) +#define LENOVO_IDEAPAD3_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3881) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From nobody Wed May 22 13:23:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VksSR53cnz5LjPq; Wed, 22 May 2024 13:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VksSR2zxDz43Jl; Wed, 22 May 2024 13:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hVg6YTZAbgtmLwFgLMHiXM9X24xWPpFWxQrJzlmIkdg=; b=Tta4IPV8EcoPSV3yd1plLG0ntcU4bADk+KbJ6BCsRWmsQVxsrD92XFCJb3JilJ9zz8qu+2 P5mumBELrXnNdtnBpGzMM4i2Wanu67FnOLHASK8IjW4bMsbOhw4OVgOe63ZIVRtm6kVEiR YTAeFSbHKqnrdLuBq+ust/e1SGdXq17HGc7RG6kE7OEEx1bAr1E8h7Ts0Swt54Fsa4qib0 hq4ksAXKR8lTZZ0xRjIiWEh9qe/cU9rQIw72FzEPLPc3A4O5TAc0nJfaujjoCW9mkb6agw BRNKx61M3YJyAb7hiVPU9F7ubIkZah2+661aSR2Z27yZXj1vdU4BwwmdtBncPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716384199; a=rsa-sha256; cv=none; b=W8Jx9+iSn8M6S0HZyxYmwOW7f1Ri8ON8DdaYa/yQtvtaSNdVwktz8Sutbl08raTP5rEsdr q82pvirdhxK7JxkrsuGysaRNdB2ycA82Z/BRFOLCbbeVmZrhjMZjeHKRosErKplFVuS4mP tca7pwyZ5GULUHpxtI3AvU0TqLzW+fhgWi3HLeEM5l1CawBhc2CJby0jhtq8CGBAHVf230 MayY4l7UvB03UPgUjSjaXvCE1JiLrMtuiS/EhGFbxZfzs5itxIPoA9QZqyjTwHoU3KzSwR Bx2I4MTJGrhJTDPev8zGfU72EsILbP/w3MJyWRatPSE5yGwAiJhNp1E6P82fEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hVg6YTZAbgtmLwFgLMHiXM9X24xWPpFWxQrJzlmIkdg=; b=U6TQr4Siy+Q2yH/WbqVE8Lgeclact6KxOMQCJkfeHVRquX0PRcYOGDWcyx/I1q/LcStJF1 c6NYD7sN5bnVug7bYfpWmElHFMwcPk5xyHBjBgJVJmZQ5qsGYfZUEGTIeK17NpOain76g7 +SGj4PACUp0e19MBdOTSyz6TC1ugJHDYfE9Jr4ivPdXxkSN9bBok3vNs9eowTiu6nMuOLH vjzRm/XxEr7rrL3yitpadMWSqueNX6RphK+4RbJGyJ9KdI3I+DHMckYxNieiBwC5/kh+L4 Mh67UuufsTFkhKFte35JKoVBuT9qLp1YwKMhvaICe3L/BXEoHP9Xs+5ZL084hg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VksSR2bGyz16pG; Wed, 22 May 2024 13:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MDNJ3i098755; Wed, 22 May 2024 13:23:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDNJaM098752; Wed, 22 May 2024 13:23:19 GMT (envelope-from git) Date: Wed, 22 May 2024 13:23:19 GMT Message-Id: <202405221323.44MDNJaM098752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 18f80d6d4634 - releng/14.1 - sound: Check user-supplied size passed to SNDSTIOC_ADD_USER_DEVS* List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 18f80d6d463495703f9eb2ccfd92bae93c7889a3 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=18f80d6d463495703f9eb2ccfd92bae93c7889a3 commit 18f80d6d463495703f9eb2ccfd92bae93c7889a3 Author: Christos Margiolis AuthorDate: 2024-05-20 14:18:28 +0000 Commit: Christos Margiolis CommitDate: 2024-05-22 13:22:26 +0000 sound: Check user-supplied size passed to SNDSTIOC_ADD_USER_DEVS* SNDSTIOC_ADD_USER_DEVS* expects a user-supplied sndstioc_nv_arg->nbytes, however we currently do not check whether this size is actually valid, which results in a panic when SNDSTIOC_ADD_USER_DEVS* is called with an invalid size. sndstat_add_user_devs() calls sndstat_unpack_user_nvlbuf(), which then calls malloc() with that size. PR: 266142 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D45236 (cherry picked from commit 074d337ad618f9cc2a1d5ab18b484928e57bd72b) (cherry picked from commit 5830a00c2c5485ec17900558e4f29c459c6a1f3e) Approved by: re (cperciva) --- sys/dev/sound/pcm/sndstat.c | 5 +++++ sys/sys/sndstat.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index ef006a580d40..eb5c68c7c519 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -865,6 +865,11 @@ sndstat_add_user_devs(struct sndstat_file *pf, caddr_t data) goto done; } + if (arg->nbytes > SNDST_UNVLBUF_MAX) { + err = ENOMEM; + goto done; + } + err = sndstat_unpack_user_nvlbuf(arg->buf, arg->nbytes, &nvl); if (err != 0) goto done; diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index f0e4d352242f..8a49042b0453 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -74,6 +74,11 @@ struct sndstioc_nv_arg { #define SNDST_DSPS_SOUND4_PVCHAN "pvchan" #define SNDST_DSPS_SOUND4_RVCHAN "rvchan" +/* + * Maximum user-specified nvlist buffer size + */ +#define SNDST_UNVLBUF_MAX 65535 + #define SNDSTIOC_REFRESH_DEVS \ _IO('D', 100) #define SNDSTIOC_GET_DEVS \ From nobody Wed May 22 13:23:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VksSS5MlLz5LjF5; Wed, 22 May 2024 13:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VksSS3xYZz43T8; Wed, 22 May 2024 13:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rERo10kJVv7BymmKkdEJPQhP//YR6OK+gvvB9FC30pM=; b=Zpkcv9wj0qR6D8VaH1g1xwr40jHY309FCkxC3E+dYpWeA86ltrL19GwH5p6e9G9Z8vtmCp R9UmHmXWP7ePqvaGA3RXlhznO9+J02ciCPeh5aFL4CQxwFD3usGL1x+Di3/GLoM1X/6eMO CtuRuheNnpmz8XGPcZskcsM25K82jv4y0adFpvatOOGOG2rv9pv1rcgmooEWjfte4/Gl3t GEj1ROdEdq5eHzzUZSbK6buqq5827wk2iFFADqo36/QoQbk3+uXt9skjNk8cJmnu4z30lb GsuuBauAdJJmb8/g5llURf1v9UcfnxwAdBvWsZKw2xfKrTdNuf1H6XdUe4VpFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716384200; a=rsa-sha256; cv=none; b=lnWEaOg3L8snpfH+qe1TNeAmkSRb26F1LpNuVf60A4Isb++rlgfVVff77aq/AXaIWJt99+ XeQh9+Mct2s7JcWWyHv9QuQuNKK98yCZ9v3S9MmexCZF6rnzZ5FOu3fSnQGxFzhk1Bg53k Yzq+xpbW+B3mKmBdAHdegI0vlPG4Cuo+hoO5pGPg5r2nqOStTG916EyL2D0XbtU8yIRy93 OnKjlJlAuUygyrITgyUBtv2te80uVGlRkWN6B6cIDkO9+9XxnCAu+v4sSpGTlmUFAhEjaK RdOcizbJrdzXRwDrB+saBd0BFcwiaz9QEBxc89z1mw7vhFPyhurV6yikjBXdng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rERo10kJVv7BymmKkdEJPQhP//YR6OK+gvvB9FC30pM=; b=nLM3mes6Oe07KEHQQKYRzSRhx1gKB6JfDJW9pysz3mP7rb1LidfMAjtIIqicBVvWg4P1BQ KSidb3hz2Z/O2Ju9PLiU8XUH5edX3wf62Px366JPqkgkC/911mMczPt7JJ3T1CKHfAdr2D 4AOSeZsopKjDjHBBp3jzuRM/yywQqnm7Oe7u6k2VaZxrIVIFcp+uarYi0971P91dejCvW6 rs7rlJH9h5lBtRBuq0XfXF4UfTQIUENGiAYyVM4ZfvPdnWvrhLzVMc+hdyCqqDqe++rkq5 49DAPbxKBU7YM333xm18v9GkAhqcvynL5Cm//BZeLDsZXVZr+mRmoY2ZB8lOgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VksSS3Yspz16pH; Wed, 22 May 2024 13:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MDNK6b098797; Wed, 22 May 2024 13:23:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDNKxh098794; Wed, 22 May 2024 13:23:20 GMT (envelope-from git) Date: Wed, 22 May 2024 13:23:20 GMT Message-Id: <202405221323.44MDNKxh098794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8d3f96bd85c9 - releng/14.1 - sound: Correctly check nvlist_unpack() error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 8d3f96bd85c9519cef76d0727b00082354a2134b Auto-Submitted: auto-generated The branch releng/14.1 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8d3f96bd85c9519cef76d0727b00082354a2134b commit 8d3f96bd85c9519cef76d0727b00082354a2134b Author: Christos Margiolis AuthorDate: 2024-05-20 14:18:33 +0000 Commit: Christos Margiolis CommitDate: 2024-05-22 13:22:40 +0000 sound: Correctly check nvlist_unpack() error The current check is never false and if nvlist_unpack() fails, we might panic later down the road. PR: 266144 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45237 (cherry picked from commit 64f4e2db6d19d8ab520903a197fcaa8cc7ab9f9a) (cherry picked from commit 45feaa73c68011bbba647d1eb6f86a166a0453e9) Approved by: re (cperciva) --- sys/dev/sound/pcm/sndstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index eb5c68c7c519..2d66d8760327 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -706,7 +706,7 @@ sndstat_unpack_user_nvlbuf(const void *unvlbuf, size_t nbytes, nvlist_t **nvl) } *nvl = nvlist_unpack(nvlbuf, nbytes, 0); free(nvlbuf, M_DEVBUF); - if (nvl == NULL) { + if (*nvl == NULL) { return (EINVAL); } From nobody Wed May 22 13:23:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VksST6nLKz5LjHr; Wed, 22 May 2024 13:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VksST4yQhz43fr; Wed, 22 May 2024 13:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H+Xz+tn4IFljaKkignUN0XQ+vE4n0zDdLmMH9vBA1KA=; b=rVDJrnKuE+zEyf+KY+VTNRuTxUbl1GtE0sVmOkoEaxjJ9qikoDyZXo90r0fiQ3CoaVtran MXzKrrn9YHCgNhxncSNs+6oS1d0CNeWJJk5yfx4nfkd78kAEtQQOrU8th6eEBy9+xzZnht xli7cSpsX8tJYgAN4MFC097JjVWLbZn4rFdZ3ss/P+EtfbZmgC9DGqCJag3qSEhe4nAdM+ JAui6NU6KUrILbwunMk0qz3oM+f1g6JvSWI/gonk9DQVZnvXaplZrYnFmaLbVbEkvdEsLJ BUrmWPnb0AbG6MACx8v55BYBNB/4pAvcpPc6HJ7SpxBs3OUZk3+BsxfsCcYGAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716384201; a=rsa-sha256; cv=none; b=eXJ79bJPchOsRUtyKzYP+IhU2xTgf98wQ2Nnxxkb+M+mv6W1ycGcNoZmNaonMlqM+ONVIN 3pMZ2l3HCL0YCMKVKMUYqWCy+6N4Fnf+yGh9lP/SqJq3piX6V/9u5WoqIn0u3SoeOvDqje jwrhnWxcsQgb9ZpMivQnNTgxL/cJskeKY1uvLwgwMcPnGI7lioHiscOceGyTP9QPwqzQU/ uzXs9eGKHiovHujBuXJRKhZREat1RaJVaLAzrU11tpbLB8F6Hx9H5UtXYNoOhddj11JCzO TLZSwimkVUNNHpb8HKpn+YcDpQuuArHlv8ltk5ix5iHcttsM5AXmPB6YXaoyhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H+Xz+tn4IFljaKkignUN0XQ+vE4n0zDdLmMH9vBA1KA=; b=fyuwIcOXygRCFGV4YgwrJLfffNQRoI+zU2rLlGQFzEtUQIz4yZ5B6H421ycBUiwWP9z8Mz e8TfBAYs+MBo6wM6ZW2z6e2X2WTUuD8a/ojWWA95k+ro+HkMeJRlpUBCcgyxpDXMe2p+wt jKmf8s8mHkeuT0XCpkhv1vD7L23+6PEDjepJYjzdfxZI2v2u12JpXFq3Nq92ZGc4+yhbMM O5AwL3TUwhPcb7fw5K+nGJLNP6IQ6eqU2xbw3IilST+3MJVKSlxqgE4fjyncInV4KDLkOz WdbKq6mSQLapVK/AByltEJLRJOWT3xG6xS4aqcTNGZH5Exw4/qXf+JMQppmVyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VksST4b3Jz16nw; Wed, 22 May 2024 13:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MDNLHA098845; Wed, 22 May 2024 13:23:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDNL0G098842; Wed, 22 May 2024 13:23:21 GMT (envelope-from git) Date: Wed, 22 May 2024 13:23:21 GMT Message-Id: <202405221323.44MDNL0G098842@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 0b367134dd92 - releng/14.1 - sound: Make SNDST_UNVLBUF_MAX a power of two List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 0b367134dd928af4cf85ed9821a4948257f547d0 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0b367134dd928af4cf85ed9821a4948257f547d0 commit 0b367134dd928af4cf85ed9821a4948257f547d0 Author: Christos Margiolis AuthorDate: 2024-05-20 17:41:18 +0000 Commit: Christos Margiolis CommitDate: 2024-05-22 13:22:54 +0000 sound: Make SNDST_UNVLBUF_MAX a power of two Fixes: 074d337ad618 ("sound: Check user-supplied size passed to SNDSTIOC_ADD_USER_DEVS*") Reported by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45277 (cherry picked from commit d59058f3b31353442497e728dd5beb80585ad8d2) (cherry picked from commit eba949c37e6473a07a6e3a386f239aa0f49a4c93) Approved by: re (cperciva) --- sys/sys/sndstat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index 8a49042b0453..e0e403b1a72a 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -77,7 +77,7 @@ struct sndstioc_nv_arg { /* * Maximum user-specified nvlist buffer size */ -#define SNDST_UNVLBUF_MAX 65535 +#define SNDST_UNVLBUF_MAX 65536 #define SNDSTIOC_REFRESH_DEVS \ _IO('D', 100) From nobody Wed May 22 13:59:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VktG40C8pz5LmDL; Wed, 22 May 2024 13:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VktG36X4Tz4D5V; Wed, 22 May 2024 13:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716386363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/nY7nopUCbJ89NoBxmM8NoqvkX49Y61vk9Ml0lrdbBY=; b=wb9rxCxOqiXEiaXTr6/A3qtbhJB6YZMwNBGkZz1IFCV4OH9MLfi3wDHcCdAWw3Hm/74/UO xbavuhOjGpOKqte2CT5p7iro/PRdbOBQrZecknWO1h5qjB/vvTai/OXrGVECBGLmHRUJu7 AkL3oSjohS/gxpoUW7CPa3hB3W2uyfuDZYWA88d29DChK34dBoFSzVqTQyPT8pCpof5tt1 IQXiUebqIibBCTY7v4lnreuaRxj+P8KzMvgi7DVNv7x97paFHqFGCt4R6AG0+Pir+lAEpA PGCVR6TnEx2mgyNzwFPxtLrG9liJDdHKEpdqFvv7z9wm2hpFTOsTlVh2hG4oQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716386363; a=rsa-sha256; cv=none; b=gqxycC1M/XHD7+/RIxdO9VHRuwPtkWvmjmQifnpRt2Rc3vmIGkWuhx0r9mhR+/3jqOyUUU IotI2YziL/B64P2G37ZZb3q+wh4ezmHLjnr7S/AKzc+fEXWIrvupVWxgLZf0W7tJEQzFlo FLHrznXisFnxJ4sCeAB9+/oJ8IeFp8f2yN+cbvzF7JyPI/t3PRUScUiwJa8GhYbyL7sX+8 HhdhMYy3LJqycF5CA2EKbkbLsxn2zMAMyqxVnGhAiKWMCrU9qiMdfYaFf7l2CvuOCuJsIX J7IK9pVE4vz7kdsEYWwl5vQ80aTXGa7aXC5EVQT4qNQ/3h6/yXanbVrf2WuzqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716386363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/nY7nopUCbJ89NoBxmM8NoqvkX49Y61vk9Ml0lrdbBY=; b=jdvxFn8utxZESVYlDU2Uro4L2h7YfYJWU7ROcSO9WpCnZRWYXOErY3l/iEpdzk7NN1ONxd dB1mLh0uu9nJ0pYetTo6Ym+yFwffiipwB3Zw/KAzKE5+P1WgapdMQqWWY1/9JT6R/XQOZK MLzQAfAYSQ2AXgL0GpjaqWb4BidpKGSZKr7x3RLfHgSHeDawCYnpqK33CYjiS8goTH7UUE gQDX5mCeetpMGeOAfeeIeLygm4bhNe0Vi2qaq4zGnQVGjdSBS/tgpcDYRbM83GMOrgsyks Td54pakYazr5DMarbZwBJYSAnEbRlGRuv6gQOKWdrlqsNI/aURAwYY8oV7f5mA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VktG35kt1z17Ps; Wed, 22 May 2024 13:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MDxN32051520; Wed, 22 May 2024 13:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDxNAP051517; Wed, 22 May 2024 13:59:23 GMT (envelope-from git) Date: Wed, 22 May 2024 13:59:23 GMT Message-Id: <202405221359.44MDxNAP051517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 3ebd2b1c7308 - stable/14 - if_vxlan(4): Add checking for loops and nesting of tunnels List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3ebd2b1c730834123a53b3eddcf9029fcf414782 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3ebd2b1c730834123a53b3eddcf9029fcf414782 commit 3ebd2b1c730834123a53b3eddcf9029fcf414782 Author: Zhenlei Huang AuthorDate: 2024-05-20 12:14:07 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-22 13:58:31 +0000 if_vxlan(4): Add checking for loops and nesting of tunnels User misconfiguration, either tunnel loops, or a large number of different nested tunnels, can overflow the kernel stack. Prevent that by using if_tunnel_check_nesting(). PR: 278394 Diagnosed by: markj Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45197 (cherry picked from commit 93fbfef0b50354b7a1620822454ef29cd415cb2d) --- sys/net/if_vxlan.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index e6949bb5dc9a..87648abd116b 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -433,6 +433,21 @@ TUNABLE_INT("net.link.vxlan.legacy_port", &vxlan_legacy_port); static int vxlan_reuse_port = 0; TUNABLE_INT("net.link.vxlan.reuse_port", &vxlan_reuse_port); +/* + * This macro controls the default upper limitation on nesting of vxlan + * tunnels. By default it is 3, as the overhead of IPv6 vxlan tunnel is 70 + * bytes, this will create at most 210 bytes overhead and the most inner + * tunnel's MTU will be 1290 which will meet IPv6 minimum MTU size 1280. + * Be careful to configure the tunnels when raising the limit. A large + * number of nested tunnels can introduce system crash. + */ +#ifndef MAX_VXLAN_NEST +#define MAX_VXLAN_NEST 3 +#endif +static int max_vxlan_nesting = MAX_VXLAN_NEST; +SYSCTL_INT(_net_link_vxlan, OID_AUTO, max_nesting, CTLFLAG_RW, + &max_vxlan_nesting, 0, "Max nested tunnels"); + /* Default maximum number of addresses in the forwarding table. */ #ifndef VXLAN_FTABLE_MAX #define VXLAN_FTABLE_MAX 2000 @@ -2722,6 +2737,7 @@ vxlan_encap6(struct vxlan_softc *sc, const union vxlan_sockaddr *fvxlsa, #endif } +#define MTAG_VXLAN_LOOP 0x7876706c /* vxlp */ static int vxlan_transmit(struct ifnet *ifp, struct mbuf *m) { @@ -2747,6 +2763,13 @@ vxlan_transmit(struct ifnet *ifp, struct mbuf *m) m_freem(m); return (ENETDOWN); } + if (__predict_false(if_tunnel_check_nesting(ifp, m, MTAG_VXLAN_LOOP, + max_vxlan_nesting) != 0)) { + VXLAN_RUNLOCK(sc, &tracker); + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (ELOOP); + } if ((m->m_flags & (M_BCAST | M_MCAST)) == 0) fe = vxlan_ftable_entry_lookup(sc, eh->ether_dhost); From nobody Wed May 22 14:01:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VktJq3JpLz5Lmbd; Wed, 22 May 2024 14:01: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VktJq2pxPz4F0M; Wed, 22 May 2024 14:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716386507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uxTVDSdmB1fMUWmysa0nfDaizJYCyMTq66c9N2EyIfg=; b=TPy/9w7WKTPdPaxrLtHrYhaA881TwEOQU0uveojD5y9qMdYB2iC+diaNCgVWSpE+FCt3fV BBHNtL3pkk60aZB/VJ8czxqMn+RVLeAioj5vSauof0wFaAqvL9/ttmFnaFUe+3ozp4tM7R PwsRwOQ5egTBJTRhy5tfedDMOkKn+k29zR3e4GVGMsn98cfOTAGco8d0hyiebESwasJHDX yGDXEjFdXgy0jkz8uN4llIVlzsMLd7SirUwW8tT7mLiTvALPFVklVAKQ/EYRSfB4Lyn5vD awIXTg4buwqonwSDmkYun3RZJHShzE3Y4mvc+1fcULbVGZ1dvLqa0pY6AAEunw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716386507; a=rsa-sha256; cv=none; b=LdAnzqnHiVJ2pVNcKBCdpWDUOnG4I7OOcPuV9RSy6SREEMS12Q1hPj03OAGdNNIpG/gB4O hD12sry8E/Z9Vdjcd6z2UdGRtyQgOnjbhAMU3DdRJ5Azgb4BXMm+sK1XdQoI7RnG8UKvkx r67rjN0TLh3//JftAsqWn7gD1bas71vGMtAIy0QovHgnOeWhyEPVBovOk1UOnK5fmHDfMK ZhvPx3upWm+AoJ2OhH2eNU9i2zJUJOttjsUMjhMTpW6Rqi3Rul0BF+VTnqVhKwU4iSzIDD fKmk5WIJwC1RJPCMqxM2mkAHC81QPGKT3+c+zicZLIsJt5L8PXhRf00HJkw9nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716386507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uxTVDSdmB1fMUWmysa0nfDaizJYCyMTq66c9N2EyIfg=; b=QpcbBJiz7tD2OrUjZFTDPsJrbZlgcA0YYB6sRgxtSeBj9sIyfMFtJdO+pAXhFZ2R/adtZh ZYw5XZbkjLADeTPGJlcjm3U/2xDJTFrnk95ZCaWRPUc0vJDMsYrwefWASSeimE0djskOQ3 dhv8bsALts/KD0ypoqHK0Xgoalxosng9FQ0SHuDBxzX83jsdOlodREjWLILosjDKf+5CF2 vCDywjdqu/BlzJw2Fy/gj+zbsL0es3yBJ5dOKQW1aaRF/OPwOBB5qkSAQZUEjaXxOBvH8A q8nwmCN+rJTwj6xgunZTg5nYt+Dm18qSh1NDpzQF2Z4Gzf4M7ACPK8QY/ds6Ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VktJq2470z17dB; Wed, 22 May 2024 14:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44ME1lIC066879; Wed, 22 May 2024 14:01:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ME1lhb066876; Wed, 22 May 2024 14:01:47 GMT (envelope-from git) Date: Wed, 22 May 2024 14:01:47 GMT Message-Id: <202405221401.44ME1lhb066876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 9d653a52f899 - stable/13 - if_vxlan(4): Add checking for loops and nesting of tunnels List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9d653a52f899c420f00e23401c3ff44b493d4d32 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9d653a52f899c420f00e23401c3ff44b493d4d32 commit 9d653a52f899c420f00e23401c3ff44b493d4d32 Author: Zhenlei Huang AuthorDate: 2024-05-20 12:14:07 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-22 14:01:00 +0000 if_vxlan(4): Add checking for loops and nesting of tunnels User misconfiguration, either tunnel loops, or a large number of different nested tunnels, can overflow the kernel stack. Prevent that by using if_tunnel_check_nesting(). PR: 278394 Diagnosed by: markj Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45197 (cherry picked from commit 93fbfef0b50354b7a1620822454ef29cd415cb2d) (cherry picked from commit 3ebd2b1c730834123a53b3eddcf9029fcf414782) --- sys/net/if_vxlan.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 9ab46a36545c..3802ebe4bfbe 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -431,6 +431,21 @@ TUNABLE_INT("net.link.vxlan.legacy_port", &vxlan_legacy_port); static int vxlan_reuse_port = 0; TUNABLE_INT("net.link.vxlan.reuse_port", &vxlan_reuse_port); +/* + * This macro controls the default upper limitation on nesting of vxlan + * tunnels. By default it is 3, as the overhead of IPv6 vxlan tunnel is 70 + * bytes, this will create at most 210 bytes overhead and the most inner + * tunnel's MTU will be 1290 which will meet IPv6 minimum MTU size 1280. + * Be careful to configure the tunnels when raising the limit. A large + * number of nested tunnels can introduce system crash. + */ +#ifndef MAX_VXLAN_NEST +#define MAX_VXLAN_NEST 3 +#endif +static int max_vxlan_nesting = MAX_VXLAN_NEST; +SYSCTL_INT(_net_link_vxlan, OID_AUTO, max_nesting, CTLFLAG_RW, + &max_vxlan_nesting, 0, "Max nested tunnels"); + /* Default maximum number of addresses in the forwarding table. */ #ifndef VXLAN_FTABLE_MAX #define VXLAN_FTABLE_MAX 2000 @@ -2718,6 +2733,7 @@ vxlan_encap6(struct vxlan_softc *sc, const union vxlan_sockaddr *fvxlsa, #endif } +#define MTAG_VXLAN_LOOP 0x7876706c /* vxlp */ static int vxlan_transmit(struct ifnet *ifp, struct mbuf *m) { @@ -2743,6 +2759,13 @@ vxlan_transmit(struct ifnet *ifp, struct mbuf *m) m_freem(m); return (ENETDOWN); } + if (__predict_false(if_tunnel_check_nesting(ifp, m, MTAG_VXLAN_LOOP, + max_vxlan_nesting) != 0)) { + VXLAN_RUNLOCK(sc, &tracker); + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (ELOOP); + } if ((m->m_flags & (M_BCAST | M_MCAST)) == 0) fe = vxlan_ftable_entry_lookup(sc, eh->ether_dhost); From nobody Wed May 22 14:38:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkv6d3v9Bz5LqJc; Wed, 22 May 2024 14:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkv6d37w8z4JDb; Wed, 22 May 2024 14:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716388681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MedQFDT7nmV3FN7g45YK3QhNW/3qPxLC1w4nLI5tqCI=; b=O/56Jvlbc9yb3e/xHGmosiygaLIv0GppQ2r4KaVHETP+xgofQe+gP9a6UJxdRXbIx1rtoR PvzyuUrpEltR7DXgdY0Oy3adI4vEGfS2662/n4Zhyw+obUGEom//sCqLYFywM3XEK9Yu0s BmTiAWCJzqdOkHYsnPdqc2+n2E9usJWbYoonYz9hSxAT5PQAPyAK1yRecHV+727CWnneJu wCT8lZ6M81uP0JsnBPPez/UKL9pc522L2kJmRXqe1bB8OtP58/vsSAUeAXSSSAC7HWImJM 7DCbuQjK+bAt9e6RgHo43Wt4q7hAw4HYShKErfl32g009vuS1Ff/6KTbWV7jIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716388681; a=rsa-sha256; cv=none; b=sLrEdbcr/mGPpi0n1E9GcFqYdHtHRWf1wZHvZqCMtRHV+oUkR7tFc6XTLAQWYVmxOaIaJe QUr3VhCp9lGK4x9g/Xah3KRg/H6nHY2ziqUNtGBLKj8Ru6yGRga9XIyF442kppNE/LdD+N h5MbOvA2E/SLFLXh1cPfbgB3LsK6Pw9Zu3wl2/12T8E3aaksDSn2OowPhcR1u9seYvzPR7 RJKWHKUELv7z2bu11Pc6cFXqrDClSciY6n/wTaReWAj5hSyDPw3trxkplSjJpI521D4MEn +9o3Dl8/3EeNezZggfLKR8UCOrBoStrpZGjQTFA21vTOY3GONdH7FeLsuRoqdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716388681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MedQFDT7nmV3FN7g45YK3QhNW/3qPxLC1w4nLI5tqCI=; b=Ms2Qcx39JlSd82P3iiO5f9OqAzLstpqXNMefe/M7kuwHGGMEMnNRoewpqk0XSp0P8u1YNS /o/M38tx5wCyuzfUa08nDPL3M83TTO9HTyarQyRwTZC1TJJQnmyO9UhqGIPo6mNNXV3JRE xrKud9kWPto4JSQUFWXD7KlNCnwPaxUZP3UcTCHX8Hig+0qfsrH3sEO2+BDKH8yjUclRjq +3cJ9tmzfzJFwI59z6cgwcWSza4B1mo0JbNuaJ8H38BSbqkF3xSJueSEaJaMTRLkgHc3JN 6cLLfj9qXAP7V7WUP3dP6cckShMrvOXKV9fIk0QBprQHUDRGcBcEubSbgrWydA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkv6d2lfMz18dV; Wed, 22 May 2024 14:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MEc1x7019763; Wed, 22 May 2024 14:38:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MEc1gn019760; Wed, 22 May 2024 14:38:01 GMT (envelope-from git) Date: Wed, 22 May 2024 14:38:01 GMT Message-Id: <202405221438.44MEc1gn019760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f9c67a0f203f - stable/14 - devctl: Disable the boottime optimization of suppressing NOMATCH List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f9c67a0f203fe3bf4fa83f38bcd5963ea568142d Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f9c67a0f203fe3bf4fa83f38bcd5963ea568142d commit f9c67a0f203fe3bf4fa83f38bcd5963ea568142d Author: Warner Losh AuthorDate: 2024-05-18 13:07:16 +0000 Commit: Warner Losh CommitDate: 2024-05-22 14:37:58 +0000 devctl: Disable the boottime optimization of suppressing NOMATCH The usb bus code (uhub) doens't present the same information to devctl as it does to the NOMATCH events it generats. As such, devmatch fails to find USB devices on boot when NOMATCH events are optimized out. Since the savings of boot time is relatively trivial for all but the most demanding boot environments, disable it by default until this issue is fixed. Fixes: 6437872c1d66 MFC After: 1 minute Sponsored by: Netflix (cherry picked from commit 97aedd3395b4e9b017e29823096771aff0835ff0) --- sys/kern/kern_devctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_devctl.c b/sys/kern/kern_devctl.c index 0dd05a49c9ad..602b82105525 100644 --- a/sys/kern/kern_devctl.c +++ b/sys/kern/kern_devctl.c @@ -89,7 +89,7 @@ static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue length"); -static bool nomatch_enabled = false; +static bool nomatch_enabled = true; SYSCTL_BOOL(_hw_bus, OID_AUTO, devctl_nomatch_enabled, CTLFLAG_RWTUN, &nomatch_enabled, 0, "enable nomatch events"); From nobody Wed May 22 15:59:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkwwP2SQ7z5LxVp; Wed, 22 May 2024 15:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkwwP1x23z4SRk; Wed, 22 May 2024 15:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716393557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CdTVRyOzAtou4NFRnIBeSxyoqg/kTU+8cQweT+JB5So=; b=N8uNQnMFzmiwjCbhpa+Sj9G+tHJluRsYIdAwrFSkbw7BKisnR53sO87GcZsDDS4ExrqK31 SMj6dVCKvu73mb4yvCu3ZopLI8oamckSw94gQ2ol+rBvrTedtvFkQXfamSNMm0BS78UXdx 5L1jtzWl9eTQ1wGtzbdg2FROaF2KS99bdN67QFW3jsX5SXwwInjMKSSLW4NDxGSxUsWojn eDQv2su1MSvMLwR/2VtlBGnxfAyhkz6EaHsMvZ8gwQ0JGxkDNoFXyaQ8zflj3D9jVoshke x8LNqH2mBdpG6QWMa1Z1YJouxrX9BiZRySg6YlQYLM2v8TbWtRKJBUgp2YZeUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716393557; a=rsa-sha256; cv=none; b=o1zc6mr3DgotjC328lgwJ9DI4JSWRTcsj9vRuw/yce8SqZ/MH/HtCAXq92Fb5833hKtjPL teWG9Sm7YKuRo/tx0tLj4/avYuvjujIo+/2+URMATTUjuX2GUORj0FQCXDBctnrHlMInLI vGN4VKRj2y28uaQyVMMaekemecr1dEBlADwz+WjV4uheaHQrN0ynqkLHpfgsiJYLuyH1Ct L4bMLbd5oS7tUqvXXU8s1+pg1papySXAwH6sIfAwWIMjOnJvefBpVuIZ09WpoCMHr0AhBW pbNscwi0vlKPBPo2MDFkbbUahmG3ADLfac6k3BiCEZwA/KTJbre79Wm+vpv+OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716393557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CdTVRyOzAtou4NFRnIBeSxyoqg/kTU+8cQweT+JB5So=; b=AJw02/GMSVwIFIqT45yi+n0cGEZc4lJ/qBvg6FjpZVHCWWaigxWyB2O8SYBNpbXOX/zrRd rUSvVt/G0xpDW7abPaRvw/Xk3Y3se1AD7/E2DFJdMHTd1B8js0YBy7FnE4bCGe8k6qVsB/ 7w5uZktXXtp3+ioV11elFg9QcXsy8jYELCjapM9JytEps8xG3wPe7XDmYqksXB616cXfMn k4IXStV5h4keQJqIsaqRgwxdBh7UUbdzumiwvZdgutCai7NOpC52kiEXP+M2D02YyArUQR aGXbHJ73zRS5xxgien3L3u9trC+YCXVogxh1ABpbHvrZK5/DgvjLF6kVqsNOaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkwwP1PwKz1BhX; Wed, 22 May 2024 15:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MFxHFS055096; Wed, 22 May 2024 15:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MFxH9M055093; Wed, 22 May 2024 15:59:17 GMT (envelope-from git) Date: Wed, 22 May 2024 15:59:17 GMT Message-Id: <202405221559.44MFxH9M055093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: e5fadc41b480 - stable/14 - ftpd: stop using -g flag for /bin/ls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e5fadc41b48045d8978993d6c4ac72c64542b470 Auto-Submitted: auto-generated The branch stable/14 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=e5fadc41b48045d8978993d6c4ac72c64542b470 commit e5fadc41b48045d8978993d6c4ac72c64542b470 Author: Allan Jude AuthorDate: 2024-05-21 22:58:21 +0000 Commit: Allan Jude CommitDate: 2024-05-22 15:59:05 +0000 ftpd: stop using -g flag for /bin/ls In 3bfbb521 the behaviour of ls was changed such that -g was no longer a noop for compatibility with BSD 4.3, but instead changed the output of long mode to exclude the owner of the file and display only the group. Update how FTPd invokes ls to restore the previous behaviour Reported-by: Andrew Fengler Reviewed-by: jrtc27, des, imp MFC after: 3 days Sponsored-by: ScaleEngine Inc. Fixes: 3bfbb521fef5 ("ls: Improve POSIX compatibility for -g and -n.") (cherry picked from commit 5af3225e0448be6af7f0312e10d2a1dfbe150c25) --- libexec/ftpd/ftpcmd.y | 4 ++-- libexec/ftpd/ftpd.8 | 2 +- libexec/ftpd/ftpd.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 9d57017e2f19..827ceda03272 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -460,12 +460,12 @@ cmd | LIST check_login CRLF { if ($2) - retrieve(_PATH_LS " -lgA", ""); + retrieve(_PATH_LS " -lA", ""); } | LIST check_login SP pathstring CRLF { if ($2) - retrieve(_PATH_LS " -lgA %s", $4); + retrieve(_PATH_LS " -lA %s", $4); free($4); } | STAT check_login SP pathname CRLF diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8 index ec4ce0c65100..44f8a2e00835 100644 --- a/libexec/ftpd/ftpd.8 +++ b/libexec/ftpd/ftpd.8 @@ -278,7 +278,7 @@ is specified. .It EPSV Ta "prepare for server-to-server transfer, multiprotocol" .It FEAT Ta "give information on extended features of server" .It HELP Ta "give help information" -.It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA" +.It LIST Ta "give list files in a directory" Pq Dq Li "ls -lA" .It LPRT Ta "specify data connection port, multiprotocol" .It LPSV Ta "prepare for server-to-server transfer, multiprotocol" .It MDTM Ta "show last modification time of file" diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index a41a23ab1184..11811da35cb5 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -2336,7 +2336,7 @@ statfilecmd(char *filename) struct stat st; code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213; - (void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename); + (void)snprintf(line, sizeof(line), _PATH_LS " -lA %s", filename); fin = ftpd_popen(line, "r"); if (fin == NULL) { perror_reply(551, filename); From nobody Wed May 22 17:18:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkyh62nqyz5M4jW; Wed, 22 May 2024 17:18: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkyh62FlLz4g4v; Wed, 22 May 2024 17:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716398326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lXyvRHmFpgzSxbl7qOxvVjpYA/yAfeHXo6w+TMlpDUA=; b=vhSt3Ri3FMLwAJFiEKdfxW1y8GhLzyEIekca++2FWlLJ3v+52Ih9SJon0hzhaSY75WU6EF YBavjBlujPGYa1HFlV5a912gifKFJkV05HbWzkZmZ4g00raIYHNHoiSwruyxf/21kp+T3r iEWreeHIWH5LztYCmsHEkyYQT/5afQfwdRu1CWTHhksKlXYi5pgscNdfoP9dGp3Uc5B/U4 TBVJhssak+PrXNOuhbYbaf77XhJEGfnzMXw4LIkUkCMfmL8/LbAqG2h29D3QUO5vImukNh dnGHLoVkSP/MhpZCPIACwd1qXFbLlLTkILt9SLeNgApOtf9QpnC6m1YD2I3pNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716398326; a=rsa-sha256; cv=none; b=AO8ZIIEaNnxAdrJ9n07miC+5KnNjkMj+Us8GXnm6yixuPu4SHeAcpD98zt8uKuFdPfjRhb ybAt2cgx++ExJqMD7ndvgJNqdklREzcIPvdHJzXEwEjDWcH8hSV1jLpU8oPOaiSm3UHhO0 Y9P/oGxGwtiX8gsT9A78b/bq2/BUnkWUm5ybIEyLV/CA3ESHKfkIzkr/ISiy9+pXslvrqz ZeTh1FVguMTGvYaZ6Puwu79EaZ9boBZJ4Oumr44KzqGd04kAr4uNSysllVGy3ObuLUe7JG XXf7EXD+55ogDTvZ7NPkRyhDO2F3hG8GsudAdanxzMTXIm0V8F/Sfyqwggm+6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716398326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lXyvRHmFpgzSxbl7qOxvVjpYA/yAfeHXo6w+TMlpDUA=; b=rLSOkU3PI2Jfbg98QUep3sKiPO0Tai8/XX2kVtAys3S5Z/GPeRK3lVYH1a/TtaC3MdatEv s/B6bjO+rCJPJWHqRUgViVgx8PZVqpdI3MRt+upb2TrQDlV65zGeE+KQPp062p/V/Tz9i4 AOjzqdgPJRCU8fME9HAzQdhSFRYhqc2LZsuiu4hkEm3FOGSGFhmKReAkL1Y4r2iE8L/I7B WiJRwhzwcxMJPFomvXd0jdsVzcBoGTjyz3K9w6FKDS+KKZgcsRPlRFp5Y3b9xaUreSgU6A lsv+fqQ/IN4vLx6BlaZTNc4c1JeLoS1fN0N6CHrMUentFUWvXLAMzKoCYEqUGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkyh61S06zF9v; Wed, 22 May 2024 17:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHIklr092888; Wed, 22 May 2024 17:18:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHIkdU092885; Wed, 22 May 2024 17:18:46 GMT (envelope-from git) Date: Wed, 22 May 2024 17:18:46 GMT Message-Id: <202405221718.44MHIkdU092885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: 207e8cef0b36 - releng/14.1 - ftpd: stop using -g flag for /bin/ls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 207e8cef0b363603d68a226bb03f0ff421d30dd2 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=207e8cef0b363603d68a226bb03f0ff421d30dd2 commit 207e8cef0b363603d68a226bb03f0ff421d30dd2 Author: Allan Jude AuthorDate: 2024-05-21 22:58:21 +0000 Commit: Allan Jude CommitDate: 2024-05-22 17:18:07 +0000 ftpd: stop using -g flag for /bin/ls In 3bfbb521 the behaviour of ls was changed such that -g was no longer a noop for compatibility with BSD 4.3, but instead changed the output of long mode to exclude the owner of the file and display only the group. Update how FTPd invokes ls to restore the previous behaviour Reported-by: Andrew Fengler Reviewed-by: jrtc27, des, imp Approved by: re (cperciva) MFC after: 3 days Sponsored-by: ScaleEngine Inc. Fixes: 3bfbb521fef5 ("ls: Improve POSIX compatibility for -g and -n.") (cherry picked from commit 5af3225e0448be6af7f0312e10d2a1dfbe150c25) (cherry picked from commit e5fadc41b48045d8978993d6c4ac72c64542b470) --- libexec/ftpd/ftpcmd.y | 4 ++-- libexec/ftpd/ftpd.8 | 2 +- libexec/ftpd/ftpd.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 9d57017e2f19..827ceda03272 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -460,12 +460,12 @@ cmd | LIST check_login CRLF { if ($2) - retrieve(_PATH_LS " -lgA", ""); + retrieve(_PATH_LS " -lA", ""); } | LIST check_login SP pathstring CRLF { if ($2) - retrieve(_PATH_LS " -lgA %s", $4); + retrieve(_PATH_LS " -lA %s", $4); free($4); } | STAT check_login SP pathname CRLF diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8 index ec4ce0c65100..44f8a2e00835 100644 --- a/libexec/ftpd/ftpd.8 +++ b/libexec/ftpd/ftpd.8 @@ -278,7 +278,7 @@ is specified. .It EPSV Ta "prepare for server-to-server transfer, multiprotocol" .It FEAT Ta "give information on extended features of server" .It HELP Ta "give help information" -.It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA" +.It LIST Ta "give list files in a directory" Pq Dq Li "ls -lA" .It LPRT Ta "specify data connection port, multiprotocol" .It LPSV Ta "prepare for server-to-server transfer, multiprotocol" .It MDTM Ta "show last modification time of file" diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index a41a23ab1184..11811da35cb5 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -2336,7 +2336,7 @@ statfilecmd(char *filename) struct stat st; code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213; - (void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename); + (void)snprintf(line, sizeof(line), _PATH_LS " -lA %s", filename); fin = ftpd_popen(line, "r"); if (fin == NULL) { perror_reply(551, filename); From nobody Wed May 22 17:34:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkz2j3tfRz5M664; Wed, 22 May 2024 17:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkz2j3JMTz4jrG; Wed, 22 May 2024 17:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hjJ7McacaeCkCoKYnq5xtIVWsXb0wkz5oy5fHiTs5Mk=; b=XghmgYOZwpHtF1Q7j5p21j1L/CTDVpkBWxiwFcHsL/66OK+tKUMw60Tl3sILU+F4R8sZII +4rLHErDJRuFHQTK3Qq3tOqA4VYZ8TIDYXzWx266b323TDlAiPTdV6swDAOmIVPbdQlGRW //Vqn5bbPY2TjiQgcQBCosnTECI1dHQencpzMKxfV+3oSzQ6S8XtrH8piHjfPD5Q1IImgy sNHu3QXiLXwdqHHq4OYZxYjFDWd7EJYKZvdD2lPDrGchg5cZFa5Mt1SRZzRgew8I55lMe9 htbIAUs7eEoBvkgBdSlDIj7Jkj5Jmd7PR9FjQQQQTRXXO7AcUsX7gStGPEpaYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716399293; a=rsa-sha256; cv=none; b=q8p2aKpSxvrft5Tj9eY/D9dY9NbRH3etoJCWkHWYgp56u+7bXJR1g5Fp+4YdsRWrlW94zD 5AAYYdf1VpvFoO2HVHy9lyWne+Ithm8oojcGQFODxqIbqj5PBNG+R7iYdfeNQN4kyTjmZ1 Xs7ZBaDnus55idnnTosan/qWocnpjN128GKwA88eud9pdBaETpIx+85g9hKG8ufl4sUXse jpyIsVY7vUug/mvRgRBdNHIotQthtUVWrKg+dvHbpJXSQLdKFL5/zOlUt2gnxAKkkaC2FP bRZqsTkin3/8YYzCRcU3whYksL1olf4v3WDLiKp4adQZAiLqge6tJuKWF2p9Ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hjJ7McacaeCkCoKYnq5xtIVWsXb0wkz5oy5fHiTs5Mk=; b=wN4NxqzjfVuMvlRKSWhCdohYH84xAFpTAiqXs+tFgBMdRzjJlWnPtwQ9KKkOT36wPHlrtC AZUN3ShylhXtESJ4Le/v0OfZGU60qd8jeOM1pOTPfKhBuYyE2QCAAJvQEFA61urtuhP777 bmAQ7B5wbNRswebUAtuQNcR/tEhzpp5zppaFBlu7/zg+vsVfr6jRnt3y7s73DPau9hw5HJ g7x7M/ymDcWVGFohApphHSTllraMqy/og+wLJL6VYxnci9r6Wj7WbNKx4vUIMkPwh2faCK p6gRmQy1QHKmFSkHg5riHHJu5WzcphZWcHh9jB8G0OAS+izrX446dxrU4gJy5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkz2j2vCxzFZW; Wed, 22 May 2024 17:34:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHYr0B026518; Wed, 22 May 2024 17:34:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHYrFt026515; Wed, 22 May 2024 17:34:53 GMT (envelope-from git) Date: Wed, 22 May 2024 17:34:53 GMT Message-Id: <202405221734.44MHYrFt026515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: d6e32525c778 - stable/14 - fib_dxr: check if cached fib_data matches the new request in dxr_init() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d6e32525c778d92c26a37f4e1b562e80b18a9af7 Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=d6e32525c778d92c26a37f4e1b562e80b18a9af7 commit d6e32525c778d92c26a37f4e1b562e80b18a9af7 Author: Marko Zec AuthorDate: 2024-05-17 15:55:43 +0000 Commit: Marko Zec CommitDate: 2024-05-22 17:34:05 +0000 fib_dxr: check if cached fib_data matches the new request in dxr_init() When calling dxr_init(), the FIB_ALGO infrastructure may provide a pointer to a previous dxr instance, which permits reuse of auxiliary dxr structures, i.e. incremental lookup structure updates. For dxr this is a crucial feature provided by FIB_ALGO, since dxr incremental updates are typically several orders of magnitude faster than full lookup table rebuilds. However, the auxiliary dxr structure caches a pointer to struct fib_data and relies upon it for performing incremental updates. Apparently, incremental rebuild requests from FIB_ALGO, i.e. a calls to dxr_init() with a pointer old_data set, may (under not yet fully understood circumstances) be invoked within a different fib_data context than the one cached in the previous version of dxr auxiliary structures. In such (rare) events, we ignore the offered old dxr context, and proceed with a full lookup structure rebuild instead of attempting an incremental one using a fib_data context which may or may not no longer be valid, and thus lead to a system crash. PR: 278422 MFC after: 1 week (cherry picked from commit 4ab122e8ef127d36d95f874e85600c36c87c8c22) --- sys/netinet/in_fib_dxr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 82245ecf6e66..539d7fe6c96f 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1139,7 +1139,8 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) } /* Check whether we may reuse the old auxiliary structures */ - if (old_dxr != NULL && old_dxr->aux != NULL) { + if (old_dxr != NULL && old_dxr->aux != NULL && + old_dxr->aux->fd == fd) { da = old_dxr->aux; atomic_add_int(&da->refcnt, 1); } @@ -1275,7 +1276,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, da = dxr->aux; MPASS(da != NULL); - MPASS(da->fd != NULL); + MPASS(da->fd == dxr->fd); MPASS(da->refcnt > 0); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); From nobody Wed May 22 17:34:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkz2k6m7Wz5M5k9; Wed, 22 May 2024 17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkz2k4LcPz4kG9; Wed, 22 May 2024 17: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=1716399294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y02pqzWHft3T38xFQB7Pje/sAN/HNQDQubbJi9rZ5p0=; b=DtmzTq6EDlSgLXxwiUrfJoE4naEylirUCtS8V/jGtdjbNp+y+sqKzHFIYzOuFdOkTvktpF B+gK9IJFXdOSkLpRhHNuJhpJnJOqEuDH1Q+61AsUvkMN9Virmee3pG9WVf5mBkzFi0+tWx jLrWJWkGX6E/J+8LxFBNTz0QlrW26uwdcT3a1evGSpK7vEFsb1os8tuC1QOXeMOKG86A1u jZQlSC2zp3gMouZvM1vhlHAmt9vH5ysWPQyZA2JmRVjPqbKaHwIld3l3j49EcFVs4bqcna gmfU2Nio6F4NvVwFHiWVj6PteZ0Zr/D27Gbps4siqvyYAQs8UMpvetW7luxp9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716399294; a=rsa-sha256; cv=none; b=RoTRv5LSo5mF0c0lVi2YvaDeKmYgNoLnpxx/om+QYJoA/YDvuao1NIVejNs9rBMXcRTW3A C342HblcajDWODcCfLM1UXGCZqWpSez0WZvJR3jOURWSfdIR2udCToz3uN86qlPStD9Lvw rrTWvS3/poAmxphnQPcBID2L0OJw9vD6FY53WD02gjuWDYgayoNjdEDe/7EInf8pJPP+O6 SPYz3Y+jepsgwHcP5vV5VcliBrkfoSTkJycQUUB/6jLunskP8383aETGQiD3x6BkoG9G75 /ks3msGzED5lpwD+Hm8BJsNahLkJvn3r92FI739nkGkJf9crKqASMa6hSNLFTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y02pqzWHft3T38xFQB7Pje/sAN/HNQDQubbJi9rZ5p0=; b=sdflXCVAn1eFpLMQBJWHCy5gDcVyCaSG9HqQ2aBRx+cwo8KS9cR8b8Smx7p4V2rC7ksmH+ wTDVl/c7WVqI8EnLXUmvdcMXOb9El5QRw9I6/vAt4SYw0QoOrL5QgtOYfC8xsE1zDxpv2Z i06tOarcR3O2p9OtMy5nGG9k/xYNwpOgyZ5WTTfTispJ92UQqERl2zMiOP8NlVX+XkIL4v a009v3zR5/lLnvRK/X3vOXoRpXWFdyHGgUdOmlv5amsv4HF4LdieRtWAaUeQs+z99IKlb+ Bo70wSyFxRvs++lAvuRT7+jPlVa9eQMcq8/nZXzbZTTMTpCKXNsLFoC1SFfbtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkz2k3xs8zFcs; Wed, 22 May 2024 17:34:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHYsPp026578; Wed, 22 May 2024 17:34:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHYsXM026575; Wed, 22 May 2024 17:34:54 GMT (envelope-from git) Date: Wed, 22 May 2024 17:34:54 GMT Message-Id: <202405221734.44MHYsXM026575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: ada1d9b8edbd - stable/14 - fib_dxr: do not leak memory if FIB constellation hits structural limit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ada1d9b8edbd52d2ce206bb99de35858b2f871cb Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=ada1d9b8edbd52d2ce206bb99de35858b2f871cb commit ada1d9b8edbd52d2ce206bb99de35858b2f871cb Author: Marko Zec AuthorDate: 2024-05-17 16:36:21 +0000 Commit: Marko Zec CommitDate: 2024-05-22 17:34:26 +0000 fib_dxr: do not leak memory if FIB constellation hits structural limit DXR lookup table encoding has an inherent structural limit on the amount of binary search ranges it can accomodate. With the current IPv4 BGP views (circa 1 M prefixes) and default DXR encoding we are only at around 5% of that limit, so far, far away from hitting it. Just in case it ever gets hit, make sure we free the allocated structures, instead of leaking it. MFC after: 1 week (cherry picked from commit 19bd24caa4c8c76ddf138b3a1598a21c8c5c3291) --- sys/netinet/in_fib_dxr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 539d7fe6c96f..326710cc4c45 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1320,8 +1320,10 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, dxr_build(new_dxr); /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) + if (da->rtbl_top >= BASE_MAX) { + dxr_destroy(new_dxr); return (FLM_ERROR); + } if (new_dxr->d == NULL) { dxr_destroy(new_dxr); From nobody Wed May 22 17:34:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkz2m1H45z5M63Y; Wed, 22 May 2024 17:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkz2l5L5Kz4kGH; Wed, 22 May 2024 17: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=1716399295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MVSVOJURmilM7lC8s2kCcXY8KkVJlYDe901a3iKtWOw=; b=kGLVvOzKBqyk56F+D7ogbmxGK5vD92i3saPuOsl5DzuPUEADNGtmqdQMUQY0K3xHYVNS+p GWuOF3qRl6GmyjurBURaELBzbz2Ye6/94jVEbgXNsPcHGh1GeCvxUOU6igNTFIDviCXC6c WAbx+Y2YpjHfYvJiG0rbTCui2fkpu7fFmXjO/ppvltiKTf6bU/MKZimEzRmTQUcUC8uYcA ulKIkhL50A631tFsncu55tDzbpKPog0qjyramQHY1VXgSU+0O86NM8bj2x9rR5Wco1oIDu f0g+VdJrpYs9IbdlqztYJG9HqCFJjyAeVvYk9DGAlSyA6F592BOq1YqTcaGghg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716399295; a=rsa-sha256; cv=none; b=a9YHsB473p/fBJ4gAsdKKNV8Aj0Yr+ept5ZSxkAyWkN4QVhS9Ir+jCQfbgjLhI0YKaiovi f7YLftDDufl2fvv/pX+oIRHDrTTc9AIOY50Wo9ngAfR3yg471x6e0CmAR/rVj8NA4o4Obe xi8msMw1UIUHg9TXI5c7kcWLvfbXWf4qKgfqbNhsUQm1ZnyKo+DLW+rgQ9IVnSAY28PrZY wh64jDI0Un7Db4dAoxpp7P+LNUJ8u9iIOS7zUAqIvzbmGL+TAu3vbGPKwFQCgw31mOx8x6 vKQb2yLIKofurEShCR3h94crw8gthfQa9q4b0ccipgx+Hmcos7BGs4puHQZ8qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MVSVOJURmilM7lC8s2kCcXY8KkVJlYDe901a3iKtWOw=; b=nbiZgKb9gL0J0z3hJUjGQVAHO/O5O92YDCuhpHmWD7o+rEYHhJ2lfU84bZwPwkW0mF629N ktEicXf9OA77uaA0UA7ZYYz+AFgJZkRN3fgVSsa1HBWok1JEgv+6Nd+q/6OLQz/DllA/49 ShlrZJpD/FRfWjmsD7pKCJwcNtfQJx+Vq2O+aKi2bPXvmjGHTwkJi1nrv0cfF/+4j3SDEw UHcxbifRwWqGIB57iIiUQeGKse85u/Z+rwTwntUDJSk2SPB8U/do/86BMez+Vs72qt0kwL GJQZAC4/TT3xlHs06FsLTqLcSlhIzwIstYjlqGQafaobi/zZ7IPxPGej7xh6jQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkz2l4yGbzFmZ; Wed, 22 May 2024 17:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHYtuY026632; Wed, 22 May 2024 17:34:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHYtTC026629; Wed, 22 May 2024 17:34:55 GMT (envelope-from git) Date: Wed, 22 May 2024 17:34:55 GMT Message-Id: <202405221734.44MHYtTC026629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 1266d894c50c - stable/14 - fib_dxr: code hygiene, prune old code, no functional changes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1266d894c50c54d7282c5cf13a1ac889e87ca0df Auto-Submitted: auto-generated The branch stable/14 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=1266d894c50c54d7282c5cf13a1ac889e87ca0df commit 1266d894c50c54d7282c5cf13a1ac889e87ca0df Author: Marko Zec AuthorDate: 2024-05-17 16:57:25 +0000 Commit: Marko Zec CommitDate: 2024-05-22 17:34:40 +0000 fib_dxr: code hygiene, prune old code, no functional changes The !DXR2 code corresponds to the original DXR encoding proposal from 2012 with a single direct-lookup stage, which is inferior to the more recent (DXR2) variant with two-stage trie both in terms of memory footprint of the lookup structures, and in terms of overall lookup througput. I'm axing the old code chunks to (hopefully) somewhat improve readability, as well as to simplify future maintenance and updates. MFC after: 1 week (cherry picked from commit 42b3c16e3051fdc04acc6276dd5d97dbe80ae7eb) --- sys/netinet/in_fib_dxr.c | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 326710cc4c45..b889131b544b 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2012-2022 Marko Zec + * Copyright (c) 2012-2024 Marko Zec * Copyright (c) 2005, 2018 University of Zagreb * Copyright (c) 2005 International Computer Science Institute * @@ -68,9 +68,6 @@ CTASSERT(DXR_TRIE_BITS >= 16 && DXR_TRIE_BITS <= 24); -/* DXR2: two-stage primary trie, instead of a single direct lookup table */ -#define DXR2 - #if DXR_TRIE_BITS > 16 #define DXR_D 16 #else @@ -317,7 +314,6 @@ range_lookup(struct range_entry_long *rt, struct direct_entry de, uint32_t dst) ntohl(key.addr4.s_addr))]); \ } -#ifdef DXR2 #if DXR_TRIE_BITS > 16 DXR_LOOKUP_DEFINE(16) #endif @@ -328,23 +324,16 @@ DXR_LOOKUP_DEFINE(12) DXR_LOOKUP_DEFINE(11) DXR_LOOKUP_DEFINE(10) DXR_LOOKUP_DEFINE(9) -#endif /* DXR2 */ static int inline dxr_lookup(struct dxr *dxr, uint32_t dst) { struct direct_entry de; -#ifdef DXR2 uint16_t *dt = dxr->d; struct direct_entry *xt = dxr->x; de = xt[(dt[dst >> dxr->d_shift] << dxr->x_shift) + ((dst >> DXR_RANGE_SHIFT) & dxr->x_mask)]; -#else /* !DXR2 */ - struct direct_entry *dt = dxr->d; - - de = dt[dst >> DXR_RANGE_SHIFT]; -#endif /* !DXR2 */ if (__predict_true(de.fragments == FRAGS_MARK_HIT)) return (de.base); return (range_lookup(dxr->r, de, dst)); @@ -571,7 +560,6 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) LIST_INSERT_HEAD(&da->unused_chunks[i], cdp, cd_hash_le); } -#ifdef DXR2 static uint32_t trie_hash(struct dxr_aux *da, uint32_t dxr_x, uint32_t index) { @@ -670,7 +658,6 @@ trie_unref(struct dxr_aux *da, uint32_t index) } } while (tp != NULL); } -#endif static void heap_inject(struct dxr_aux *da, uint32_t start, uint32_t end, uint32_t preflen, @@ -864,12 +851,10 @@ dxr_build(struct dxr *dxr) uint32_t r_size, dxr_tot_size; uint32_t i, m, range_rebuild = 0; uint32_t range_frag; -#ifdef DXR2 struct trie_desc *tp; uint32_t d_tbl_size, dxr_x, d_size, x_size; uint32_t ti, trie_rebuild = 0, prev_size = 0; uint32_t trie_frag; -#endif MPASS(dxr->d == NULL); @@ -907,7 +892,6 @@ dxr_build(struct dxr *dxr) } range_rebuild = 1; } -#ifdef DXR2 if (da->x_tbl == NULL) { da->x_tbl = malloc(sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); @@ -918,7 +902,6 @@ dxr_build(struct dxr *dxr) } trie_rebuild = 1; } -#endif microuptime(&t0); @@ -970,7 +953,6 @@ range_build: r_size = sizeof(*da->range_tbl) * da->rtbl_top; microuptime(&t1); -#ifdef DXR2 if (range_rebuild || abs(fls(da->prefixes) - fls(da->trie_rebuilt_prefixes)) > 1) trie_rebuild = 1; @@ -1044,10 +1026,6 @@ dxr2_try_squeeze: goto dxr2_try_squeeze; } microuptime(&t2); -#else /* !DXR2 */ - dxr_tot_size = sizeof(da->direct_tbl) + r_size; - t2 = t1; -#endif dxr->d = malloc(dxr_tot_size, M_DXRLPM, M_NOWAIT); if (dxr->d == NULL) { @@ -1055,7 +1033,6 @@ dxr2_try_squeeze: "Unable to allocate DXR lookup table"); return; } -#ifdef DXR2 memcpy(dxr->d, da->d_tbl, d_size); dxr->x = ((char *) dxr->d) + d_size; memcpy(dxr->x, da->x_tbl, x_size); @@ -1063,10 +1040,6 @@ dxr2_try_squeeze: dxr->d_shift = 32 - da->d_bits; dxr->x_shift = dxr_x; dxr->x_mask = 0xffffffffU >> (32 - dxr_x); -#else /* !DXR2 */ - memcpy(dxr->d, da->direct_tbl, sizeof(da->direct_tbl)); - dxr->r = ((char *) dxr->d) + sizeof(da->direct_tbl); -#endif memcpy(dxr->r, da->range_tbl, r_size); if (da->updates_low <= da->updates_high) @@ -1076,36 +1049,24 @@ dxr2_try_squeeze: da->updates_high = 0; microuptime(&t3); -#ifdef DXR2 FIB_PRINTF(LOG_INFO, da->fd, "D%dX%dR, %d prefixes, %d nhops (max)", da->d_bits, dxr_x, rinfo.num_prefixes, rinfo.num_nhops); -#else - FIB_PRINTF(LOG_INFO, da->fd, "D%dR, %d prefixes, %d nhops (max)", - DXR_D, rinfo.num_prefixes, rinfo.num_nhops); -#endif i = dxr_tot_size * 100; if (rinfo.num_prefixes) i /= rinfo.num_prefixes; FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d KBytes, %d.%02d Bytes/prefix", dxr_tot_size / 1024, dxr_tot_size * 100 / 1024 % 100, i / 100, i % 100); -#ifdef DXR2 FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d%% trie, %d.%02d%% range fragmentation", trie_frag / 100, trie_frag % 100, range_frag / 100, range_frag % 100); -#else - FIB_PRINTF(LOG_INFO, da->fd, "%d.%01d%% range fragmentation", - range_frag / 100, range_frag % 100); -#endif i = (t1.tv_sec - t0.tv_sec) * 1000000 + t1.tv_usec - t0.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "range table %s in %u.%03u ms", range_rebuild ? "rebuilt" : "updated", i / 1000, i % 1000); -#ifdef DXR2 i = (t2.tv_sec - t1.tv_sec) * 1000000 + t2.tv_usec - t1.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "trie %s in %u.%03u ms", trie_rebuild ? "rebuilt" : "updated", i / 1000, i % 1000); -#endif i = (t3.tv_sec - t2.tv_sec) * 1000000 + t3.tv_usec - t2.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "snapshot forked in %u.%03u ms", i / 1000, i % 1000); @@ -1194,7 +1155,6 @@ static void * choose_lookup_fn(struct dxr_aux *da) { -#ifdef DXR2 switch (da->d_bits) { #if DXR_TRIE_BITS > 16 case 16: @@ -1215,7 +1175,6 @@ choose_lookup_fn(struct dxr_aux *da) case 9: return (dxr_fib_lookup_9); } -#endif /* DXR2 */ return (dxr_fib_lookup); } From nobody Wed May 22 17:38:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkz6S6YlRz5M66l; Wed, 22 May 2024 17:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkz6S60ZTz4l09; Wed, 22 May 2024 17:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=463fwtfwyjdMrW/s+o0/iBzIBAnOj0G87zz7zOnI/XA=; b=nv2wdeCgxX66E9tG/uNoMiLPPMxLdpYfQw5Y8ay69UFAfa6izyUaQ5KX5c1mvxVJdcZzOd ggLQudebyOo21V8u4xbrJB0i/f2iizZ6C3eUPsWPkHH+QS+/lP8r6p25BgO8LD8WOqHDVJ phKD1TnCNbyM9JhLdNvlvPRXnQ/Fd2Dt9iqF+MmXC8iL3Ss9avTB4EE/3Agk9H+lRqr8bQ rQNLJzgTdFKHMWf6r7F0RcY9QuCZ7f+TujI6YsrQo9oCzbpaY3ctWuUw3H/CdmgKTQ2tYr SiuNgHF1g5qh450iqsUBWXkki5XucVKwadyb3ro5H3+F0dRkzgZLNLNrVRMGdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716399488; a=rsa-sha256; cv=none; b=BEZplMA0GfOgH+1+EDZ741QpMpcpA+IgtKIcBFQsH2UD5/AxaJQ7Q3u4gc1DuWIkCDyYrb 67qftdh6KoPnOvKIGF6umBem8PxPG9X3zVGSzu0LZF7Xs+bSrnaLShUrwu0O0qygMtXHG7 9oev0ZdZShKBKvGafXe3gRUNWn25G2ldVppZ/k5qP534Le45kPwPbv9PQxMew4q+MEQjtU UIzxYJ/Yghkn9krqGCGWBsncpJCudScE1o0QLnh9Bn2WqiZuEWVCiddeDzrkjUJ57RBmZO zWUW/LHO6lFhJ4PZXYi56FHN4GRq/+75+ThWiZaZXzfaGq3gw1fa4wmyXKSWiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=463fwtfwyjdMrW/s+o0/iBzIBAnOj0G87zz7zOnI/XA=; b=MzwHK2LqSvsXPMT8BnGUPA5gEtZlWAw0rtted4OtCMFWIe0fLfbH87ZOw0LU/Lk7G98Bar yuHKMChzZR2LS+Hlgz0sclm3AUn5PrYKxvJaGe1tIj6sGmMv3OEuz7AWteAvTVTM+GE5jm jCBY/+JK0D/CAjtyaVXsseecZvKK18G2Vn4aUyr4Kc0N6CUBH/ITX7O0ZUYs5iEVm6Frai B2urovvgAf5jNZ3U6UIuYalN2vj2hsv/ajuAR5sUszKfArML/VjAAC64+hTYLz8iIbw0Qk FtB9ebhYk74510QCDkv5deBqnMiQOuq9/oZ/752YMF9UK34T7jWQhU5Y+eDSYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkz6S5c1nzFX0; Wed, 22 May 2024 17:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHc8T1027235; Wed, 22 May 2024 17:38:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHc8Bc027232; Wed, 22 May 2024 17:38:08 GMT (envelope-from git) Date: Wed, 22 May 2024 17:38:08 GMT Message-Id: <202405221738.44MHc8Bc027232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 9629a4b6865c - stable/13 - fib_dxr: check if cached fib_data matches the new request in dxr_init() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9629a4b6865c5c56804f79a62f45512b175776e2 Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=9629a4b6865c5c56804f79a62f45512b175776e2 commit 9629a4b6865c5c56804f79a62f45512b175776e2 Author: Marko Zec AuthorDate: 2024-05-17 15:55:43 +0000 Commit: Marko Zec CommitDate: 2024-05-22 17:37:31 +0000 fib_dxr: check if cached fib_data matches the new request in dxr_init() When calling dxr_init(), the FIB_ALGO infrastructure may provide a pointer to a previous dxr instance, which permits reuse of auxiliary dxr structures, i.e. incremental lookup structure updates. For dxr this is a crucial feature provided by FIB_ALGO, since dxr incremental updates are typically several orders of magnitude faster than full lookup table rebuilds. However, the auxiliary dxr structure caches a pointer to struct fib_data and relies upon it for performing incremental updates. Apparently, incremental rebuild requests from FIB_ALGO, i.e. a calls to dxr_init() with a pointer old_data set, may (under not yet fully understood circumstances) be invoked within a different fib_data context than the one cached in the previous version of dxr auxiliary structures. In such (rare) events, we ignore the offered old dxr context, and proceed with a full lookup structure rebuild instead of attempting an incremental one using a fib_data context which may or may not no longer be valid, and thus lead to a system crash. PR: 278422 MFC after: 1 week (cherry picked from commit 4ab122e8ef127d36d95f874e85600c36c87c8c22) --- sys/netinet/in_fib_dxr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 82245ecf6e66..539d7fe6c96f 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1139,7 +1139,8 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) } /* Check whether we may reuse the old auxiliary structures */ - if (old_dxr != NULL && old_dxr->aux != NULL) { + if (old_dxr != NULL && old_dxr->aux != NULL && + old_dxr->aux->fd == fd) { da = old_dxr->aux; atomic_add_int(&da->refcnt, 1); } @@ -1275,7 +1276,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, da = dxr->aux; MPASS(da != NULL); - MPASS(da->fd != NULL); + MPASS(da->fd == dxr->fd); MPASS(da->refcnt > 0); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); From nobody Wed May 22 17:38:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkz6V0n4Yz5M66q; Wed, 22 May 2024 17:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkz6V00Ccz4lGF; Wed, 22 May 2024 17:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Mfdp7d2OokRW21Y1f4Wc+e5dztvlykk1Cz6M46gu5o=; b=B+pyQYz85ndKUUmT23t0wtfSErF0MTSqUJLpmN/UX8KXt+RQkFrEkX0Gl0fsCl/USgeYwB W9+wlTfFrqo3VOlWLZg+60DwVHyC62CLzE7WJCLcGxP8QAQWE+6jxdfui2rbwLt6SGirqE NIkppDsklhvoGUl4M7PRo/AtDtAHV+2Xr/RG4f6Xo25IOlk35s/hxnJ6wcddktNPDoysys 4LkSbrB1C0ogatIgrhk/z23LyPfSSWY/KOaGTgU0ujV8cnc94KAVNsU3GJ8UBVu8yys7fx kU4MeiGAUumJCCiDZ/i5Wxef4E6zPrjhtv05E70UBCynwmAZ1P5/a1kEZMpoBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716399490; a=rsa-sha256; cv=none; b=U6jlwr1RjtUgkkHzjdAbZGxx4nGIE1b4AomiPOL6/ve7FKzjFN31yk1hLpIutrdsLAHl/9 JxwjBP9rCvexsdWb87c171A9qNF7bpL1YwlY5RlrSuvCkGJNRUSmlSL0WI0+r01/5sU5j3 JeqBoX9oac7dNBEc19ED2chUMC04zTkNbDdYum113DlR34ovKtF1xsqrT8Kh5UqfkqbOec pMuccefJQ3OHwvgX/RmihKAIGIDew1LuxdFz1w1McKadaMUWo0OepbOtjrVkJ4kEeMeXs5 Z384lrxT83E0LR5tRCwWHKlEjkKKKl16StrhPu/Tkb6E4xn8GgotK5XCyMYN0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Mfdp7d2OokRW21Y1f4Wc+e5dztvlykk1Cz6M46gu5o=; b=yTySAqHBeZgkQrzjvYiKFJ7mZrAQejlmfPgj3yi9pjrXH3RkVVxQGQOeN+/FUNm5/oQO8W iObtJOquSYGKXV5OYoAEMimahRYZEoVRpH2T2fFQ8HKFgxMZwoMhlvPtMIio2y4g38iXUY ZqM93TilezS+fjP/G8Yz0o8hJeTItG7qdPDurnuoRa7mG9F+o43tulQgIFO3HLeC0yp+A4 KHx98bdC4vcr+qW3rkKGPERD+dknk0xQbyhcBbjWw8PV1ojPgUs66eZ5tdUlYRI/uLniXd zD2aa6dvnXj1s80ZQYdYw1upJ850J82Uykas9GMg4smBYa40rnkBUxjiaFRAKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkz6T6dGszFGM; Wed, 22 May 2024 17:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHc9J9027295; Wed, 22 May 2024 17:38:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHc9Zk027292; Wed, 22 May 2024 17:38:09 GMT (envelope-from git) Date: Wed, 22 May 2024 17:38:09 GMT Message-Id: <202405221738.44MHc9Zk027292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 56d8fb274847 - stable/13 - fib_dxr: do not leak memory if FIB constellation hits structural limit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 56d8fb27484746416a74c8bd36aacc9edd0f4794 Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=56d8fb27484746416a74c8bd36aacc9edd0f4794 commit 56d8fb27484746416a74c8bd36aacc9edd0f4794 Author: Marko Zec AuthorDate: 2024-05-17 16:36:21 +0000 Commit: Marko Zec CommitDate: 2024-05-22 17:37:43 +0000 fib_dxr: do not leak memory if FIB constellation hits structural limit DXR lookup table encoding has an inherent structural limit on the amount of binary search ranges it can accomodate. With the current IPv4 BGP views (circa 1 M prefixes) and default DXR encoding we are only at around 5% of that limit, so far, far away from hitting it. Just in case it ever gets hit, make sure we free the allocated structures, instead of leaking it. MFC after: 1 week (cherry picked from commit 19bd24caa4c8c76ddf138b3a1598a21c8c5c3291) --- sys/netinet/in_fib_dxr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 539d7fe6c96f..326710cc4c45 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1320,8 +1320,10 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, dxr_build(new_dxr); /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) + if (da->rtbl_top >= BASE_MAX) { + dxr_destroy(new_dxr); return (FLM_ERROR); + } if (new_dxr->d == NULL) { dxr_destroy(new_dxr); From nobody Wed May 22 17:38:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkz6W3Hflz5M645; Wed, 22 May 2024 17:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkz6W0tzKz4lJm; Wed, 22 May 2024 17:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ueq4uqlVsvoSQTZt+DxezgiQD0MsGFNOsLbADbUCNw8=; b=TZpu797GjakM/KVB3JVSypAqFNEju8wivS9lWEuMuXui/yRooSbjL1E7Hk4XvRvX5UBV/R 74fVh0qR80aSln3JxDechlJa3NkEVWdqG+07Ul5AF6FZBRsNEjVpyrnmTt07skzJInfgwC kaLAEcqBP8+bWgvv8HzqDZyJRf8J2Va737ktuXQsOXIcEyvD0lK/q7qGgno9yh/NQbBSyQ NXiPi08M0H4xVzykYki4vHlZyENh5aRyutUStJO9w7D+UwzJ7EA1jOy8Ov6eyZhEghn0G1 Bv4IOGVaCCgS+SdnvoloAEmUKP4Pyz9o5qxGS94EHcVbYaadITizq8U2DhGX0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716399491; a=rsa-sha256; cv=none; b=hLh7yUCgVpwNvL3SLCnhYX9Hmcb5L/mlPz8J45MdLc3RgNh07+365hKYvqwOOcQJQ5qVaa zIXaTm7jK2gpQOl0l7piN3z5tHORI9oILMMJ+2HEOyafHxnGQm//tt3vEkfJwok36oyd/V g/hEfstr5RDs2MYNYXij6+fjvqNzY9/KSi8uYjrBGSOjDx8krpHotCqzsSldlxaPQCNMZt hsivAGdku7l8vIdDPq2LjlZT7MpY1NYKD0h9oraKIjjrxsY8/pDwwWnJ6uLSvNfMKzg99m 0dKIF/AXNvv0DnyRZixxqFNhi4aaDHg72l93inK5LTUD5YTdvD6DX0/Bo0cyqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716399491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ueq4uqlVsvoSQTZt+DxezgiQD0MsGFNOsLbADbUCNw8=; b=c0UUP+e8gY6Syu20MIpnhEBx3cmCBPN4jTzuWm7JPoJ33GNJgU4pMd6qast+Wfhb10O/mr eW5xfVYLBuhM0N7RygdXb0g+SXeSqxRjRbur2ZEfykpMPZNt6CCFEQUSMFtJ8iXhU5nGWc YVCmQnltoeKCVfN6Pde4pvpP1tlyVskzyw0RsDka2uHPeb2VCqWp/zznsobxiyhofjVEem XY9WHoWVz1HIGCTif8+q7ULGlfmK1KVi7gzfHjP/nc4jQRrEYDTqoG0/+tmGIYnOKfUmIq f9/+7LCGbksNefdxmuVdElayjsn92TXuYtT6xZ65DrZ8CrQylLz4cj2AdXHFVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkz6W0WNZzFcv; Wed, 22 May 2024 17:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHcAjF027356; Wed, 22 May 2024 17:38:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHcA33027353; Wed, 22 May 2024 17:38:10 GMT (envelope-from git) Date: Wed, 22 May 2024 17:38:10 GMT Message-Id: <202405221738.44MHcA33027353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 913a955bf55d - stable/13 - fib_dxr: code hygiene, prune old code, no functional changes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 913a955bf55dcaaaceb4424ece804d5f4080281e Auto-Submitted: auto-generated The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=913a955bf55dcaaaceb4424ece804d5f4080281e commit 913a955bf55dcaaaceb4424ece804d5f4080281e Author: Marko Zec AuthorDate: 2024-05-17 16:57:25 +0000 Commit: Marko Zec CommitDate: 2024-05-22 17:37:52 +0000 fib_dxr: code hygiene, prune old code, no functional changes The !DXR2 code corresponds to the original DXR encoding proposal from 2012 with a single direct-lookup stage, which is inferior to the more recent (DXR2) variant with two-stage trie both in terms of memory footprint of the lookup structures, and in terms of overall lookup througput. I'm axing the old code chunks to (hopefully) somewhat improve readability, as well as to simplify future maintenance and updates. MFC after: 1 week (cherry picked from commit 42b3c16e3051fdc04acc6276dd5d97dbe80ae7eb) --- sys/netinet/in_fib_dxr.c | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 326710cc4c45..b889131b544b 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2012-2022 Marko Zec + * Copyright (c) 2012-2024 Marko Zec * Copyright (c) 2005, 2018 University of Zagreb * Copyright (c) 2005 International Computer Science Institute * @@ -68,9 +68,6 @@ CTASSERT(DXR_TRIE_BITS >= 16 && DXR_TRIE_BITS <= 24); -/* DXR2: two-stage primary trie, instead of a single direct lookup table */ -#define DXR2 - #if DXR_TRIE_BITS > 16 #define DXR_D 16 #else @@ -317,7 +314,6 @@ range_lookup(struct range_entry_long *rt, struct direct_entry de, uint32_t dst) ntohl(key.addr4.s_addr))]); \ } -#ifdef DXR2 #if DXR_TRIE_BITS > 16 DXR_LOOKUP_DEFINE(16) #endif @@ -328,23 +324,16 @@ DXR_LOOKUP_DEFINE(12) DXR_LOOKUP_DEFINE(11) DXR_LOOKUP_DEFINE(10) DXR_LOOKUP_DEFINE(9) -#endif /* DXR2 */ static int inline dxr_lookup(struct dxr *dxr, uint32_t dst) { struct direct_entry de; -#ifdef DXR2 uint16_t *dt = dxr->d; struct direct_entry *xt = dxr->x; de = xt[(dt[dst >> dxr->d_shift] << dxr->x_shift) + ((dst >> DXR_RANGE_SHIFT) & dxr->x_mask)]; -#else /* !DXR2 */ - struct direct_entry *dt = dxr->d; - - de = dt[dst >> DXR_RANGE_SHIFT]; -#endif /* !DXR2 */ if (__predict_true(de.fragments == FRAGS_MARK_HIT)) return (de.base); return (range_lookup(dxr->r, de, dst)); @@ -571,7 +560,6 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) LIST_INSERT_HEAD(&da->unused_chunks[i], cdp, cd_hash_le); } -#ifdef DXR2 static uint32_t trie_hash(struct dxr_aux *da, uint32_t dxr_x, uint32_t index) { @@ -670,7 +658,6 @@ trie_unref(struct dxr_aux *da, uint32_t index) } } while (tp != NULL); } -#endif static void heap_inject(struct dxr_aux *da, uint32_t start, uint32_t end, uint32_t preflen, @@ -864,12 +851,10 @@ dxr_build(struct dxr *dxr) uint32_t r_size, dxr_tot_size; uint32_t i, m, range_rebuild = 0; uint32_t range_frag; -#ifdef DXR2 struct trie_desc *tp; uint32_t d_tbl_size, dxr_x, d_size, x_size; uint32_t ti, trie_rebuild = 0, prev_size = 0; uint32_t trie_frag; -#endif MPASS(dxr->d == NULL); @@ -907,7 +892,6 @@ dxr_build(struct dxr *dxr) } range_rebuild = 1; } -#ifdef DXR2 if (da->x_tbl == NULL) { da->x_tbl = malloc(sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); @@ -918,7 +902,6 @@ dxr_build(struct dxr *dxr) } trie_rebuild = 1; } -#endif microuptime(&t0); @@ -970,7 +953,6 @@ range_build: r_size = sizeof(*da->range_tbl) * da->rtbl_top; microuptime(&t1); -#ifdef DXR2 if (range_rebuild || abs(fls(da->prefixes) - fls(da->trie_rebuilt_prefixes)) > 1) trie_rebuild = 1; @@ -1044,10 +1026,6 @@ dxr2_try_squeeze: goto dxr2_try_squeeze; } microuptime(&t2); -#else /* !DXR2 */ - dxr_tot_size = sizeof(da->direct_tbl) + r_size; - t2 = t1; -#endif dxr->d = malloc(dxr_tot_size, M_DXRLPM, M_NOWAIT); if (dxr->d == NULL) { @@ -1055,7 +1033,6 @@ dxr2_try_squeeze: "Unable to allocate DXR lookup table"); return; } -#ifdef DXR2 memcpy(dxr->d, da->d_tbl, d_size); dxr->x = ((char *) dxr->d) + d_size; memcpy(dxr->x, da->x_tbl, x_size); @@ -1063,10 +1040,6 @@ dxr2_try_squeeze: dxr->d_shift = 32 - da->d_bits; dxr->x_shift = dxr_x; dxr->x_mask = 0xffffffffU >> (32 - dxr_x); -#else /* !DXR2 */ - memcpy(dxr->d, da->direct_tbl, sizeof(da->direct_tbl)); - dxr->r = ((char *) dxr->d) + sizeof(da->direct_tbl); -#endif memcpy(dxr->r, da->range_tbl, r_size); if (da->updates_low <= da->updates_high) @@ -1076,36 +1049,24 @@ dxr2_try_squeeze: da->updates_high = 0; microuptime(&t3); -#ifdef DXR2 FIB_PRINTF(LOG_INFO, da->fd, "D%dX%dR, %d prefixes, %d nhops (max)", da->d_bits, dxr_x, rinfo.num_prefixes, rinfo.num_nhops); -#else - FIB_PRINTF(LOG_INFO, da->fd, "D%dR, %d prefixes, %d nhops (max)", - DXR_D, rinfo.num_prefixes, rinfo.num_nhops); -#endif i = dxr_tot_size * 100; if (rinfo.num_prefixes) i /= rinfo.num_prefixes; FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d KBytes, %d.%02d Bytes/prefix", dxr_tot_size / 1024, dxr_tot_size * 100 / 1024 % 100, i / 100, i % 100); -#ifdef DXR2 FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d%% trie, %d.%02d%% range fragmentation", trie_frag / 100, trie_frag % 100, range_frag / 100, range_frag % 100); -#else - FIB_PRINTF(LOG_INFO, da->fd, "%d.%01d%% range fragmentation", - range_frag / 100, range_frag % 100); -#endif i = (t1.tv_sec - t0.tv_sec) * 1000000 + t1.tv_usec - t0.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "range table %s in %u.%03u ms", range_rebuild ? "rebuilt" : "updated", i / 1000, i % 1000); -#ifdef DXR2 i = (t2.tv_sec - t1.tv_sec) * 1000000 + t2.tv_usec - t1.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "trie %s in %u.%03u ms", trie_rebuild ? "rebuilt" : "updated", i / 1000, i % 1000); -#endif i = (t3.tv_sec - t2.tv_sec) * 1000000 + t3.tv_usec - t2.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "snapshot forked in %u.%03u ms", i / 1000, i % 1000); @@ -1194,7 +1155,6 @@ static void * choose_lookup_fn(struct dxr_aux *da) { -#ifdef DXR2 switch (da->d_bits) { #if DXR_TRIE_BITS > 16 case 16: @@ -1215,7 +1175,6 @@ choose_lookup_fn(struct dxr_aux *da) case 9: return (dxr_fib_lookup_9); } -#endif /* DXR2 */ return (dxr_fib_lookup); } From nobody Wed May 22 17:52:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkzR60X75z5M740; Wed, 22 May 2024 17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkzR575D1z4nJj; Wed, 22 May 2024 17:52:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716400354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5IWP8HMB4NpSEzAy3+1yypfsid2N2/hs3d9sbGwcM1Y=; b=N9U9Ca9Q9ZdwALuri3SciUKV+wYLEVP5ZkJ4S7TXlZ4k57YuTohoWvuyClC8NVjUTSAS4q bvYW3eE235TTjYf+w32XN/1iuMvQrVMLcbXo0Dsn0o7UMLYN8HOuNFI2jwLWHcxK0zCVtS VBetYLWX6mCFFC+4WFMTC5O6mKrAcA0LHsRtNqkG7L5n7bcQBK5fhlCaTQc2A6NIcipQf+ 0oWksbeMmxaEUQdmTETpFr8Yy4gzTBIhOIEDRTuVL6fRPv5BNAS9LnT091nYlYXamFS4xn nN15hFFRqBTDFotPz1nUC5GdgQHpAPvv6nweQYrYLvkDEdrVAYCr2iu4LUsElg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716400354; a=rsa-sha256; cv=none; b=P2aNR7RYnt+KKw9B7bLBypCbR5RP07nM9PsvUmpoZs4uLil2PgV9F9SeJJsJyFT59xDhZI oA6f7/sxjJpZfXsU4ntNICMHvnBgFvBKjdQD45Riwkk3p3Dq8by4fpGfrPt8LP3P0OaKb5 i/6wfauh+Lo6pJG5LFPqgQuNI/c8DEXmcpqMfHDMtD9/tMuMfhUNFPXk4Yuy+OKbOJJPCS KpHzxcoFhsW1bFa19AHkwigurPyQjg56pIPq7tqTiTmSHUS0nTSPtqo8QKGJ/qOlcCkKRc vgMzaTGjAfg8gizv2sQliOKHWdLEU2kJDoeLdO4fqAUV0FVILxQSlV41yc3M+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716400354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5IWP8HMB4NpSEzAy3+1yypfsid2N2/hs3d9sbGwcM1Y=; b=GKcl7C2YnSgAKlwGfZfjgx3K8JfkZDgjH1/X8HPTgY63kwQEuqr1k1yNQaU+STY2+AFMeq V5Mckw2GfDcC7HEFtH0GFHuTHI67jF/slNU4hKb3b1RGn8xMLes9G81/zq1Gss/YN2ftsi 9TTWpn1waG4cckrk8mjChXUwv9vccGBfRrewaKAX659e96QU7wfhsNiHty2f4zzBYqXVgM x1Uj84KDBB3yd5viloTV3gls7pxZYMlyzshw0yOsoYTDKpoxloulrFYg+zWVrbIgpLiG90 VFavLFOUXmoxbx/b8dsC+SraK1SkGCHrqBHWnqSy6ivLk6PYk2iFRyvanLO0mQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkzR56fh9zFCk; Wed, 22 May 2024 17:52:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHqXd6059043; Wed, 22 May 2024 17:52:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHqXS1059040; Wed, 22 May 2024 17:52:33 GMT (envelope-from git) Date: Wed, 22 May 2024 17:52:33 GMT Message-Id: <202405221752.44MHqXS1059040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: b0a1a3138a37 - releng/14.1 - fib_dxr: set fib_data field in struct dxr_aux early enough List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: b0a1a3138a37b7849d1fb735e6b5c2cd392a2e8b Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=b0a1a3138a37b7849d1fb735e6b5c2cd392a2e8b commit b0a1a3138a37b7849d1fb735e6b5c2cd392a2e8b Author: Marko Zec AuthorDate: 2024-05-07 15:44:09 +0000 Commit: Marko Zec CommitDate: 2024-05-22 17:50:29 +0000 fib_dxr: set fib_data field in struct dxr_aux early enough Previously it was possible for dxr_build() to return with da->fd unset in case of range_tbl or x_tbl malloc() failures. This may have led to NULL ptr dereferencing in dxr_change_rib_batch(). Approved by: re (cperciva) MFC after: 1 week PR: 278422 (cherry picked from commit 0418d7a0903725ade71ae77c4ff900010a93a185) --- sys/netinet/in_fib_dxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index e7eede53ea51..94f066bdf982 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -877,6 +877,7 @@ dxr_build(struct dxr *dxr) return; dxr->aux = da; da->fibnum = dxr->fibnum; + da->fd = dxr->fd; da->refcnt = 1; LIST_INIT(&da->all_chunks); LIST_INIT(&da->all_trie); @@ -907,7 +908,6 @@ dxr_build(struct dxr *dxr) trie_rebuild = 1; } #endif - da->fd = dxr->fd; microuptime(&t0); From nobody Wed May 22 19:22:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl1Qv6bkpz5KYP5; Wed, 22 May 2024 19:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl1Qv68c8z40FS; Wed, 22 May 2024 19:22:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716405751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HYVIMLfSVQQeN8rQ4DZGei+hA/KQZdqb4MSvXmizfps=; b=J11Q0tRwaVF07Evx3vqUtMFYrlrPMzTbiKv9tTTYxFVNY6HaarJGnBx015u5Pak//WdO+5 f6tYkYH4oX0Ti0HXH31jidkUEHf1oRVJrzsVNaPZJbJ0//vXk1xWKB+erIL7As1Ed+/+D7 CjLpsaV2dVbPKfSZyD4p7h608MkG6/Ec2934hFeMXx8ZhKYN2Z23hh40Rz6ENPKvhxaPvw UgpiAZ9cYHlE1sHoFPvu5hpy0WtDG3lNacLJK2X73TDnZzIyzpIiefw2wUPhc5YMLCS8Yx O5RQDAzLPV5vk7UBZIEE/9pM/OgmmKlrKuM9BOGxQrILZY8/Vo4JZzb7kK764g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716405751; a=rsa-sha256; cv=none; b=tPYT3P8PLYzpgPWkCeZgkqhnvR7hO08FgLeiNEw1jf7zbCtHwp0aVptdEApWvAH3ocycwo OzJoaWSuFYooT4SCLFg64gDsvfq3Ct4EBocQs/YcUkNmr7NdrgokBine/TGonNTKf3fhAl ZnTFC5e4qOqWj17ONpwv2kt2jG9lsRvm/qRUG0Kjpd7zoYMWnDuJ+vKuvdqopzgqFV877N NlPYdRCvbJ1bKA1pQTuVr5m42fHk2TYMyyzA6sJ8PhGX9EcWgkMI0K9pyFC/6Z3SNNJ6FL SC9BPlanwpxKsyk+xdeqmoAfVBxTEwN5ms52PwtZcckWKRXItsWIq8jM3ZQsQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716405751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HYVIMLfSVQQeN8rQ4DZGei+hA/KQZdqb4MSvXmizfps=; b=uLBGVHj/apWfO0H3TOLMpqYkbzwTMOmtKblCGH5pa4g1BQQx2QF5znxB7HPwI/vt84pjvs TBWzhqj7THmBYNqBZKnrWm5WPQG+YNxwhYaecmBL5aLyo/ikSkl85dlDfhcFNy4GXRynhF EPmN2JITZkoMcZjD3osZ7nN/rEUDcdz4t64zoRT/TFVOhpUtRFOWccMmGW1DBFatqbZtVP 3ETzz0ml6yPIJtRBaInZhG2p2ipLMBIt1iDN4aeiWRuY48Cc/MifGMY1vPdDOQ1jIdcMU3 XD/5nvMYz+FQJX4bWVIIddDpLghrnTI7kITHpzXD0kOhS/OPccVPV40XammOhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl1Qv5ly3zJRg; Wed, 22 May 2024 19:22:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MJMVXV012106; Wed, 22 May 2024 19:22:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MJMVjC012103; Wed, 22 May 2024 19:22:31 GMT (envelope-from git) Date: Wed, 22 May 2024 19:22:31 GMT Message-Id: <202405221922.44MJMVjC012103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 017d52e38ab3 - stable/13 - Enable soft updates by default for UFS2 filesystems. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 017d52e38ab332b140ab40231ef920bcc3b2b1c1 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=017d52e38ab332b140ab40231ef920bcc3b2b1c1 commit 017d52e38ab332b140ab40231ef920bcc3b2b1c1 Author: Kirk McKusick AuthorDate: 2024-05-15 05:38:35 +0000 Commit: Kirk McKusick CommitDate: 2024-05-22 19:22:14 +0000 Enable soft updates by default for UFS2 filesystems. Reviewed-by: Warner Losh, kib Differential Revision: https://reviews.freebsd.org/D45201 (cherry picked from commit 61dece6d27fb2436928ca93d65667b358e05aa7b) --- sbin/newfs/newfs.8 | 8 +++++--- sbin/newfs/newfs.c | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index 915304caaa40..0b9f66a7e76d 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 -.\" -.Dd October 21, 2022 +.Dd May 18, 2024 .Dt NEWFS 8 .Os .Sh NAME @@ -100,6 +98,10 @@ The default format is UFS2. For backward compatibility. .It Fl U Enable soft updates on the new file system. +Soft updates are enabled by default for UFS2 format file systems. +Use +.Xr tunefs 8 +to disable soft updates if they are not wanted. .It Fl a Ar maxcontig Specify the maximum number of contiguous blocks that will be laid out before forcing a rotational delay. diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 1db317766692..6e69a6c5437b 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -391,6 +391,9 @@ main(int argc, char *argv[]) fprintf(stderr, "because minfree is less than %d%%\n", MINFREE); opt = FS_OPTSPACE; } + /* Use soft updates by default for UFS2 and above */ + if (Oflag > 1) + Uflag = 1; realsectorsize = sectorsize; if (sectorsize != DEV_BSIZE) { /* XXX */ int secperblk = sectorsize / DEV_BSIZE; From nobody Wed May 22 21:11:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl3r439sbz5L1Z7; Wed, 22 May 2024 21:11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl3r42kw9z4JX8; Wed, 22 May 2024 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716412260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hgbWhybwHRMelHo0DOlxBVzHIHATGc8MJkZv+jR+QTM=; b=l8MYWJBNFObpuUS1+GCtsZTwThWWyxApTQ+sd6NA0UebjDxYiXkB0TBF6p23B0DmAAe4Ht tVfOhzRVH275y8gZVnuyUTGyOp0iWU3MmxBPjsTMPqOZ9oI9o6/GxgQR3n9dJTEQHA7ApA zPJRlI/5U7E0dfOkeyY/784/KZOxsrE8dP0VRLDKEDpckJ9KLhWTYWC7bd49jIjRuguTI/ uD84XtAsbtTA9B3Ot7deg8xgsO8+sP3eUrTIgjRLMqeFAmRQ6DpVcPYUJbppRiGT57oe/w JjsbwkerywFudR9QhHMdYvdIZAGG4uShiIrJ02cpvLanumUxjrDITFAly5xdiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716412260; a=rsa-sha256; cv=none; b=PPvIeHx4/nU9IQyRT4oWwkDQXByzLLc++8gDWtUEzMj1NrfnO8v2NSReRqvfiuWvyK+UIa DgkIeaG7utddVd3LYfWPKj7MLowPntM3TX3Q/wTiWY/HBuKQB2m+MbB08j7bUAnMZTcShw 5aO8Yxe50hgdcebRAkM9SQv2yuvHJObDS/CdR+5vjq2UzgyB6ar9IF6YE/BkDnPAoveZy0 O0wTwxKlHEgBx6zsIwqj8zN2AdORkIXwBa91VeYX7EvnUcuJnvq0QpZLiVb1VlT9W1g2N0 kc9uCiZ3QsTbAb5jCunD5bWnfotTnbLMsNrzm29332ZcsvD8XOegz4CQPhaw7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716412260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hgbWhybwHRMelHo0DOlxBVzHIHATGc8MJkZv+jR+QTM=; b=LRLt3fM0QIK9iBR2DA+3bYltI/Hxrqq9huoszhpwjhuIPWXZsQ7by2uO6WAcsNOKLa9fq1 kGOkjBbvYlmjr+2x/m3l/vdIhDfX0oLRky273TNiS6VqA38UAVH4sP6ucJAKFVa1JFeQq+ QsKM93Lf5JcnaJX75bSvEtt7wC8xC7x/VW1QpfrD2o6/WR6RT9T/erUfD8R/bT17huf3AA foGF89gI0kFz73URgPgmTwiw95ZQzI11tqMB3t4orveChwHBW5L6eQXkeN2IwjlEnyBYNQ MpxZkNkf60pVG+xpRTF7S01I2po9bV/9S01omPrN+2etI5sBZ6cmlhl2oSMVaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl3r423SxzLYy; Wed, 22 May 2024 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MLB0bg094221; Wed, 22 May 2024 21:11:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MLB0GY094218; Wed, 22 May 2024 21:11:00 GMT (envelope-from git) Date: Wed, 22 May 2024 21:11:00 GMT Message-Id: <202405222111.44MLB0GY094218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6a61917a4b64 - stable/14 - sg: Add sg(4) man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a61917a4b641c2e3ebba19bd13a0e5472b6885f Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6a61917a4b641c2e3ebba19bd13a0e5472b6885f commit 6a61917a4b641c2e3ebba19bd13a0e5472b6885f Author: Warner Losh AuthorDate: 2024-05-06 22:28:09 +0000 Commit: Warner Losh CommitDate: 2024-05-22 21:10:51 +0000 sg: Add sg(4) man page Add minimal sg(4) manual page. This implements a subset of the Linux IOCTL interface for either native FreeBSD programs, or for Linux binaries in the linuxulator. Noticed by: Lexi Winter Sponsored by: Netflix (cherry picked from commit 08b4520338349bc065ec184b32a6e700cb8e34ec) --- share/man/man4/Makefile | 1 + share/man/man4/sg.4 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 222422526180..a97c92b960f5 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -492,6 +492,7 @@ MAN= aac.4 \ send.4 \ ses.4 \ ${_sfxge.4} \ + sg.4 \ sge.4 \ siba.4 \ siftr.4 \ diff --git a/share/man/man4/sg.4 b/share/man/man4/sg.4 new file mode 100644 index 000000000000..bf7cb93cfb09 --- /dev/null +++ b/share/man/man4/sg.4 @@ -0,0 +1,63 @@ +.\" +.\" Copyright (c) 2024 Netflix, Inc. +.\" +.\" SPDX-License-Expression: BSD-2-Clause +.\" +.Dd May 6, 2024 +.Dt SG 4 +.Os +.Sh NAME +.Nm sg +.Nd Linux ioclt-compatible SCSI passthru device +.Sh SYNOPSIS +.Cd device sg +.Cd device scbus +.Sh DESCRIPTION +The +.Nm +driver provides a Linux compatible scsi passthru device. +This driver attaches to all +.Xr cam 4 +peripheral devices. +It is similar to the +.Xr pass 4 +device, but uses the Linux interfaces, rather than the FreeBSD CAM interfaces. +.Sh IOCTL +The following subset of the Linux sg ioctl interfaces are implemented: +.Bl -tag -width 12 +.It Va SG_SET_TIMEOUT +.Fa u_int to +Set the timeout in milliseconds. +.It Va SG_GET_TIMEOUT +Get the timeout in milliseconds +.It Va SG_GET_RESERVED_SIZE +.Fa u_int +Returns the size of the I/O one can do this device. +.It Va SG_GET_SCSI_ID +.Fa struct sg_scsi_id +Returns the bus number, channel, scsi bus ID number, lun and other information +about the SCSI device. +.It Va SG_GET_SG_TABLESIZE +.Fa u_int +Returns the table size, though hard wired to 0. +.It Va SG_GET_VERSION_NUM +.Fa u_int +Return the version number that is implemented. +.It Va SG_IO +.Fa struct sg_io_hdr +.El +All other ioctl interfaces return +.Va ENODEV . +.Sh FILES +.Bl -tag -width ".Pa /dev/sg*" -compact +.It Pa /dev/sg* +Passthru devices. +.El +.Sh SEE ALSO +.Xr cam 4 , +.Xr pass 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 7.0 . From nobody Wed May 22 21:11:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl3r53qXTz5L1TV; Wed, 22 May 2024 21:11:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl3r535pxz4Jhv; Wed, 22 May 2024 21:11:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716412261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RlwUok2uRqPkOGa1yVzCctM10mKDlKnssCoWkG6ofyQ=; b=CmJ1h8NDt6RJcz5WZnGLrjYtYO/KDJ/7wDFLjmlvd3QsnjgXTsNf4Cwz/xYCZ+C0cNhnb7 M11p4zRnMn5tQBxr9XmhtJHNIN4Do0vZh3euhs0L3KHeoTSMhY3gfSQvwheB5nSivToE1O vlUc8TRoMgW0I6JwNVaA9zZapKzbjSDzlD1/dhIBjCf9vDS4a/mJmL/HNNGtZtioM8GetZ vxq/W1J6DCTHIjFe9CwUV+OdFj6IByYLlBaHSZBZk7yMDcyG4d9itWp0yvQIriA0h2ZWLf tspoEaMKgPBMc25sLzl93+KGI5UlyqQ5wG/S0nQ+yXWU3n0T2k179uG4CQAxiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716412261; a=rsa-sha256; cv=none; b=xN/jICT4n73Z9uqTg0Hh0ecV2ka1Vk95DCQKjx2EPnSa6R4Ftsw0sbV4wAM0OZt8unthFT 5DL3HDq69WIPMSyeYlRhhr1Oykci+NM7q9T26IYbLgf8vkP2I3XXeXeKeeTKbBpiO//4fz WvPFEobXH4HW2qMAtJX7Y6esB9g5r5ARb6mVCqlvqP5cYnL9IyiurAppdU6YFiN4WnKIv6 21h8Lbdu5L0qFnP/W2fNNS2hkltcH4AMmcWfWgCy3VEJPgVEAePEVYKZGSGY8kpzfMk/gq brVtETqZ2tVz9jY/X2crwjP7dhmJgEwOAeHomWjullssIykX/SLCt0Td/RiMNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716412261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RlwUok2uRqPkOGa1yVzCctM10mKDlKnssCoWkG6ofyQ=; b=EZZm9JVGFLT40uE424OHd/ZtumCrBJlgaY2cLED/sBEHBjJlwjWypwBIMxO7OJezWo3sM4 TWJ8DxeKN1IC0qnqvPG/i9KM32JvXBM/iPqWrV2IV7V9aHMPalF6V8IA2RuIjM2gqx/bB+ 8nMD0GIE8Xa+xZxTFOafB5wLhoBW6juHeH/GJ3MkXnlVEVX6dpLgBbJYN+n3XQKVsMOkjl 6m+Gzz1ZmBioEeiP5ItIXdtsbYvOcNJpQYcQmNXyWmMbkUqQX3nC9GeOp1Juqwayzk8sCQ ZustErUgizU6ozkpcYuuSoBrF6JUwIcn9MnORDiyUMVu0TihKkNjpLd+djwt3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl3r52bQwzLZ1; Wed, 22 May 2024 21:11:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MLB1Gm095360; Wed, 22 May 2024 21:11:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MLB1G4095346; Wed, 22 May 2024 21:11:01 GMT (envelope-from git) Date: Wed, 22 May 2024 21:11:01 GMT Message-Id: <202405222111.44MLB1G4095346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 23989c61c39a - stable/14 - Fix typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 23989c61c39a10fbacbd17a977b628b3ceb714d1 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=23989c61c39a10fbacbd17a977b628b3ceb714d1 commit 23989c61c39a10fbacbd17a977b628b3ceb714d1 Author: Warner Losh AuthorDate: 2024-05-22 21:05:55 +0000 Commit: Warner Losh CommitDate: 2024-05-22 21:10:51 +0000 Fix typo ioclt -> ioctl. Fixes: 08b452033834 Noticed by: Thomas Mueller and John W. De Boskey Pointy hat to: imp Sponsored by: Netflix (cherry picked from commit 58e44aa01101d420c9d7021a788b6074b7183286) --- share/man/man4/sg.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/sg.4 b/share/man/man4/sg.4 index bf7cb93cfb09..ac549452cc93 100644 --- a/share/man/man4/sg.4 +++ b/share/man/man4/sg.4 @@ -8,7 +8,7 @@ .Os .Sh NAME .Nm sg -.Nd Linux ioclt-compatible SCSI passthru device +.Nd Linux ioctl-compatible SCSI passthru device .Sh SYNOPSIS .Cd device sg .Cd device scbus From nobody Wed May 22 21:30:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl4G6374hz5L3CK; Wed, 22 May 2024 21:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl4G61sL1z4LkT; Wed, 22 May 2024 21:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716413406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hS4u9pZREYIm12DIcVvG6sA5+R6cCjfs14/3jaiXU6Q=; b=dLE56t7qvidkVGmwXnkh1z1A3HmB0dJdc/0nbKovtJPeBUW2BNl1+x0KW60oYE7L32XI7i VHJpeRU6V+GKJQBBfJsSFguAejY/1o5kn3D5JD2DJWPtZDigQR93cciY8YCmSPmQJeLEdN 5Gh9KAXoGqaboCeUXaLazTpG83hUfBXK5n3lV+OnD63tcxmF7YgtL5hnj8PoKW3JhvGhYL btqr+bpq7tWnv9W1C1qDe9FSVTJf8phyTHV6jDgspjePJH5STvVV5yrL/9gRpFmoI19tOk DEY+LMPLsQhthWdCQuyoFGSIi852w6cCYx3lOu0p3wwnvW55qojaRieGPaNZpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716413406; a=rsa-sha256; cv=none; b=B0egM13JaGoOOEY9tLXKMgaLyiPPYagLHWJKflcQ8mwg0PHeMgvkL4gEs5yWk1Aok45yhD ubwlvOYJ8f41si6Pblwy2o9bDwHo6aY5gqE1yaOJxLJi57dSa5Zc54u19Bz1XWcWCp6/Xx ky0OLkOolyZxFqSFI7RfVQwyK4G63Fbw7zk8LSVi+i7VzGTvS6FLb6tQNxnSXxdbMaxZWw /zMELhWMqPHp8S4OBIdhLOiCUZJcMo2pcnBgiUcDcDsntbFF8Hd8OioT/FMCU3FlbtGUu5 IEdvFgw0/GnaHywV5fh5Rmu3TYFL1J18I3GD1OexP8SD0aRyko2D7nQKu1L2TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716413406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hS4u9pZREYIm12DIcVvG6sA5+R6cCjfs14/3jaiXU6Q=; b=HLFwRU7EZKo123yolKttnmz1EDemC7cL1XgNvhvnNSNCMl+RryovVR9OBwlorTEs34WwUl WaQ54d6ZLu6sCW3H1GOV6y+mkaXsjkn+Bxlsd+jFbezjbYL9kumMQmtP1mBDrqp+x5sIG0 CM5xj+2rUJV+aEiWAML8jred1sGd9CSyZxkOEP7aF/9Fx0EDkKNXt/2ydkd2ubj7299UiR /cDHgG48IR4D+FhdDy5cj/KLGXvdPANjD24Xq4AbmDgrsYJ8kJAINWd9h8rSxipilbHwnq L/uE3GNlCVbKt0xwpU55nPYpbbjECbAD+3ogixjpHcrxZA/G539jibjrtEUycg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl4G61Lm9zMCG; Wed, 22 May 2024 21:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MLU65d019680; Wed, 22 May 2024 21:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MLU67p019675; Wed, 22 May 2024 21:30:06 GMT (envelope-from git) Date: Wed, 22 May 2024 21:30:06 GMT Message-Id: <202405222130.44MLU67p019675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e85f2ed0950a - stable/14 - mtree: Add missing directories generated by certctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e85f2ed0950ae81fa0343103c5ba8fe88e7d204d Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e85f2ed0950ae81fa0343103c5ba8fe88e7d204d commit e85f2ed0950ae81fa0343103c5ba8fe88e7d204d Author: Jose Luis Duran AuthorDate: 2023-12-28 05:26:23 +0000 Commit: Warner Losh CommitDate: 2024-05-22 21:29:19 +0000 mtree: Add missing directories generated by certctl PR: 255639 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/912 (cherry picked from commit 5b7f73ce16cbd3704b21943ebe6b489b2bc2de1f) --- etc/mtree/BSD.root.dist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index c6b73e648209..a85ce552589c 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -94,6 +94,10 @@ ssh .. ssl + certs + .. + untrusted + .. .. sysctl.kld.d .. From nobody Wed May 22 23:02:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl6JC6fp2z5LCNt; Wed, 22 May 2024 23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl6JC5qMgz4XR8; Wed, 22 May 2024 23: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=1716418923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f8lybhmjlD3UPDNHphrjKA7qeS4s8DZKJ9DDbRWknGc=; b=biuSRbVlfMGS4dVZ4d0befgdl1mcl7ocUFYpMIE8CCoIKmwBRI+slcqgt9RAQUUqRcCoR8 etmHogMKR3vu0BPXIkcamGoPZyK8C/8nsRFWDz4GznY0eER9WFxXJ3U2q6I3FAjXVyZaZ1 JCH2c8zBGS2/sUDKQKBdlvRsIhdAWwX/yWvnV9SuT7nRR6/rtOxprCsL0NiVevTQIPLP7z MDfDd+Tiobn89Y5IyB5FJY4OkVOz07fmCj84eOvEKqAH+d6oK+eRZ9KzQC42tt9mim0LKz V+oJ8KYgi+RMtRWnZN6NBw9uT6QvoHhJfRplcjk3pL5TC/Nw73rErY/32owTiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716418923; a=rsa-sha256; cv=none; b=q2D9hVA2EOmtVMA+O0lwFdP3AIUn9yKG16Qp7OyvF7HMunyssX1jysZOybNpn9WmKRmynM MdXHV9nfRXZlQ7683nsAwAdLoxUZCe3HKSXegh4FCplrpHt5eTrsjHbo4Fywky1xuOWthR K8ok4JfNNYw10f8QetUP8cJhdaOHupjIaZpnanhaR/REYj0WYYSSSTV5MZSghSYa5rDJn9 9OCa/9BDUld/SnABDxxyDP8cmNOMEc1da8JBUVtDLBlz0x3maynNBq8SwLNLu83wJczj+/ z0wGaQJgyTncBo+d2Y1w/w4MyuiJMgiFdUCYXwnvX5RXyy11zyJMBDAvDkbSPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716418923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f8lybhmjlD3UPDNHphrjKA7qeS4s8DZKJ9DDbRWknGc=; b=RuUeiXkcAB6cvHbhuU+l2C0vMCi8YAkV3JMNyKlW76V9jretdIukCo5OWwhg/3Lwobx/hm iwm79hhUZDRHctS01UPMVH/nom+IGg3WHbou6Qr4fYjR4loLqBgjpZAPq9oAD/ufd8LFUO WvTkM8hTX7DPjyxd+AN1VsO/8Va1M78PPfYMxKGQaebk16jnczvNdPwF+5Ns824qc7sqER W5ULQJ90qk9C46YWt+ine1uPdw+xUffxvc0CWIS5ckF5q/h4rWSbtJRYz8iNqEpHBxecZG PBcSjZbOA0DcQ470/KOvOOupYTQ/iVn5x/Hif9DXlVn7b73NQPPmpZLUiGA8DA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl6JC5RQFzPDg; Wed, 22 May 2024 23:02:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MN23Dh085356; Wed, 22 May 2024 23:02:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MN236A085353; Wed, 22 May 2024 23:02:03 GMT (envelope-from git) Date: Wed, 22 May 2024 23:02:03 GMT Message-Id: <202405222302.44MN236A085353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 34db75d21876 - releng/14.1 - if_vxlan(4): Add checking for loops and nesting of tunnels List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 34db75d21876ae406ff57fdc594f151fc4214109 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=34db75d21876ae406ff57fdc594f151fc4214109 commit 34db75d21876ae406ff57fdc594f151fc4214109 Author: Zhenlei Huang AuthorDate: 2024-05-20 12:14:07 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-22 23:00:03 +0000 if_vxlan(4): Add checking for loops and nesting of tunnels User misconfiguration, either tunnel loops, or a large number of different nested tunnels, can overflow the kernel stack. Prevent that by using if_tunnel_check_nesting(). PR: 278394 Diagnosed by: markj Reviewed by: kp Approved by: re (cperciva) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45197 (cherry picked from commit 93fbfef0b50354b7a1620822454ef29cd415cb2d) (cherry picked from commit 3ebd2b1c730834123a53b3eddcf9029fcf414782) --- sys/net/if_vxlan.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index e6949bb5dc9a..87648abd116b 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -433,6 +433,21 @@ TUNABLE_INT("net.link.vxlan.legacy_port", &vxlan_legacy_port); static int vxlan_reuse_port = 0; TUNABLE_INT("net.link.vxlan.reuse_port", &vxlan_reuse_port); +/* + * This macro controls the default upper limitation on nesting of vxlan + * tunnels. By default it is 3, as the overhead of IPv6 vxlan tunnel is 70 + * bytes, this will create at most 210 bytes overhead and the most inner + * tunnel's MTU will be 1290 which will meet IPv6 minimum MTU size 1280. + * Be careful to configure the tunnels when raising the limit. A large + * number of nested tunnels can introduce system crash. + */ +#ifndef MAX_VXLAN_NEST +#define MAX_VXLAN_NEST 3 +#endif +static int max_vxlan_nesting = MAX_VXLAN_NEST; +SYSCTL_INT(_net_link_vxlan, OID_AUTO, max_nesting, CTLFLAG_RW, + &max_vxlan_nesting, 0, "Max nested tunnels"); + /* Default maximum number of addresses in the forwarding table. */ #ifndef VXLAN_FTABLE_MAX #define VXLAN_FTABLE_MAX 2000 @@ -2722,6 +2737,7 @@ vxlan_encap6(struct vxlan_softc *sc, const union vxlan_sockaddr *fvxlsa, #endif } +#define MTAG_VXLAN_LOOP 0x7876706c /* vxlp */ static int vxlan_transmit(struct ifnet *ifp, struct mbuf *m) { @@ -2747,6 +2763,13 @@ vxlan_transmit(struct ifnet *ifp, struct mbuf *m) m_freem(m); return (ENETDOWN); } + if (__predict_false(if_tunnel_check_nesting(ifp, m, MTAG_VXLAN_LOOP, + max_vxlan_nesting) != 0)) { + VXLAN_RUNLOCK(sc, &tracker); + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (ELOOP); + } if ((m->m_flags & (M_BCAST | M_MCAST)) == 0) fe = vxlan_ftable_entry_lookup(sc, eh->ether_dhost); From nobody Wed May 22 23:47:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl7K80NZFz5LH7K; Wed, 22 May 2024 23:47: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl7K76pzpz4c9P; Wed, 22 May 2024 23:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716421676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jl8jCJxvW1GZprG8JrBTQFDCk5Pc4/OlaHxPzlCBEk4=; b=JQKftniYEqbTpZczM71YvS5Y+rmAaMJFeguYvQYiEpphE58ysytntDpZ6YXxBgbWaa8+kZ BaeoRPQ0PlHRGIxGJvdaN1zio+YXLCBWmFqxQ/Rgnl+0D2LVFmbTxEoXpazb+0YiUDo1WP LiF2aFh3LakBTMFbISMY5mgPmYvceTSZMRkQSA6cOrE2f+rgcISSQsAgtn+w06wMZAw89G YOIuwHl8gTa+5ksrQd7LDPh0cE+3O/PnZ7iu/ksJxCKqV1GxBAmBMKYWdcO6zhCI4lzzHE dvVFno1yHCXF44wGR1NBZgucoz71K6OQTM6vVFxHSjxvkHvB+tps9hzrR9A+Sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716421676; a=rsa-sha256; cv=none; b=Z6NV+tgwklRDZh1smQ28Rpm7rQK0znIW+wv1OLXlCdwyscmp9rQ18HYsEaPSHFa35V59Zx F1mB9WWSsqKgqYuINd1PXtxng+2BSKDzROkQc3/lep6x+vca3FmyBkSaGn5CZIPBA1vzLp lNPc+4a7UOeTvZNPJbbfAfcNEy5Fb2OUi8uUqtQ0ir/8kVch+Hp6FgAS9uW6xNxSaIdsay rMb+45Y+anwDwFSJwPKY23N4wMYws9dyKDuxo4jQ4NHbl4Sa+Q7LvAQUcWW6vP7gcvmLAP 5ti7/3KdI1ekk8iHPp0HIybRB4/p9GxHoA45bzW17XAq2IGaR/IMgya3kw/7fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716421676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jl8jCJxvW1GZprG8JrBTQFDCk5Pc4/OlaHxPzlCBEk4=; b=osRyoZ0Py5BKdo3KPHSGRk/mlP1sekz8hkeZvHW1vR/7o8+2WuQz9CqFEoiWMyBqOb+/3A gW1bKCTP34Kwh8KMU78hxjOa0BeI3ARx1SRftR0ERfxXOK9CucAtyD0bv/22/uR0tIqU4V 0YxZGvSntY+7IbgsRVr0GQMh/Vd0qTBKZ152PQe07/9ouhS6kBeU9xV5XIlL53RbUY7E+I po4/HuPULO+JtRXr9a8xqddISHM6VsYDhRSUwd9NtswoJ1+Ns6m5OaCCmWr37dxgnDXXsU oZCG9zQKbItAX42vDhxk+H7JRhWYkqdkaF8lEV32DE7iOI9/KqR0EK8hWstq4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl7K764FtzQQ1; Wed, 22 May 2024 23:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MNltIF052788; Wed, 22 May 2024 23:47:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MNltPr052785; Wed, 22 May 2024 23:47:55 GMT (envelope-from git) Date: Wed, 22 May 2024 23:47:55 GMT Message-Id: <202405222347.44MNltPr052785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cd73b38955f6 - stable/13 - killpg(): more carefully avoid LoR List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cd73b38955f62d9c05ded8e641a7462ca0f06179 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cd73b38955f62d9c05ded8e641a7462ca0f06179 commit cd73b38955f62d9c05ded8e641a7462ca0f06179 Author: Konstantin Belousov AuthorDate: 2023-07-07 17:19:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-22 23:47:23 +0000 killpg(): more carefully avoid LoR (cherry picked from commit 7a70f17ac4bd64dc1a5020f963ba4380cf37b7e5) --- sys/kern/kern_proc.c | 15 +++++++++++++-- sys/kern/kern_prot.c | 6 ++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 23d2856a3d32..28c1dd90e685 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -587,8 +587,12 @@ enterpgrp(struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess) ("enterpgrp: session leader attempted setpgrp")); old_pgrp = p->p_pgrp; - if (!sx_try_xlock(&old_pgrp->pg_killsx)) + if (!sx_try_xlock(&old_pgrp->pg_killsx)) { + sx_xunlock(&proctree_lock); + sx_xlock(&old_pgrp->pg_killsx); + sx_xunlock(&old_pgrp->pg_killsx); return (ERESTART); + } MPASS(old_pgrp == p->p_pgrp); if (sess != NULL) { @@ -656,11 +660,18 @@ enterthispgrp(struct proc *p, struct pgrp *pgrp) ("%s: p %p belongs to pgrp %p", __func__, p, pgrp)); old_pgrp = p->p_pgrp; - if (!sx_try_xlock(&old_pgrp->pg_killsx)) + if (!sx_try_xlock(&old_pgrp->pg_killsx)) { + sx_xunlock(&proctree_lock); + sx_xlock(&old_pgrp->pg_killsx); + sx_xunlock(&old_pgrp->pg_killsx); return (ERESTART); + } MPASS(old_pgrp == p->p_pgrp); if (!sx_try_xlock(&pgrp->pg_killsx)) { sx_xunlock(&old_pgrp->pg_killsx); + sx_xunlock(&proctree_lock); + sx_xlock(&pgrp->pg_killsx); + sx_xunlock(&pgrp->pg_killsx); return (ERESTART); } diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index a91b7ec3015f..5dea43971e3d 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -345,10 +345,8 @@ again: error = EPERM; } else { error = enterpgrp(p, p->p_pid, newpgrp, newsess); - if (error == ERESTART) { - sx_xunlock(&proctree_lock); + if (error == ERESTART) goto again; - } MPASS(error == 0); td->td_retval[0] = p->p_pid; newpgrp = NULL; @@ -458,11 +456,11 @@ again: error = enterthispgrp(targp, pgrp); } done: - sx_xunlock(&proctree_lock); KASSERT(error == 0 || newpgrp != NULL, ("setpgid failed and newpgrp is NULL")); if (error == ERESTART) goto again; + sx_xunlock(&proctree_lock); uma_zfree(pgrp_zone, newpgrp); return (error); } From nobody Thu May 23 00:24:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl87H03D7z5LLHY; Thu, 23 May 2024 00:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl87G6BHXz4fmC; Thu, 23 May 2024 00:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716423866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wlA8156E7XW3A98b3pUQ3Ywtip+nNE0jAPi+1W9U+ys=; b=Ha4uQBc8dZZa0J9Kk52gOMXdEJCaySOJ0WpV+Gxp0XISC00B3B3dvzpGpN9Fuo2hz6cWvq 15Ge+WpLN4+aX6bP81FkAsr3LGJhA1h3GBFG+a3N6XNelB9ulHUBvXxN/aYRoxPmPgdg61 Ey0iDUALFAmu8PqG28rxHOV/WZIstfmduGyFrsBxifu/H1DU4RuAINWU/SD0zIqDlcpU8s 6HkA5A7+zuNUAWlAhv6RXv6wb2GYpxc3Rwz9e5e2azIST6Kt085t6G/vRyB2nNz/FRlCwQ Ljr8Q1xSCJ7SBvj1hz3xW53hPgiVArWM9GjTQ42tTb1ng+61OqDxaIh8syaK+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716423866; a=rsa-sha256; cv=none; b=QkQYALveBe9qHKcBj7AtuG1Y1Ic/TMXDwlviAaXKKvIWGvWo3CsuRefnIxbloNxxFQo54d HsYOxoWOniB2Wynm7PPvCKouoxd0ehZYJiM8/DXWTyGvkShhfRpClYvJlFDYTcRt7p2W7m gScTwNAb6oRP+IASsqmb63omrX2C85aRAlQY4UXatUFSnS/JxAqpLz3Ym7mozPl4FTiTw0 W8flJ8a7x9aKmFSuIU4BGJexmGGtuGOMRc849NuI1EEzIwU9FhOkcWc0dLG1yKylkerxv0 pl72iJeoSG3FAJv0aD1pb1CAXo7X8DYF9rmKDzpc8gEwaQgrZnHaikIV8xQ3kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716423866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wlA8156E7XW3A98b3pUQ3Ywtip+nNE0jAPi+1W9U+ys=; b=UtwSOFoouDygKe4y4YApDMRcqgl3OHAZz1QrkTTSRbMMJWrqGk1h1EW92/XheP62sCMig8 GF/vz40sFVnN+gMVrvVTiKi/MB8axmQ2Cgb4nr2lEwELLt57Us+piuhqUPeawgz5APrG4/ 1mELdD0qCmrDymIHPwdIm0ITq4E9qJKwMBCYrTuAhux+eYkV+y6tCEj7mTlphB5fSPMXMw vQItyYrPxvem0GuzbRP8RcOcM6Qjn0ZP9M5INRk9oOnWMwYYSPYD2MyQsDo/MINuWAADUN hkpSSg6aD6DawsY8HJnEaAORQ61DnxXvn+1ImcVZ+JCmT+fmdkFPFAD7qooYbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl87G5n8kzRC9; Thu, 23 May 2024 00:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N0OQhF020038; Thu, 23 May 2024 00:24:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N0OQng020035; Thu, 23 May 2024 00:24:26 GMT (envelope-from git) Date: Thu, 23 May 2024 00:24:26 GMT Message-Id: <202405230024.44N0OQng020035@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 1fb0a65ab2dd - stable/14 - snd_hda: Add patch for Asus UX331UAL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1fb0a65ab2dd7f6fb5dfcac2d78b6dcb6e3c6c9e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1fb0a65ab2dd7f6fb5dfcac2d78b6dcb6e3c6c9e commit 1fb0a65ab2dd7f6fb5dfcac2d78b6dcb6e3c6c9e Author: Lutz Bichler AuthorDate: 2024-05-22 22:19:50 +0000 Commit: Christos Margiolis CommitDate: 2024-05-23 00:24:15 +0000 snd_hda: Add patch for Asus UX331UAL PR: 242802 MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D45238 (cherry picked from commit 93ad59a251897431627345c287390ae134925a95) --- sys/dev/sound/pci/hda/hdaa_patches.c | 11 +++++++++++ sys/dev/sound/pci/hda/hdac.h | 1 + 2 files changed, 12 insertions(+) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index 9f3532562252..d425e3c0080b 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -359,6 +359,17 @@ hdac_pin_patch(struct hdaa_widget *w) patch_str = "as=4 seq=15"; break; } + } else if (id == HDA_CODEC_ALC294 && + subid == ASUS_UX331_SUBVENDOR) { + switch (nid) { + case 25: + /* XXX You are not expected to understand this. */ + config = 0x01a1103c; + break; + case 33: + patch_str = "as=1 seq=15"; + break; + } } else { /* * loop over hdaa_model_pin_patch diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 6a3314280a22..6b6bc58a4818 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -332,6 +332,7 @@ #define ASUS_G2K_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1339) #define ASUS_Z550SA_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x13b0) #define ASUS_A7T_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x13c2) +#define ASUS_UX331_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x14de) #define ASUS_UX31A_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1517) #define ASUS_GL553VE_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x15e0) #define ASUS_Z71V_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1964) From nobody Thu May 23 00:27:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl8BP5xD5z5LLL5; Thu, 23 May 2024 00:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl8BP5Nflz4gCq; Thu, 23 May 2024 00:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F7hzKJtyyaZp1+/ksN+a2TwrVnid7KEHWmGrb9sETs8=; b=ZpGF/W7hhcryoNyi21cG2glfja7w+ePaiaSoDaV8x/CSqbqt3wJRs4iA0RKnYHMIKas56z 74YuumAZeNX9mYuQENo0EDddDY9p697pciJH3B8RIgU3HZpVfMi1I40RjVHcbXVPDT8a5r JVuuT2awvH6JP3ZArdI9tytZINFcMsCC7RGAwGv3uwK442SlknbVSxucZADqmpbAJN7pFG ZXQDP4IuTrsYY6oibYCoGp/4BGIKURiyfmkfp6oG6zs9J3ZtgR1jQ95kpfPkcuPgP9nSsy vI9V1HyBrWgtd0CPclRuNfY3r12uC7cBgzXCQ2teIaScRt2X9+eaOKLv61fYOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716424029; a=rsa-sha256; cv=none; b=A3da8UaluXJSaGYlZ46HEZeb/1tPJ6pXtKmdrqUnWrWsescWJVGbcSeYhjavIKxMg6CN9Z PpfPY0Eq5FPmssduf77F+giOYKoWX5vNF7TrudVk0EImFNtLUDWILWWI0CLuA7Gp5rksbe yXD8uK4eiLnJCMBSAZJmTmuSSSpCjFgJuD2+ErORllKGpvbXdnSZZocrDqknFFeYtbTGgl cgYbyqJPbI8qi1BELFfe0IQOiLpOgFQxijN8y9whEXxPbJE09UiVKHi9JE54Lh8CN3CplF bga5U0516iZH10/PwtHZ2uC0z+JL0LLVOrIT8tz65zb6CXp2Un+43GKV4WgKrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F7hzKJtyyaZp1+/ksN+a2TwrVnid7KEHWmGrb9sETs8=; b=eI9s1/Ueh3IEvBOgOoA2eFP/zM+M0HiipGsYd70q22uB2hfl1wnf05LjRsZYB/fJrdEnSp l6jLR6ubu2daQFsHyGXhG6GlTlOxG95ajRLNR6HmUuvTAkqm74fh8//Z5j5xi1WvyyqAoh rjIyGesB4bmX0UJgX97X9sGCF/KfeW3ybZFDKvx1G0l/Fl6bAPaCbTP25yZWbhhMzzJzuH WjOn1NOJqIYAIVkQ2uZgdrx3uvq1wWS7xSkGScri1XOynOnbv1z9/X6A0aDGzdPacKz1BJ C5et0krihvqGRyb7d7fuKbtCHsDz6BcN9pUpdowW1WopTelEVN7F40sLLviFDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl8BP4zSmzQxX; Thu, 23 May 2024 00:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N0R96S020599; Thu, 23 May 2024 00:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N0R9Ib020596; Thu, 23 May 2024 00:27:09 GMT (envelope-from git) Date: Thu, 23 May 2024 00:27:09 GMT Message-Id: <202405230027.44N0R9Ib020596@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 625a622cc651 - stable/14 - vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 625a622cc6511e250470ee3f84a8553c7c734de6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=625a622cc6511e250470ee3f84a8553c7c734de6 commit 625a622cc6511e250470ee3f84a8553c7c734de6 Author: Konstantin Belousov AuthorDate: 2024-05-15 09:54:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-23 00:26:43 +0000 vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done PR: 265311 (cherry picked from commit 21ccdb4119afdfdfeaa80e9c8514171c65b35862) --- sys/kern/vfs_mount.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 9289c35e4f86..206618b4ac6b 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1314,7 +1314,7 @@ vfs_domount_update( void *bufp; struct mount *mp; int error, export_error, i, len, fsid_up_len; - uint64_t flag; + uint64_t flag, mnt_union; gid_t *grps; fsid_t *fsid_up; bool vfs_suser_failed; @@ -1396,6 +1396,7 @@ vfs_domount_update( vfs_deleteopt(*optlist, "fsid"); } + mnt_union = 0; MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { MNT_IUNLOCK(mp); @@ -1417,6 +1418,11 @@ vfs_domount_update( mp->mnt_flag |= MNT_UPDATE; } else { mp->mnt_flag &= ~MNT_UPDATEMASK; + if ((mp->mnt_flag & MNT_UNION) == 0 && + (fsflags & MNT_UNION) != 0) { + fsflags &= ~MNT_UNION; + mnt_union = MNT_UNION; + } mp->mnt_flag |= fsflags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE | MNT_SNAPSHOT | MNT_ROOTFS | MNT_UPDATEMASK | MNT_RDONLY); if ((mp->mnt_flag & MNT_ASYNC) == 0) @@ -1520,6 +1526,7 @@ vfs_domount_update( if (error == 0) { mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); + mp->mnt_flag |= mnt_union; } else { /* * If we fail, restore old mount flags. MNT_QUOTA is special, From nobody Thu May 23 00:27:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl8BQ6x1Tz5LLSD; Thu, 23 May 2024 00:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl8BQ6PlHz4g5L; Thu, 23 May 2024 00:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bAuUlS9a/YjjBgknCIN8gpwhUaDVbe6cURsiMjQDEN8=; b=yHdePxjf7kbN/yEDZEqBWBQBt6lliSEavyWjUCTcKlf4l74GVJy0ZJU7ZBvjhmVwluKmlc OqhCrx24Gmk59EcF1lM00056fDGzG+IE6doGqL5LzJCyNRyauesjlCZv2B+KtKdmy+1lmu 8TOlZVoCKkVpmaAqwvCjJj0GhDtohd5UF9lLeHGJPA06Gl0iLwb464PMYqMRLJej1lnHxU BTm8+E/jb5Ty/HgQ4qa0AaKYb7Ul3elhD+OFJ5JisMyMOL1J5ZN3s3DdyPFADf8LHSB9c8 jov2ugyUAW9zZ73sC1GEGkaNKNIdHHnNV3UTT+07lhGorm4fiCppRA9YERWJug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716424030; a=rsa-sha256; cv=none; b=QAxSe3DdpCZTMATfmH0gVA7gs9RVqUGYEkHCQgRPnkEUMShlFhjRCf2ntpQph43it8rN/D 4dxxf8yccdXEt0yt+UxJ3YrwqzCWLtMC1fTJyjWOToJoe+teya4mKzZDU7Zxxj9gVZ8ZNF qNwuVvkb42g5WdVpO7lCyEGGrgpmg77z0YEX5cdRheECMmu2WtqAkymNMmUSwWLESGBKFq mJtU9clGOhtzqPsnJrjCUToi6u8H5s0sLEBQDkFYmkDPrccCcuikiGQh96i6idkKfkTu93 sx1XeePfZYY5q461ktRv8bMfOlHDwzmxmTjfcful3xbs5lOQghIE3alhfkYYnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bAuUlS9a/YjjBgknCIN8gpwhUaDVbe6cURsiMjQDEN8=; b=cLzMX5nz9Fk9SYLA5SveEOJ/cEdduh/J1kOqbm707acEYcL8BT+Gr0yMJY1WgslEglPaVt GYDH0uSzqYTbSNFEuXA+caCgPjWedqo3Tr2C6Q6Yk6Ji+m2CUxzaICPyGW8+GD4P8YQ9GH JRQHgEARBxfGAFzjj+9RGjcNOlheAzd6+TaM42yHviSzn6MronMkBKUhG5Ig7gWRLvHbXf hV2RQl58LcMwA6z2/Xppp/CkrEadAk7qvFhUEKZYsKv0dge09y4+fhoE9ZHBOw/Nc9l+sX 07+hzOOGYCimDorXWN8BuJtfVJxNZEm8F2D39g6ctut5QbGb/+c7wQpw8Tk47g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl8BQ608kzRhT; Thu, 23 May 2024 00:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N0RA4v020647; Thu, 23 May 2024 00:27:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N0RAZr020644; Thu, 23 May 2024 00:27:10 GMT (envelope-from git) Date: Thu, 23 May 2024 00:27:10 GMT Message-Id: <202405230027.44N0RAZr020644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: afb68a177420 - stable/14 - SysV SHM: move SHMSEG constants to sys/shm.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: afb68a1774206059cf31cbae8269c9453669febd Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=afb68a1774206059cf31cbae8269c9453669febd commit afb68a1774206059cf31cbae8269c9453669febd Author: Konstantin Belousov AuthorDate: 2024-05-16 15:24:00 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-23 00:26:44 +0000 SysV SHM: move SHMSEG constants to sys/shm.h (cherry picked from commit 53725168e1b631be0e60f888ba5e63e140b57766) --- sys/kern/sysv_shm.c | 4 ---- sys/sys/shm.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 2529a9eeb1a7..8f67cb63f33c 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -109,10 +109,6 @@ FEATURE(sysv_shm, "System V shared memory segments support"); static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments"); -#define SHMSEG_FREE 0x0200 -#define SHMSEG_REMOVED 0x0400 -#define SHMSEG_ALLOCATED 0x0800 - static int shm_last_free, shm_nused, shmalloced; vm_size_t shm_committed; static struct shmid_kernel *shmsegs; diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 0b5cba0120e5..9c6dad5d43cc 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -152,6 +152,10 @@ struct vmspace; extern struct shminfo shminfo; +#define SHMSEG_FREE 0x0200 +#define SHMSEG_REMOVED 0x0400 +#define SHMSEG_ALLOCATED 0x0800 + void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); From nobody Thu May 23 00:27:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl8BS0g0gz5LLSF; Thu, 23 May 2024 00:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl8BS05GRz4gFq; Thu, 23 May 2024 00:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7RUFn7EQI4JlcIAwPBKCEN8Imr04m233Qpv3OzMEnBA=; b=L3KGa+n6nvHv6P29Gdvae0osgmZy19kgoNqkQ5J4KwfIkzqAkisdRkfFQMzYH/mGra9UL0 fCXUdyZ77EDLI9ntbb1Ia8C8xSlX9I6lOAMRMA7w8rljIbLxVuNmG/isMvP0f147MIdKpo PesvMnE6pf0lbXwO7pRtYVW9yi4Huh9eC09EqLAeWzQYCr3FaoHb2yjffI78msK9nt7TtR sLBt6BZcFzWF8HP1fGXFiEaGsR1IeGqaTbYap3/MfMa9PhF7nG0XMhvLyRbjz/SHECNFeB HbO5qJhs7bOM9YN9slEcQTNP02MxgRV60eAV02A8oBvb2QOrpSqdecaagV36BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716424032; a=rsa-sha256; cv=none; b=QzU5INBMT6CIqr+mwhvZ4ef5LxzZZqThz+5IKyDVlzc+sFYh7ZFLAMtuZC8FfDpD4IDw9J 2j0655LzRUOqiDA4EAQNcR6J4qgGsOLTveOusa7lozATIMIedS9XiZYmSYvZNQA/ljLPAc qg43mUdXX5Cs1+3x1sJgqPoE1WmF1ZJ9yWDJZWUJ4CM3JlYQBlVP2ST3HPUAzFeYNzCYB+ 9PPyFnVNyW21Ye8q3sjsN6XTloNRHmeYhI7acY3u+ExdFM+NaV5fgNJqshUcwPaDq3/wHq vYJxyBdvbSXwHZeo/M8GBc8C9TuABWDaQZIfS2PMeNAPB2PIwhgOTm6vYE579w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7RUFn7EQI4JlcIAwPBKCEN8Imr04m233Qpv3OzMEnBA=; b=nvgxULW7xw0MBNq8dyh5F8zbjzUK6GNQAva3FmMaRELUR2SUP0D9xFAhEpy9Ga2lWbpq5p Ibo9JflTBF403lDMcp3CspiDbOvHpHC75m4ZwpPhSGqn6nhDlrPiA72qENK5CSmF0L4nKf AMtH4oXq1hesihlQ48OWvwacJ5Umk+oFvCH0GQRyS5YNG0MNXAys4sU+2PySFQwM2Hk3Sl IhJ8qJRecxHO1nki41RHYWO/nq30VOx2MTlJNbwm22Z5jSQ7qPY33A8tdTYGQj6V+Au3HG 9dr+WCjcM2vz9C0/c7HFMMlkPzuVtZ6Csq98J1VaedpZlB3m9E3DnE0Hc/RpQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl8BR6nGNzS64; Thu, 23 May 2024 00:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N0RBHh020701; Thu, 23 May 2024 00:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N0RBoO020698; Thu, 23 May 2024 00:27:11 GMT (envelope-from git) Date: Thu, 23 May 2024 00:27:11 GMT Message-Id: <202405230027.44N0RBoO020698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b76674a73988 - stable/14 - SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b76674a73988eb708bdb53e11c5c54e8488b33a1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b76674a73988eb708bdb53e11c5c54e8488b33a1 commit b76674a73988eb708bdb53e11c5c54e8488b33a1 Author: Konstantin Belousov AuthorDate: 2024-05-13 17:17:47 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-23 00:26:44 +0000 SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information PR: 278949 (cherry picked from commit 87a156527563d0728bff355093e26943da3d7fad) --- sys/kern/sysv_msg.c | 34 ++++++++++++++++++++++++++++++++++ sys/kern/sysv_sem.c | 33 +++++++++++++++++++++++++++++++++ sys/kern/sysv_shm.c | 36 ++++++++++++++++++++++++++++++++++++ sys/sys/msg.h | 3 +++ sys/sys/sem.h | 3 +++ sys/sys/shm.h | 2 ++ 6 files changed, 111 insertions(+) diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 078151627dfc..0620fbd175af 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1477,6 +1477,40 @@ sysctl_msqids(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_msqids(struct thread *td, struct msqid_kernel **res, size_t *sz) +{ + struct msqid_kernel *pmsqk; + struct prison *pr, *rpr; + int i, mi; + + *sz = mi = msginfo.msgmni; + if (res == NULL) + return (0); + + pr = td->td_ucred->cr_prison; + rpr = msg_find_prison(td->td_ucred); + *res = malloc(sizeof(struct msqid_kernel) * mi, M_TEMP, M_WAITOK); + for (i = 0; i < mi; i++) { + pmsqk = &(*res)[i]; + mtx_lock(&msq_mtx); + if (msqids[i].u.msg_qbytes == 0 || rpr == NULL || + msq_prison_cansee(rpr, &msqids[i]) != 0) + bzero(pmsqk, sizeof(*pmsqk)); + else { + *pmsqk = msqids[i]; + if (pmsqk->cred->cr_prison != pr) + pmsqk->u.msg_perm.key = IPC_PRIVATE; + } + mtx_unlock(&msq_mtx); + pmsqk->u.__msg_first = NULL; + pmsqk->u.__msg_last = NULL; + pmsqk->label = NULL; + pmsqk->cred = NULL; + } + return (0); +} + SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, 0, "Maximum message size"); SYSCTL_INT(_kern_ipc, OID_AUTO, msgmni, CTLFLAG_RDTUN, &msginfo.msgmni, 0, diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 6a668906ebd0..d8c10f837105 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1574,6 +1574,39 @@ sysctl_sema(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_sema(struct thread *td, struct semid_kernel **res, size_t *sz) +{ + struct prison *pr, *rpr; + struct semid_kernel *psemak; + int i, mi; + + *sz = mi = seminfo.semmni; + if (res == NULL) + return (0); + + pr = td->td_ucred->cr_prison; + rpr = sem_find_prison(td->td_ucred); + *res = malloc(sizeof(struct semid_kernel) * mi, M_TEMP, M_WAITOK); + for (i = 0; i < mi; i++) { + psemak = &(*res)[i]; + mtx_lock(&sema_mtx[i]); + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) == 0 || + rpr == NULL || sem_prison_cansee(rpr, &sema[i]) != 0) + bzero(psemak, sizeof(*psemak)); + else { + *psemak = sema[i]; + if (psemak->cred->cr_prison != pr) + psemak->u.sem_perm.key = IPC_PRIVATE; + } + mtx_unlock(&sema_mtx[i]); + psemak->u.__sem_base = NULL; + psemak->label = NULL; + psemak->cred = NULL; + } + return (0); +} + static int sem_prison_check(void *obj, void *data) { diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 8f67cb63f33c..835b44ab332a 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1089,6 +1089,42 @@ sysctl_shmsegs(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_shmsegs(struct thread *td, struct shmid_kernel **res, size_t *sz) +{ + struct shmid_kernel *pshmseg; + struct prison *pr, *rpr; + int i; + + SYSVSHM_LOCK(); + *sz = shmalloced; + if (res == NULL) + goto out; + + pr = td->td_ucred->cr_prison; + rpr = shm_find_prison(td->td_ucred); + *res = malloc(sizeof(struct shmid_kernel) * shmalloced, M_TEMP, + M_WAITOK); + for (i = 0; i < shmalloced; i++) { + pshmseg = &(*res)[i]; + if ((shmsegs[i].u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || + rpr == NULL || shm_prison_cansee(rpr, &shmsegs[i]) != 0) { + bzero(pshmseg, sizeof(*pshmseg)); + pshmseg->u.shm_perm.mode = SHMSEG_FREE; + } else { + *pshmseg = shmsegs[i]; + if (pshmseg->cred->cr_prison != pr) + pshmseg->u.shm_perm.key = IPC_PRIVATE; + } + pshmseg->object = NULL; + pshmseg->label = NULL; + pshmseg->cred = NULL; + } +out: + SYSVSHM_UNLOCK(); + return (0); +} + static int shm_prison_check(void *obj, void *data) { diff --git a/sys/sys/msg.h b/sys/sys/msg.h index 29fb8c2106b5..d8c950e66c47 100644 --- a/sys/sys/msg.h +++ b/sys/sys/msg.h @@ -152,6 +152,9 @@ struct msqid_kernel { #ifdef _KERNEL extern struct msginfo msginfo; +int kern_get_msqids(struct thread *td, struct msqid_kernel **res, + size_t *sz); + #else /* _KERNEL */ __BEGIN_DECLS diff --git a/sys/sys/sem.h b/sys/sys/sem.h index 05b69f64cd05..5634f4b0cfcc 100644 --- a/sys/sys/sem.h +++ b/sys/sys/sem.h @@ -142,6 +142,9 @@ extern struct seminfo seminfo; */ void semexit(struct proc *p); +int kern_get_sema(struct thread *td, struct semid_kernel **res, + size_t *sz); + #else /* !_KERNEL */ __BEGIN_DECLS diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 9c6dad5d43cc..a1aa6ca54c60 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -158,6 +158,8 @@ extern struct shminfo shminfo; void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); +int kern_get_shmsegs(struct thread *td, struct shmid_kernel **res, + size_t *sz); #else /* !_KERNEL */ From nobody Thu May 23 00:27:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl8BT2yngz5LLHj; Thu, 23 May 2024 00:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl8BT19z9z4g88; Thu, 23 May 2024 00:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+wLPOLoaU5fr8olViyrYOaD5wprjU4nb0eTUGE3NGfA=; b=FpOfsWdLl+/AQdCAaWlzE8I3LNT0iBdKhWwvVqgKPK5+uZ8sTgPQ9BRDGitTPHypWyS1FZ S2tZhAqF3UBoLq97p+avNGpogBu1LZ7LF8YbULIze26kgQoc6+a68S9ZtLT5s9YOSYfs2I 3ATxvMSIhbY6Hx0iczRdcyx4LQCTaGR87vxLXtOqC7LSbW3VA0ETY55ctX5wa59vaDa0LI dCHOa0uKtyzUbc+oNxqBrK30/1qlZDbK8D9yQo3AZh0THSEH+63DGcAhovk2wX9gfg6LAy kI+su3JgXvaFjLJJUmF+XdwxnA3QT0GC6dF5WmRDadL0zmHLhn9di+AElpdgfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716424033; a=rsa-sha256; cv=none; b=EohFJb8BHxH2xHPLvN/GBfjMiYIXH+tQ71rQx0cn6VPg7aktZSS3R1pAXGoUKhCyDPRcyf e7CP4CKuHj8khN8VXPOE2OHRtIG+JK9aha7GeeIU1xoSV2SFYgNwHADDCGQoZB5pVpQwZk HKY90PAgRrNQlmDBAlQWq6XjqBScem6SVdipkl4fGoisBujYDsI4A/K6R3v1XkJ8JYnp3r IHk8ZI+qESZwefEP0pZK28pD4hW5O2u9hWFQVeYGfV9qnoVKWpLy6qOIhdF8lP6PKTTk5r QyvuJryRNu+oMVdyBmipynf74/U7KgWuMampqcmsAQzZHy2FL23H5I+e4vS4yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+wLPOLoaU5fr8olViyrYOaD5wprjU4nb0eTUGE3NGfA=; b=BmiMhSq3y/QLgkfVMu2vojzYUZ9SN5zG/AUXhdWS0Jr2DsuRwGmAcNd5QYRq6OECmUcjiK LHApwvnwfwZvdVg1wPF6AH3W1w6xYWojASfZ5rfAwr9Z1bEPgCN8eVPVa+glcNb4Uj3Ddh rIlqaIr4cZTc7a2QQRLXtMN1yA5IHtyya3VjZkCHSAcAzQRnnG6v5O0ofZQRwJqfkvW2Kh EfFhRNCJKLdJjyR0+ZxZqf7t26c8QrmZ1ii8KsbrG/173faJTb38kQnjlA+td5ZWAw8bSD dgO9b9aeoqHgtzEfNc9Lp1jGNZ+/wI68ug+n+8KAs1+X5MrRWt+vnUxZR4sV/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 4Vl8BT0mCQzRdc; Thu, 23 May 2024 00:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N0RDG4020755; Thu, 23 May 2024 00:27:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N0RDdc020752; Thu, 23 May 2024 00:27:13 GMT (envelope-from git) Date: Thu, 23 May 2024 00:27:13 GMT Message-Id: <202405230027.44N0RDdc020752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1449d298daaa - stable/14 - acpidump IVRS table format: change 'IOMMUId' into 'IOMMU DeviceId' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1449d298daaa955153df7e0b67d9b38b17cae4dd Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1449d298daaa955153df7e0b67d9b38b17cae4dd commit 1449d298daaa955153df7e0b67d9b38b17cae4dd Author: Konstantin Belousov AuthorDate: 2024-05-19 23:01:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-23 00:26:44 +0000 acpidump IVRS table format: change 'IOMMUId' into 'IOMMU DeviceId' (cherry picked from commit 6cba29c09a966be33b0958f912a7c03d92b926b8) --- usr.sbin/acpi/acpidump/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index adef488065f6..6f8effe58fbd 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1504,7 +1504,7 @@ acpi_handle_dmar(ACPI_TABLE_HEADER *sdp) static void acpi_handle_ivrs_ivhd_header(ACPI_IVRS_HEADER *addr) { - printf("\n\tIVHD Type=%#x IOMMUId=%x\n\tFlags=", + printf("\n\tIVHD Type=%#x IOMMU DeviceId=%#06x\n\tFlags=", addr->Type, addr->DeviceId); #define PRINTFLAG(flag, name) printflag(addr->Flags, flag, #name) PRINTFLAG(ACPI_IVHD_TT_ENABLE, HtTunEn); From nobody Thu May 23 00:28:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl8CS2GYdz5LLLW; Thu, 23 May 2024 00:28: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl8CS0FK3z4hV5; Thu, 23 May 2024 00:28:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aQJ/aTp8Zkbx3VI7+h83e9vZLMAPKMKZiZrP7p7rlfI=; b=iMMVpmVFV6gvhdq6lHuRjNG7jcL342AF5v+lZWB6RumvZOPIgpXLMDs4rbB3k3n+FfptC7 qMlDjW89LfQGDzoiJ2+GsyDtn2ja8AA1kkYm73z12tiLn/1/E9YB6ILvKjD8hmI0ECDJVc NRp8MdRnar9tKWUU0gTW2jvlG3OoC00dOx+o6bNFkO2GHjcrjcPSVjF7Ro6mpmh+aSd1IC IsUatpYHFkc/XivdlJoOhVvyfHf4s1qYC7Oun81YDDpg3DvWzEX5mxpNq7MMYTtOkXVjuy xYI4jTeEtNsvoBevzeB7xATejDKHRXq7bBAAlx0bW9Aj3/MQCfeuXF6ryV7oNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716424084; a=rsa-sha256; cv=none; b=Jr//tN+q2ArQh4cRPc6FG/LJ1Gk5y/JHJUjxaBnzXOrUq5D/EsQ2ktB0ZDC0phf5A1ee/c BwrUvW0qYzlz3Y3ketTpO4Nc1bmThsG4F+UBKixqaQL2bcdDMlTDWHflX0Dzegr3eKikdO vrFpOIdi7eXwZ972wlznZlhpsqh2jQBAeNcyoI+XH6mjrjf+dxqtKMl5DtyGGXoPPqSnRJ Cu5j4FdVEzBTwFE34OJ5L8hxM1wndKy1QxjzVL8k/O/tvhP7+blpNUXixjpV9V/Azm6FJ2 QEn1EBOHtSXNRfQt/S1r4GhWz+oyrrW2LdR9RG8RI2231WvJViKXIfWqBzXwjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aQJ/aTp8Zkbx3VI7+h83e9vZLMAPKMKZiZrP7p7rlfI=; b=C6KQS6D2GdMDYw9ZeoKbztk8gi5UDB56h2HZmD7WTyc40hM11vfRSXIP1NUEG/+meMebRj iPrvadnhKp+jIC88jSZWObscs9KGis5RnXzHzNIik1zwNk+Ix7PJHERGHRUS9RoDU1Y2Og us4ZI5TjGlv/kTfHGhLi3f053BSId2ZSmItsLwd9603Yc1272vWHprYIOfyA5esrFx5fEe FuyKti+bfe03fUg+CKmCt/Ne4XLInS9+8BSMCmRa6zt8bd5fcFp/b6kwY51x7u8Be3Nihx q6HK8g5Ke9ficU5mDYjYA1ypI8Bz6tFTWytlvgCP0EFdtKa/1yE3WmU5zBtWaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl8CR6zT9zRhZ; Thu, 23 May 2024 00:28:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N0S3S8021079; Thu, 23 May 2024 00:28:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N0S3TX021077; Thu, 23 May 2024 00:28:03 GMT (envelope-from git) Date: Thu, 23 May 2024 00:28:03 GMT Message-Id: <202405230028.44N0S3TX021077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2a2f2f59132a - stable/13 - vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a2f2f59132ad365203c5deb8ed16202a78585c1 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2a2f2f59132ad365203c5deb8ed16202a78585c1 commit 2a2f2f59132ad365203c5deb8ed16202a78585c1 Author: Konstantin Belousov AuthorDate: 2024-05-15 09:54:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-22 23:47:23 +0000 vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done PR: 265311 (cherry picked from commit 21ccdb4119afdfdfeaa80e9c8514171c65b35862) --- sys/kern/vfs_mount.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 68b22d1a77a8..8cee38c7ec2e 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1155,7 +1155,7 @@ vfs_domount_update( void *bufp; struct mount *mp; int error, export_error, i, len, fsid_up_len; - uint64_t flag; + uint64_t flag, mnt_union; gid_t *grps; fsid_t *fsid_up; bool vfs_suser_failed; @@ -1237,6 +1237,7 @@ vfs_domount_update( vfs_deleteopt(*optlist, "fsid"); } + mnt_union = 0; MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { MNT_IUNLOCK(mp); @@ -1258,6 +1259,11 @@ vfs_domount_update( mp->mnt_flag |= MNT_UPDATE; } else { mp->mnt_flag &= ~MNT_UPDATEMASK; + if ((mp->mnt_flag & MNT_UNION) == 0 && + (fsflags & MNT_UNION) != 0) { + fsflags &= ~MNT_UNION; + mnt_union = MNT_UNION; + } mp->mnt_flag |= fsflags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE | MNT_SNAPSHOT | MNT_ROOTFS | MNT_UPDATEMASK | MNT_RDONLY); if ((mp->mnt_flag & MNT_ASYNC) == 0) @@ -1361,6 +1367,7 @@ vfs_domount_update( if (error == 0) { mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); + mp->mnt_flag |= mnt_union; } else { /* * If we fail, restore old mount flags. MNT_QUOTA is special, From nobody Thu May 23 00:28:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl8CW4689z5LLQj; Thu, 23 May 2024 00:28: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl8CV2NvLz4hB3; Thu, 23 May 2024 00:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z1VvnXNg9ZoSDbTBJrf/JxKEzt3hIeC0vaunt2yhKi0=; b=yQhtodsJby3h8V9J2nso6FN7A28A3KTwuGywcjQP4qUBKBOBYxygWmYM+PvG8p3UMzuFJl mDAq/Hso0qMUkUAid23ZwphGWvgESZohpCOZG7Ux2Z5zHyWIoCG37jPiontcd0Ehv5b90/ OKBt9LCfnZAY0Gu15DENzFRJ1y+UIIYSrq+cwEG99MRG3WkgvtYVo+/X50TNrsPm5FPT5Z oUshNIKSEuNVbBdlFz+KOlBi/7GkaUhzHb8Un7HvERPIZIUnGobFG2FAkjwsqoyod2qYnC CPIwQXydqnbra07MqjZKUFmhpKGktcVZAm6hzIhW3/DjRBA3hIlHITDTg5mKvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716424086; a=rsa-sha256; cv=none; b=m3BQmPeWWtyfwEfUYnY6V4BFTLXThcHeepitsOo9NZTSrXDcfG20YP3NHmt7mMqE9u+dNq 0BVEUKj4x3ziNJt/e6VigsXzjUtcqyi0/0SYTZVd4ZaxdX7gg4OuCqyIfgnQzvr9CPkpu2 JR8E1rO8feI9wSvHOBMSZqwWPCSFv3PacdaUM/4aqeSvq/2+ePM9sxkI8UqH7geDNQOGTr u6BRClgwprDg3aYOtYRFq5pMKzsk3JZKJmcI09WjBnPmqCNUpln4X/Ei0EJgpW7QTclLAD iU/zgu4T+PzgWoq3Chtpb38XVtIjvSZJa1KtNooPejHrhvbFl/TNwa1ngiMaPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z1VvnXNg9ZoSDbTBJrf/JxKEzt3hIeC0vaunt2yhKi0=; b=P6N9c/Y3hQjYxx26Nvvy2YvKrgO9GrnRQCq9bbJsL28Sl61W86JsQf9um4ggiqeeXmd9ze tNVWVkaZzJHBqlIhX9UvztAV67Xaqm6lbWDSAiKlQdVZ+unYQ5dnk4PCtyYDdGCFHktr8m rP89fn7PYlrN3nXb+iVmVv79zm51NIwff+XHfQElM7+Ju/wozor7mnE9/tHcsisxtnGGs/ J/mxWxMmxotNNvAxyJAh4M/X1UprjixVyTYbF37qCvmxI3qnWM07oPJ7LLAaX9drmOm5HT 19+f3M1P5SdEpiAR81Uq8F9tn0MVdid+FSW+XEx32yTgmz4+qCIm0UT+gINqow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl8CV1yqHzRCD; Thu, 23 May 2024 00:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N0S6Lt021188; Thu, 23 May 2024 00:28:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N0S6gC021185; Thu, 23 May 2024 00:28:06 GMT (envelope-from git) Date: Thu, 23 May 2024 00:28:06 GMT Message-Id: <202405230028.44N0S6gC021185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 07b7dec1fe42 - stable/13 - SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07b7dec1fe4296cdf470013087180a80a0d4a2cf Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=07b7dec1fe4296cdf470013087180a80a0d4a2cf commit 07b7dec1fe4296cdf470013087180a80a0d4a2cf Author: Konstantin Belousov AuthorDate: 2024-05-13 17:17:47 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-22 23:47:23 +0000 SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information PR: 278949 (cherry picked from commit 87a156527563d0728bff355093e26943da3d7fad) --- sys/kern/sysv_msg.c | 34 ++++++++++++++++++++++++++++++++++ sys/kern/sysv_sem.c | 33 +++++++++++++++++++++++++++++++++ sys/kern/sysv_shm.c | 36 ++++++++++++++++++++++++++++++++++++ sys/sys/msg.h | 3 +++ sys/sys/sem.h | 3 +++ sys/sys/shm.h | 2 ++ 6 files changed, 111 insertions(+) diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 5f08a867f5a9..1b73634eea24 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1477,6 +1477,40 @@ sysctl_msqids(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_msqids(struct thread *td, struct msqid_kernel **res, size_t *sz) +{ + struct msqid_kernel *pmsqk; + struct prison *pr, *rpr; + int i, mi; + + *sz = mi = msginfo.msgmni; + if (res == NULL) + return (0); + + pr = td->td_ucred->cr_prison; + rpr = msg_find_prison(td->td_ucred); + *res = malloc(sizeof(struct msqid_kernel) * mi, M_TEMP, M_WAITOK); + for (i = 0; i < mi; i++) { + pmsqk = &(*res)[i]; + mtx_lock(&msq_mtx); + if (msqids[i].u.msg_qbytes == 0 || rpr == NULL || + msq_prison_cansee(rpr, &msqids[i]) != 0) + bzero(pmsqk, sizeof(*pmsqk)); + else { + *pmsqk = msqids[i]; + if (pmsqk->cred->cr_prison != pr) + pmsqk->u.msg_perm.key = IPC_PRIVATE; + } + mtx_unlock(&msq_mtx); + pmsqk->u.__msg_first = NULL; + pmsqk->u.__msg_last = NULL; + pmsqk->label = NULL; + pmsqk->cred = NULL; + } + return (0); +} + SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, 0, "Maximum message size"); SYSCTL_INT(_kern_ipc, OID_AUTO, msgmni, CTLFLAG_RDTUN, &msginfo.msgmni, 0, diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 381c1ac4f71b..8a10c1ed90ce 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1574,6 +1574,39 @@ sysctl_sema(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_sema(struct thread *td, struct semid_kernel **res, size_t *sz) +{ + struct prison *pr, *rpr; + struct semid_kernel *psemak; + int i, mi; + + *sz = mi = seminfo.semmni; + if (res == NULL) + return (0); + + pr = td->td_ucred->cr_prison; + rpr = sem_find_prison(td->td_ucred); + *res = malloc(sizeof(struct semid_kernel) * mi, M_TEMP, M_WAITOK); + for (i = 0; i < mi; i++) { + psemak = &(*res)[i]; + mtx_lock(&sema_mtx[i]); + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) == 0 || + rpr == NULL || sem_prison_cansee(rpr, &sema[i]) != 0) + bzero(psemak, sizeof(*psemak)); + else { + *psemak = sema[i]; + if (psemak->cred->cr_prison != pr) + psemak->u.sem_perm.key = IPC_PRIVATE; + } + mtx_unlock(&sema_mtx[i]); + psemak->u.__sem_base = NULL; + psemak->label = NULL; + psemak->cred = NULL; + } + return (0); +} + static int sem_prison_check(void *obj, void *data) { diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 1da95b86c9ba..7d38747b585d 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1089,6 +1089,42 @@ sysctl_shmsegs(SYSCTL_HANDLER_ARGS) return (error); } +int +kern_get_shmsegs(struct thread *td, struct shmid_kernel **res, size_t *sz) +{ + struct shmid_kernel *pshmseg; + struct prison *pr, *rpr; + int i; + + SYSVSHM_LOCK(); + *sz = shmalloced; + if (res == NULL) + goto out; + + pr = td->td_ucred->cr_prison; + rpr = shm_find_prison(td->td_ucred); + *res = malloc(sizeof(struct shmid_kernel) * shmalloced, M_TEMP, + M_WAITOK); + for (i = 0; i < shmalloced; i++) { + pshmseg = &(*res)[i]; + if ((shmsegs[i].u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || + rpr == NULL || shm_prison_cansee(rpr, &shmsegs[i]) != 0) { + bzero(pshmseg, sizeof(*pshmseg)); + pshmseg->u.shm_perm.mode = SHMSEG_FREE; + } else { + *pshmseg = shmsegs[i]; + if (pshmseg->cred->cr_prison != pr) + pshmseg->u.shm_perm.key = IPC_PRIVATE; + } + pshmseg->object = NULL; + pshmseg->label = NULL; + pshmseg->cred = NULL; + } +out: + SYSVSHM_UNLOCK(); + return (0); +} + static int shm_prison_check(void *obj, void *data) { diff --git a/sys/sys/msg.h b/sys/sys/msg.h index 29fb8c2106b5..d8c950e66c47 100644 --- a/sys/sys/msg.h +++ b/sys/sys/msg.h @@ -152,6 +152,9 @@ struct msqid_kernel { #ifdef _KERNEL extern struct msginfo msginfo; +int kern_get_msqids(struct thread *td, struct msqid_kernel **res, + size_t *sz); + #else /* _KERNEL */ __BEGIN_DECLS diff --git a/sys/sys/sem.h b/sys/sys/sem.h index 05b69f64cd05..5634f4b0cfcc 100644 --- a/sys/sys/sem.h +++ b/sys/sys/sem.h @@ -142,6 +142,9 @@ extern struct seminfo seminfo; */ void semexit(struct proc *p); +int kern_get_sema(struct thread *td, struct semid_kernel **res, + size_t *sz); + #else /* !_KERNEL */ __BEGIN_DECLS diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 9c6dad5d43cc..a1aa6ca54c60 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -158,6 +158,8 @@ extern struct shminfo shminfo; void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); +int kern_get_shmsegs(struct thread *td, struct shmid_kernel **res, + size_t *sz); #else /* !_KERNEL */ From nobody Thu May 23 00:28:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vl8CT4NPqz5LL6F; Thu, 23 May 2024 00:28: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl8CT1KBTz4hGh; Thu, 23 May 2024 00:28:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q7tJyXyg1msmZZAAw1Aiw6hkWAAnDpIbP78zNMZVKsw=; b=hXYM7+4QuVd3AfSLOZc4GbhS8H0FnuvZAngg9S49lcF9ln/w/BYJviMXNx5ppKyVxYkZXG ib7vOzeFeg2Cnq+tAzll39ZiiNtagGlvVVm5no6ZzOjnNUM7iPlE0PXzhUAJhmrGHzkB4z oeK9FBUOs6gPjPNfQTYytnakAakhf01ik6nGn2ROKXFhMRaHrXUpbODQ1ustiQssT1w0II RTZ3p/aN/wEd6NzrJzqEzoEQz4roD6JNSe33U9pDD1SznClmo+2TkfJ7P2GOwd5J4WYxmv XejAOToa/rojwtfNrWugqaS8lizbmOpDrVRX+e5JSm9uE5kLj+6uuJ0ZUunFxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716424085; a=rsa-sha256; cv=none; b=kofcFHv7RHrr7rZ42x5LGW1lyGJBI0IJcsvDG8gRZUlW9yDDmjHVnfW6b81X5QJS6wjDcd 9GQSkhEJcCLj51kaKg9LwVJdQClyWUN8hSDh6wnykqUKtG7gT3ORRVg9s/ZgvsX6Hj/w6Z t42lm+05QREPX2/c7TqlajKimXK1Ma6MgsZPGlm+UzNgTz/gA3Ta1d1JT4/P9Bro6wgbtf nCqamzzyZevWysr/eP4+bApv+iT2lXE601iY/T+ocZZToxymlkK7sQrYyYVWcbmS5Pgv7E bFVdJenwav7tmnBhzHjwG+BbTYowP45jN9XKRzpqvHHqAuch2yauwKPihCmSuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716424085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q7tJyXyg1msmZZAAw1Aiw6hkWAAnDpIbP78zNMZVKsw=; b=d4Fy9D62mnm/QTKI6K+x0ot2A6VZ85w4znKClx5MhP3toooujIyTvm/M9mZLvHzNnugdYt CwvLTvl2c/2PH0wchZjyXeB4yy6B0QD8/YyuO0OhgPJnXwHL6ftcZL99vpJiUNsRFr74xz OfWuQpx4gfzSJav05ZWT1hUq0GD9DLo1PhwwAKB88MY0WwU3u6N9yJ2JQDQwwngA+RvSHQ b4C1hcWWV4PIvA8lnv6ndfMeTYu3e2UwsDc0uodX8JcAdJZzNEEmOuatQ0YIJzckqmNIY1 z4afhAbpkGBtg66uNRgOAw5wqGxiz7opVazxbEMCUYc0eKYuzVSt7wXnPvWerw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vl8CT0tCTzQxb; Thu, 23 May 2024 00:28:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N0S51f021131; Thu, 23 May 2024 00:28:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N0S5l3021128; Thu, 23 May 2024 00:28:05 GMT (envelope-from git) Date: Thu, 23 May 2024 00:28:05 GMT Message-Id: <202405230028.44N0S5l3021128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 454ebd0be5ee - stable/13 - SysV SHM: move SHMSEG constants to sys/shm.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 454ebd0be5ee35e804759c6fff0144f08f75f538 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=454ebd0be5ee35e804759c6fff0144f08f75f538 commit 454ebd0be5ee35e804759c6fff0144f08f75f538 Author: Konstantin Belousov AuthorDate: 2024-05-16 15:24:00 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-22 23:47:23 +0000 SysV SHM: move SHMSEG constants to sys/shm.h (cherry picked from commit 53725168e1b631be0e60f888ba5e63e140b57766) --- sys/kern/sysv_shm.c | 4 ---- sys/sys/shm.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 91ee7c557136..1da95b86c9ba 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -109,10 +109,6 @@ FEATURE(sysv_shm, "System V shared memory segments support"); static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments"); -#define SHMSEG_FREE 0x0200 -#define SHMSEG_REMOVED 0x0400 -#define SHMSEG_ALLOCATED 0x0800 - static int shm_last_free, shm_nused, shmalloced; vm_size_t shm_committed; static struct shmid_kernel *shmsegs; diff --git a/sys/sys/shm.h b/sys/sys/shm.h index 0b5cba0120e5..9c6dad5d43cc 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -152,6 +152,10 @@ struct vmspace; extern struct shminfo shminfo; +#define SHMSEG_FREE 0x0200 +#define SHMSEG_REMOVED 0x0400 +#define SHMSEG_ALLOCATED 0x0800 + void shmexit(struct vmspace *); void shmfork(struct proc *, struct proc *); From nobody Thu May 23 02:41:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlC9t3JFLz5LZ2j; Thu, 23 May 2024 02:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlC9t1xf1z42PW; Thu, 23 May 2024 02:41:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zeCGx0iJUrR8TcVh23WiIwaS5QaQUwCaV29dRiqEKHk=; b=RzApUkwXi50zLgcy7JZYSDqKLFBtnyPrl0cWoCHN9l5tZICfy7N6rgaYTR69l0omvX6Nvv X4wOhz9OD5HEWbNn4zRv8QrEQZu6UxPDRGspvmoEm6EhwI8IqpXjpFYUAP8sO+vYwbTHoI X6L8+Hl8BETN+iE5hLgi77h7GgMC2T7oi2txIRRRV9vZqFaz1HzHHjozJwIdhTwwqLLpby gtOn7dfUJrWkJmqx5HXXaiWn7f4iDohO9qj6UXyaPwKA5VwHPc9apQ71jOIGce47aRVAgQ WRPqcHVH/9XExhsZZf3pgbgJC5pU6NAFY6r9uqhs4Cw+5TR3nJYtJN1VUEKtcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432114; a=rsa-sha256; cv=none; b=DTWcScmFdxStzWNZF9aAIuK+wfKg1mFN+I8gqlFsiBVO5gfIkXsd52aQtXeWn3JVyemZTw FutZSi31SgiLHYqYafFzW6lgnldypWN/o4O06PW0XhtZNfJ4JcF9qYvMmhLj8hDUGFkNh3 4wccNFzb4mOq2sgyQcwFSBPA9yH4OUF0OS8ULuT1KFye3sljr1djkiYSu6nIOM7CFUHkdn iboBQp7xRXJZjiYRjGkxRspQNaWUyDDNtZH9OL9EnqYpdVv7N8NkoAjgMTpLrakqfQJJk+ OfdpnCcHxgFfyGskme4x2W/8dw3AW/kRIMHWnljHbDVvQhqvs/JH4YtDf1p+8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zeCGx0iJUrR8TcVh23WiIwaS5QaQUwCaV29dRiqEKHk=; b=kgbepy9Ie0hKyXYsWsNHkCY/ycZHfDJj3VxZjMOLUii46Iw5Fo/zO1dmQ64i198QN05v2X lELirOevKMtneWPrcIYDWLa9jkG3zTkpf5g9pe4G0lM5JDKqtEYBoF+9vJoJiKu0KDVMSN l2xOrW5UCofBX2OZF2aTV1oQODJAt9Nq6ij4z0IV6Mm41dSsC/LANqLEmtWaM7F3JT3SfY TV/uStNCLYnuNg/rXIN+CeY2xG3RNB4mUL0fSKxTz6o68ZeeY+1YA7VaXfq8lfqKBIWySf qUvob6N1pALI284mNzp5gGHVq8kMqtq295HqXmydwTmtZL57+KI4nL9kw+vLOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlC9t1YGNzX78; Thu, 23 May 2024 02:41:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2fsMN053692; Thu, 23 May 2024 02:41:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2fsml053681; Thu, 23 May 2024 02:41:54 GMT (envelope-from git) Date: Thu, 23 May 2024 02:41:54 GMT Message-Id: <202405230241.44N2fsml053681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 42e50eaf7f6f - stable/14 - Add man page for the ice network driver. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 42e50eaf7f6f4459f1217564fd143ae4f8127154 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=42e50eaf7f6f4459f1217564fd143ae4f8127154 commit 42e50eaf7f6f4459f1217564fd143ae4f8127154 Author: Mathieu Simon AuthorDate: 2024-05-21 05:49:50 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:41:32 +0000 Add man page for the ice network driver. PR: 262892 MFC after: 3 days Reviewed by: concussious.bugzilla@runbox.com, erj Differential Revision: https://reviews.freebsd.org/D45270 (cherry picked from commit 8e5e42d54ad3093e38263814d1f3e7d8406d5421) --- share/man/man4/Makefile | 2 + share/man/man4/ice.4 | 250 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 252 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index a97c92b960f5..10ae7f3cef19 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -209,6 +209,7 @@ MAN= aac.4 \ hwpmc.4 \ ${_hwpstate_intel.4} \ iavf.4 \ + ice.4 \ ichsmb.4 \ ${_ichwd.4} \ icmp.4 \ @@ -690,6 +691,7 @@ MLINKS+=ip.4 rawip.4 MLINKS+=ipfirewall.4 ipaccounting.4 \ ipfirewall.4 ipacct.4 \ ipfirewall.4 ipfw.4 +MLINKS+=ice.4 if_ice.4 MLINKS+=ipheth.4 if_ipheth.4 MLINKS+=ipw.4 if_ipw.4 MLINKS+=iwi.4 if_iwi.4 diff --git a/share/man/man4/ice.4 b/share/man/man4/ice.4 new file mode 100644 index 000000000000..da46c758479c --- /dev/null +++ b/share/man/man4/ice.4 @@ -0,0 +1,250 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" +.\" Copyright (c) 2019-2020, Intel Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms of the Software, 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. +.\" +.\" 3. Neither the name of the Intel Corporation nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this Software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +.\" +.\" * Other names and brands may be claimed as the property of others. +.\" +.Dd May 20, 2024 +.Dt ICE 4 +.Os +.Sh NAME +.Nm ice +.Nd "Intel Ethernet 800 Series 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 iflib" +.Cd "device ice" +.Ed +.Pp +To load the driver as a module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ice_load="YES" +.Ed +.Sh DESCRIPTION +.Ss Features +The +.Nm +driver provides support for any PCI Express adapter or LOM +(LAN On Motherboard) +in the Intel Ethernet 800 Series. +As of this writing, the series includes devices with these model numbers: +.Pp +.Bl -bullet -compact +.It +Intel\(rg Ethernet Controller E810\-C +.It +Intel\(rg Ethernet Controller E810\-XXV +.It +Intel\(rg Ethernet Connection E822\-C +.It +Intel\(rg Ethernet Connection E822\-L +.It +Intel\(rg Ethernet Connection E823\-C +.It +Intel\(rg Ethernet Connection E823\-L +.El +.Pp +For questions related to hardware requirements, refer to the documentation +supplied with your adapter. +.Pp +Support for Jumbo Frames is provided via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +The maximum MTU size for Jumbo Frames is 9706. +This value coincides with the maximum Jumbo Frame size of 9728. +.Pp +This driver version supports VLANs. +For information on enabling VLANs, see the +.Pa README . +.Pp +Offloads are also controlled via the interface, for instance, checksumming for +both IPv4 and IPv6 can be set and unset, TSO4 and/or TSO6, and finally LRO can +be set and unset. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Ss Additional Utilities +There are additional tools available from Intel to help configure and update +the adapters covered by this driver. +These tools can be downloaded directly from Intel at +.Lk https://downloadcenter.intel.com , +by searching for their names, or by installing certain packages: +.Bl -bullet +.It +To change the behavior of the QSFP28 ports on E810-C adapters, use the +Intel EPCT (Ethernet Port configuration tool); installed by the +.Em sysutils/intel-epct +package. +.It +To update the firmware on an adapter, use the Intel Non-Volatile Memory (NVM) +Update Utility for Intel Network Adapter 800 series; installed by the +.Em sysutils/intel-nvmupdate-100g +package. +.El +.Sh HARDWARE +Most adapters in the Intel Ethernet 800 Series with SFP28/QSFP28 cages +have firmware that requires that Intel qualified modules are used; these +qualified modules are listed below. +This qualification check cannot be disabled by the driver. +.Pp +The +.Nm +driver supports 100Gb Ethernet adapters with these QSFP28 modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 100G QSFP28 100GBASE-SR4 E100GQSFPSR28SRX +.It +Intel\(rg 100G QSFP28 100GBASE-SR4 SPTMBP1PMCDF +.It +Intel\(rg 100G QSFP28 100GBASE-CWDM4 SPTSBP3CLCCO +.It +Intel\(rg 100G QSFP28 100GBASE-DR SPTSLP2SLCDF +.El +.Pp +The +.Nm +driver supports 25Gb and 10Gb Ethernet adapters with these SFP28 modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 10G/25G SFP28 25GBASE-SR E25GSFP28SR +.It +Intel\(rg 25G SFP28 25GBASE-SR E25GSFP28SRX (Extended Temp) +.It +Intel\(rg 25G SFP28 25GBASE-LR E25GSFP28LRX (Extended Temp) +.El +.Pp +The +.Nm +driver supports 10Gb and 1Gb Ethernet adapters with these SFP+ modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSR +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSRG1P5 +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSRG2P5 +.It +Intel\(rg 10G SFP+ 10GBASE-SR E10GSFPSRX (Extended Temp) +.It +Intel\(rg 1G/10G SFP+ 10GBASE-LR E10GSFPLR +.El +.Pp +Note that adapters also support all passive and active +limiting direct attach cables that comply with SFF-8431 v4.1 and +SFF-8472 v10.4 specifications. +.Pp +This is not an exhaustive list; please consult product documentation for an +up-to-date list of supported media. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +See the +.Xr iflib 4 +man page for more information on using iflib sysctl variables as tunables. +.Bl -tag -width indent +.It Va hw.ice.#.enable_health_events +TBW +.It Va hw.ice.#.debug.enable_tx_fc_filter +TBW +.It Va hw.ice.#.debug.enable_tx_lldp_filter +TBW +.It Va hw.ice.#.debug.enable_health_events +TBW +.El +.Sh SYSCTL PROCEDURES +.Bl -tag -width indent +.It Va dev.ice.#.fc +Allows one to set the flow control value. +A value of 0 disables flow control, 3 enables full, 1 is RX, and 2 is +TX pause. +.It Va dev.ice.#.advertise_speed +Allows one to set advertised link speeds, this will then cause a link +renegotiation. +.It Va dev.ice.#.current_speed +This is a display of the current setting. +.It Va dev.ice.#.fw_version +Displays the current firmware and NVM versions of the adapter. +.It Va dev.ice.#.ddp_version +TBW +.It Va dev.ice.#.requested_fec +TBW +.It Va dev.ice.#.negotiated_fec +TBW +.It Va dev.ice.#.fw_lldp_agent +TBW +.It Va dev.ice.#.ets_min_rate +TBW +.It Va dev.ice.#.up2tc_map +TBW +.It Va dev.ice.#.pfc +TBW +.El +.Sh INTERRUPT STORMS +It is important to note that 100G operation can generate high +numbers of interrupts, often incorrectly being interpreted as +a storm condition in the kernel. +It is suggested that this be resolved by setting +.Va hw.intr_storm_threshold +to 0. +.Sh SUPPORT +For general information and support, +go to the Intel support website at: +.Lk http://www.intel.com/support/ . +.Pp +If an issue is identified with this driver with a supported adapter, +email all the specific information related to the issue to +.Aq Mt freebsd@intel.com . +.Sh SEE ALSO +.Xr arp 4 , +.Xr iflib 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.2 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Intel Corporation Aq Mt freebsd@intel.com . From nobody Thu May 23 02:41:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlC9v5fPqz5LZ5P; Thu, 23 May 2024 02:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlC9v2zP5z42ML; Thu, 23 May 2024 02:41:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tn3IyRI0eV8ZAy7J+14LgrOGmTVRB2hGL5vOMEBQDl0=; b=sK4tRHQeD7z+4UfEg/rrbQwcg5elKAgvboJqc/P1auv4UUS4nwLPdQ0oKmO6v9/73IoPEP phvY+p9hhriAR8N6WAeVCZu7GiDLG9wPms6eat9AABuSWwAR12bOeTFY94OvA84L0zMLdr z0tXj4mXTpYoGZB3w1c0DznqUHnvOSgGCIywKlbIc5EgQaj9cneKRC36rVz2dnksNw0rxL NB8CFlbwyjFIXm+DcTWTpU/tDF3IkCN9RsnH1RlkNJeqSUQYqvl4TYaoc//lPX3diz6bSo RD1iCgFoynK0bg+fmAScei2wACIGjg/lSkaPnU0G2vyjeqtwnq2fkPX2iGJmdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432115; a=rsa-sha256; cv=none; b=gB24aPr8Fm2An5R7RjZC8jnn6mvovA3Gn80EkJi4oM6kQhxwUA9m1aD5W2HhsRjqacOBog u/dP0nnpX9Q1K+LSv4KsR55mEh6bEJc3Aih4ODk72ZuiuXwtwwzFiBc6tpalm+iV6zhuQS 9EAyNOEha+/vNOno8etXGNvtMToxlwdtk3/YyKAZfA2NB7mHeL/LgUxAPF0XAbQq80qR9W WzuHdihl+PYXfFpAgoDvW3LpuZ9e8G804hZB9PTd9iNU4fCzgrVEdSVvMjqV/idVJ7fPZz FTISmfp+a5xIlwxVT9mMwa3P0ISc+7Pf8dirTk46uE8kxVQS48MedShOnQST3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tn3IyRI0eV8ZAy7J+14LgrOGmTVRB2hGL5vOMEBQDl0=; b=AKHXGXt0KH4EnQ+KTh7US0fvoi1gMwYo1OZXb2nj9Q6k3Cs6qHZexbB3sMPSeXsLcFlMts 95IOKRbr6erLaxWGC+qCC9sX7LUcsgNBtcQc5agNSaLUQbqgm6jgvc/9laZ4GQzEZtkmkd zND7isjKsWiUV5T2HT/6Nn3CqBCWwqljfzeqYkPvkUVFUATNWRjkwq2MHLJoycb5trPHgm /9c3xqK05tEO3CmrVQOiPw+krxtsDrAof/BGbxMd8Ejw6c10+baTS+Ipqz4bvUo6ydbLo6 yVnMI3SJYPKiaxu1Ze/iuYYxgZx/W2iIYsE4J7utABjl5j9RBVeX00kI+F2Cbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlC9v2bB7zXbc; Thu, 23 May 2024 02:41:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2ftGD054196; Thu, 23 May 2024 02:41:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2ftsJ054193; Thu, 23 May 2024 02:41:55 GMT (envelope-from git) Date: Thu, 23 May 2024 02:41:55 GMT Message-Id: <202405230241.44N2ftsJ054193@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f075b6113726 - stable/14 - access.2: Mention that lstat(2) should be used for symbolic links List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f075b6113726d74342d4af15dfab60709f50b859 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f075b6113726d74342d4af15dfab60709f50b859 commit f075b6113726d74342d4af15dfab60709f50b859 Author: Gordon Bergling AuthorDate: 2024-05-13 08:40:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:41:32 +0000 access.2: Mention that lstat(2) should be used for symbolic links access(), eaccess() and faccessat() will always dereference symbolic links. So add a note in the manual page, that lstat(2) should be used in the case of symbolic links. PR: 262895 Reviewed by: gbe, pauamma_gundo.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44890 (cherry picked from commit 421025a274fb5759b3ecc8bdb30b24db830b45ae) --- lib/libc/sys/access.2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 681e4483a9e6..64ed1133b23d 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -27,7 +27,7 @@ .\" .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" -.Dd March 30, 2021 +.Dd May 13, 2024 .Dt ACCESS 2 .Os .Sh NAME @@ -149,6 +149,15 @@ Likewise for .Dv R_OK and .Dv W_OK . +.Pp +.Fn access , +.Fn eaccess +and +.Fn faccessat +will always dereference symbolic links. +If the symbolic link itself needs to be referenced, +.Xr lstat 2 +should be used instead. .Sh RETURN VALUES .Rv -std .Sh ERRORS From nobody Thu May 23 02:41:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlC9w5ltKz5LYtY; Thu, 23 May 2024 02:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlC9w40hBz42dR; Thu, 23 May 2024 02:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eFa41nT7sMbFZCZ6armDW6yGlfLOs3YlR5OkDKMaxNU=; b=ftsJ1uU949pASCkStKD+Wleq53Kfgx1Cq6/sW+s5HVaqoKsYonEHs4YcNLPne383Bx/q4K VsSzd1497CDqwT2slii8nKNoFHIDc3EGqRVqi22wMZ08BEBj3RIoOqzfr11bFPOdcmVmEr 51Ock5wp5HBLqyJ6QYu2Qy/E2BpyB1pMriudO6+57lKGgbfD3CGs206pHMuvR/+lfjJcAm AHkZZEcjCOGIlwRPLCWbkEFSUmBFVFOTDDz83t8X3hRPmFFkbxGRs65ZeZNOHe/nbjr4Z9 PNJT38V+w8ZAxmvuYP68M4t8x3Le6YQAjjtsmBPwVK27/GLeL08NzrxSctAdBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432116; a=rsa-sha256; cv=none; b=Zimremh+n/W6/rGUec6irJ0lrdSEjx1Qw8PEJ7ctZgQaeh5jkxmEW6hxhhMjN3xX/9iTT/ 9l1ZLdiiA4+Uq/bXq387A6Qa32nEvbWJKRdaY75YMFRJXg0mks8cVmyyKS+8mu475CFK+3 rhfMbGROJ5HXik3jSWDpZi13qGWTlxjPVajQu5KmJFHPSyEWqPeRB6dYtwCmBIXNMAmqgu sHPGt93ZmzZLcKaI0KvDuuw6/xkOY5x0aqTy9pXwlBzvTi2zujwj2DwuWymNrXFTqIwmos KbumMuc9a3b7b8gF6xwcBdOP2TegVkj84tVyxju1dQSubT60lGpzfpil7iUC0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eFa41nT7sMbFZCZ6armDW6yGlfLOs3YlR5OkDKMaxNU=; b=EWnzTjkfTjruBaXTjh1KtcxfeaTIB0ey19rps1lmYNidjhLQHFff4ZrcbVu2y2BXU9t9yY Q+zrzKxwaUDOmkImBKFmkOFlZWS7IBuJFGrDV/l15/73OV5bbnCKgxO2Y9x6JAyJb+movk jEdQgSAWB6mhkX1nw9wBQk9gXumIlx929RqYG0ggCwhuDA7pC7OrzxzU8AIqmigRPNvoiN BrJdMIXetcNAhr6f2qYjTSs+A5YENQziNTi4yWFqXVAkIS/14Iyu1lqmGtw5AVbD+I2OzF C0DN13TPgqpqVB02yvMnFAzhEkIh1KiKmimLcnIhTuzyHQXs0Zi231baBb8rLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlC9w3cLJzXQH; Thu, 23 May 2024 02:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2fuDa054248; Thu, 23 May 2024 02:41:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2fuAf054245; Thu, 23 May 2024 02:41:56 GMT (envelope-from git) Date: Thu, 23 May 2024 02:41:56 GMT Message-Id: <202405230241.44N2fuAf054245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 79b39f23e134 - stable/14 - access(2): Discourage use of these system calls. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 79b39f23e1341bdc3ab9c6a08e1506d40b8b6dbc Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=79b39f23e1341bdc3ab9c6a08e1506d40b8b6dbc commit 79b39f23e1341bdc3ab9c6a08e1506d40b8b6dbc Author: Dag-Erling Smørgrav AuthorDate: 2024-05-21 22:35:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:41:32 +0000 access(2): Discourage use of these system calls. Fixes: 421025a274fb PR: 262895 MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45240 (cherry picked from commit a4be1eb21165d7aedae9dc6634528619ff10d025) --- lib/libc/sys/access.2 | 105 ++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 55 deletions(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 64ed1133b23d..8595444720b1 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -27,7 +27,7 @@ .\" .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" -.Dd May 13, 2024 +.Dd May 21, 2024 .Dt ACCESS 2 .Os .Sh NAME @@ -47,35 +47,43 @@ .Fn faccessat "int fd" "const char *path" "int mode" "int flag" .Sh DESCRIPTION The -.Fn access -and +.Fn access , .Fn eaccess -system calls check the accessibility of the -file named by -the +and +.Fn faccessat +system calls report whether an attempt to access the file designated +by their .Fa path -argument -for the access permissions indicated by -the +in the manner described by their .Fa mode -argument. +argument is likely to succeed. The value of .Fa mode -is either the bitwise-inclusive OR of the access permissions to be -checked -.Dv ( R_OK +is either the bitwise-inclusive OR of the desired permissions +.Po +.Dv R_OK for read permission, .Dv W_OK for write permission, and .Dv X_OK -for execute/search permission), -or the existence test -.Pq Dv F_OK . +for execute / search permission +.Pc +or +.Dv F_OK +to simply check whether the file exists. .Pp -For additional information, see the -.Sx "File Access Permission" -section of -.Xr intro 2 . +For a number of reasons, these system calls cannot be relied upon to +give a correct and definitive answer. +They can at best provide an early indication of the expected outcome, +to be confirmed by actually attempting the operation. +For existence checks, either +.Xr stat 2 +or +.Xr lstat 2 +should be used instead. +See also +.Sx SECURITY CONSIDERATIONS +below. .Pp The .Fn eaccess @@ -89,6 +97,13 @@ the real user ID in place of the effective user ID, the real group ID in place of the effective group ID, and the rest of the group access list. .Pp +See the +.Sx DEFINITIONS +section of +.Xr intro 2 +for additional information on file access permissions and real +vs. effective user and group IDs. +.Pp The .Fn faccessat system call is equivalent to @@ -116,8 +131,10 @@ list, defined in .In fcntl.h : .Bl -tag -width indent .It Dv AT_EACCESS -The checks for accessibility are performed using the effective user and group -IDs instead of the real user and group ID as required in a call to +The checks are performed using the effective user and group IDs, +like +.Fn eaccess , +instead of the real user and group ID, like .Fn access . .It Dv AT_RESOLVE_BENEATH Only walk paths below the directory specified by the @@ -149,23 +166,15 @@ Likewise for .Dv R_OK and .Dv W_OK . -.Pp -.Fn access , -.Fn eaccess -and -.Fn faccessat -will always dereference symbolic links. -If the symbolic link itself needs to be referenced, -.Xr lstat 2 -should be used instead. .Sh RETURN VALUES .Rv -std .Sh ERRORS +The .Fn access , .Fn eaccess , -or +and .Fn faccessat -will fail if: +system calls may fail if: .Bl -tag -width Er .It Bq Er EINVAL The value of the @@ -256,25 +265,11 @@ system call appeared in .Fx 8.0 . .Sh SECURITY CONSIDERATIONS The -.Fn access -system call -is a potential security hole due to race conditions and -should never be used. -Set-user-ID and set-group-ID applications should restore the -effective user or group ID, -and perform actions directly rather than use -.Fn access -to simulate access checks for the real user or group ID. -The -.Fn eaccess -system call -likewise may be subject to races if used inappropriately. -.Pp -.Fn access -remains useful for providing clues to users as to whether operations -make sense for particular filesystem objects (e.g. 'delete' menu -item only highlighted in a writable folder ... avoiding interpretation -of the st_mode bits that the application might not understand -- -e.g. in the case of AFS). -It also allows a cheaper file existence test than -.Xr stat 2 . +.Fn access , +.Fn eaccess , +and +.Fn faccessat +system calls are subject to time-of-check-to-time-of-use races and +should not be relied upon for file permission enforcement purposes. +Instead, applications should perform the desired action using the +requesting user's credentials. From nobody Thu May 23 02:41:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlC9y0xlZz5LZGJ; Thu, 23 May 2024 02:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlC9x4yx4z42XD; Thu, 23 May 2024 02:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mQWLkQMZ0aF8JLq9n900lQg7CaU+Q9nRlbzkbZV7cyo=; b=Ni2LSmIp0wJuCw13oiV0c+QacHkymhQlUyiWcJmMake9zDGB9MFHMubu8ItIRS162eEcK2 9DZd+PoTeAKYJlma5oXRJKt8fzS0wP5EEnrqrsOG8fvnmQw0brgMuH5sHlp6rBixVUZenf dPyvCIkerEszWR6NflYtWo2vD5WQy5mMUfrI54FI0lCO4CZyClmW3gvGbaangCT9Fgyb2I yU3q5Z62NWJCy30HOF2ekJdwoQR/3mphuv1KuHFfBijyuK521GfZKUmUaVqhFdnQa3ikvA 9VxkGBnL/m7VJjs9ye1GUd3+SIeRNBzt42rChMNlNfLDE9oP8BeC0Yjtgclo5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432117; a=rsa-sha256; cv=none; b=eyHNz6DVDTp3SqFwniQfAfU/4ay1cRkfw0BnqMQK0s3cmmLuhE1DJXlCJsnrhBREVrW0Ih FKUTVGtIkNcZKkHrEkHZvwnXa0YIMS6ZRcaajjr+LPRNdyStvf2lX2ztqrWdp04syOXBjP ydYytSQVX2Zq1WNHIRaB8i4Iy+ivNRDmEmtG2vWiHIZqrNA22FWZ9kahcOA2jED4hBeSwo jg51fbbbVxVxKnuBn2Qduag5/bKOd9aPBrxOvkFJC+QqcLSKRt3R2Ldkfu5oVAWDvCmSZg fTGgixS76Egim7jvH9aD3+rmz5Bf8qfeTLhOm2UgkZMQ7YHFMcL6HrbddyHOig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mQWLkQMZ0aF8JLq9n900lQg7CaU+Q9nRlbzkbZV7cyo=; b=VyG8yDk5efnpinDboDMZTrpNlq1dp1Mq0u0/ze+nXgLq8cBZnsYptGaJRNFy1pXBD7PNJh 734eh/4bah8/Gfb6vPJBMXnlmo2Hmzfq4wRyNWAKWNQ0hZTG++xXWd2LsvtUvXHT4GwESG f/TXFf1ebA+Qd2qFB7Jf8JaYpKdAUGAEWCz9sAzz9eRKWWYvCIwKOn07Q8WzBFwWBM2Lti yHfDOFnJybjset4SRv0+hGwgGZtH34DVGu9dyKD75BsZLH4lHVQ+SMhJEoXTBllF9/8TtC 3JHuJnDbucdzSuc2pDaHMBnngCGrGpP+u6ZVIqCJQP3UAcjOyGpk1tbQ/2NQnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlC9x4bRdzX7C; Thu, 23 May 2024 02:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2fvNE054290; Thu, 23 May 2024 02:41:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2fvnD054287; Thu, 23 May 2024 02:41:57 GMT (envelope-from git) Date: Thu, 23 May 2024 02:41:57 GMT Message-Id: <202405230241.44N2fvnD054287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 4c380c44c82f - stable/14 - iavf(4): Improve man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4c380c44c82f36c04539e3c9e60e58567abf3856 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4c380c44c82f36c04539e3c9e60e58567abf3856 commit 4c380c44c82f36c04539e3c9e60e58567abf3856 Author: Eric Joyner AuthorDate: 2024-05-21 23:24:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:41:32 +0000 iavf(4): Improve man page MFC after: 3 days Reviewed by: erj Differential Revision: https://reviews.freebsd.org/D43093 (cherry picked from commit ba222f6fb4b226ab24beaa13a8591dcb624ae70f) --- share/man/man4/iavf.4 | 348 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 282 insertions(+), 66 deletions(-) diff --git a/share/man/man4/iavf.4 b/share/man/man4/iavf.4 index 2e265a5a2fbb..d55e084e82cc 100644 --- a/share/man/man4/iavf.4 +++ b/share/man/man4/iavf.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 2013-2018, Intel Corporation .\" All rights reserved. .\" @@ -29,12 +32,12 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd January 30, 2019 +.Dd May 21, 2024 .Dt IAVF 4 .Os .Sh NAME .Nm iavf -.Nd "Intel Adaptive Virtual Function driver" +.Nd "Intel Ethernet Adaptive Virtual Function Driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -51,87 +54,300 @@ if_iavf_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the PCI Virtual Functions from the 700 Series of -ethernet devices and newer product families. -The driver supports Jumbo Frames, TX/RX checksum offload, -TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN -tag insertion/extraction, VLAN checksum offload, VLAN TSO, and -Receive Side Steering (RSS), all for both IPv4 and IPv6. -For further hardware information and questions related to hardware -requirements, see -.Pa http://support.intel.com/ . -.Pp -Support for Jumbo Frames is provided via the interface MTU setting. -Selecting an MTU larger than 1500 bytes with the +driver provides support for any PCI Virtual Function created from certain +Intel Ethernet devices. +This driver is compatible with virtual functions bound to devices based on the +following: +.Pp +.Bl -bullet -compact +.It +Intel\(rg Ethernet Controller E810\-C +.It +Intel\(rg Ethernet Controller E810\-XXV +.It +Intel\(rg Ethernet Connection E822\-C +.It +Intel\(rg Ethernet Connection E822\-L +.It +Intel\(rg Ethernet Connection E823\-C +.It +Intel\(rg Ethernet Connection E823\-L +.It +Intel\(rg Ethernet Controller I710 +.It +Intel\(rg Ethernet Controller X710 +.It +Intel\(rg Ethernet Controller XL710 +.It +Intel\(rg Ethernet Network Connection X722 +.It +Intel\(rg Ethernet Controller XXV710 +.It +Intel\(rg Ethernet Controller V710 +.El +.Pp +The associated Physical Function (PF) drivers for this VF driver are: +.Pp +.Bl -bullet -compact +.It +.Xr ice 4 +.It +.Xr ixl 4 +.El +.Pp +For questions related to hardware requirements, refer to the documentation +supplied with your Intel Ethernet Adapter. +All hardware requirements listed apply to use with +.Fx . +.Ss The VF Driver +The VF driver is normally used in a virtualized environment where a host driver +manages SR\-IOV, and provides a VF device to the guest. +.Pp +In the +.Fx +guest, the iavf driver would be loaded and will function using +the VF device assigned to it. +.Pp +The VF driver provides most of the same functionality as the core driver, but +is actually a subordinate to the host. +Access to many controls is accomplished by a request to the host via what is +called the "Admin queue." +These are startup and initialization events, however; once in operation, the +device is self\-contained and should achieve near native performance. +.Pp +Some notable limitations of the VF environment: +.Bl -bullet +.It +The PF can configure the VF to allow promiscuous mode, using a configuration +parameter in +.Xr iovctl.conf 5 ; +otherwise, promiscuous mode will not work +.It +Media info is not available from the PF, so the active media will always be +displayed as auto in .Xr ifconfig 8 -utility configures the adapter to receive and transmit Jumbo Frames. -The maximum MTU size for Jumbo Frames is 9706. +.El +.Ss Adaptive Virtual Function +Adaptive Virtual Function (AVF) allows the virtual function driver, or VF, to +adapt to changing feature sets of the physical function driver (PF) with which +it is associated. +This allows system administrators to update a PF without having to update all +the VFs associated with it. +All AVFs have a single common device ID and branding string. .Pp -Offloads are also controlled via the interface, for instance, -checksumming for both IPv4 and IPv6 can be set and unset, TSO4 -and/or TSO6, and finally LRO can be set and unset. +AVFs have a minimum set of features known as "base mode," but may provide +additional features depending on what features are available in the PF with +which the AVF is associated. +The following are base mode features: +.Bl -bullet -compact +.It +4 Queue Pairs (QP) and associated Configuration Status Registers (CSRs) +for Tx/Rx +.It +iavf descriptors and ring format +.It +Descriptor write\-back completion +.It +1 control queue, with iavf descriptors, CSRs and ring format +.It +5 MSI\-X interrupt vectors and corresponding iavf CSRs +.It +1 Interrupt Throttle Rate (ITR) index +.It +1 Virtual Station Interface (VSI) per VF +.It +1 Traffic Class (TC), TC0 +.It +Receive Side Scaling (RSS) with 64 entry indirection table and key, +configured through the PF +.It +1 unicast MAC address reserved per VF +.It +8 MAC address filters for each VF on an Intel\(rg Ethernet 800 Series device +.It +16 MAC address filters for each VF on an Intel\(rg Ethernet 700 Series device +.It +Stateless offloads \- non\-tunneled checksums +.It +AVF device ID +.It +HW mailbox is used for VF to PF communications +.El +.Sh CONFIGURATION AND TUNING +.Ss Important System Configuration Changes +It is important to note that 100G operation can generate high +numbers of interrupts, often incorrectly being interpreted as +a storm condition in the kernel. +It is suggested that this be resolved by setting +.Va hw.intr_storm_threshold +to 0. .Pp -For more information on configuring this device, see -.Xr ifconfig 8 . +The default is 1000. .Pp -.Em NOTE : -This +Best throughput results are seen with a large MTU; use 9706 if possible. +The default number of descriptors per ring is 1024. +Increasing this may improve performance, depending on your use case. +.Ss Configuring for no iflib +.Xr iflib 4 +is a common framework for network interface drivers for +.Fx +that uses a shared set of sysctl names. +.Pp +The default .Nm -driver is only for Virtual Functions. -For 700 series Physical Functions, use the -.Xr ixl 4 -driver. -.Sh LOADER TUNABLES -Tunables can be set at the -.Xr loader 8 -prompt before booting the kernel or stored in -.Xr loader.conf 5 . -.Bl -tag -width indent -.It Va hw.iavf.rx_itr -The RX interrupt rate value, set to 62 (124 usec) by default. -.It Va hw.iavf.tx_itr -The TX interrupt rate value, set to 122 (244 usec) by default. -.It Va hw.iavf.enable_head_writeback -When the driver is finding the last TX descriptor processed by the hardware, -use a value written to memory by the hardware instead of scanning the -descriptor ring for completed descriptors. -Disabled by default; this mimics the "legacy" TX behavior found in -.Xr ixgbe 4 . -to ensure compatibility with future, non-700 series VF devices. +driver depends on it, but it can be compiled without it. +.Ss Jumbo Frames +Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU) +to a value larger than the default value of 1500. +.Pp +Use the +.Xr ifconfig 8 +command to increase the MTU size. +.Pp +To confirm the MTU used between two specific devices, use +.Xr route 8 : +.Bd -literal -offset indent +route get +.Ed +.Pp +NOTE: +.Bl -bullet +.It +The maximum MTU setting for jumbo frames is 9706. +This corresponds to the maximum jumbo frame size of 9728 bytes. +.It +This driver will attempt to use multiple page-sized buffers to receive +each jumbo packet. +This should help to avoid buffer starvation issues when allocating receive +packets. +.It +Packet loss may have a greater impact on throughput when you use jumbo +frames. +If you observe a drop in performance after enabling jumbo frames, enabling +flow control may mitigate the issue. .El -.Sh SUPPORT -For general information and support, -go to the Intel support website at: -.Pa http://support.intel.com/ . +.Ss Checksum Offload +Checksum offloading supports both TCP and UDP packets and is supported for both +transmit and receive. +.Pp +TSO (TCP Segmentation Offload) supports both IPv4 and IPv6. +Both of these features are enabled and disabled via +.Xr ifconfig 8 . .Pp -If an issue is identified with this driver with a supported adapter, -email all the specific information related to the issue to -.Mt freebsd@intel.com . +NOTE: +.Bl -bullet -compact +.It +TSO requires Tx checksum; if Tx checksum is disabled then TSO will also +be disabled. +.El +.Ss LRO +LRO (Large Receive Offload) may provide Rx performance improvement. +However, it is incompatible with packet\-forwarding workloads. +You should carefully evaluate the environment and enable LRO when possible. +.Ss Rx and Tx Descriptor Rings +Allows you to set the Rx and Tx descriptor rings independently. +Set them via these +.Xr iflib 4 +sysctls: +.Bl -tag -width indent +.It dev.iavf.#.iflib.override_nrxds +.It dev.iavf.#.iflib.override_ntxds +.El +.Ss Link\-Level Flow Control (LFC) +The VF driver does not have access to flow control settings. +It must be managed from the host side. .Sh SEE ALSO .Xr arp 4 , +.Xr ice 4 , +.Xr iflib 4 , .Xr ixl 4 , .Xr netintro 4 , .Xr vlan 4 , -.Xr ifconfig 8 , -.Xr iflib 9 +.Xr ifconfig 8 +.Pp +See the +.Dq Intel\(rg Ethernet Adapters and Devices User Guide +for additional information on features. +It is available on the Intel website at either of the following: +.Bl -bullet +.It +.Lk https://cdrdv2.intel.com/v1/dl/getContent/705831 +.It +.Lk https://www.intel.com/content/www/us/en/download/19373/adapter\-user\-guide\-for\-intel\-ethernet\-adapters.html +.El +.Pp +For information on how to identify your adapter, and for the latest Intel +network drivers, refer to the Intel Support website: +.Aq Lk http://www.intel.com/support +.Sh CAVEATS +.Ss Driver Buffer Overflow Fix +The fix to resolve CVE\-2016\-8105, referenced in Intel SA\-00069 +.Aq Lk https://www.intel.com/content/www/us/en/security\-center/advisory/intel\-sa\-00069.html , +is included in this and future versions of the driver. +.Ss Network Memory Buffer Allocation +.Fx +may have a low number of network memory buffers (mbufs) by default. +If your mbuf value is too low, it may cause the driver to fail to initialize +and/or cause the system to become unresponsive. +You can check to see if the system is mbuf\-starved by running +.Li "netstat -m" . +Increase the number of mbufs by editing the lines below in +.Xr sysctl.conf 5 : +.Bd -literal -offset indent +kern.ipc.nmbclusters +kern.ipc.nmbjumbop +kern.ipc.nmbjumbo9 +kern.ipc.nmbjumbo16 +kern.ipc.nmbufs +.Ed +.Pp +The amount of memory that you allocate is system specific, and may require +some trial and error. +Also, increasing the following in +.Xr sysctl.conf 5 +could help increase +network performance: +.Bd -literal -offset indent +kern.ipc.maxsockbuf +net.inet.tcp.sendspace +net.inet.tcp.recvspace +net.inet.udp.maxdgram +net.inet.udp.recvspace +.Ed +.Ss UDP Stress Test Dropped Packet Issue +Under small packet UDP stress with the +.Nm +driver, the system may drop UDP packets due to socket buffers being full. +Setting the PF driver's Flow Control variables to the minimum may resolve the +issue. +.Ss Disable LRO when routing/bridging +LRO must be turned off when forwarding traffic. +.Sh SUPPORT +For general information, go to the Intel support website at +.Aq Lk http://www.intel.com/support/ . +.Pp +If an issue is identified with the released source code on a supported kernel +with a supported adapter, email the specific information related to the issue +to +.Aq Mt freebsd@intel.com . +.Sh LEGAL +Intel\(rg is a trademark or registered trademark of Intel Corporation +or its subsidiaries in the United States and / or other countries. +.Pp +Other names and brands may be claimed as the property of others. .Sh HISTORY The .Nm device driver first appeared in -.Fx 10.1 . -under the name "ixlv" +.Fx 10.1 +under the name +.Nm ixlv . It was converted to use -.Xr iflib 9 -and changed to its current name in -.Fx 12 . +.Xr iflib 4 +and renamed in +.Fx 12.4 . .Sh AUTHORS -.An -nosplit The .Nm -driver was written by -.An Jack Vogel Aq Mt jfv@freebsd.org -and -.An Eric Joyner Aq Mt erj@freebsd.org . -.Sh CAVEATS -This driver is supposed to function on VFs spawned from future network devices by Intel, -but at the time of this writing, has only been tested on the 700 series VFs. +driver was written by the +.An Intel Corporation Aq Mt freebsd@intel.com From nobody Thu May 23 02:44:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlCDS6k0Tz5LZ3D; Thu, 23 May 2024 02:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlCDS4Mg9z442k; Thu, 23 May 2024 02:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jG5uzTR7qJJ5+Qji3AjW1yLtQb5LBwbL8xW6l4noCRE=; b=IcEt0U8F27dRadHFIzxqHGKcxmUgxedkHQd3k6p615+Z4ZWoy70EKWXC5JLs8HUgg2lqiT NbTyXMIVZGrr4jJZhzGsdrh6fUgJLEomAKNOrLq/xZpb0xfx5bVFmPYwPr0q49pT06JTIc CLidKL+XPWVFjQTYU00Z98Zu4ydDF/tSeVPucmhOlww6Kru99dH0LUiNslH+ZvZMEnTWih JEldVlb2kI8W8qCcwaUy0E0tSJDQ1mTWzEB45Y6erHsrFs1r4EYC24wAMB9zEOVUFk0/nX dcYXxe+EEn1Uys+brg4GahY8Yz0KlSN5OPur1H9cXHWnoZpmNTR06S6aMDYTKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432248; a=rsa-sha256; cv=none; b=X5gWuUHfn1Mi8yakcoeHCBoLqM/0CohiQd0GXPOBpd3CqDobor9mnxiZ705FPj+kwhskzT ekck/fIAU+CgH6r2nWK62qOvrPIMuhFywkRxuh5taXWWpsqnujuSYZlawA5wYyJVSV2fde rNSgEn8papp+dDQ3msGC2e2HhW+pR37MgWe1z8R3tNe6G6X4mWlmIGneCojWff2k0Mw5k0 Yxi6xQDxI1sumsgA0LuDQbi/cKT9F6a3Wte0i+pSvbiXb6R0NSrZNWJq+zQuobhjif8JIa owVVR6Avw0lWr5RsA7vJxL6Ym6mmMvHYGMaEah1oAeq8NfAsPKaTNEe8hcTjFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jG5uzTR7qJJ5+Qji3AjW1yLtQb5LBwbL8xW6l4noCRE=; b=Xc4GMjvmL808C4M8gQ6QI4bsCeVmPVgBg9AJ5UELy3glmNZEibign65rwF225CCJ+vPwsx xB9UMNogMJxST35lvq5ek4hAjPJGFn3ttsYNBQFY4CRG+ScyEKyl2h0UVGqitdNR+nKlRS a7C7jDIR8o8fyQmDKqYwg3zlXvmClMdXfbPpN8wX31IffHd4kw39hTp/H5mwZypervR3mJ uPCX1UGKUIlgTJfHDSYvYk5i+OUtMaagQCzky9mKEjRETdOQYA8urtnO79u3oZRmKJxXsL qFF26tL1+Kv2sJ19AWG7x7XvlcNoaRax1ZY8F2r4PT0r0WRF9vzi3fJlZN6udQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlCDS3y9KzXbx; Thu, 23 May 2024 02:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2i8pi056604; Thu, 23 May 2024 02:44:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2i8Ls056601; Thu, 23 May 2024 02:44:08 GMT (envelope-from git) Date: Thu, 23 May 2024 02:44:08 GMT Message-Id: <202405230244.44N2i8Ls056601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: c96451a0d94e - stable/13 - Add man page for the ice network driver. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c96451a0d94e046d1ce147f8db6e83c1e7968f2c Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c96451a0d94e046d1ce147f8db6e83c1e7968f2c commit c96451a0d94e046d1ce147f8db6e83c1e7968f2c Author: Mathieu Simon AuthorDate: 2024-05-21 05:49:50 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:43:49 +0000 Add man page for the ice network driver. PR: 262892 MFC after: 3 days Reviewed by: concussious.bugzilla@runbox.com, erj Differential Revision: https://reviews.freebsd.org/D45270 (cherry picked from commit 8e5e42d54ad3093e38263814d1f3e7d8406d5421) --- share/man/man4/Makefile | 2 + share/man/man4/ice.4 | 250 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 252 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 1ea3431c859a..727768ae5bea 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -209,6 +209,7 @@ MAN= aac.4 \ hwpmc.4 \ ${_hwpstate_intel.4} \ iavf.4 \ + ice.4 \ ichsmb.4 \ ${_ichwd.4} \ icmp.4 \ @@ -708,6 +709,7 @@ MLINKS+=ip.4 rawip.4 MLINKS+=ipfirewall.4 ipaccounting.4 \ ipfirewall.4 ipacct.4 \ ipfirewall.4 ipfw.4 +MLINKS+=ice.4 if_ice.4 MLINKS+=ipheth.4 if_ipheth.4 MLINKS+=ipw.4 if_ipw.4 MLINKS+=iwi.4 if_iwi.4 diff --git a/share/man/man4/ice.4 b/share/man/man4/ice.4 new file mode 100644 index 000000000000..da46c758479c --- /dev/null +++ b/share/man/man4/ice.4 @@ -0,0 +1,250 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" +.\" Copyright (c) 2019-2020, Intel Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms of the Software, 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. +.\" +.\" 3. Neither the name of the Intel Corporation nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this Software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +.\" +.\" * Other names and brands may be claimed as the property of others. +.\" +.Dd May 20, 2024 +.Dt ICE 4 +.Os +.Sh NAME +.Nm ice +.Nd "Intel Ethernet 800 Series 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 iflib" +.Cd "device ice" +.Ed +.Pp +To load the driver as a module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ice_load="YES" +.Ed +.Sh DESCRIPTION +.Ss Features +The +.Nm +driver provides support for any PCI Express adapter or LOM +(LAN On Motherboard) +in the Intel Ethernet 800 Series. +As of this writing, the series includes devices with these model numbers: +.Pp +.Bl -bullet -compact +.It +Intel\(rg Ethernet Controller E810\-C +.It +Intel\(rg Ethernet Controller E810\-XXV +.It +Intel\(rg Ethernet Connection E822\-C +.It +Intel\(rg Ethernet Connection E822\-L +.It +Intel\(rg Ethernet Connection E823\-C +.It +Intel\(rg Ethernet Connection E823\-L +.El +.Pp +For questions related to hardware requirements, refer to the documentation +supplied with your adapter. +.Pp +Support for Jumbo Frames is provided via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +The maximum MTU size for Jumbo Frames is 9706. +This value coincides with the maximum Jumbo Frame size of 9728. +.Pp +This driver version supports VLANs. +For information on enabling VLANs, see the +.Pa README . +.Pp +Offloads are also controlled via the interface, for instance, checksumming for +both IPv4 and IPv6 can be set and unset, TSO4 and/or TSO6, and finally LRO can +be set and unset. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Ss Additional Utilities +There are additional tools available from Intel to help configure and update +the adapters covered by this driver. +These tools can be downloaded directly from Intel at +.Lk https://downloadcenter.intel.com , +by searching for their names, or by installing certain packages: +.Bl -bullet +.It +To change the behavior of the QSFP28 ports on E810-C adapters, use the +Intel EPCT (Ethernet Port configuration tool); installed by the +.Em sysutils/intel-epct +package. +.It +To update the firmware on an adapter, use the Intel Non-Volatile Memory (NVM) +Update Utility for Intel Network Adapter 800 series; installed by the +.Em sysutils/intel-nvmupdate-100g +package. +.El +.Sh HARDWARE +Most adapters in the Intel Ethernet 800 Series with SFP28/QSFP28 cages +have firmware that requires that Intel qualified modules are used; these +qualified modules are listed below. +This qualification check cannot be disabled by the driver. +.Pp +The +.Nm +driver supports 100Gb Ethernet adapters with these QSFP28 modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 100G QSFP28 100GBASE-SR4 E100GQSFPSR28SRX +.It +Intel\(rg 100G QSFP28 100GBASE-SR4 SPTMBP1PMCDF +.It +Intel\(rg 100G QSFP28 100GBASE-CWDM4 SPTSBP3CLCCO +.It +Intel\(rg 100G QSFP28 100GBASE-DR SPTSLP2SLCDF +.El +.Pp +The +.Nm +driver supports 25Gb and 10Gb Ethernet adapters with these SFP28 modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 10G/25G SFP28 25GBASE-SR E25GSFP28SR +.It +Intel\(rg 25G SFP28 25GBASE-SR E25GSFP28SRX (Extended Temp) +.It +Intel\(rg 25G SFP28 25GBASE-LR E25GSFP28LRX (Extended Temp) +.El +.Pp +The +.Nm +driver supports 10Gb and 1Gb Ethernet adapters with these SFP+ modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSR +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSRG1P5 +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSRG2P5 +.It +Intel\(rg 10G SFP+ 10GBASE-SR E10GSFPSRX (Extended Temp) +.It +Intel\(rg 1G/10G SFP+ 10GBASE-LR E10GSFPLR +.El +.Pp +Note that adapters also support all passive and active +limiting direct attach cables that comply with SFF-8431 v4.1 and +SFF-8472 v10.4 specifications. +.Pp +This is not an exhaustive list; please consult product documentation for an +up-to-date list of supported media. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +See the +.Xr iflib 4 +man page for more information on using iflib sysctl variables as tunables. +.Bl -tag -width indent +.It Va hw.ice.#.enable_health_events +TBW +.It Va hw.ice.#.debug.enable_tx_fc_filter +TBW +.It Va hw.ice.#.debug.enable_tx_lldp_filter +TBW +.It Va hw.ice.#.debug.enable_health_events +TBW +.El +.Sh SYSCTL PROCEDURES +.Bl -tag -width indent +.It Va dev.ice.#.fc +Allows one to set the flow control value. +A value of 0 disables flow control, 3 enables full, 1 is RX, and 2 is +TX pause. +.It Va dev.ice.#.advertise_speed +Allows one to set advertised link speeds, this will then cause a link +renegotiation. +.It Va dev.ice.#.current_speed +This is a display of the current setting. +.It Va dev.ice.#.fw_version +Displays the current firmware and NVM versions of the adapter. +.It Va dev.ice.#.ddp_version +TBW +.It Va dev.ice.#.requested_fec +TBW +.It Va dev.ice.#.negotiated_fec +TBW +.It Va dev.ice.#.fw_lldp_agent +TBW +.It Va dev.ice.#.ets_min_rate +TBW +.It Va dev.ice.#.up2tc_map +TBW +.It Va dev.ice.#.pfc +TBW +.El +.Sh INTERRUPT STORMS +It is important to note that 100G operation can generate high +numbers of interrupts, often incorrectly being interpreted as +a storm condition in the kernel. +It is suggested that this be resolved by setting +.Va hw.intr_storm_threshold +to 0. +.Sh SUPPORT +For general information and support, +go to the Intel support website at: +.Lk http://www.intel.com/support/ . +.Pp +If an issue is identified with this driver with a supported adapter, +email all the specific information related to the issue to +.Aq Mt freebsd@intel.com . +.Sh SEE ALSO +.Xr arp 4 , +.Xr iflib 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.2 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Intel Corporation Aq Mt freebsd@intel.com . From nobody Thu May 23 02:44:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlCDV0WCgz5LZGB; Thu, 23 May 2024 02:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlCDT5RLVz44D9; Thu, 23 May 2024 02:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wcQ5ONHn5E2MoSdFsZVSDl3TA9q92OLwJxvSbthveAw=; b=OfdA8AoC41ZWFuazHMhflujmLeTc0+goHpm4v+09YuWCjNwI8x0P9toWgB7heiRRUcd9z0 3UoXZfTCApHktNRRv0AcNJ3Tb2aB8X0RpVkLGMUj0VkkuV4DNaC0MopCHTR76DrvG6SyS1 AjGA9YaN5/j0rUCNbACssngfBuN24qBdT+FASpNzDiEGA9yrc2gUTEoS6s5XkhzhVyN1Tn +eozjP0fa01NQuxiwxwghD38UZ0Hjt42KhAv7n22HZaZ0qyvYm6B0eq79Aq1wNGfltILV8 d4tRW7ngHbB6ABZeGBKTAYK9iGFZgNfI8Jqt4TpU6gzmnSBIjVOG/EdOLR3DUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432249; a=rsa-sha256; cv=none; b=nZo8Hl94Felnz5O/xYz+02eZlaEY79zp9HRnPxCgrC4PqUTrHcXalJP81YfraGVuarPIeO NXZ7OF+i49O4JFmpvRTkWnhXQUEYwxC74/MVUjTJmjbNaBP9jOkQ5z0Mgmu2JE0nNv3qc7 KIblHiILeriOGOYBP0RgsGXqHQiqn7fCt+jR8W0xGTyB20QjywjajrCmBtFu9v6l/3iR0j 9vY2nY7FTIbdUxh1/yLV7v8S1o/X6DD5jj9Thz7ezc2vFDY46uZ+NhmpNn0Yrel27ScT+7 MOHgtXGbeAZZk0epp9YETfGuNsMcA3bL6KhY6bcZ40Zxz7i7CzPZcK1Sv2O18w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wcQ5ONHn5E2MoSdFsZVSDl3TA9q92OLwJxvSbthveAw=; b=wB1z4TtPuQnLamYeRHlchZFfP82U40IYhC1himit7Xd0BRdkDtogQnf4be1qcN7K6LFutW TGd595mRRF6tEdLXDFP31UVtgchnA5k7CsnsAmy+VoR/C0kmQIm+UDW2XegI0p6YnhVLxY dNp0MsqsPjHrBM/WlA+htqh/a5aI/N9/7jTmBjLE2qnK1/xcfk5d6ZDOjOCr7WouAjo2ED HXCEGYRWeSi/2h2yIBLwXE89WC2JhGtexyP+15N2uoHjCkYf9VbB9Z4bpKY1pw3rJ9Gjb1 gZGYwWaTZ0GKYis2P9hMyIA5k0UJfqYmHlN/dQtX/cG1MdqdpBTlpqdcgiUiow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlCDT52QrzXgy; Thu, 23 May 2024 02:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2i9Ec056669; Thu, 23 May 2024 02:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2i9IW056666; Thu, 23 May 2024 02:44:09 GMT (envelope-from git) Date: Thu, 23 May 2024 02:44:09 GMT Message-Id: <202405230244.44N2i9IW056666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 78ea1fcf29a7 - stable/13 - access.2: Mention that lstat(2) should be used for symbolic links List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 78ea1fcf29a780fb6bd90e41772d5a3751fb56d7 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=78ea1fcf29a780fb6bd90e41772d5a3751fb56d7 commit 78ea1fcf29a780fb6bd90e41772d5a3751fb56d7 Author: Gordon Bergling AuthorDate: 2024-05-13 08:40:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:43:49 +0000 access.2: Mention that lstat(2) should be used for symbolic links access(), eaccess() and faccessat() will always dereference symbolic links. So add a note in the manual page, that lstat(2) should be used in the case of symbolic links. PR: 262895 Reviewed by: gbe, pauamma_gundo.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44890 (cherry picked from commit 421025a274fb5759b3ecc8bdb30b24db830b45ae) --- lib/libc/sys/access.2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 681e4483a9e6..64ed1133b23d 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -27,7 +27,7 @@ .\" .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" -.Dd March 30, 2021 +.Dd May 13, 2024 .Dt ACCESS 2 .Os .Sh NAME @@ -149,6 +149,15 @@ Likewise for .Dv R_OK and .Dv W_OK . +.Pp +.Fn access , +.Fn eaccess +and +.Fn faccessat +will always dereference symbolic links. +If the symbolic link itself needs to be referenced, +.Xr lstat 2 +should be used instead. .Sh RETURN VALUES .Rv -std .Sh ERRORS From nobody Thu May 23 02:44:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlCDW07rNz5LZGd; Thu, 23 May 2024 02:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlCDV6RFjz44DB; Thu, 23 May 2024 02:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMo4CrH36YDicqI36poGTw6SdSoiF+qRfPuj2srp0G0=; b=D04zx2bV80WV2RQRIg8DyzutAuj7Cr/xMPQ2P7Se8Em30AgMnJRCD5cAc+lm7Wum4QGiNq uNViRVVtsB/HsH3f0vOhQCVouD9zg/e71o+Nu8ZFgaadbRBPJz1rjnTmP3KpmLIGzC9oQ8 AZo/eo5QScjq7LoKr/6GWgpDXfQyxJ4dd6xy3d4RTXJdcKNfHzPo8eEKDF4sFb8RfHOg5h JtPGPFAd7bWS2Ez+4/eJF+9oPIJud2t5SJt09N+yzbmJR3Zec80WYE7EkH8ZZhBxFP++N4 C//iLyNHMMQFqTCLkI61nY7gDxQ4Mfy+0JFBgdtaesr0g6/8W177Z6MNTBXoGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432250; a=rsa-sha256; cv=none; b=Tm2kRaeMY6HaSX+8mB9A5uyg23Fi4z2OtVY2fnYhkT5YsYpGrQZy7cp+PYDrFFcr0Lcyra 7Tf96wOGWhl7/pbtd4uQjuSEl4YEycuzBqUrse5AzLD6wUQh8Dr1oMReBEovTyrQBnQ49d WgwkTbLJI4+CLxq4TPO+ipVNerc6fL2ITSIVXa4KSs9L5Z2dgr/ZS0Uyx8wE/efYkOTHss lgFb5tYmP04kL/9QR5jx+J4rU+XbpCkgTMg8dVWdDIFiUaYW5IvPyQTkQFlGc81D86SMFe iGgCYXavOy9yWFs9RlwnzH07lboPWwb/27K2+CELN6cjz2uiJkrIuqi/PM9pZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMo4CrH36YDicqI36poGTw6SdSoiF+qRfPuj2srp0G0=; b=KqmJYcM+9cEtjvpzGaDKB8qtyIlAMuGrTd/LgG77IhGlmL0pjk+ET+uHYbM0FZa+11oR5B p5HCw3VqAvMdo5fJm48u7tAb8jBtoqhgIBPQRiIhgx2aEc/WGl/ASTeIz4xQ+yuJx4Wnee Xfh+OiR2xbPQ/7AIyeUsU0juTEwL45KKfbEKv9c4oQLhUogiz84rUs+EsJ/Pbwkljs642I wG4Dckgtwx9+mAlkUsMblqyCRCncIlF3Gl4i5QgCJJRjT7pPhKCNAUyChm/Sz5mpBRoux1 qQW/drnnpmF7iJmFNvRVfIJsLWEUC1Zn+m+9XNmJjf/DWeWxoohrkkrUhoKfyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlCDV63b0zX7S; Thu, 23 May 2024 02:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2iAti056720; Thu, 23 May 2024 02:44:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2iAnB056717; Thu, 23 May 2024 02:44:10 GMT (envelope-from git) Date: Thu, 23 May 2024 02:44:10 GMT Message-Id: <202405230244.44N2iAnB056717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 55cd52a4418d - stable/13 - access(2): Discourage use of these system calls. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 55cd52a4418d79962ebd81f34544a3747db9e031 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=55cd52a4418d79962ebd81f34544a3747db9e031 commit 55cd52a4418d79962ebd81f34544a3747db9e031 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-21 22:35:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:43:49 +0000 access(2): Discourage use of these system calls. Fixes: 421025a274fb PR: 262895 MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45240 (cherry picked from commit a4be1eb21165d7aedae9dc6634528619ff10d025) --- lib/libc/sys/access.2 | 105 ++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 55 deletions(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 64ed1133b23d..8595444720b1 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -27,7 +27,7 @@ .\" .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" -.Dd May 13, 2024 +.Dd May 21, 2024 .Dt ACCESS 2 .Os .Sh NAME @@ -47,35 +47,43 @@ .Fn faccessat "int fd" "const char *path" "int mode" "int flag" .Sh DESCRIPTION The -.Fn access -and +.Fn access , .Fn eaccess -system calls check the accessibility of the -file named by -the +and +.Fn faccessat +system calls report whether an attempt to access the file designated +by their .Fa path -argument -for the access permissions indicated by -the +in the manner described by their .Fa mode -argument. +argument is likely to succeed. The value of .Fa mode -is either the bitwise-inclusive OR of the access permissions to be -checked -.Dv ( R_OK +is either the bitwise-inclusive OR of the desired permissions +.Po +.Dv R_OK for read permission, .Dv W_OK for write permission, and .Dv X_OK -for execute/search permission), -or the existence test -.Pq Dv F_OK . +for execute / search permission +.Pc +or +.Dv F_OK +to simply check whether the file exists. .Pp -For additional information, see the -.Sx "File Access Permission" -section of -.Xr intro 2 . +For a number of reasons, these system calls cannot be relied upon to +give a correct and definitive answer. +They can at best provide an early indication of the expected outcome, +to be confirmed by actually attempting the operation. +For existence checks, either +.Xr stat 2 +or +.Xr lstat 2 +should be used instead. +See also +.Sx SECURITY CONSIDERATIONS +below. .Pp The .Fn eaccess @@ -89,6 +97,13 @@ the real user ID in place of the effective user ID, the real group ID in place of the effective group ID, and the rest of the group access list. .Pp +See the +.Sx DEFINITIONS +section of +.Xr intro 2 +for additional information on file access permissions and real +vs. effective user and group IDs. +.Pp The .Fn faccessat system call is equivalent to @@ -116,8 +131,10 @@ list, defined in .In fcntl.h : .Bl -tag -width indent .It Dv AT_EACCESS -The checks for accessibility are performed using the effective user and group -IDs instead of the real user and group ID as required in a call to +The checks are performed using the effective user and group IDs, +like +.Fn eaccess , +instead of the real user and group ID, like .Fn access . .It Dv AT_RESOLVE_BENEATH Only walk paths below the directory specified by the @@ -149,23 +166,15 @@ Likewise for .Dv R_OK and .Dv W_OK . -.Pp -.Fn access , -.Fn eaccess -and -.Fn faccessat -will always dereference symbolic links. -If the symbolic link itself needs to be referenced, -.Xr lstat 2 -should be used instead. .Sh RETURN VALUES .Rv -std .Sh ERRORS +The .Fn access , .Fn eaccess , -or +and .Fn faccessat -will fail if: +system calls may fail if: .Bl -tag -width Er .It Bq Er EINVAL The value of the @@ -256,25 +265,11 @@ system call appeared in .Fx 8.0 . .Sh SECURITY CONSIDERATIONS The -.Fn access -system call -is a potential security hole due to race conditions and -should never be used. -Set-user-ID and set-group-ID applications should restore the -effective user or group ID, -and perform actions directly rather than use -.Fn access -to simulate access checks for the real user or group ID. -The -.Fn eaccess -system call -likewise may be subject to races if used inappropriately. -.Pp -.Fn access -remains useful for providing clues to users as to whether operations -make sense for particular filesystem objects (e.g. 'delete' menu -item only highlighted in a writable folder ... avoiding interpretation -of the st_mode bits that the application might not understand -- -e.g. in the case of AFS). -It also allows a cheaper file existence test than -.Xr stat 2 . +.Fn access , +.Fn eaccess , +and +.Fn faccessat +system calls are subject to time-of-check-to-time-of-use races and +should not be relied upon for file permission enforcement purposes. +Instead, applications should perform the desired action using the +requesting user's credentials. From nobody Thu May 23 02:44:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlCDX0ymtz5LZ69; Thu, 23 May 2024 02:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlCDX0JBzz44Gs; Thu, 23 May 2024 02:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=je6mt2LTvqaWS4bpcPtnaWGZoOUF42D3IPP+G3Yz6LU=; b=BjrpL82qG2bfzkS5OsCq68eOkzHNEnDNfl20WHHSre82VXOJHcxhPi+ReA1gwUE9VnYvlk c4gBDtqpQZUj8A2dMT3WSaY5nqFGFCa0y6uVkHQaIOyIrZxE3e1K/MOgbJtEzwo1XXD0Cv zoVPyQbJPaMURqa2HiR1/xUIc3vV4loDtDa7Idf9x8Xvzaf3CvyBbitLFTJfLCsWUnmz2w hbzuoT6O/EU4F1jwFeKJ1yMbecPGikXJlYdSRDPjVby06yQ9NevUHEkAvJ1NVfCCch4aTG Zm/LYV0ZMuk316Oa5t1beOMfkrpVH0hGkZs66Xl6yzNfFXbtXnEjJJkJbn/AoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432252; a=rsa-sha256; cv=none; b=E9UrDsh+wwjgCt3XEHUUPZcsbOZ6kFggA3+1jMpmnqbHvv6HYIH8pdcRpL4y1KxW2O1ILo 39aSUKYVnmkf3BKsNkdrRbdY2lSvEFzRCjTCsMrPpRosjxp/TZKiGsWUaeI9iaenBmEdua r2tZSTixfti2GY9OALvwnIBLTGC4m0LIxmaKXX0yMGZYxmGHRnE5mjAvUqemRVe5gVNM6j 3O4xxhWpSJYueXzMz+oP4srpBUj2eqXkHJIOeq81ADtemK8VmQr6i14Jf+IZT4/03XlCdF hMVBCamMdOwvq6tbJFRWX5RkTLI3E5dsELj7HGpgb0mrhNMs+iyO16SAhlPT1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=je6mt2LTvqaWS4bpcPtnaWGZoOUF42D3IPP+G3Yz6LU=; b=qHJgJ2DXHnjxZXAbVOo5y64SpKNvFK/iV8n/3C4fP2brG0QUQ9b5RoeXRD5/yf0bRNC05Q /fAyOC29YVIUxcnrwHB8h8ukPIYlECuuyeuz8KTAOcjZ6AydKHGQIlP2SRUDxDW/iIv61S NRxGdFMVCvq8uC+rmiFDIMPnYo4Ro8gL/kAqUm2LVq2PKBl1adZs+33hIpXMAN658SQm9L lCa3KZ3xBsNJ5IdrhYryF1y9jhvy/mywb9/hdLxIMGCifNfPo6lpXwbyIhV3Dr6yIjIxaE w79TxGxn/pCf9XlY44E1Pzyt5505btp+KFBoMhja1d+Oktg2IFk0cCgv+AgOxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlCDW7235zXby; Thu, 23 May 2024 02:44:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2iBcW056772; Thu, 23 May 2024 02:44:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2iB5m056769; Thu, 23 May 2024 02:44:11 GMT (envelope-from git) Date: Thu, 23 May 2024 02:44:11 GMT Message-Id: <202405230244.44N2iB5m056769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: d823e80ef5a7 - stable/13 - iavf(4): Improve man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d823e80ef5a709ee8c1f9e138eedcda6c1cbd1b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d823e80ef5a709ee8c1f9e138eedcda6c1cbd1b5 commit d823e80ef5a709ee8c1f9e138eedcda6c1cbd1b5 Author: Eric Joyner AuthorDate: 2024-05-21 23:24:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:43:49 +0000 iavf(4): Improve man page MFC after: 3 days Reviewed by: erj Differential Revision: https://reviews.freebsd.org/D43093 (cherry picked from commit ba222f6fb4b226ab24beaa13a8591dcb624ae70f) --- share/man/man4/iavf.4 | 348 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 282 insertions(+), 66 deletions(-) diff --git a/share/man/man4/iavf.4 b/share/man/man4/iavf.4 index 2e265a5a2fbb..d55e084e82cc 100644 --- a/share/man/man4/iavf.4 +++ b/share/man/man4/iavf.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 2013-2018, Intel Corporation .\" All rights reserved. .\" @@ -29,12 +32,12 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd January 30, 2019 +.Dd May 21, 2024 .Dt IAVF 4 .Os .Sh NAME .Nm iavf -.Nd "Intel Adaptive Virtual Function driver" +.Nd "Intel Ethernet Adaptive Virtual Function Driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -51,87 +54,300 @@ if_iavf_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the PCI Virtual Functions from the 700 Series of -ethernet devices and newer product families. -The driver supports Jumbo Frames, TX/RX checksum offload, -TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN -tag insertion/extraction, VLAN checksum offload, VLAN TSO, and -Receive Side Steering (RSS), all for both IPv4 and IPv6. -For further hardware information and questions related to hardware -requirements, see -.Pa http://support.intel.com/ . -.Pp -Support for Jumbo Frames is provided via the interface MTU setting. -Selecting an MTU larger than 1500 bytes with the +driver provides support for any PCI Virtual Function created from certain +Intel Ethernet devices. +This driver is compatible with virtual functions bound to devices based on the +following: +.Pp +.Bl -bullet -compact +.It +Intel\(rg Ethernet Controller E810\-C +.It +Intel\(rg Ethernet Controller E810\-XXV +.It +Intel\(rg Ethernet Connection E822\-C +.It +Intel\(rg Ethernet Connection E822\-L +.It +Intel\(rg Ethernet Connection E823\-C +.It +Intel\(rg Ethernet Connection E823\-L +.It +Intel\(rg Ethernet Controller I710 +.It +Intel\(rg Ethernet Controller X710 +.It +Intel\(rg Ethernet Controller XL710 +.It +Intel\(rg Ethernet Network Connection X722 +.It +Intel\(rg Ethernet Controller XXV710 +.It +Intel\(rg Ethernet Controller V710 +.El +.Pp +The associated Physical Function (PF) drivers for this VF driver are: +.Pp +.Bl -bullet -compact +.It +.Xr ice 4 +.It +.Xr ixl 4 +.El +.Pp +For questions related to hardware requirements, refer to the documentation +supplied with your Intel Ethernet Adapter. +All hardware requirements listed apply to use with +.Fx . +.Ss The VF Driver +The VF driver is normally used in a virtualized environment where a host driver +manages SR\-IOV, and provides a VF device to the guest. +.Pp +In the +.Fx +guest, the iavf driver would be loaded and will function using +the VF device assigned to it. +.Pp +The VF driver provides most of the same functionality as the core driver, but +is actually a subordinate to the host. +Access to many controls is accomplished by a request to the host via what is +called the "Admin queue." +These are startup and initialization events, however; once in operation, the +device is self\-contained and should achieve near native performance. +.Pp +Some notable limitations of the VF environment: +.Bl -bullet +.It +The PF can configure the VF to allow promiscuous mode, using a configuration +parameter in +.Xr iovctl.conf 5 ; +otherwise, promiscuous mode will not work +.It +Media info is not available from the PF, so the active media will always be +displayed as auto in .Xr ifconfig 8 -utility configures the adapter to receive and transmit Jumbo Frames. -The maximum MTU size for Jumbo Frames is 9706. +.El +.Ss Adaptive Virtual Function +Adaptive Virtual Function (AVF) allows the virtual function driver, or VF, to +adapt to changing feature sets of the physical function driver (PF) with which +it is associated. +This allows system administrators to update a PF without having to update all +the VFs associated with it. +All AVFs have a single common device ID and branding string. .Pp -Offloads are also controlled via the interface, for instance, -checksumming for both IPv4 and IPv6 can be set and unset, TSO4 -and/or TSO6, and finally LRO can be set and unset. +AVFs have a minimum set of features known as "base mode," but may provide +additional features depending on what features are available in the PF with +which the AVF is associated. +The following are base mode features: +.Bl -bullet -compact +.It +4 Queue Pairs (QP) and associated Configuration Status Registers (CSRs) +for Tx/Rx +.It +iavf descriptors and ring format +.It +Descriptor write\-back completion +.It +1 control queue, with iavf descriptors, CSRs and ring format +.It +5 MSI\-X interrupt vectors and corresponding iavf CSRs +.It +1 Interrupt Throttle Rate (ITR) index +.It +1 Virtual Station Interface (VSI) per VF +.It +1 Traffic Class (TC), TC0 +.It +Receive Side Scaling (RSS) with 64 entry indirection table and key, +configured through the PF +.It +1 unicast MAC address reserved per VF +.It +8 MAC address filters for each VF on an Intel\(rg Ethernet 800 Series device +.It +16 MAC address filters for each VF on an Intel\(rg Ethernet 700 Series device +.It +Stateless offloads \- non\-tunneled checksums +.It +AVF device ID +.It +HW mailbox is used for VF to PF communications +.El +.Sh CONFIGURATION AND TUNING +.Ss Important System Configuration Changes +It is important to note that 100G operation can generate high +numbers of interrupts, often incorrectly being interpreted as +a storm condition in the kernel. +It is suggested that this be resolved by setting +.Va hw.intr_storm_threshold +to 0. .Pp -For more information on configuring this device, see -.Xr ifconfig 8 . +The default is 1000. .Pp -.Em NOTE : -This +Best throughput results are seen with a large MTU; use 9706 if possible. +The default number of descriptors per ring is 1024. +Increasing this may improve performance, depending on your use case. +.Ss Configuring for no iflib +.Xr iflib 4 +is a common framework for network interface drivers for +.Fx +that uses a shared set of sysctl names. +.Pp +The default .Nm -driver is only for Virtual Functions. -For 700 series Physical Functions, use the -.Xr ixl 4 -driver. -.Sh LOADER TUNABLES -Tunables can be set at the -.Xr loader 8 -prompt before booting the kernel or stored in -.Xr loader.conf 5 . -.Bl -tag -width indent -.It Va hw.iavf.rx_itr -The RX interrupt rate value, set to 62 (124 usec) by default. -.It Va hw.iavf.tx_itr -The TX interrupt rate value, set to 122 (244 usec) by default. -.It Va hw.iavf.enable_head_writeback -When the driver is finding the last TX descriptor processed by the hardware, -use a value written to memory by the hardware instead of scanning the -descriptor ring for completed descriptors. -Disabled by default; this mimics the "legacy" TX behavior found in -.Xr ixgbe 4 . -to ensure compatibility with future, non-700 series VF devices. +driver depends on it, but it can be compiled without it. +.Ss Jumbo Frames +Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU) +to a value larger than the default value of 1500. +.Pp +Use the +.Xr ifconfig 8 +command to increase the MTU size. +.Pp +To confirm the MTU used between two specific devices, use +.Xr route 8 : +.Bd -literal -offset indent +route get +.Ed +.Pp +NOTE: +.Bl -bullet +.It +The maximum MTU setting for jumbo frames is 9706. +This corresponds to the maximum jumbo frame size of 9728 bytes. +.It +This driver will attempt to use multiple page-sized buffers to receive +each jumbo packet. +This should help to avoid buffer starvation issues when allocating receive +packets. +.It +Packet loss may have a greater impact on throughput when you use jumbo +frames. +If you observe a drop in performance after enabling jumbo frames, enabling +flow control may mitigate the issue. .El -.Sh SUPPORT -For general information and support, -go to the Intel support website at: -.Pa http://support.intel.com/ . +.Ss Checksum Offload +Checksum offloading supports both TCP and UDP packets and is supported for both +transmit and receive. +.Pp +TSO (TCP Segmentation Offload) supports both IPv4 and IPv6. +Both of these features are enabled and disabled via +.Xr ifconfig 8 . .Pp -If an issue is identified with this driver with a supported adapter, -email all the specific information related to the issue to -.Mt freebsd@intel.com . +NOTE: +.Bl -bullet -compact +.It +TSO requires Tx checksum; if Tx checksum is disabled then TSO will also +be disabled. +.El +.Ss LRO +LRO (Large Receive Offload) may provide Rx performance improvement. +However, it is incompatible with packet\-forwarding workloads. +You should carefully evaluate the environment and enable LRO when possible. +.Ss Rx and Tx Descriptor Rings +Allows you to set the Rx and Tx descriptor rings independently. +Set them via these +.Xr iflib 4 +sysctls: +.Bl -tag -width indent +.It dev.iavf.#.iflib.override_nrxds +.It dev.iavf.#.iflib.override_ntxds +.El +.Ss Link\-Level Flow Control (LFC) +The VF driver does not have access to flow control settings. +It must be managed from the host side. .Sh SEE ALSO .Xr arp 4 , +.Xr ice 4 , +.Xr iflib 4 , .Xr ixl 4 , .Xr netintro 4 , .Xr vlan 4 , -.Xr ifconfig 8 , -.Xr iflib 9 +.Xr ifconfig 8 +.Pp +See the +.Dq Intel\(rg Ethernet Adapters and Devices User Guide +for additional information on features. +It is available on the Intel website at either of the following: +.Bl -bullet +.It +.Lk https://cdrdv2.intel.com/v1/dl/getContent/705831 +.It +.Lk https://www.intel.com/content/www/us/en/download/19373/adapter\-user\-guide\-for\-intel\-ethernet\-adapters.html +.El +.Pp +For information on how to identify your adapter, and for the latest Intel +network drivers, refer to the Intel Support website: +.Aq Lk http://www.intel.com/support +.Sh CAVEATS +.Ss Driver Buffer Overflow Fix +The fix to resolve CVE\-2016\-8105, referenced in Intel SA\-00069 +.Aq Lk https://www.intel.com/content/www/us/en/security\-center/advisory/intel\-sa\-00069.html , +is included in this and future versions of the driver. +.Ss Network Memory Buffer Allocation +.Fx +may have a low number of network memory buffers (mbufs) by default. +If your mbuf value is too low, it may cause the driver to fail to initialize +and/or cause the system to become unresponsive. +You can check to see if the system is mbuf\-starved by running +.Li "netstat -m" . +Increase the number of mbufs by editing the lines below in +.Xr sysctl.conf 5 : +.Bd -literal -offset indent +kern.ipc.nmbclusters +kern.ipc.nmbjumbop +kern.ipc.nmbjumbo9 +kern.ipc.nmbjumbo16 +kern.ipc.nmbufs +.Ed +.Pp +The amount of memory that you allocate is system specific, and may require +some trial and error. +Also, increasing the following in +.Xr sysctl.conf 5 +could help increase +network performance: +.Bd -literal -offset indent +kern.ipc.maxsockbuf +net.inet.tcp.sendspace +net.inet.tcp.recvspace +net.inet.udp.maxdgram +net.inet.udp.recvspace +.Ed +.Ss UDP Stress Test Dropped Packet Issue +Under small packet UDP stress with the +.Nm +driver, the system may drop UDP packets due to socket buffers being full. +Setting the PF driver's Flow Control variables to the minimum may resolve the +issue. +.Ss Disable LRO when routing/bridging +LRO must be turned off when forwarding traffic. +.Sh SUPPORT +For general information, go to the Intel support website at +.Aq Lk http://www.intel.com/support/ . +.Pp +If an issue is identified with the released source code on a supported kernel +with a supported adapter, email the specific information related to the issue +to +.Aq Mt freebsd@intel.com . +.Sh LEGAL +Intel\(rg is a trademark or registered trademark of Intel Corporation +or its subsidiaries in the United States and / or other countries. +.Pp +Other names and brands may be claimed as the property of others. .Sh HISTORY The .Nm device driver first appeared in -.Fx 10.1 . -under the name "ixlv" +.Fx 10.1 +under the name +.Nm ixlv . It was converted to use -.Xr iflib 9 -and changed to its current name in -.Fx 12 . +.Xr iflib 4 +and renamed in +.Fx 12.4 . .Sh AUTHORS -.An -nosplit The .Nm -driver was written by -.An Jack Vogel Aq Mt jfv@freebsd.org -and -.An Eric Joyner Aq Mt erj@freebsd.org . -.Sh CAVEATS -This driver is supposed to function on VFs spawned from future network devices by Intel, -but at the time of this writing, has only been tested on the 700 series VFs. +driver was written by the +.An Intel Corporation Aq Mt freebsd@intel.com From nobody Thu May 23 02:47:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlCJ11Tj9z5LZTk; Thu, 23 May 2024 02:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlCJ10ttqz45tT; Thu, 23 May 2024 02:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OKfp/a5S7IAk2HedaLh6JxGRHcFYYYb1lpS+QkWKYU4=; b=mIRcIut7FB4KdgDt2+E4gvDptLe0TgvKS3IRZ4X397azeHcv6+uNdUECD0mkjwkAQZsiQa 9wOEIR//zJI6PxT3E+Ryuu6cY/jaj+pclf9/nx3VIaWS3opQ19H6hb6F6wyyx6llBruFch td3e5gs+yhf61X31QLYgIiR+XLBXHap19rBhQfJAXSRx1J8/brrujlKn3S5ggeeVGAKhju j2aHkDKW7LoiDm4BeIk4mdvvS4buA9nWDEDNi4EuDFDXy+RaZxBDf5mqIViSHUNWG9MPTg MAqM/X8vKHsq2KRT7v+FNC3fC/hgV//G3x5yC79ix3lPGcx9j6M46/nj6pS5gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432433; a=rsa-sha256; cv=none; b=wfzx8lj65rip7/X8t3dYprwaTpUkbD3ta48WgUqsES9tE4lTKf96NX4Rwaahp1X06T8n6N bGoNxvBTnz4X8n8U0UdgIdJFniWiZBqTjTdxX3onvLb4GtsJ+jL42kAhR8veGyhU5x9oLp FoMYfWpYSoDU3r8s81XFoqACJZ3ojoajUY5YgUE6LMH4CcX9UHXkNVvd8jkaHyDvNlrs1J 8l3TU/IMLdEqi8QdexSIEdEzT4Bi2RF/+VjT+xNvolC2d7sOHB+KoNYpKCBl8kYDrg4MO+ oxVfua+7soNgQ+oop70D49EDTaK+o+ASCvXJ+pkSwA7MaHc9/+2LUtuepBKaAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OKfp/a5S7IAk2HedaLh6JxGRHcFYYYb1lpS+QkWKYU4=; b=ao+342A09vbk5GNJqQpoLP0zxiiBJIMcwud5AuA3f6M/aPNnMYacJfQM6XE8CLgARqjhk2 HJ8nkmueBD8EyXHh97Xtg7RcgWaainVNy854ALiXe2+BydzFlRqisxOGu/ju1WNkzg3hV+ LrNrgcBkwnp4tAYufBtqIQfwLtV4syYuXUXNPCtdnQFk97O6K6B/4I5CArlxjrvP0K7uCv O5q0YKbzSj5Iio53r9ujhiIH8jLuoDQIfsdgtKUpv/XlhL9EwSjcJLJ/cBQmBH71yMf8aO 0nE8nmZbRLKp/Ea7MDhpGhqCrrn8uSDf6XuH2iUoINNmxpLOAuyVH7SuAbG8nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlCJ106LRzXdk; Thu, 23 May 2024 02:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2lCqN057393; Thu, 23 May 2024 02:47:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2lCB4057390; Thu, 23 May 2024 02:47:12 GMT (envelope-from git) Date: Thu, 23 May 2024 02:47:12 GMT Message-Id: <202405230247.44N2lCB4057390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 3cec7e14b06e - releng/14.1 - Add man page for the ice network driver. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 3cec7e14b06edb74c6c30889bef5c8e448ecec71 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3cec7e14b06edb74c6c30889bef5c8e448ecec71 commit 3cec7e14b06edb74c6c30889bef5c8e448ecec71 Author: Mathieu Simon AuthorDate: 2024-05-21 05:49:50 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:45:25 +0000 Add man page for the ice network driver. PR: 262892 MFC after: 3 days Reviewed by: concussious.bugzilla@runbox.com, erj Differential Revision: https://reviews.freebsd.org/D45270 (cherry picked from commit 8e5e42d54ad3093e38263814d1f3e7d8406d5421) (cherry picked from commit 42e50eaf7f6f4459f1217564fd143ae4f8127154) Approved by: re (karels) --- share/man/man4/Makefile | 2 + share/man/man4/ice.4 | 250 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 252 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index a2d544034005..7c18e3cf7d12 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -209,6 +209,7 @@ MAN= aac.4 \ hwpmc.4 \ ${_hwpstate_intel.4} \ iavf.4 \ + ice.4 \ ichsmb.4 \ ${_ichwd.4} \ icmp.4 \ @@ -688,6 +689,7 @@ MLINKS+=ip.4 rawip.4 MLINKS+=ipfirewall.4 ipaccounting.4 \ ipfirewall.4 ipacct.4 \ ipfirewall.4 ipfw.4 +MLINKS+=ice.4 if_ice.4 MLINKS+=ipheth.4 if_ipheth.4 MLINKS+=ipw.4 if_ipw.4 MLINKS+=iwi.4 if_iwi.4 diff --git a/share/man/man4/ice.4 b/share/man/man4/ice.4 new file mode 100644 index 000000000000..da46c758479c --- /dev/null +++ b/share/man/man4/ice.4 @@ -0,0 +1,250 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" +.\" Copyright (c) 2019-2020, Intel Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms of the Software, 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. +.\" +.\" 3. Neither the name of the Intel Corporation nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this Software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +.\" +.\" * Other names and brands may be claimed as the property of others. +.\" +.Dd May 20, 2024 +.Dt ICE 4 +.Os +.Sh NAME +.Nm ice +.Nd "Intel Ethernet 800 Series 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 iflib" +.Cd "device ice" +.Ed +.Pp +To load the driver as a module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ice_load="YES" +.Ed +.Sh DESCRIPTION +.Ss Features +The +.Nm +driver provides support for any PCI Express adapter or LOM +(LAN On Motherboard) +in the Intel Ethernet 800 Series. +As of this writing, the series includes devices with these model numbers: +.Pp +.Bl -bullet -compact +.It +Intel\(rg Ethernet Controller E810\-C +.It +Intel\(rg Ethernet Controller E810\-XXV +.It +Intel\(rg Ethernet Connection E822\-C +.It +Intel\(rg Ethernet Connection E822\-L +.It +Intel\(rg Ethernet Connection E823\-C +.It +Intel\(rg Ethernet Connection E823\-L +.El +.Pp +For questions related to hardware requirements, refer to the documentation +supplied with your adapter. +.Pp +Support for Jumbo Frames is provided via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +The maximum MTU size for Jumbo Frames is 9706. +This value coincides with the maximum Jumbo Frame size of 9728. +.Pp +This driver version supports VLANs. +For information on enabling VLANs, see the +.Pa README . +.Pp +Offloads are also controlled via the interface, for instance, checksumming for +both IPv4 and IPv6 can be set and unset, TSO4 and/or TSO6, and finally LRO can +be set and unset. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Ss Additional Utilities +There are additional tools available from Intel to help configure and update +the adapters covered by this driver. +These tools can be downloaded directly from Intel at +.Lk https://downloadcenter.intel.com , +by searching for their names, or by installing certain packages: +.Bl -bullet +.It +To change the behavior of the QSFP28 ports on E810-C adapters, use the +Intel EPCT (Ethernet Port configuration tool); installed by the +.Em sysutils/intel-epct +package. +.It +To update the firmware on an adapter, use the Intel Non-Volatile Memory (NVM) +Update Utility for Intel Network Adapter 800 series; installed by the +.Em sysutils/intel-nvmupdate-100g +package. +.El +.Sh HARDWARE +Most adapters in the Intel Ethernet 800 Series with SFP28/QSFP28 cages +have firmware that requires that Intel qualified modules are used; these +qualified modules are listed below. +This qualification check cannot be disabled by the driver. +.Pp +The +.Nm +driver supports 100Gb Ethernet adapters with these QSFP28 modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 100G QSFP28 100GBASE-SR4 E100GQSFPSR28SRX +.It +Intel\(rg 100G QSFP28 100GBASE-SR4 SPTMBP1PMCDF +.It +Intel\(rg 100G QSFP28 100GBASE-CWDM4 SPTSBP3CLCCO +.It +Intel\(rg 100G QSFP28 100GBASE-DR SPTSLP2SLCDF +.El +.Pp +The +.Nm +driver supports 25Gb and 10Gb Ethernet adapters with these SFP28 modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 10G/25G SFP28 25GBASE-SR E25GSFP28SR +.It +Intel\(rg 25G SFP28 25GBASE-SR E25GSFP28SRX (Extended Temp) +.It +Intel\(rg 25G SFP28 25GBASE-LR E25GSFP28LRX (Extended Temp) +.El +.Pp +The +.Nm +driver supports 10Gb and 1Gb Ethernet adapters with these SFP+ modules: +.Pp +.Bl -bullet -compact +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSR +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSRG1P5 +.It +Intel\(rg 1G/10G SFP+ 10GBASE-SR E10GSFPSRG2P5 +.It +Intel\(rg 10G SFP+ 10GBASE-SR E10GSFPSRX (Extended Temp) +.It +Intel\(rg 1G/10G SFP+ 10GBASE-LR E10GSFPLR +.El +.Pp +Note that adapters also support all passive and active +limiting direct attach cables that comply with SFF-8431 v4.1 and +SFF-8472 v10.4 specifications. +.Pp +This is not an exhaustive list; please consult product documentation for an +up-to-date list of supported media. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +See the +.Xr iflib 4 +man page for more information on using iflib sysctl variables as tunables. +.Bl -tag -width indent +.It Va hw.ice.#.enable_health_events +TBW +.It Va hw.ice.#.debug.enable_tx_fc_filter +TBW +.It Va hw.ice.#.debug.enable_tx_lldp_filter +TBW +.It Va hw.ice.#.debug.enable_health_events +TBW +.El +.Sh SYSCTL PROCEDURES +.Bl -tag -width indent +.It Va dev.ice.#.fc +Allows one to set the flow control value. +A value of 0 disables flow control, 3 enables full, 1 is RX, and 2 is +TX pause. +.It Va dev.ice.#.advertise_speed +Allows one to set advertised link speeds, this will then cause a link +renegotiation. +.It Va dev.ice.#.current_speed +This is a display of the current setting. +.It Va dev.ice.#.fw_version +Displays the current firmware and NVM versions of the adapter. +.It Va dev.ice.#.ddp_version +TBW +.It Va dev.ice.#.requested_fec +TBW +.It Va dev.ice.#.negotiated_fec +TBW +.It Va dev.ice.#.fw_lldp_agent +TBW +.It Va dev.ice.#.ets_min_rate +TBW +.It Va dev.ice.#.up2tc_map +TBW +.It Va dev.ice.#.pfc +TBW +.El +.Sh INTERRUPT STORMS +It is important to note that 100G operation can generate high +numbers of interrupts, often incorrectly being interpreted as +a storm condition in the kernel. +It is suggested that this be resolved by setting +.Va hw.intr_storm_threshold +to 0. +.Sh SUPPORT +For general information and support, +go to the Intel support website at: +.Lk http://www.intel.com/support/ . +.Pp +If an issue is identified with this driver with a supported adapter, +email all the specific information related to the issue to +.Aq Mt freebsd@intel.com . +.Sh SEE ALSO +.Xr arp 4 , +.Xr iflib 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.2 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Intel Corporation Aq Mt freebsd@intel.com . From nobody Thu May 23 02:47:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlCJ23pmbz5LZXC; Thu, 23 May 2024 02:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlCJ21bGdz45yQ; Thu, 23 May 2024 02:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lFFnT922PQT8Jgkz+34Br5kZUU0y5zdt50OwrXxmArM=; b=gWZ+bGimf1Dikj52VJxKEF/+1w9UND7u3TaD0tVcBtRxVjGfc+1mbVhYBgjmiPC0HVL918 +HJubLrmypWnFMqr3D7h+uFmH5D8878kap1SuvJR6r/RL3KPYhLUFLu2W51SyrpXwGD/Wv zJWVwLxdqMQnBuLxM1xCqRAujFDHpU4h2HG/YTsg+3BivFA/Tyhw6vKKdw87ls+PtFquC5 zrEoVW+k8vjOdjkps0KqI+S3R+KU9RWMxLwJDHLfiNbI6KDvU05+yyemtVM03gtI4aGIYR Z4i8Sn7XU2yLEe42yFgB85YnJMUYExN01VvRoaXExNy+xqNKH1vwIo8IRWl71Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432434; a=rsa-sha256; cv=none; b=aqyAgpEgUaES70/eV9WnIAsyQXDLBAX/eJMocjHj5CajwQtGKana1gB8L+F7+MFkz4hmV2 mtoQBxnM6ym1+lxaooOHTwdPMpMVl6oNAB8xhwKq9a2/RAFZelQjBwoKy3+lQqHT5IiDif 8FrKVuy/p7PkL3E8ZmVvfc9bnk2Bho+NgXG64tbJJ/SBGcwlB42Qi4yUsWV6kQFbfrwMLV dPCxb36BWUZX5SGZakxNBpWtJ5oRpnb5ZNJogENCRrkszS9AyRObLSyYEy89vjFLxDQz7w SauC6Km4PQMjszTSXnLEw54yLe9gCpUDxu8IR5uMvsT8LZqUlzOk5MgRPXFTsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lFFnT922PQT8Jgkz+34Br5kZUU0y5zdt50OwrXxmArM=; b=i5/2R0bDOZhNk5uHEA5S24k0p+giBfvQDY4SGqE4VipjUcGuibrcrUkKs/QDVeHee8KhfG fXE2fYucgBSKN8hYpgB1rYgcHOY2uRCE+3+tg85/M94s4D9ojx5QdLIrTxA4mbexV3i6dQ Kml/o0Wu/EzHcHyN5y74zrJONYUq61nhTivVHmGD0bsUs1GrKCYQ20uuE189qxe9pxqAM9 zfpUzDmzIMfeajgebv2v8K0+R9XOp2HzGHmPWsuiK6U0Bg8gfv1J1npfsTBI3rhpjf9zEE ELRElIWdXEsfSA840mDwNbqdbnLwg1lBo4/xN+vM3smukYF+S72FpR43E89TCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlCJ20mwhzXsH; Thu, 23 May 2024 02:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2lElK057456; Thu, 23 May 2024 02:47:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2lENF057453; Thu, 23 May 2024 02:47:14 GMT (envelope-from git) Date: Thu, 23 May 2024 02:47:14 GMT Message-Id: <202405230247.44N2lENF057453@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 8766ae10d3b7 - releng/14.1 - access.2: Mention that lstat(2) should be used for symbolic links List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 8766ae10d3b792caf7c31b583afcaf43b1a6543f Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=8766ae10d3b792caf7c31b583afcaf43b1a6543f commit 8766ae10d3b792caf7c31b583afcaf43b1a6543f Author: Gordon Bergling AuthorDate: 2024-05-13 08:40:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:45:49 +0000 access.2: Mention that lstat(2) should be used for symbolic links access(), eaccess() and faccessat() will always dereference symbolic links. So add a note in the manual page, that lstat(2) should be used in the case of symbolic links. PR: 262895 Reviewed by: gbe, pauamma_gundo.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44890 (cherry picked from commit 421025a274fb5759b3ecc8bdb30b24db830b45ae) (cherry picked from commit f075b6113726d74342d4af15dfab60709f50b859) Approved by: re (cperciva) --- lib/libc/sys/access.2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 681e4483a9e6..64ed1133b23d 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -27,7 +27,7 @@ .\" .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" -.Dd March 30, 2021 +.Dd May 13, 2024 .Dt ACCESS 2 .Os .Sh NAME @@ -149,6 +149,15 @@ Likewise for .Dv R_OK and .Dv W_OK . +.Pp +.Fn access , +.Fn eaccess +and +.Fn faccessat +will always dereference symbolic links. +If the symbolic link itself needs to be referenced, +.Xr lstat 2 +should be used instead. .Sh RETURN VALUES .Rv -std .Sh ERRORS From nobody Thu May 23 02:47:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlCJ345t1z5LZck; Thu, 23 May 2024 02:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlCJ32zx0z45rN; Thu, 23 May 2024 02:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7gUCz20Txw/JcsXdsm3tB4WA9PBAMAbt3ztF1bQGv8o=; b=UG7kPrXFZi3el0NqcfPGZGGTgl8x1lHS9CJVwwHmwNv7bK91U+e3BL55CE0QlMdgCY4uIA f4DrmqktW8JE1axgh+I0AmLAEL4HViSoOxQq7t+Y+YCzZTMuiYmLxfiPsW8DLEkalP6cyU F0aKWtlufoSbw5H5mAkuKHI6a0meMmfNibgyCugJWuFOmoMftkonQ4g3N2exNNFD07VKkd qNfXiLEcn2Zv0ccqK5nJXH0RX+ghIUvgroGCwH8Fh63+yBcA8b2z6Ji2BrGi96nrm6WO09 YhkWSodWrko/924df5MhDFbfUHp2fGtT7LO2HO6aPYsjI0hJTZROyR6t4nUpEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432435; a=rsa-sha256; cv=none; b=bhpU4JRMhly+UafgGKH5Erc/wDmLvt+reMkGiJ1sQK/v7WCqvlmchI7zB7I/CH0m6d0g34 lvJYMwqRwHfj8MKee9tfqPAt7UQkN6t1BZYy6cJwdAhnntvLTVm5jzvxVv27WPiT8Xox/b o+dUC0ybEfUIsN3mKTFDK9FAYbez4yO3/fxPywBQpgfHKj7dwyH4yeskjZgA7o/F26OjtW jOeAczAkVjWzOOtlmuf2Dfi/SCj0vFs6/UdITsP0A8VzKr5OQ2ClG/PfzXcPM7gbIkWGf1 OMHZw0oiKTZQE18YYbUQ2CvV4SF1GvnQ6Z/2Fo9DTrdYc6m/YFi8fKt2Xc/Bzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7gUCz20Txw/JcsXdsm3tB4WA9PBAMAbt3ztF1bQGv8o=; b=KyUprN4IaXriv2K6NQOh4n6ZNdS25xf81JaWLfVMMpFTD1rmvZMEJQrnTx3Nxj58/4lwUf MFyBfo+JWUgo5qvQSBAIkezPpSZ/4tdJC+ieGNNpMLFGBD3cfsFL0hB3jbRZEuUku3FxmB KeVTqnsJDC9yt0jEomVlgwiqdBswVPen4X9i34nidYLbVJbYW5LcxN0GFPn8ZsziGXYOaj mhp+gfJNek16KVsaSxhqKnEwh6A3yGZSEF7ZPAbu4yuWoeLnNB7kP0DJitpqs4Q/1RYQPG H37X4TozH87c1Pu0JA5wyd137rQnKR396FKDPiHY3if7z7VMKRkDT4KOsTpaVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlCJ31pZCzXsJ; Thu, 23 May 2024 02:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2lFkI057507; Thu, 23 May 2024 02:47:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2lFMP057504; Thu, 23 May 2024 02:47:15 GMT (envelope-from git) Date: Thu, 23 May 2024 02:47:15 GMT Message-Id: <202405230247.44N2lFMP057504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: fb18c369c32d - releng/14.1 - access(2): Discourage use of these system calls. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: fb18c369c32d746569e36ae7dca7dad43bcc118e Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fb18c369c32d746569e36ae7dca7dad43bcc118e commit fb18c369c32d746569e36ae7dca7dad43bcc118e Author: Dag-Erling Smørgrav AuthorDate: 2024-05-21 22:35:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:45:55 +0000 access(2): Discourage use of these system calls. Fixes: 421025a274fb PR: 262895 MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45240 (cherry picked from commit a4be1eb21165d7aedae9dc6634528619ff10d025) (cherry picked from commit 79b39f23e1341bdc3ab9c6a08e1506d40b8b6dbc) Approved by: re (cperciva) --- lib/libc/sys/access.2 | 105 ++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 55 deletions(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 64ed1133b23d..8595444720b1 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -27,7 +27,7 @@ .\" .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" -.Dd May 13, 2024 +.Dd May 21, 2024 .Dt ACCESS 2 .Os .Sh NAME @@ -47,35 +47,43 @@ .Fn faccessat "int fd" "const char *path" "int mode" "int flag" .Sh DESCRIPTION The -.Fn access -and +.Fn access , .Fn eaccess -system calls check the accessibility of the -file named by -the +and +.Fn faccessat +system calls report whether an attempt to access the file designated +by their .Fa path -argument -for the access permissions indicated by -the +in the manner described by their .Fa mode -argument. +argument is likely to succeed. The value of .Fa mode -is either the bitwise-inclusive OR of the access permissions to be -checked -.Dv ( R_OK +is either the bitwise-inclusive OR of the desired permissions +.Po +.Dv R_OK for read permission, .Dv W_OK for write permission, and .Dv X_OK -for execute/search permission), -or the existence test -.Pq Dv F_OK . +for execute / search permission +.Pc +or +.Dv F_OK +to simply check whether the file exists. .Pp -For additional information, see the -.Sx "File Access Permission" -section of -.Xr intro 2 . +For a number of reasons, these system calls cannot be relied upon to +give a correct and definitive answer. +They can at best provide an early indication of the expected outcome, +to be confirmed by actually attempting the operation. +For existence checks, either +.Xr stat 2 +or +.Xr lstat 2 +should be used instead. +See also +.Sx SECURITY CONSIDERATIONS +below. .Pp The .Fn eaccess @@ -89,6 +97,13 @@ the real user ID in place of the effective user ID, the real group ID in place of the effective group ID, and the rest of the group access list. .Pp +See the +.Sx DEFINITIONS +section of +.Xr intro 2 +for additional information on file access permissions and real +vs. effective user and group IDs. +.Pp The .Fn faccessat system call is equivalent to @@ -116,8 +131,10 @@ list, defined in .In fcntl.h : .Bl -tag -width indent .It Dv AT_EACCESS -The checks for accessibility are performed using the effective user and group -IDs instead of the real user and group ID as required in a call to +The checks are performed using the effective user and group IDs, +like +.Fn eaccess , +instead of the real user and group ID, like .Fn access . .It Dv AT_RESOLVE_BENEATH Only walk paths below the directory specified by the @@ -149,23 +166,15 @@ Likewise for .Dv R_OK and .Dv W_OK . -.Pp -.Fn access , -.Fn eaccess -and -.Fn faccessat -will always dereference symbolic links. -If the symbolic link itself needs to be referenced, -.Xr lstat 2 -should be used instead. .Sh RETURN VALUES .Rv -std .Sh ERRORS +The .Fn access , .Fn eaccess , -or +and .Fn faccessat -will fail if: +system calls may fail if: .Bl -tag -width Er .It Bq Er EINVAL The value of the @@ -256,25 +265,11 @@ system call appeared in .Fx 8.0 . .Sh SECURITY CONSIDERATIONS The -.Fn access -system call -is a potential security hole due to race conditions and -should never be used. -Set-user-ID and set-group-ID applications should restore the -effective user or group ID, -and perform actions directly rather than use -.Fn access -to simulate access checks for the real user or group ID. -The -.Fn eaccess -system call -likewise may be subject to races if used inappropriately. -.Pp -.Fn access -remains useful for providing clues to users as to whether operations -make sense for particular filesystem objects (e.g. 'delete' menu -item only highlighted in a writable folder ... avoiding interpretation -of the st_mode bits that the application might not understand -- -e.g. in the case of AFS). -It also allows a cheaper file existence test than -.Xr stat 2 . +.Fn access , +.Fn eaccess , +and +.Fn faccessat +system calls are subject to time-of-check-to-time-of-use races and +should not be relied upon for file permission enforcement purposes. +Instead, applications should perform the desired action using the +requesting user's credentials. From nobody Thu May 23 02:47:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlCJ467Tkz5LZRM; Thu, 23 May 2024 02:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlCJ442Cmz464W; Thu, 23 May 2024 02:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1H3v78dZMN6QOiKSEwuLdcFUev53mNOw6SZ1QaKfPNU=; b=dqsFbAnNp9vQTjITrvhdDW/Wqq5wNkV2gvzNjDg9jA5oQKAINHNPoIfk8v9x8Vn6P+TgfU V/jxQLlTMtP74cE5ETG8woMECH+uJ3dWLNQAm6B6zm99XLLRggrEbGpMtCXzofBa2u+KxK wlHuU2atOcadP+QUL1AzqenImllzdXhjKV/dF3n2kYqZ3ILr0P5BU27Qh2OYrd8GlXgT8O 3buUR3UD215syjuKcPfmzGgw8Yg0hBm+YRH0RpLQiqYU0W1cVl1LA9ZnHEs7gp9+4Y+VMf ZQAPfEeZ6JibHuovF5m8dOVU2bkadqGS3wxY8qBch5tmx9qp6uENyPSUQOSXUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716432436; a=rsa-sha256; cv=none; b=dCAk0p1P8IkttgCdme0w742PFYJLeVhQXNj1gyPgsq3gNjo8bfRYD0hIWtnqlnJnyHcoQ5 7X/gUg/koVHzlFcpXqBcQHSduAtN9ENxb84x3RL+jmucZ2LPBZihxTyeHIin8FlTMs9QgJ S975yTQHdpLi1u0hMzi4Q1gfT2pq7J+3MPHg4GFeFDhCGmBeuzY7ilwaahb6Lbm/dkL1B7 w++C4zwPQCe/C+XlUr6aTg0jIhMcaM3VWNuKMN9RyjNWWfVATlHDPbtizvZLHoNdRDCpQF KEo435GA2E+NJVTAbVJNfzmZpHZzUmG7OOhRS/GWwqSnNInFfmuZl1LTks9x/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716432436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1H3v78dZMN6QOiKSEwuLdcFUev53mNOw6SZ1QaKfPNU=; b=mS1KRKMclEROQLWyaNo14ptol5VszA/gwgtTlRMZVsbv5oJj6lydyWulw1UAsB534nOJHN /cF/cMXg4JstoB9h2TMPUJPzm7WqZq3pKlXcCd12X2WGpzcMwPcsNsixUv2XapfHbdIMnb cQF7Nh565iUZ9Ti34oqkAvqEH+jq4I6UkYZfvUs5dlrIMPR+bsE0DH+nuho7L0Wyo66m/c eAsqkR/liWIhZ2VIFfsPU4YoiqAKql0oO4V3DOfAJibsODDx/fn06aVrIFhlQeyQcqED1c Xonuvqr0Hs4CABaqGSijfqEYFSHRdmEatcE0A1Kq+nI0UfTKpMNRckArK7mBJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlCJ43HggzX7Z; Thu, 23 May 2024 02:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N2lG7f057549; Thu, 23 May 2024 02:47:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N2lG35057546; Thu, 23 May 2024 02:47:16 GMT (envelope-from git) Date: Thu, 23 May 2024 02:47:16 GMT Message-Id: <202405230247.44N2lG35057546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f9b5ecd25790 - releng/14.1 - iavf(4): Improve man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: f9b5ecd257908b1623daf28782c92c3dde95d368 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f9b5ecd257908b1623daf28782c92c3dde95d368 commit f9b5ecd257908b1623daf28782c92c3dde95d368 Author: Eric Joyner AuthorDate: 2024-05-21 23:24:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-23 02:46:00 +0000 iavf(4): Improve man page MFC after: 3 days Reviewed by: erj Differential Revision: https://reviews.freebsd.org/D43093 (cherry picked from commit ba222f6fb4b226ab24beaa13a8591dcb624ae70f) (cherry picked from commit 4c380c44c82f36c04539e3c9e60e58567abf3856) Approved by: re (karels) --- share/man/man4/iavf.4 | 348 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 282 insertions(+), 66 deletions(-) diff --git a/share/man/man4/iavf.4 b/share/man/man4/iavf.4 index 2e265a5a2fbb..d55e084e82cc 100644 --- a/share/man/man4/iavf.4 +++ b/share/man/man4/iavf.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 2013-2018, Intel Corporation .\" All rights reserved. .\" @@ -29,12 +32,12 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd January 30, 2019 +.Dd May 21, 2024 .Dt IAVF 4 .Os .Sh NAME .Nm iavf -.Nd "Intel Adaptive Virtual Function driver" +.Nd "Intel Ethernet Adaptive Virtual Function Driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -51,87 +54,300 @@ if_iavf_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the PCI Virtual Functions from the 700 Series of -ethernet devices and newer product families. -The driver supports Jumbo Frames, TX/RX checksum offload, -TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN -tag insertion/extraction, VLAN checksum offload, VLAN TSO, and -Receive Side Steering (RSS), all for both IPv4 and IPv6. -For further hardware information and questions related to hardware -requirements, see -.Pa http://support.intel.com/ . -.Pp -Support for Jumbo Frames is provided via the interface MTU setting. -Selecting an MTU larger than 1500 bytes with the +driver provides support for any PCI Virtual Function created from certain +Intel Ethernet devices. +This driver is compatible with virtual functions bound to devices based on the +following: +.Pp +.Bl -bullet -compact +.It +Intel\(rg Ethernet Controller E810\-C +.It +Intel\(rg Ethernet Controller E810\-XXV +.It +Intel\(rg Ethernet Connection E822\-C +.It +Intel\(rg Ethernet Connection E822\-L +.It +Intel\(rg Ethernet Connection E823\-C +.It +Intel\(rg Ethernet Connection E823\-L +.It +Intel\(rg Ethernet Controller I710 +.It +Intel\(rg Ethernet Controller X710 +.It +Intel\(rg Ethernet Controller XL710 +.It +Intel\(rg Ethernet Network Connection X722 +.It +Intel\(rg Ethernet Controller XXV710 +.It +Intel\(rg Ethernet Controller V710 +.El +.Pp +The associated Physical Function (PF) drivers for this VF driver are: +.Pp +.Bl -bullet -compact +.It +.Xr ice 4 +.It +.Xr ixl 4 +.El +.Pp +For questions related to hardware requirements, refer to the documentation +supplied with your Intel Ethernet Adapter. +All hardware requirements listed apply to use with +.Fx . +.Ss The VF Driver +The VF driver is normally used in a virtualized environment where a host driver +manages SR\-IOV, and provides a VF device to the guest. +.Pp +In the +.Fx +guest, the iavf driver would be loaded and will function using +the VF device assigned to it. +.Pp +The VF driver provides most of the same functionality as the core driver, but +is actually a subordinate to the host. +Access to many controls is accomplished by a request to the host via what is +called the "Admin queue." +These are startup and initialization events, however; once in operation, the +device is self\-contained and should achieve near native performance. +.Pp +Some notable limitations of the VF environment: +.Bl -bullet +.It +The PF can configure the VF to allow promiscuous mode, using a configuration +parameter in +.Xr iovctl.conf 5 ; +otherwise, promiscuous mode will not work +.It +Media info is not available from the PF, so the active media will always be +displayed as auto in .Xr ifconfig 8 -utility configures the adapter to receive and transmit Jumbo Frames. -The maximum MTU size for Jumbo Frames is 9706. +.El +.Ss Adaptive Virtual Function +Adaptive Virtual Function (AVF) allows the virtual function driver, or VF, to +adapt to changing feature sets of the physical function driver (PF) with which +it is associated. +This allows system administrators to update a PF without having to update all +the VFs associated with it. +All AVFs have a single common device ID and branding string. .Pp -Offloads are also controlled via the interface, for instance, -checksumming for both IPv4 and IPv6 can be set and unset, TSO4 -and/or TSO6, and finally LRO can be set and unset. +AVFs have a minimum set of features known as "base mode," but may provide +additional features depending on what features are available in the PF with +which the AVF is associated. +The following are base mode features: +.Bl -bullet -compact +.It +4 Queue Pairs (QP) and associated Configuration Status Registers (CSRs) +for Tx/Rx +.It +iavf descriptors and ring format +.It +Descriptor write\-back completion +.It +1 control queue, with iavf descriptors, CSRs and ring format +.It +5 MSI\-X interrupt vectors and corresponding iavf CSRs +.It +1 Interrupt Throttle Rate (ITR) index +.It +1 Virtual Station Interface (VSI) per VF +.It +1 Traffic Class (TC), TC0 +.It +Receive Side Scaling (RSS) with 64 entry indirection table and key, +configured through the PF +.It +1 unicast MAC address reserved per VF +.It +8 MAC address filters for each VF on an Intel\(rg Ethernet 800 Series device +.It +16 MAC address filters for each VF on an Intel\(rg Ethernet 700 Series device +.It +Stateless offloads \- non\-tunneled checksums +.It +AVF device ID +.It +HW mailbox is used for VF to PF communications +.El +.Sh CONFIGURATION AND TUNING +.Ss Important System Configuration Changes +It is important to note that 100G operation can generate high +numbers of interrupts, often incorrectly being interpreted as +a storm condition in the kernel. +It is suggested that this be resolved by setting +.Va hw.intr_storm_threshold +to 0. .Pp -For more information on configuring this device, see -.Xr ifconfig 8 . +The default is 1000. .Pp -.Em NOTE : -This +Best throughput results are seen with a large MTU; use 9706 if possible. +The default number of descriptors per ring is 1024. +Increasing this may improve performance, depending on your use case. +.Ss Configuring for no iflib +.Xr iflib 4 +is a common framework for network interface drivers for +.Fx +that uses a shared set of sysctl names. +.Pp +The default .Nm -driver is only for Virtual Functions. -For 700 series Physical Functions, use the -.Xr ixl 4 -driver. -.Sh LOADER TUNABLES -Tunables can be set at the -.Xr loader 8 -prompt before booting the kernel or stored in -.Xr loader.conf 5 . -.Bl -tag -width indent -.It Va hw.iavf.rx_itr -The RX interrupt rate value, set to 62 (124 usec) by default. -.It Va hw.iavf.tx_itr -The TX interrupt rate value, set to 122 (244 usec) by default. -.It Va hw.iavf.enable_head_writeback -When the driver is finding the last TX descriptor processed by the hardware, -use a value written to memory by the hardware instead of scanning the -descriptor ring for completed descriptors. -Disabled by default; this mimics the "legacy" TX behavior found in -.Xr ixgbe 4 . -to ensure compatibility with future, non-700 series VF devices. +driver depends on it, but it can be compiled without it. +.Ss Jumbo Frames +Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU) +to a value larger than the default value of 1500. +.Pp +Use the +.Xr ifconfig 8 +command to increase the MTU size. +.Pp +To confirm the MTU used between two specific devices, use +.Xr route 8 : +.Bd -literal -offset indent +route get +.Ed +.Pp +NOTE: +.Bl -bullet +.It +The maximum MTU setting for jumbo frames is 9706. +This corresponds to the maximum jumbo frame size of 9728 bytes. +.It +This driver will attempt to use multiple page-sized buffers to receive +each jumbo packet. +This should help to avoid buffer starvation issues when allocating receive +packets. +.It +Packet loss may have a greater impact on throughput when you use jumbo +frames. +If you observe a drop in performance after enabling jumbo frames, enabling +flow control may mitigate the issue. .El -.Sh SUPPORT -For general information and support, -go to the Intel support website at: -.Pa http://support.intel.com/ . +.Ss Checksum Offload +Checksum offloading supports both TCP and UDP packets and is supported for both +transmit and receive. +.Pp +TSO (TCP Segmentation Offload) supports both IPv4 and IPv6. +Both of these features are enabled and disabled via +.Xr ifconfig 8 . .Pp -If an issue is identified with this driver with a supported adapter, -email all the specific information related to the issue to -.Mt freebsd@intel.com . +NOTE: +.Bl -bullet -compact +.It +TSO requires Tx checksum; if Tx checksum is disabled then TSO will also +be disabled. +.El +.Ss LRO +LRO (Large Receive Offload) may provide Rx performance improvement. +However, it is incompatible with packet\-forwarding workloads. +You should carefully evaluate the environment and enable LRO when possible. +.Ss Rx and Tx Descriptor Rings +Allows you to set the Rx and Tx descriptor rings independently. +Set them via these +.Xr iflib 4 +sysctls: +.Bl -tag -width indent +.It dev.iavf.#.iflib.override_nrxds +.It dev.iavf.#.iflib.override_ntxds +.El +.Ss Link\-Level Flow Control (LFC) +The VF driver does not have access to flow control settings. +It must be managed from the host side. .Sh SEE ALSO .Xr arp 4 , +.Xr ice 4 , +.Xr iflib 4 , .Xr ixl 4 , .Xr netintro 4 , .Xr vlan 4 , -.Xr ifconfig 8 , -.Xr iflib 9 +.Xr ifconfig 8 +.Pp +See the +.Dq Intel\(rg Ethernet Adapters and Devices User Guide +for additional information on features. +It is available on the Intel website at either of the following: +.Bl -bullet +.It +.Lk https://cdrdv2.intel.com/v1/dl/getContent/705831 +.It +.Lk https://www.intel.com/content/www/us/en/download/19373/adapter\-user\-guide\-for\-intel\-ethernet\-adapters.html +.El +.Pp +For information on how to identify your adapter, and for the latest Intel +network drivers, refer to the Intel Support website: +.Aq Lk http://www.intel.com/support +.Sh CAVEATS +.Ss Driver Buffer Overflow Fix +The fix to resolve CVE\-2016\-8105, referenced in Intel SA\-00069 +.Aq Lk https://www.intel.com/content/www/us/en/security\-center/advisory/intel\-sa\-00069.html , +is included in this and future versions of the driver. +.Ss Network Memory Buffer Allocation +.Fx +may have a low number of network memory buffers (mbufs) by default. +If your mbuf value is too low, it may cause the driver to fail to initialize +and/or cause the system to become unresponsive. +You can check to see if the system is mbuf\-starved by running +.Li "netstat -m" . +Increase the number of mbufs by editing the lines below in +.Xr sysctl.conf 5 : +.Bd -literal -offset indent +kern.ipc.nmbclusters +kern.ipc.nmbjumbop +kern.ipc.nmbjumbo9 +kern.ipc.nmbjumbo16 +kern.ipc.nmbufs +.Ed +.Pp +The amount of memory that you allocate is system specific, and may require +some trial and error. +Also, increasing the following in +.Xr sysctl.conf 5 +could help increase +network performance: +.Bd -literal -offset indent +kern.ipc.maxsockbuf +net.inet.tcp.sendspace +net.inet.tcp.recvspace +net.inet.udp.maxdgram +net.inet.udp.recvspace +.Ed +.Ss UDP Stress Test Dropped Packet Issue +Under small packet UDP stress with the +.Nm +driver, the system may drop UDP packets due to socket buffers being full. +Setting the PF driver's Flow Control variables to the minimum may resolve the +issue. +.Ss Disable LRO when routing/bridging +LRO must be turned off when forwarding traffic. +.Sh SUPPORT +For general information, go to the Intel support website at +.Aq Lk http://www.intel.com/support/ . +.Pp +If an issue is identified with the released source code on a supported kernel +with a supported adapter, email the specific information related to the issue +to +.Aq Mt freebsd@intel.com . +.Sh LEGAL +Intel\(rg is a trademark or registered trademark of Intel Corporation +or its subsidiaries in the United States and / or other countries. +.Pp +Other names and brands may be claimed as the property of others. .Sh HISTORY The .Nm device driver first appeared in -.Fx 10.1 . -under the name "ixlv" +.Fx 10.1 +under the name +.Nm ixlv . It was converted to use -.Xr iflib 9 -and changed to its current name in -.Fx 12 . +.Xr iflib 4 +and renamed in +.Fx 12.4 . .Sh AUTHORS -.An -nosplit The .Nm -driver was written by -.An Jack Vogel Aq Mt jfv@freebsd.org -and -.An Eric Joyner Aq Mt erj@freebsd.org . -.Sh CAVEATS -This driver is supposed to function on VFs spawned from future network devices by Intel, -but at the time of this writing, has only been tested on the 700 series VFs. +driver was written by the +.An Intel Corporation Aq Mt freebsd@intel.com From nobody Thu May 23 05:37:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlH4M6cWhz5H9pY; Thu, 23 May 2024 05:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlH4M5vYsz4PJj; Thu, 23 May 2024 05:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cHnG1qcfHkgkpSBuHoJWHHcQZsKoj48UKCgRpp8bOCs=; b=UgT9mrSqo82KfNwYTNNk5pechqMauWlEJqILepSxfndy7CDNxxueYrPK6bIUMEq12UF8q+ b34xkhs51q8gfEkEG/ZKVsYhTjqhKnm2zsxKbwuE35grIkkPdZp2AsBJO23n0MkK+C6tnK 18TKg/Wy5iZKEAAo/3TukgST6QKsOWLRY7+LmmUIQ6Cnkx2kznYdkbK2bVRL3RgQHYwRQV BhKMDgWXLukhuiq/jiRSy59EvMSIXIEErZLui32KZJvK65QkWYFQcPW9632CgmfHNsGkS/ QWSYueLNf0ZwFzUDtuBdnUgrDo1vDq722rpRUNPgOe9VfRWIvPwFJleIbXDa9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716442643; a=rsa-sha256; cv=none; b=cgdkm9x/KgfuBtjIlexcGSAbfqd9He3zLLDGNujJ7joLwPCd4wikIPSGPyhgY5Gwf8BnYU yhlRrzGrOM8gBFOY+Hy+kxFltXgKwqhAuHzd7PPKyA+Bi3w2lFE3jTHZ0dHxnUYi8Sap3C BVlDJqsayFhZj+bh3Td2fCI4vkRhiDIr2+4tg9C7KKi6Adas92VhHc89jK9ddv559mTcvX 5bSSPhZupI2mswTzhoeEi/TECcQ/GxW61JO+dYN7b3wYDj9K9jaXHcrLDN+HOI9SBZ3dTO wqsM/BvaJktRVHpFoz8cSo5u41vR0avmOHc1n+59BX3/zYVTmKLHzK5XeGDtkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cHnG1qcfHkgkpSBuHoJWHHcQZsKoj48UKCgRpp8bOCs=; b=POi6PPuPi30kKam0CoSOj9YxzNlQvq2gjYQiu+b686263TLG7f4aFjB+1mmgxKZ7n3CC0M XXKGUxq0CTG2iCWur7pdGoo0tvNoVui0f/OsXRJC8bXH/r0+OzP3sWPW2ln39TMWh9ldgE nxpB913mrQhCGdL/9l2GkydISAZhsLmb6BYR90NhwOjAUye3BpIXTRXVQua9GcSAqLiSlb h5qtaX3DuKzHy/WPY4FDqBLJdJ8VkWO4wYY5bV3fWjcB/djajVPM7XolvWT8H9E/LyBPhB YnmyUwgslCbduanA1q9j3ji9i6moUXvKK2h6W6QzslSS6R/8Ss43bLEB/A4WKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlH4M5NTvzdCH; Thu, 23 May 2024 05:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N5bN9n047779; Thu, 23 May 2024 05:37:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N5bNlU047776; Thu, 23 May 2024 05:37:23 GMT (envelope-from git) Date: Thu, 23 May 2024 05:37:23 GMT Message-Id: <202405230537.44N5bNlU047776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 78ae540decdc - releng/14.1 - fib_dxr: log malloc() failures. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 78ae540decdc4e2a2e5d2f05b1c13bd34b68a278 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=78ae540decdc4e2a2e5d2f05b1c13bd34b68a278 commit 78ae540decdc4e2a2e5d2f05b1c13bd34b68a278 Author: Marko Zec AuthorDate: 2024-05-06 18:21:55 +0000 Commit: Marko Zec CommitDate: 2024-05-23 04:25:27 +0000 fib_dxr: log malloc() failures. MFC after: 1 week Approved by: re (cperciva) (cherry picked from commit e9927f4e6129271843985d994aab9edf7299aaa0) --- sys/netinet/in_fib_dxr.c | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 94f066bdf982..c4815a64b260 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1118,8 +1118,10 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) struct dxr *dxr; dxr = malloc(sizeof(*dxr), M_DXRAUX, M_NOWAIT); - if (dxr == NULL) + if (dxr == NULL) { + FIB_PRINTF(LOG_NOTICE, fd, "Unable to allocate DXR struct"); return (FLM_REBUILD); + } /* Check whether we may reuse the old auxiliary structures */ if (old_dxr != NULL && old_dxr->aux != NULL) { @@ -1213,16 +1215,41 @@ dxr_dump_end(void *data, struct fib_dp *dp) dxr_build(dxr); da = dxr->aux; - if (da == NULL) + if (da == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR aux struct"); return (FLM_REBUILD); + } - /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) + if (da->range_tbl == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR range table"); + return (FLM_REBUILD); + } + +#ifdef DXR2 + if (da->x_tbl == NULL) { + /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR extension table"); + return (FLM_REBUILD); + } +#endif + + if (da->rtbl_top >= BASE_MAX) { + /* Structural limit exceeded, hard error */ + FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); return (FLM_ERROR); + } - /* A malloc(,, M_NOWAIT) failed somewhere, retry later */ - if (dxr->d == NULL) + if (dxr->d == NULL) { + /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR lookup table"); return (FLM_REBUILD); + } dp->f = choose_lookup_fn(da); dp->arg = dxr; @@ -1311,13 +1338,17 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, /* Structural limit exceeded, hard error */ if (da->rtbl_top >= BASE_MAX) { + /* Structural limit exceeded, hard error */ dxr_destroy(new_dxr); + FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); return (FLM_ERROR); } - /* A malloc(,, M_NOWAIT) failed somewhere, retry later */ if (new_dxr->d == NULL) { + /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ dxr_destroy(new_dxr); + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR lookup table"); return (FLM_REBUILD); } From nobody Thu May 23 05:37:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlH4P00MZz5H9pc; Thu, 23 May 2024 05:37:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlH4N6Y9qz4PYX; Thu, 23 May 2024 05:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TfbWhQ/LvatT1kBz9TdWyNNyT91BJUA8IwqAUzbmjKY=; b=CJejoij/Q5joiVtHlhP49ufJQElLw3oemVMVLUmSVV6FA0/L/G57ll6YcoJPV0o0pQjkum +XGxgtASkukI3+To0hqMau/99U+Tus9b72O14XdgYpYgDh63nwhE0dVB+sYZGktWAEEGiU iQrnWdDYyagMxLoTzy9L1SWW3PQfFm9g9+R8YA+gs5EiOqLipAcmSFhs3wQ+LxMH+VFJbn K/vwfAFX1Oe+bStwXINIy0b7p1lHwhhSXMhNJdLDzSUziI5Ex1p7jiq2MnWmpEkDUplsNq W8aHXSHgwcD/M6/o27wuLzpfygNJLDIu64nD2fI/yjHm9KJiBM5lusKBzVUfcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716442644; a=rsa-sha256; cv=none; b=ExTwG1dL6dYuL2Shhl1uHAx8LO5rSZWQHZ1W2+UEpUUfh1qHBKPjs6BuAhhNnSTUOpkSHx 8+aud4tQOhsfgkyTlNkH1twJ9kMWq3++z5o5lKFJS7FFLGkX//THRJDB923x9jm4xYL9U7 50dJ9AHBvDU0Q4IjwnHFn7fPFwUxe9y/IDY/lAwFpGDyaYX/ZMvxdhlW44LBI9BKWO9+zt TPjLaQ5d5TnaOAUvFkiL4pJNVuljXYif7PYBnDmy2X9Jl7tZsMqWL4150XiZKHOFt7RhcY iBWwoMgXCc8EyefH2XbF7hkmaBwSE8b7kgk2WTqe9CBwkke1odiXB9DM2Vislw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TfbWhQ/LvatT1kBz9TdWyNNyT91BJUA8IwqAUzbmjKY=; b=XO4QYlZHJRHIAA9ViHwc9AUZwQVasnvbUH+/ZaUoCys+P7shkCfqhzigRekK0R8x9MMD68 b7uJpdk1/VyjRidW0qV51rgpQan8sL7EuZOBXP6fo5uegiUrbxLYsCWSu9EBhDa2M1ypet HdPXG2qluxXyPIcnJpkFW8MgIfkiRaQpOz+eGkk8Ix0rlYPUV3EWkorZD8P2YALqSaJT/5 E9osicQHmPaYOJx2O0vdlbgjewqqLBOqYOtnRaz9+YJ90xvbSx78c/NWcdxcRHnbjfk66i wH6q/jeP3V6FppQ73w9O7na9JXhTk8XRY6dopJW7iDCbrCW2itpgTmcQ8sUG9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlH4N67Sszcd0; Thu, 23 May 2024 05:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N5bOCk047845; Thu, 23 May 2024 05:37:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N5bO8X047842; Thu, 23 May 2024 05:37:24 GMT (envelope-from git) Date: Thu, 23 May 2024 05:37:24 GMT Message-Id: <202405230537.44N5bO8X047842@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 78782f3dd2f2 - releng/14.1 - fib_dxr: free() does nothing if arg is NULL, so remove a redundant check. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 78782f3dd2f27b5665abcb94a04584bd68900da0 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=78782f3dd2f27b5665abcb94a04584bd68900da0 commit 78782f3dd2f27b5665abcb94a04584bd68900da0 Author: Marko Zec AuthorDate: 2024-05-06 18:34:11 +0000 Commit: Marko Zec CommitDate: 2024-05-23 04:26:37 +0000 fib_dxr: free() does nothing if arg is NULL, so remove a redundant check. MFC after: 1 week Approved by: re (cperciva) (cherry picked from commit 64136682ba1681e56093f77b4cec8bdfa6375a72) --- sys/netinet/in_fib_dxr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index c4815a64b260..f7840858f9c9 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1142,14 +1142,11 @@ static void dxr_destroy(void *data) { struct dxr *dxr = data; - struct dxr_aux *da; + struct dxr_aux *da = dxr->aux; struct chunk_desc *cdp; struct trie_desc *tp; - if (dxr->d != NULL) - free(dxr->d, M_DXRLPM); - - da = dxr->aux; + free(dxr->d, M_DXRLPM); free(dxr, M_DXRAUX); if (da == NULL || atomic_fetchadd_int(&da->refcnt, -1) > 1) From nobody Thu May 23 05:37:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlH4Q4GYBz5H9vC; Thu, 23 May 2024 05:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlH4Q0R5gz4PfG; Thu, 23 May 2024 05:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SUJbt8Oxabq6s7afjJKxm8YniYA3ubg89cAWBa4VZWc=; b=Mr7Bu0J7t3y05xEicESZ3mycEQXpKhHmQdDziHrOgBJWFOorv1OFdE4ONN7bxFaZB+wkky DTf4ewcBvrTMJnhOlApbswPFnmBhskh/skBbPzA/O5SXZx3CF2lYjQlAUE1fqDewQRRI8k z/aeSIxBB5yGhHJtVBNqy0ugtKSYUNpskNummodE3sgoKOwud8rYXQoAJYviFNw79WJmGZ 9KnXGDjLc9Rs7Fmt/xLpbU3suXPdwbDYusyZmCNbhiZsPUt9ZoUn5d9DrRVPYuVrKS/t3k zBkvZ77lom39KmnONIU9oIAVTLn1Z7K9J+N8flLAh2nyjZHVbHDQwluxrP7D3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716442646; a=rsa-sha256; cv=none; b=FHw7z5oJhBzIrG8aD1ecV8w3WcqaEsVCceVoenGvkFrLSFgVBdPXv4d1j2OCAvGXmP3APJ yonLyIX/Y3WRaG1bDYvpwRfYtb2ANn17YIDqf5EMXE2JPeKv+lSkJ0Wrd0UfmgeF5AeE+t ZQKMHcNvPdx3y+niNGJqS7iOHWXpN5bCy/Ip3FPJ39/mTFaxKsHj7o06dc4i7CIlo6rURS tMkKkTzh+GpKZUbZanCpfZPrcORqENd/G0Hyl9cF8YGKWL7FMV2WKLRauH05psWfvCKFqn MRlQVDys03lro9fx16XIlti3lFHbuJ/h9fhCnAb6DhOKxTm1iJAhEyWUXptQWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SUJbt8Oxabq6s7afjJKxm8YniYA3ubg89cAWBa4VZWc=; b=TIkXWaS5+JmkAa6BWaveTvXn/yQObaX/i0nsCuItMcRilTE1ytUyT0K/QW/tq0dGGkjT+7 kwd3thG4a8HSl/F+qa4gTwgC9Jp9GVOS7G40Sl1u/evccUT/I/DnzhyhiY0NWtkdkPz5cE PMWPU7hfqs1zE5aOaewoI/siXtpadVjFLkEiCjncAO/c7rAvKVFCOm/SGwrrgLD4o4evC7 zVGAQ0uPDhgtuSkiLsIm3JQBFVle6SDC08NSJKg+N5F+7AAIngPbgrHTqPEqnfufhYZ72n pkvTfuyzgKN1mHDV4yAUoC/NVUFlwTr6pdXAjbtQStZrFxMK9ar0V9qREAqKhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlH4Q01DLzd8w; Thu, 23 May 2024 05:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N5bPm8047881; Thu, 23 May 2024 05:37:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N5bPLY047878; Thu, 23 May 2024 05:37:25 GMT (envelope-from git) Date: Thu, 23 May 2024 05:37:25 GMT Message-Id: <202405230537.44N5bPLY047878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 4df0c59feb66 - releng/14.1 - fib_dxr: update comment. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 4df0c59feb66bcfffe1f6b42e76e83651f9afbc8 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=4df0c59feb66bcfffe1f6b42e76e83651f9afbc8 commit 4df0c59feb66bcfffe1f6b42e76e83651f9afbc8 Author: Marko Zec AuthorDate: 2024-05-06 18:42:31 +0000 Commit: Marko Zec CommitDate: 2024-05-23 04:27:07 +0000 fib_dxr: update comment. MFC after: 1 week Approved by: re (cperciva) (cherry picked from commit df376a714af6b9aaec5a0366e27ef42985b4220b) --- sys/netinet/in_fib_dxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index f7840858f9c9..dcd13a249dd3 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1098,7 +1098,7 @@ dxr2_try_squeeze: } /* - * Glue functions for attaching to FreeBSD 13 fib_algo infrastructure. + * Glue functions for attaching to the FIB_ALGO infrastructure. */ static struct nhop_object * From nobody Thu May 23 05:37:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlH4R3vNsz5H9pd; Thu, 23 May 2024 05:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlH4R1S8Gz4Phc; Thu, 23 May 2024 05:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yRAGJs5JpHPdPUKLGSP+ozy6alOPIkm2kLdRxI60WeY=; b=HOCI+ALxsFJ+PKMCDHpisUt5NcTUlmAx5WWMh2lObjDf6RyYmpIb2h+g95HDq2b9PIPjFh F54xRM3rBYoOA+qK96zHG9j4YIkJ7h5WzcBJuFVeRcI8UtTuvU0ZfmFMTsRnraA5viaqH1 lAQGDaHVArHwIUXqs4nnzG1J39EL9DqWbGcrUCZ1W0OSYll/9rixO4/OUIjeGRYGXOoTCa O/9Gt4Ci0FgcGxCFtRvj/gD4X+V/BFOGdnYakE7vSFs628e0tv+/X4BNF3e+qqaxEpEntw zkIuYzKpjLEVUDuowajFriU4AjVJZ3sduImmcP1Gfbd8ASSfeM3YHgpnSOfHcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716442647; a=rsa-sha256; cv=none; b=kjbOfpvtGMCx/nqcN8lDcyRdDjhBdXkKxRE0TpuE+fOr1ZoS8PedMfY7GRgfnNWb778zjR tjwTCVvPGWem6AW0cH6oGN2onGfCkuYN7DEi0R1NIw73jmLmQ+XAtMr3DfwgxNZ736KyDx 2Zvqh4EzrYne/L49/AaZmfdc3dBToLCjn7k/SeGMdcZO6/ztxJolvGVqngmmcGk3iWbBmp yY9tTiHJGynaTcusIUCJ5d21hc9LEE4K2RZ+BlT+YfMsnUcSm5fkvNZZEM3CJgaApoZHIt ldg2xmwFvbd5yGPwFJcQpzsAR2QShKkBNuLcZ97A6z1e35Ck810W/v0QD30cHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yRAGJs5JpHPdPUKLGSP+ozy6alOPIkm2kLdRxI60WeY=; b=AhO0dCcZG3f/u53ddIeHDcMX3ltA+vSXmQKbPGTGqlE2HOjP2eJobG5aY4LJD7k9iJI/Jl se47poFt0db97nyMbRDtaF1/DrmtRniprxQLIBfja0/AsauF+otb8fsKrjjwCWE7HTxxsD ebu8TWBH53BQhmLsqkFiXiDZYRAzzbYVo3cl0T6IDwldI51NdWGw93W0myS9h5Hks0+Ma5 JoypCL2AFWU9nukUBFGzWduoFumxDyjG4vcbp0BAMu8AYn36LRpH6CuSolNzoOXcLeyzFn nJiyRsJPf2wlK0kgnx5n+wRDZKV9dKG8UITiRU/ffE4Opbmx2Z+Svqy6l1ZH5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlH4R149lzckY; Thu, 23 May 2024 05:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N5bRej047947; Thu, 23 May 2024 05:37:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N5bR45047944; Thu, 23 May 2024 05:37:27 GMT (envelope-from git) Date: Thu, 23 May 2024 05:37:27 GMT Message-Id: <202405230537.44N5bR45047944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 47fb63a288cd - releng/14.1 - fib_dxr: move the bulko of malloc() failure logging into dxr_build() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 47fb63a288cd2cd75b4a74c36f26a29dfcd2655f Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=47fb63a288cd2cd75b4a74c36f26a29dfcd2655f commit 47fb63a288cd2cd75b4a74c36f26a29dfcd2655f Author: Marko Zec AuthorDate: 2024-05-07 15:11:30 +0000 Commit: Marko Zec CommitDate: 2024-05-23 04:27:33 +0000 fib_dxr: move the bulko of malloc() failure logging into dxr_build() Approved by: re (cperciva) (cherry picked from commit e474704b9c49dda12e2afff2ae05f972207e21d7) --- sys/netinet/in_fib_dxr.c | 77 +++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 47 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index dcd13a249dd3..69332b859099 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -497,8 +497,11 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) da->range_tbl = realloc(da->range_tbl, sizeof(*da->range_tbl) * da->rtbl_size + FRAGS_PREF_SHORT, M_DXRAUX, M_NOWAIT); - if (da->range_tbl == NULL) + if (da->range_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR range table"); return (1); + } } return (0); @@ -632,8 +635,11 @@ trie_ref(struct dxr_aux *da, uint32_t index) da->xtbl_size += XTBL_SIZE_INCR; da->x_tbl = realloc(da->x_tbl, sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); - if (da->x_tbl == NULL) + if (da->x_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR extension table"); return (-1); + } } return(tp->td_index); } @@ -873,8 +879,11 @@ dxr_build(struct dxr *dxr) if (da == NULL) { da = malloc(sizeof(*dxr->aux), M_DXRAUX, M_NOWAIT); - if (da == NULL) + if (da == NULL) { + FIB_PRINTF(LOG_NOTICE, dxr->fd, + "Unable to allocate DXR aux struct"); return; + } dxr->aux = da; da->fibnum = dxr->fibnum; da->fd = dxr->fd; @@ -895,16 +904,22 @@ dxr_build(struct dxr *dxr) if (da->range_tbl == NULL) { da->range_tbl = malloc(sizeof(*da->range_tbl) * da->rtbl_size + FRAGS_PREF_SHORT, M_DXRAUX, M_NOWAIT); - if (da->range_tbl == NULL) + if (da->range_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR range table"); return; + } range_rebuild = 1; } #ifdef DXR2 if (da->x_tbl == NULL) { da->x_tbl = malloc(sizeof(*da->x_tbl) * da->xtbl_size, M_DXRAUX, M_NOWAIT); - if (da->x_tbl == NULL) + if (da->x_tbl == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR extension table"); return; + } trie_rebuild = 1; } #endif @@ -1039,8 +1054,11 @@ dxr2_try_squeeze: #endif dxr->d = malloc(dxr_tot_size, M_DXRLPM, M_NOWAIT); - if (dxr->d == NULL) + if (dxr->d == NULL) { + FIB_PRINTF(LOG_NOTICE, da->fd, + "Unable to allocate DXR lookup table"); return; + } #ifdef DXR2 memcpy(dxr->d, da->d_tbl, d_size); dxr->x = ((char *) dxr->d) + d_size; @@ -1119,7 +1137,8 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) dxr = malloc(sizeof(*dxr), M_DXRAUX, M_NOWAIT); if (dxr == NULL) { - FIB_PRINTF(LOG_NOTICE, fd, "Unable to allocate DXR struct"); + FIB_PRINTF(LOG_NOTICE, fd, + "Unable to allocate DXR container struct"); return (FLM_REBUILD); } @@ -1212,41 +1231,11 @@ dxr_dump_end(void *data, struct fib_dp *dp) dxr_build(dxr); da = dxr->aux; - if (da == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR aux struct"); + if (da == NULL || dxr->d == NULL) return (FLM_REBUILD); - } - if (da->range_tbl == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR range table"); - return (FLM_REBUILD); - } - -#ifdef DXR2 - if (da->x_tbl == NULL) { - /* malloc(, M_DXRAUX, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR extension table"); - return (FLM_REBUILD); - } -#endif - - if (da->rtbl_top >= BASE_MAX) { - /* Structural limit exceeded, hard error */ - FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); + if (da->rtbl_top >= BASE_MAX) return (FLM_ERROR); - } - - if (dxr->d == NULL) { - /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR lookup table"); - return (FLM_REBUILD); - } dp->f = choose_lookup_fn(da); dp->arg = dxr; @@ -1334,18 +1323,11 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, dxr_build(new_dxr); /* Structural limit exceeded, hard error */ - if (da->rtbl_top >= BASE_MAX) { - /* Structural limit exceeded, hard error */ - dxr_destroy(new_dxr); - FIB_PRINTF(LOG_ERR, dxr->fd, "DXR structural limit exceeded"); + if (da->rtbl_top >= BASE_MAX) return (FLM_ERROR); - } if (new_dxr->d == NULL) { - /* malloc(, M_DXRLPM, M_NOWAIT) failed, retry later */ dxr_destroy(new_dxr); - FIB_PRINTF(LOG_NOTICE, dxr->fd, - "Unable to allocate DXR lookup table"); return (FLM_REBUILD); } @@ -1357,6 +1339,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, return (FLM_SUCCESS); } + FIB_PRINTF(LOG_NOTICE, dxr->fd, "fib_set_datapath_ptr() failed"); dxr_destroy(new_dxr); return (FLM_REBUILD); } From nobody Thu May 23 05:37:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlH4S5K72z5HB31; Thu, 23 May 2024 05:37:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlH4S2Y3Xz4Pq2; Thu, 23 May 2024 05:37:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Ms0wZdFii87NsgO0/fqyUUXKvS9QqD0xn2ezWMTSJk=; b=d29pZLJMbkGmDANmCGuUEKVQaH0qZ497rdrnJDZegOrO9MowEpxvXYzGx3cmYW5qJJjSKS rWkfiFmjnI+EQgLKg8GjdvTIc8SKtR46a8cL/GklaGsfkY+WkrI1tng4ZGH4kMrycXKGKt M+Z8hpHNnzuUueOlmVUSfV/q4lmGUcSjFQ9KucVIwL/PnzxrlvuOWDekIQYv0yNK6vf5ne N1gxfnLa7OH2H2X3u/KAdalBL8cBbXzRQRGaxHuatA12LBwD3c4IeI/ruGVnW7S1ptMO+2 JLyBG97x8rrpx5biguMIgY20ML2UANgfMuYH1CK9T0ijbAs1qcretk29TnPfZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716442648; a=rsa-sha256; cv=none; b=PkM5cxMBTMM0DtwE0qNwOVG/wYR6jJ8tfI8AOZKSYKyVDwLuzQF8xqA13lbbRkrqNCX+H/ g+4fthhO0GpdNK3WBbiBGQt8lBilmmwhrt1KYoVyXaxvzoSQ/j4vORrDscM+ZyYNHsP3mz 2IOtQAmSe80ltrIufLX7kwxpNtJpHPgHkMg07RNPlxOpprMd2cUETDIrBak38cKvYtvpZk irJjNjxrU5DZ8Vzm1hfD94yZIPT77GMCuCMHz+N3kupkjyc1+VPCWKhku/7jC1Bn04ywSh P47xagGisOhxPiwSyAy1S9MnDgvmkIt9aKD2kUMPGdQk7+6G0FwX4w4ylQlCVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Ms0wZdFii87NsgO0/fqyUUXKvS9QqD0xn2ezWMTSJk=; b=CcJvhbtgfVhN0AScyBtDiVdsci62Dim3D3ptoWKCZnSjC+/7Usgc2Z8srm16pocWQmrrAE DC+eZ5HGV/gqfUz4k0XFzYIxX4lSFpHBjeweVvrF/gUlmgVk7PhEEqxYGDOOQbq/lJsd+E 17JkBL6QvJk0OU0rIKFJVOM6Z+FV1t8dl+0Ukv8+N5RoNezgAJrEJTnXL09zHfy+rQ4P3o ivNRHTxE9iG/OSU2wH9HRZ2sAgHij+UO81lxPik6f9bz7j3Jkq1L4mRLmkq+XA8Syo/lNz v60o2cZjS3mWfH651OYOIK1ZXXz800MYqeygIgnx9ObwVJ1TxTEr3jQ/MWdtuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlH4S273bzcd1; Thu, 23 May 2024 05:37:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N5bS5Q048006; Thu, 23 May 2024 05:37:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N5bSTL048003; Thu, 23 May 2024 05:37:28 GMT (envelope-from git) Date: Thu, 23 May 2024 05:37:28 GMT Message-Id: <202405230537.44N5bSTL048003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: cf879fdb4820 - releng/14.1 - fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: cf879fdb482034f73150fd47aed60ff6e57110f8 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=cf879fdb482034f73150fd47aed60ff6e57110f8 commit cf879fdb482034f73150fd47aed60ff6e57110f8 Author: Marko Zec AuthorDate: 2024-05-07 15:22:00 +0000 Commit: Marko Zec CommitDate: 2024-05-23 04:28:02 +0000 fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects MFC after: 1 week Approved by: re (cperciva) (cherry picked from commit 52075e4cfabc30d08605ec296b2b374d61e2e2bb) --- sys/netinet/in_fib_dxr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 69332b859099..8b1e92d01d35 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1280,6 +1280,9 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, da = dxr->aux; KASSERT(da != NULL, ("%s: NULL dxr->aux", __FUNCTION__)); + KASSERT(da->fd != NULL, ("%s: da->fd %p", __FUNCTION__, da->fd)); + KASSERT(da->refcnt > 0, ("%s: da->refcnt %d", __FUNCTION__, + da->refcnt)); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); for (ui = 0; ui < q->count; ui++) { From nobody Thu May 23 05:37:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlH4T55zFz5H9vH; Thu, 23 May 2024 05:37:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlH4T3JhSz4PKC; Thu, 23 May 2024 05:37:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lKOAS40rxuXRvgwuKdKkFpIu6TstVPWzVYPfSgstQJE=; b=T6WmNwwmE54Jmak6eJTDkh1Z6lK94Pkv/0SFbFYk+C8zFViNu5bQgaznEKLz+iDxDZHIFE ap4H+9xgjXk7LSMJLiZHI6BrVr4WDcfWgN3WIIYTZxT/PwaxEjXl2CP4qdfJMWcKc8l7IG abVMhTB9ZBb23W6uTCrfzvxTrgRP6l8ffEk1c0Kz1FtGO8Pb1MvsZSOOaIZWASCgdqC6V1 JA4yIs1sDfSSWzNvV+lEu7HEd2Ahaqkpbr2UE256yX8I0rCOpcJSmHWh9ZiIQnI7CxvvBW ff97DKVqe8XaAn8lcLkw7IjVPYonLwJLr/UPOsKXXXZjd2f0vIRKZzUJ5Ol94w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716442649; a=rsa-sha256; cv=none; b=sOTdABHBWnvy8TIQ0Szclbj3IjzrRTXpqYyTzUl5xEKfWYLJGjn+r5+TBmnxEvbnZtS3xe vgWbcYc6MtfiRz4lxu/Oi62fK+p0ed/x6n3ngJGMYcCCjXFXBfGKYlwcDh5oeD11n1Gjhw uI0xtQNk4WhLiXwl6A4IawSoGmsuEkBe9KtRJGGR3MuvsE7VuUXtaAUQYvNntE8K1yEkd7 Jkzbt6WzU5hS6EjXKviniOe+j3G/Dr29GKD3GyoqPSxy1uHyeStJOc8wTyaGa/6xs5h0qb kPp+99vVurgWsOL1RiScNwxMJq5YSqvZjeQlD7nbECA+4pXffQ4vxZVeRanOAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lKOAS40rxuXRvgwuKdKkFpIu6TstVPWzVYPfSgstQJE=; b=fI8gpiHP3rpqKYphScSLjbUng3vu8A6KQoqCSMKJiNtEfYbd+SejXgB6dNcHRUhBMIclnr 85soq8hc/u3H/FniyID9g3e8qCWsbdpvmxss9GfxiG/HdqwSgayB/fxSWpRbzrGzDOgM59 EykKlFymD9QxZIY1CYkh54hfCZ1jIZ+rpYhhozWNaMYPeTZoDmsGva/arlmO4C89qYvXle uJf0lp/EKIPr1Dyz7FPrsIWKOAZZ8dR5ZduFGSKHGh6FNnyRzbQkqeMMcucy4EBUgcfow9 BrU13N77WwV73oN2TwBGTbW4TgaVMaw76eE3FWJptmoE2pv5MWG3teP440dW3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlH4T2rX1zdCJ; Thu, 23 May 2024 05:37:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N5bTCa048043; Thu, 23 May 2024 05:37:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N5bTGD048040; Thu, 23 May 2024 05:37:29 GMT (envelope-from git) Date: Thu, 23 May 2024 05:37:29 GMT Message-Id: <202405230537.44N5bTGD048040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 0e5e6a9419ea - releng/14.1 - fib_dxr: s/KASSERT/MPASS/ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 0e5e6a9419ea1c966cfe1afe4c5e46e9bbcd43c8 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=0e5e6a9419ea1c966cfe1afe4c5e46e9bbcd43c8 commit 0e5e6a9419ea1c966cfe1afe4c5e46e9bbcd43c8 Author: Marko Zec AuthorDate: 2024-05-07 15:33:23 +0000 Commit: Marko Zec CommitDate: 2024-05-23 04:28:30 +0000 fib_dxr: s/KASSERT/MPASS/ MFC after: 1 week Approved by: re (cperciva) (cherry picked from commit 1261fc325c3cb96eeaddf3ed5a6b1c7c6a08d064) --- sys/netinet/in_fib_dxr.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 8b1e92d01d35..82245ecf6e66 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -474,8 +474,7 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) cdp->cd_max_size = size; cdp->cd_base = fdesc->base; LIST_INSERT_HEAD(&da->all_chunks, cdp, cd_all_le); - KASSERT(cdp->cd_base + cdp->cd_max_size == da->rtbl_top, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp->cd_base + cdp->cd_max_size == da->rtbl_top); } cdp->cd_hash = hash; @@ -525,7 +524,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) sizeof(struct range_entry_long) * size) == 0) break; - KASSERT(cdp != NULL, ("dxr: dangling chunk")); + MPASS(cdp != NULL); if (--cdp->cd_refcnt > 0) return; @@ -536,8 +535,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) /* Attempt to merge with the preceding chunk, if empty */ cdp2 = LIST_NEXT(cdp, cd_all_le); if (cdp2 != NULL && cdp2->cd_cur_size == 0) { - KASSERT(cdp2->cd_base + cdp2->cd_max_size == cdp->cd_base, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp2->cd_base + cdp2->cd_max_size == cdp->cd_base); LIST_REMOVE(cdp, cd_all_le); LIST_REMOVE(cdp2, cd_hash_le); cdp2->cd_max_size += cdp->cd_max_size; @@ -548,8 +546,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) /* Attempt to merge with the subsequent chunk, if empty */ cdp2 = LIST_PREV(cdp, &da->all_chunks, chunk_desc, cd_all_le); if (cdp2 != NULL && cdp2->cd_cur_size == 0) { - KASSERT(cdp->cd_base + cdp->cd_max_size == cdp2->cd_base, - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp->cd_base + cdp->cd_max_size == cdp2->cd_base); LIST_REMOVE(cdp, cd_all_le); LIST_REMOVE(cdp2, cd_hash_le); cdp2->cd_max_size += cdp->cd_max_size; @@ -560,8 +557,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) if (cdp->cd_base + cdp->cd_max_size == da->rtbl_top) { /* Free the chunk on the top of the range heap, trim the heap */ - KASSERT(cdp == LIST_FIRST(&da->all_chunks), - ("dxr: %s %d", __FUNCTION__, __LINE__)); + MPASS(cdp == LIST_FIRST(&da->all_chunks)); da->rtbl_top -= cdp->cd_max_size; da->unused_chunks_size -= cdp->cd_max_size; LIST_REMOVE(cdp, cd_all_le); @@ -875,7 +871,7 @@ dxr_build(struct dxr *dxr) uint32_t trie_frag; #endif - KASSERT(dxr->d == NULL, ("dxr: d not free")); + MPASS(dxr->d == NULL); if (da == NULL) { da = malloc(sizeof(*dxr->aux), M_DXRAUX, M_NOWAIT); @@ -1273,16 +1269,14 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, int update_delta = 0; #endif - KASSERT(data != NULL, ("%s: NULL data", __FUNCTION__)); - KASSERT(q != NULL, ("%s: NULL q", __FUNCTION__)); - KASSERT(q->count < q->size, ("%s: q->count %d q->size %d", - __FUNCTION__, q->count, q->size)); + MPASS(data != NULL); + MPASS(q != NULL); + MPASS(q->count < q->size); da = dxr->aux; - KASSERT(da != NULL, ("%s: NULL dxr->aux", __FUNCTION__)); - KASSERT(da->fd != NULL, ("%s: da->fd %p", __FUNCTION__, da->fd)); - KASSERT(da->refcnt > 0, ("%s: da->refcnt %d", __FUNCTION__, - da->refcnt)); + MPASS(da != NULL); + MPASS(da->fd != NULL); + MPASS(da->refcnt > 0); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); for (ui = 0; ui < q->count; ui++) { @@ -1315,8 +1309,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, #ifdef INVARIANTS fib_get_rtable_info(fib_get_rh(da->fd), &rinfo); - KASSERT(da->prefixes + update_delta == rinfo.num_prefixes, - ("%s: update count mismatch", __FUNCTION__)); + MPASS(da->prefixes + update_delta == rinfo.num_prefixes); #endif res = dxr_init(0, dxr->fd, data, (void **) &new_dxr); From nobody Thu May 23 05:37:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlH4W0BwSz5H9xc; Thu, 23 May 2024 05:37: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlH4V4fNgz4Q1b; Thu, 23 May 2024 05:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qdp4QXhiq4b3DQ41jTs2EdZmGRmq2qOq2odFGmyRfds=; b=N+3MlXgLOOJBx7CJBpOCe74UgQKpi8td/CJkH5ZUubiyUIFXf1E2TWkLoUb13GVKkSJp2r PnQkoIJ4VoXJ3SteMBRvgH1JMJ0PRNtKYCJ8gao4bW0jm00N9zrQnUpvLSdXWngaFV58E2 uzEibUq7lgIO1VXPzxK3dmwbsVnmK0jus8/aqgiVyMbxMxFKifTpOPsXI8Cj8cbdhqvgw9 y3h1k02yWJ26r0wVUZdwKa0C6Px5ZQ10vpPCUIzOCx2rSsCCx31+wrWrT2xRVSprnCazqr O0Y5WGtcB17Ni5BThdzucCaGRiJD7XTVeqEo1umTlB5LhJIuHVZdatIeCDdGWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716442650; a=rsa-sha256; cv=none; b=Ty3i6wQelQdFy1bJO2BEwpAzPWpIyo3/06ob6zL2nUOQpsC2EZp6BU4ycGYdkzb1ujOM2b /cjrYAFgxuB3tbbVc4a0KGeQ3w2OHEHc/Y31zsgGf8Bhtke08DRCUVNwgOHlJRl7S2O+3J gCEUA682bjXg1IlyZ7wQrgHgfi/iLQuK1VnHOb2peuVN11GIG40buaQRN/fqUS3mqif62Z 4E22LzUOMGjeBlaguRn0Hm21Sr5m8jqXcPnUgP7bLiEmAOQ7Fv5fvUIx6h0YeCaZDOhleV U4nePk+WDWcP1S5qYwXTI74fK0L8PMI7JHb1ULAtOF9Z5wNAjdGgaa4Jt555ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716442650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qdp4QXhiq4b3DQ41jTs2EdZmGRmq2qOq2odFGmyRfds=; b=wFZY9fXPEKCwBqlgkJZW+QP+OduaHRLuDzvY0R8aXG3uuzrBvfm/VQ6idCmJ5L0bCi5YS6 J/4XvrKM2hxvPksJJ0ZdDxVruEHu4OK2gvlFMfp18ejl07U+bCgEvyZSutFKc/rHZA0nMC X8Iu4IW3xsKfNBtel5p7dWaS2bhzSd6NLYMN/m3ASEVZeOkwEeJqc/MfY8NIgYSkKZCW86 MMTwoWrTSQgCMgJbkjpO+96TZ+7/2XSUFfbbJbvPF5skU22ur+vTxdvDa0ONgCKM9EAJPH SNPnylttyp+6D1XSa04dTwVT0qXgYUIUQf8HWDoqBK93jkP4nQyGNieeXPe4yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlH4V4G71zcyP; Thu, 23 May 2024 05:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N5bU8O048103; Thu, 23 May 2024 05:37:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N5bUTA048100; Thu, 23 May 2024 05:37:30 GMT (envelope-from git) Date: Thu, 23 May 2024 05:37:30 GMT Message-Id: <202405230537.44N5bUTA048100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: 782f02004251 - releng/14.1 - fib_dxr: check if cached fib_data matches the new request in dxr_init() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 782f02004251f68d144ea7914e390297b6edad48 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=782f02004251f68d144ea7914e390297b6edad48 commit 782f02004251f68d144ea7914e390297b6edad48 Author: Marko Zec AuthorDate: 2024-05-17 15:55:43 +0000 Commit: Marko Zec CommitDate: 2024-05-23 04:29:22 +0000 fib_dxr: check if cached fib_data matches the new request in dxr_init() When calling dxr_init(), the FIB_ALGO infrastructure may provide a pointer to a previous dxr instance, which permits reuse of auxiliary dxr structures, i.e. incremental lookup structure updates. For dxr this is a crucial feature provided by FIB_ALGO, since dxr incremental updates are typically several orders of magnitude faster than full lookup table rebuilds. However, the auxiliary dxr structure caches a pointer to struct fib_data and relies upon it for performing incremental updates. Apparently, incremental rebuild requests from FIB_ALGO, i.e. a calls to dxr_init() with a pointer old_data set, may (under not yet fully understood circumstances) be invoked within a different fib_data context than the one cached in the previous version of dxr auxiliary structures. In such (rare) events, we ignore the offered old dxr context, and proceed with a full lookup structure rebuild instead of attempting an incremental one using a fib_data context which may or may not no longer be valid, and thus lead to a system crash. PR: 278422 MFC after: 1 week Approved by: re (cperciva) (cherry picked from commit 4ab122e8ef127d36d95f874e85600c36c87c8c22) (cherry picked from commit d6e32525c778d92c26a37f4e1b562e80b18a9af7) --- sys/netinet/in_fib_dxr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 82245ecf6e66..539d7fe6c96f 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1139,7 +1139,8 @@ dxr_init(uint32_t fibnum, struct fib_data *fd, void *old_data, void **data) } /* Check whether we may reuse the old auxiliary structures */ - if (old_dxr != NULL && old_dxr->aux != NULL) { + if (old_dxr != NULL && old_dxr->aux != NULL && + old_dxr->aux->fd == fd) { da = old_dxr->aux; atomic_add_int(&da->refcnt, 1); } @@ -1275,7 +1276,7 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, da = dxr->aux; MPASS(da != NULL); - MPASS(da->fd != NULL); + MPASS(da->fd == dxr->fd); MPASS(da->refcnt > 0); FIB_PRINTF(LOG_INFO, da->fd, "processing %d update(s)", q->count); From nobody Thu May 23 06:00:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlHbK5nKyz5HCmY; Thu, 23 May 2024 06:00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlHbK5DwQz4SSN; Thu, 23 May 2024 06:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716444045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yygCUqVmMfRbAkXFmP8nw4bJcOXFAAnii0J0V+wLDDM=; b=NgmdRHJcWl54DqeeKVobmZA/e2f8l/lqokD7uOglFM9Wf916eTiTynfbWImwjmqlf2XTb6 NJzGloDQDzEhxjzZVeH6DGQZslihbCd2BfoJGFnCefBL4sVT9dJ2jKsiCSu5sPfAjor6vE 2XkUmqaHdIjNiI3YqxSJ6+IdLOLXjpeiLW71m0+F+XVCVnVk503ZE8jVKYg8f6+qrLvKpn QBL1NLSHcwBCFt30RxjU27sKZ03poP8hcw8wCBWi4zEBXRKgLRqmAKPW/m/SjLf66vMD0r 1owR5VA2nzPtt05a0E1VzS/JWB3/zMT8d8fFwKQbyFhAtlM+telSE6A3h7asdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716444045; a=rsa-sha256; cv=none; b=ZWYLcskhxtg5I2GZmyc7NbK9mK3Lfp2Vi/Yw8X2sQ4fiNzypvbWm5nHSpXtrJAp+SO3po2 Yl+j7zzgvBSDIF66Sp+EcTbvSSF1aEkXEJM+qH9/+pcWueNDKqaQEEACimaAoPsWkCqP6q fxqRzjVk44pDuSaY9hFnXkVOMYWtscBVoqTUgQUlDOCAQrnocBZ3DE6cPRDfesMB8Svawx 023GdN7LJiqwo6NV1WdnlYFjn7gocC2apMK1ejkP/MAUaFViTcgZoVxc9Dzu10cmizczv3 rTPBPfnu92WzXjXUKgIY5Nm42qLLPt9yzpxeNa9JDvYmxAtRPlYuYQygXW0ziw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716444045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yygCUqVmMfRbAkXFmP8nw4bJcOXFAAnii0J0V+wLDDM=; b=kSrlYtJI4kFoxsDH35+dMUpv4rZ5BYWsnSQ6HbofxDgrgILewl11CfULFNDaWvL1f+hBLu 9ociQhVFDvR0ghI3qbwQ/LXYLna8cj0NVF81lPs8hE3Y9wp894AHtXelHustex4q1wiaN9 vVNxmuYxOLJNyKFKV3F4AXZBxJIh7ble7TRwkzU6QMT3ntCp/IpiI/JopLXjYTJlMrp/ky QlgYP+gPAkw4rtVXiQUe3NNH9zkmIHaxMiUezOIb3s0fapV24+i+I3BUWA57qjTFhuUsMC s6JaP8TKqZZ0zJjb844JTPrCHqBfjheUp4JDt3w7mVVxQiLtO5eQ+T6mudlT/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 4VlHbK4rNjzdGR; Thu, 23 May 2024 06:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N60jIW094316; Thu, 23 May 2024 06:00:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N60jWS094313; Thu, 23 May 2024 06:00:45 GMT (envelope-from git) Date: Thu, 23 May 2024 06:00:45 GMT Message-Id: <202405230600.44N60jWS094313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: ea5a708625e5 - stable/14 - geli: allocate a UMA pool earlier List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ea5a708625e5b5c89333e3e3e9a48fe588f05361 Auto-Submitted: auto-generated The branch stable/14 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=ea5a708625e5b5c89333e3e3e9a48fe588f05361 commit ea5a708625e5b5c89333e3e3e9a48fe588f05361 Author: Mariusz Zaborski AuthorDate: 2024-05-19 12:53:17 +0000 Commit: Mariusz Zaborski CommitDate: 2024-05-23 06:00:57 +0000 geli: allocate a UMA pool earlier The functions g_eli_init_uma and g_eli_fini_uma are used to trace the number of devices in GELI. There is an issue where the g_eli_create function may fail before g_eli_init_uma is called, however g_eli_fini_uma is still executed in the fail path. This can incorrectly decrease the device count to zero, potentially leading to the UMA pool being freed. Accessing the device after the pool has been freed causes a system panic. This commit resolves the issue by ensuring devices count is increassed eariler. PR: 278828 Reported by: Andre Albsmeier Reviewed by: asomers MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45225 (cherry picked from commit 4b3141f5d5373989598f9447ab5a9f87e2d1c9fb) --- sys/geom/eli/g_eli.c | 4 +++- tests/sys/geom/class/eli/attach_test.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 400734c10596..bed0875283aa 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -1047,10 +1047,12 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, bioq_init(&sc->sc_queue); mtx_init(&sc->sc_queue_mtx, "geli:queue", NULL, MTX_DEF); mtx_init(&sc->sc_ekeys_lock, "geli:ekeys", NULL, MTX_DEF); + g_eli_init_uma(); pp = NULL; cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; + error = g_attach(cp, bpp); if (error != 0) { if (req != NULL) { @@ -1093,7 +1095,6 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, if (threads == 0) threads = mp_ncpus; sc->sc_cpubind = (mp_ncpus > 1 && threads == mp_ncpus); - g_eli_init_uma(); for (i = 0; i < threads; i++) { if (g_eli_cpu_is_disabled(i)) { G_ELI_DEBUG(1, "%s: CPU %u disabled, skipping.", @@ -1165,6 +1166,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, sc->sc_crypto == G_ELI_CRYPTO_SW_ACCEL ? "accelerated software" : sc->sc_crypto == G_ELI_CRYPTO_SW ? "software" : "hardware"); return (gp); + failed: mtx_lock(&sc->sc_queue_mtx); sc->sc_flags |= G_ELI_FLAG_DESTROY; diff --git a/tests/sys/geom/class/eli/attach_test.sh b/tests/sys/geom/class/eli/attach_test.sh index bdb39a806fca..8803fa9f1a40 100644 --- a/tests/sys/geom/class/eli/attach_test.sh +++ b/tests/sys/geom/class/eli/attach_test.sh @@ -39,6 +39,34 @@ attach_d_cleanup() geli_test_cleanup } +atf_test_case atach_multiple_fails cleanup +attach_multiple_fails_head() +{ + atf_set "descr" "test multiple failed attach of geli provider" + atf_set "require.user" "root" +} +attach_multiple_fails_body() +{ + geli_test_setup + + sectors=1000 + attach_md md -t malloc -s `expr $sectors + 1` + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check geli attach -d -p -k keyfile ${md} + + for i in $(jot 100); do + atf_check -s not-exit:0 -e ignore -- geli attach -d -p -k keyfile ${md} + done + atf_check -o ignore -- newfs ${md}.eli +} +attach_multiple_fails_cleanup() +{ + geli_test_cleanup +} + + atf_test_case attach_r cleanup attach_r_head() { @@ -125,5 +153,6 @@ atf_init_test_cases() atf_add_test_case attach_d atf_add_test_case attach_r atf_add_test_case attach_multiple + atf_add_test_case attach_multiple_fails atf_add_test_case nokey } From nobody Thu May 23 07:51:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlL2d5WVYz5L7nZ; Thu, 23 May 2024 07:51: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlL2d4ysnz4dLB; Thu, 23 May 2024 07:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716450665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ma3xbwPwd5Q8yU0tG7QIonRruw2V/vtOV2AXbvdwVnY=; b=tB4+d4ZHCV/l6eAyC1SguNAsIvqLW6XMapwvRdrhZRxIPHI8PPsCnGnUZhRCMY1Z6yu/3g eELn8VwvVxJgNYgI1xD0FX7qZZ4nmG6MO3jcMuoBsTRDIE6IpJUaa7FYUDAh6KLxRteFux FW0LPMpG2iLhbU2wi7fumeOBSr7dxSpyXd8wC5X610MkKKyqmuO3nBihHOQ5gIueSdQK9N d9mDn91CrBHek7L3nyG+PysDNHjvo+kjOaMdjSLCHfp0WRzFf7qiErLj/cQg7MOcspZLAK Ic8mYCkFa5mCzmA/QzcXUY2K4wSdyv7FEp6aJytbRdqTVv3EvERDtcFX6sqipw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716450665; a=rsa-sha256; cv=none; b=K8xnYeWZ5ZyglVAb61zTT4fkJECp+ZYOK1RLWGy0i86sRCY0ZH1m02GGlB5r9iWntkVxZO AkAwVNYthDmls8Es0kysvxWkqw2sQqXbAJf5T3gaA+WKY6IKF3AHfBKAz/CKGJsSzhHie3 np27JSczA1QDNOc9RDi0QLwsQ1untBRwv5sU1EuQwkpQrMZmEPwhP8RuhBBtyof5VTDLpS dEFFg+FFRo0pVjwfHeHvPaWPiWNsJL3wpxmzLL9B9e49BlNUc/nOwTG6w4xj+Sl9TZY6wD B4f1eLWfXFOpbBSYSlRHgJ2aMP/WEIWkDLjv+O6h+vi8lxnhidyl40C7/SJysQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716450665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ma3xbwPwd5Q8yU0tG7QIonRruw2V/vtOV2AXbvdwVnY=; b=cojGPWcOiJjNTslJ8sW0hZbLy7GkypHOoZtUzwddO9jZ5v1PF2hJ5FgfPiU165UZnV1OAP R/tAdeO4446A/j3gtMFhnl1ZSirG6sJ4roJQkfe4khstapmbaoN/HGXTA/aa1C/4m0HWmj meGYfkvHAT98gITz2KxPmiw1uOC70DZOlBaxMUYoqSVMujg3MTeQqIFmOBoEHz5NVgB7EE I/eGEsqyd7rApR9WOLyz7pkUX9VdJvtjF5Gz/Pju9bk8GXgTZkQBPAGKjX7+iu10VdmUJa +wj76vQok8saFmFgPYBBWpeBE6Ju9IyQcNVKzhjqYekEmQ/R5wHurF47NXhPYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlL2d4ZsFzhMB; Thu, 23 May 2024 07:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N7p52B080872; Thu, 23 May 2024 07:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N7p5i6080869; Thu, 23 May 2024 07:51:05 GMT (envelope-from git) Date: Thu, 23 May 2024 07:51:05 GMT Message-Id: <202405230751.44N7p5i6080869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: d31c10fca32c - releng/14.1 - nuageinit: by default to not enable nuageinit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: d31c10fca32c6ee07e35d50010ef1b55976a5d25 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d31c10fca32c6ee07e35d50010ef1b55976a5d25 commit d31c10fca32c6ee07e35d50010ef1b55976a5d25 Author: Baptiste Daroussin AuthorDate: 2024-05-14 12:15:43 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-23 07:49:46 +0000 nuageinit: by default to not enable nuageinit MFC After: 1 day Reported by: karels@ Approved by: re (cperciva) (cherry picked from commit 5681636ead6790d5ad2c24a4712f010fcdfc926c) (cherry picked from commit 2c5c85cbcfac0037aaafff130d9c4bdb5d341fe8) --- libexec/rc/rc.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 831ef202219c..7f9e67981eec 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -725,6 +725,7 @@ newsyslog_enable="YES" # Run newsyslog at startup. newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off +nuageinit_enable="NO" # Run nuageinit at startup # rctl(8) requires kernel options RACCT and RCTL rctl_enable="YES" # Load rctl(8) rules on boot From nobody Thu May 23 07:51:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlL2g15Cbz5L7fp; Thu, 23 May 2024 07:51: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlL2f6CV0z4dLD; Thu, 23 May 2024 07:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716450666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JKiRoWaqoX8BQwGctmx0asnJF7CpD9GO+VhxtTyTn7A=; b=j84H93ZIktQcV0KYwspKzdPbEkpOdSvY1208I6XFa5r7ov2yJEPuWiLEY/xoaHOAqqmkG4 dRWvFSJJI1RjijofU4FaeSNCCgG5ZpNNP5TdkZ42iuE3/Qi7MXESpOmDBcZvHzv1MxXBmq E6fFro+t4bGsJF5NOhFr5G6HLhwd0lReww5qpyyMYo1gHNodsnl5urbr4UM19Gc1NIAH8h FjCI+stRiKATuOJBr/PMu9TZr/R0u/Hj/2XKKM851YXwUp36vjbVV4sgV5K7HOxUlUAIQL f7zOmivnmUPNhkBrzFT+AYhCTO2CL0NjWGoTGVXob2ry1smfo7MzhqnxMX/0cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716450666; a=rsa-sha256; cv=none; b=qZ+XTySFqYcqNkIJfQx5ZjKMx5etRV9WpBifdz9AyRSU4hJss45z2nzZFxUN7MmawK3dNw dqjy42n1IdWm7Cqsr1qRNpMU0zzQ919BLO2TuXso/dLoKOzFla7z/B0aksbSxwYc87HpkS KOoNcBMdFe/fAoUA9whMRzUChavjG7yYEcwP7kvj9Aq6WVla4wWLJ8l7c7EeLGukIkfQfs xYDY7OqeUoHiMJRMReXuE/Ih3SyJ/YR7EEu+wOJyBPFVw3P9OGdHpq8Sz0h898rjQ1jUlX XS9GCWpLCffYnDC4hi/lN9mOPf6Elta9ZhgxvPq03CsiUbQnMu/owA1y6Ve/oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716450666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JKiRoWaqoX8BQwGctmx0asnJF7CpD9GO+VhxtTyTn7A=; b=Az+rPsI1kD7+5H+bPeLQShhHdt4wBt/gy6u/o3sEtWsJOrTdawAbTGuFMubDqKgbo634AX 1trRTBlqv60tSye5Qp23dautGBgwX0dFYO+HuHO6x7i43TgIm1xh2UF40tf12LFCu1J12z 3ZRh2Se+OhxzbjuxqZlwK8g6ceeQP3/q/yNVr5XgvIoURauy+N/wAlHPXY0nuAHcdzogY4 Q8O1CD9PwPkI6a0HL9tZ4YtcZ2FhLBC26vZrKDAgA0jDaj2i2Qw61y8BhO4IhAWQlLNnmR 036PDQ3HfoHfjj+qSabQ9z1cnBX//m4H6xE553X/Uy+ydDz0OSHNXRKpp0525g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlL2f5f5NzgwC; Thu, 23 May 2024 07:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N7p6gu080935; Thu, 23 May 2024 07:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N7p6ID080932; Thu, 23 May 2024 07:51:06 GMT (envelope-from git) Date: Thu, 23 May 2024 07:51:06 GMT Message-Id: <202405230751.44N7p6ID080932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 3b9c88fa9916 - releng/14.1 - fix (nuageinit): SSH keys are not handled in metadata but in userdata List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 3b9c88fa991649be79bc84b131266b20d432b11a Auto-Submitted: auto-generated The branch releng/14.1 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3b9c88fa991649be79bc84b131266b20d432b11a commit 3b9c88fa991649be79bc84b131266b20d432b11a Author: Jeremy Collin AuthorDate: 2024-05-21 14:52:23 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-23 07:50:01 +0000 fix (nuageinit): SSH keys are not handled in metadata but in userdata MFC After: 1 day Approved by: re (cperciva) (cherry picked from commit 48edad2edf6eb7a539e40dad8e1f87e3fa4973fd) (cherry picked from commit 5601feb7204b2ebb4c351b534105da8fc22213fd) --- libexec/nuageinit/nuageinit | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 08224061d1b1..df637bbc5064 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -164,13 +164,6 @@ if citype == "config-2" then nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) end local obj = parser:get_object() - local sshkeys = obj["public_keys"] - if sshkeys then - local homedir = nuage.adduser(default_user) - for _,v in pairs(sshkeys) do - nuage.addsshkey(root .. homedir, v) - end - end nuage.sethostname(obj["hostname"]) -- network From nobody Thu May 23 08:06:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlLNH5fkPz5L8hc; Thu, 23 May 2024 08:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlLNH4q8Dz4fLn; Thu, 23 May 2024 08:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716451583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MPAckFDfhEPtW21OTLuO9fssnIrXC3Vdsc4F8bv2vEQ=; b=Gq7WfRcZChxZeu9l5FZz1GByygePBYjzQEWMeEHun/zAT9eBW2ejNY+ugzlAzbF8XOg763 KOj8Y11fK1LwrGfxjkuSQJZbnybJ3B5+hgzXfdHk2VziLn7IqRu7WdTGWB28YPktwqW8OL eDkwo0DQy32nxx1l8ed+opJRK20Iary9hfwmVUPBxbVPf9c0aqZeLmEEGLAmmfdEDy71D7 XtHZdCGMIeOJN/4HNmXSuQ6KUN0nqO8reRIfDF0e+XxxD2/rpisfXnMUX4zfTvdidEgn6z i9HdGkFwTVNn7I4HMPmQKy6TR9H9dfU4GThQTYWHKp2A/E32SPg5L8gykB7huA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716451583; a=rsa-sha256; cv=none; b=JML6Jp5fc/sg0fvowiWtc9tTqO7xLYM9CZ86Usq3yrENswQqoC95Zd+X5yamxdwmA9w7EK 6SUsGDZrkqrW3dQGZAIUrJ0fzYva9NGZ4feANe/YM3hdheNZCWwLOEQil4G44PlrzJWrJV V0LzhsNGcpxl6nJLl+PmGqfqW0RFjlO6INrSEVPvoaUyzbDw2tcpvFl2cmSkdGypt/ngJH R7wmkqEbK8gQgifxyOm5FqVsKCG61wdeu2Vdd3DFgDEiacBJ2hCNcrfXg5MsqOfTFR0IcG yoF8b9Ah0zH47AxkCXNL68Jxe/pj/+ZiGbsRXF5aK/Jh/Mp24jSoNPxV/z5wWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716451583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MPAckFDfhEPtW21OTLuO9fssnIrXC3Vdsc4F8bv2vEQ=; b=oYYLNh7HAViDrfbtRQuCKfNaBOWaubBnpTwy4q9zj4V+ld+GkFuax1Y04WH5iTudp6ncY+ 4V54OqzjI8k6nXW8bxPgQQXaQxP1eTX1e3EkxTf0LxJGvRmOYjGjm6j9aNQOiPT6+BmH+U gItY8CLyi4w63NgJGktGIAz9OXu+jieZLvPleTVtspOm0qX9BTGHGJb/bZFQZuhhhfBewj ePm6B9CBpmFuHVvxGteiV5WuLNI4kh2bZn/C6Q9E91TFQjugElUeO0Ndh0bagihZspf2Jp QdXffFXXSb93qpkkGVuAFFW4ltJMUtStAySejXHHgCojeZiS5ufp1h+C8HDWdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlLNH4QCNzhqW; Thu, 23 May 2024 08:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44N86NrT002409; Thu, 23 May 2024 08:06:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44N86Ngw002406; Thu, 23 May 2024 08:06:23 GMT (envelope-from git) Date: Thu, 23 May 2024 08:06:23 GMT Message-Id: <202405230806.44N86Ngw002406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 309946854fd5 - releng/14.1 - geli: allocate a UMA pool earlier List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 309946854fd5cb24283cf7a36c9d20c2f2820df7 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=309946854fd5cb24283cf7a36c9d20c2f2820df7 commit 309946854fd5cb24283cf7a36c9d20c2f2820df7 Author: Mariusz Zaborski AuthorDate: 2024-05-19 12:53:17 +0000 Commit: Mariusz Zaborski CommitDate: 2024-05-23 08:07:19 +0000 geli: allocate a UMA pool earlier The functions g_eli_init_uma and g_eli_fini_uma are used to trace the number of devices in GELI. There is an issue where the g_eli_create function may fail before g_eli_init_uma is called, however g_eli_fini_uma is still executed in the fail path. This can incorrectly decrease the device count to zero, potentially leading to the UMA pool being freed. Accessing the device after the pool has been freed causes a system panic. This commit resolves the issue by ensuring devices count is increassed eariler. PR: 278828 Reported by: Andre Albsmeier Reviewed by: asomers MFC after: 3 days Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D45225 (cherry picked from commit 4b3141f5d5373989598f9447ab5a9f87e2d1c9fb) (cherry picked from commit ea5a708625e5b5c89333e3e3e9a48fe588f05361) --- sys/geom/eli/g_eli.c | 4 +++- tests/sys/geom/class/eli/attach_test.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 16b38e628e35..8c866820b33e 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -1045,10 +1045,12 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, bioq_init(&sc->sc_queue); mtx_init(&sc->sc_queue_mtx, "geli:queue", NULL, MTX_DEF); mtx_init(&sc->sc_ekeys_lock, "geli:ekeys", NULL, MTX_DEF); + g_eli_init_uma(); pp = NULL; cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; + error = g_attach(cp, bpp); if (error != 0) { if (req != NULL) { @@ -1091,7 +1093,6 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, if (threads == 0) threads = mp_ncpus; sc->sc_cpubind = (mp_ncpus > 1 && threads == mp_ncpus); - g_eli_init_uma(); for (i = 0; i < threads; i++) { if (g_eli_cpu_is_disabled(i)) { G_ELI_DEBUG(1, "%s: CPU %u disabled, skipping.", @@ -1163,6 +1164,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, sc->sc_crypto == G_ELI_CRYPTO_SW_ACCEL ? "accelerated software" : sc->sc_crypto == G_ELI_CRYPTO_SW ? "software" : "hardware"); return (gp); + failed: mtx_lock(&sc->sc_queue_mtx); sc->sc_flags |= G_ELI_FLAG_DESTROY; diff --git a/tests/sys/geom/class/eli/attach_test.sh b/tests/sys/geom/class/eli/attach_test.sh index bdb39a806fca..8803fa9f1a40 100644 --- a/tests/sys/geom/class/eli/attach_test.sh +++ b/tests/sys/geom/class/eli/attach_test.sh @@ -39,6 +39,34 @@ attach_d_cleanup() geli_test_cleanup } +atf_test_case atach_multiple_fails cleanup +attach_multiple_fails_head() +{ + atf_set "descr" "test multiple failed attach of geli provider" + atf_set "require.user" "root" +} +attach_multiple_fails_body() +{ + geli_test_setup + + sectors=1000 + attach_md md -t malloc -s `expr $sectors + 1` + atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none + + atf_check geli init -B none -P -K keyfile ${md} + atf_check geli attach -d -p -k keyfile ${md} + + for i in $(jot 100); do + atf_check -s not-exit:0 -e ignore -- geli attach -d -p -k keyfile ${md} + done + atf_check -o ignore -- newfs ${md}.eli +} +attach_multiple_fails_cleanup() +{ + geli_test_cleanup +} + + atf_test_case attach_r cleanup attach_r_head() { @@ -125,5 +153,6 @@ atf_init_test_cases() atf_add_test_case attach_d atf_add_test_case attach_r atf_add_test_case attach_multiple + atf_add_test_case attach_multiple_fails atf_add_test_case nokey } From nobody Thu May 23 12:53:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlSlb5Kt0z5LgM5; Thu, 23 May 2024 12:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlSlb4V43z4B3k; Thu, 23 May 2024 12:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716468811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3mKlZrdIo9oTTyWyCiS0um0fqJmxVdL2BmYxTKqYKDU=; b=xMBeERCm/X6F1DLWrjYi3ZTBqEVlxH25IBMiNWAPxCKhjDNIZ7sqW6s53rD+o5lOHKAaHz RFr6Fsv0py9Oip7iNTmQIS3HRWLNCFAEIkYlGVEt3r3Rr3/0/OvgR1hhiSFGK23Uhaz+Zt jzCpl9v+dDgAJ00wH/L6cuUu+hDBYKhVppQ7kPd1ApMmrT6eG8MYehsk+VK762Nq/wA4On HOxq4F1h/X8TVlv4x5VgynW9Cvl4oWCbugmX5jxZ6tcmJiVirVaUHE+Fe8aCQ6v5tnfsOB QYyug5VUJIGUcwQ9YVRuzsi+YVjoVeJGCIiUMjwLUurjnwf5dYEIHmJvp+7OwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716468811; a=rsa-sha256; cv=none; b=dzV+D+GcXkqRngk1hWoNpAFTaEBkADy8jZyp5ET47k8i5km8TmutkQs2bZLY1Emx0XulMZ Kg7z0R5CcGJyhCgbqFND8n2jAIwH+NaCh/THeDAYueTLhJYn452GffUk1QQ7/5yICozntk DjBAdfLw8IwFfgfahVljOUr+b/MUVp9mmiG00j5YZgQJkUmvpOdbspDvvmIOFV5TPX1OIA vUPg+2/Y70+3h2bt9mJxsWYqz7TtrHi0mI/+Kegvb4MTSIkLEhMnJGydIbdSWZx70LUo8u 4Uqtj58sZ54e9frVUmUjVPOQkdjONDIWS+KCbgnuO8Yi1HPztHhSqLLqjDsyrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716468811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3mKlZrdIo9oTTyWyCiS0um0fqJmxVdL2BmYxTKqYKDU=; b=s/udqqLnMuC4PCxBNcs/Wu+VAZ3RKy9tEFfzHanNTHN9IkRkR7lQdUNUs0kNc7BNM7grfP I2oTgX/uve3vcpbukdPJZQCbySNw3tnZTw7EMRMHQ3bUflLJCot29CnYPhNPtOGiylylSx nPkf/Pka4pbpbYI8vG4B9Pdf29wX9WQfM2cCOOiygqvmb5sdRl28bfZ5R++lvANYs/xfT5 xht20k9juLHFy/kExc66DMhJACpsO/HCl6LjKhePmJlMJVq+892kcvKfu8vqSM/ZWYAYIa X0nRuZG+F89Z2BzzJvHgp301KEmET1QXuaBa3A/z/eSZGukFjQbYnzhE/4GbpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlSlb45BBzr1G; Thu, 23 May 2024 12:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44NCrVTa090050; Thu, 23 May 2024 12:53:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44NCrVq2090047; Thu, 23 May 2024 12:53:31 GMT (envelope-from git) Date: Thu, 23 May 2024 12:53:31 GMT Message-Id: <202405231253.44NCrVq2090047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: 83731cdde6c6 - stable/14 - adduser: create dataset only if home is directly within dataset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 83731cdde6c672b16338de4c6a0c4939c02c0928 Auto-Submitted: auto-generated The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=83731cdde6c672b16338de4c6a0c4939c02c0928 commit 83731cdde6c672b16338de4c6a0c4939c02c0928 Author: Mike Karels AuthorDate: 2024-05-20 13:43:34 +0000 Commit: Mike Karels CommitDate: 2024-05-23 12:52:37 +0000 adduser: create dataset only if home is directly within dataset Currently, if the prefix of the new home directory is a subdirectory of a ZFS dataset, adduser will create a new dataset up one or more levels from the intended destination. "pw useradd" will then create a normal directory in the desired location, leaving an unused dataset. Check for this situation when determining whether to create a dataset, and let pw create the directory. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D45229 (cherry picked from commit 0b39b2e2ddb2df1d1325e042893ddcb1a1c12b8e) --- usr.sbin/adduser/adduser.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 7c3fdb418179..ecac7478befd 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -474,7 +474,7 @@ get_homeperm() { # so, enable ZFS home dataset creation. # get_zfs_home() { - local _prefix= + local _prefix= _tmp= # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS @@ -487,6 +487,13 @@ get_zfs_home() { Zcreate="no" return fi + # Make sure that _prefix is not a subdirectory within a dataset. If it + # is, the containing dataset will be the same for it and its parent. + _tmp=$(${ZFSCMD} list -Ho name "$(dirname "${homeprefix}")" 2>/dev/null) + if [ "${_tmp}" = "${_prefix}" ]; then + Zcreate="no" + return + fi zhome="${_prefix}/${username}" } From nobody Thu May 23 17:42:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vlb8Z4Smpz5Kxtb; Thu, 23 May 2024 17:42:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vlb8Z3pJ9z4rSD; Thu, 23 May 2024 17:42:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716486126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u5VkYq5r8JejhsZf2gECWaykt3YMrZXT4G6s5dL4gqc=; b=S8jPBVa6ntDq0hvJwAyb9AzuSoyR2ppgiwFZ65JkDZG6+5X/TAl8ytf3vL0AAq1KhNlRi8 OXiKf/bqJXlbP8eOvsQenOjBR22nh2pMxuXque6qvm4XMzfAtAbegrhs0hxzByQxJqstQw +Sk3o9snP3+4H2ubuTREBuK/F4ZnGedQ0k9aHOiYYO2zqgT17Tax6cJotKgExDOsgHRDW6 DJGfGncbGcSGAb7wPpot7jhZBy2IKG/pzrsocPYIIAmHULpDznNblc1EwX+s+Q9WNzk392 U5nM9NuzRHmDexY02c7251m/KTq8g1BHR6zXRUJoG7nzz00y+MiZ+SxiJewt7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716486126; a=rsa-sha256; cv=none; b=n9utmUZYQM2ESgB6SkW07lSBauIph9fKB9BeQ42gfSJrjYiot0ehTbm8DlTtVGbjbuJfX5 jIKGJ3E2UP7kSrhN0vDZCEVfwh/SR83afrR952NTML8mCTYfE6NdvedEpYwOD0DlFvjSwh gCv2qHDb4PzktqhbLzRXU9hYg0IJZ3MJNZeT2nLFCfui91fhhebNXCKTek4+YVFQfeTk82 K8Onj9nBbdCYJdW23h3slK922gH4raT60NrefsoDO2t5Maflw0iiz+WE/Ynb+YLLnJitby hkuncLm2yStIuIH39/wVVwDNCFa9BMXvMaR4YEHFz/ApDSjnlcTHOSCSo+q+6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716486126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u5VkYq5r8JejhsZf2gECWaykt3YMrZXT4G6s5dL4gqc=; b=ZGvDEv1AbchieOJ8yNmZSBuo7WriyLHiyb1JdFOm205IVsa+w53oa9CXN+U7ylMvrdAoIC P+rA/GfpzQqYiAdP23Kfzt/gNGZTODbC1cJCK2qMGm2IM1LMqTDsnrlMRpvjk8ttRxnq+5 PJmynNaF5S3+lV2ARYJ3QdixsH1vPSs27Yoe5gUXbgVQ0Up9yYrCVz2pT4FK+m2x8NradW g998feJCz+nH30L5/wH9yr0IiaLobCINyXrazOxbKXQA2II4uhhHlVgj9KnwsrwPHPx+QX IZGFaAbmdvdcNeiGt1WjEQMrXv8Rt0AKhTHsTQGRQyd4+Tl41UwiP0g0CNKnLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vlb8Z3PwWzyrN; Thu, 23 May 2024 17:42:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44NHg6um081525; Thu, 23 May 2024 17:42:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44NHg6WV081522; Thu, 23 May 2024 17:42:06 GMT (envelope-from git) Date: Thu, 23 May 2024 17:42:06 GMT Message-Id: <202405231742.44NHg6WV081522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 455ce1729353 - stable/14 - Fix scn_queue races on very old pools List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 455ce1729353f2ffce9713ccc3574e73186a22f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=455ce1729353f2ffce9713ccc3574e73186a22f0 commit 455ce1729353f2ffce9713ccc3574e73186a22f0 Author: Alexander Motin AuthorDate: 2024-05-23 16:20:37 +0000 Commit: Alexander Motin CommitDate: 2024-05-23 16:24:55 +0000 Fix scn_queue races on very old pools Code for pools before version 11 uses dmu_objset_find_dp() to scan for children datasets/clones. It calls enqueue_clones_cb() and enqueue_cb() callbacks in parallel from multiple taskq threads. It ends up bad for scan_ds_queue_insert(), corrupting scn_queue AVL-tree. Fix it by introducing a mutex to protect those two scan_ds_queue_insert() calls. All other calls are done from the sync thread and so serialized. Reviewed-by: Brian Behlendorf Reviewed-by: Brian Atkinson Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #16162 PR: 278414 (cherry picked from commit 49086aa35d987b78dbc3c9ec94814fe338e07164) --- sys/contrib/openzfs/include/sys/dsl_scan.h | 1 + sys/contrib/openzfs/module/zfs/dsl_scan.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sys/contrib/openzfs/include/sys/dsl_scan.h b/sys/contrib/openzfs/include/sys/dsl_scan.h index 2e3452e5ebaa..f32f59a2bedf 100644 --- a/sys/contrib/openzfs/include/sys/dsl_scan.h +++ b/sys/contrib/openzfs/include/sys/dsl_scan.h @@ -173,6 +173,7 @@ typedef struct dsl_scan { dsl_scan_phys_t scn_phys; /* on disk representation of scan */ dsl_scan_phys_t scn_phys_cached; avl_tree_t scn_queue; /* queue of datasets to scan */ + kmutex_t scn_queue_lock; /* serializes scn_queue inserts */ uint64_t scn_queues_pending; /* outstanding data to issue */ /* members needed for syncing error scrub status to disk */ dsl_errorscrub_phys_t errorscrub_phys; diff --git a/sys/contrib/openzfs/module/zfs/dsl_scan.c b/sys/contrib/openzfs/module/zfs/dsl_scan.c index 34012db82dee..c509f402c44a 100644 --- a/sys/contrib/openzfs/module/zfs/dsl_scan.c +++ b/sys/contrib/openzfs/module/zfs/dsl_scan.c @@ -491,6 +491,7 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg) avl_create(&scn->scn_queue, scan_ds_queue_compare, sizeof (scan_ds_t), offsetof(scan_ds_t, sds_node)); + mutex_init(&scn->scn_queue_lock, NULL, MUTEX_DEFAULT, NULL); avl_create(&scn->scn_prefetch_queue, scan_prefetch_queue_compare, sizeof (scan_prefetch_issue_ctx_t), offsetof(scan_prefetch_issue_ctx_t, spic_avl_node)); @@ -646,6 +647,7 @@ dsl_scan_fini(dsl_pool_t *dp) scan_ds_queue_clear(scn); avl_destroy(&scn->scn_queue); + mutex_destroy(&scn->scn_queue_lock); scan_ds_prefetch_queue_clear(scn); avl_destroy(&scn->scn_prefetch_queue); @@ -2727,8 +2729,10 @@ enqueue_clones_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) return (err); ds = prev; } + mutex_enter(&scn->scn_queue_lock); scan_ds_queue_insert(scn, ds->ds_object, dsl_dataset_phys(ds)->ds_prev_snap_txg); + mutex_exit(&scn->scn_queue_lock); dsl_dataset_rele(ds, FTAG); return (0); } @@ -2919,8 +2923,10 @@ enqueue_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) ds = prev; } + mutex_enter(&scn->scn_queue_lock); scan_ds_queue_insert(scn, ds->ds_object, dsl_dataset_phys(ds)->ds_prev_snap_txg); + mutex_exit(&scn->scn_queue_lock); dsl_dataset_rele(ds, FTAG); return (0); } From nobody Thu May 23 17:45:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlbDh37cpz5Ky4Z; Thu, 23 May 2024 17:45: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlbDh2bwsz4rpC; Thu, 23 May 2024 17:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716486340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zdcerXvjMvNzTp3aTHPHmknrAfZBH8kondIICJh2F9U=; b=CtaAGzuoq2UcEX4yCxZdu0l+gEE9r7hp/GKcR9FUHJYXImnPytsbXoeXLuJcKe7scCJ+FW BFyYJgHE3iAgqrF8EkZgMI3z6e+saTrmw4uHM7sdvIW/ArSiNGiCsg5Ogsrb/G4q44SL8h WdXrs/fDkaeeuUcBLBgi3aO9N/Saonpyf2EWKwlYh+LxkUpqjaJeUmM7KpgCog+v9UGosP ZMiDrNF+yBD7UITlqQup4m9JGAR7mdEaF9Q7IVnWXBvrkl/Nm/f3UUy7/QIZW6cDCCyMME ahmD4y9I02NKiLJlKgCqpUpZ9h3VTzc1WVb+cedXxmqJ494uWz4D32eM8vwfCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716486340; a=rsa-sha256; cv=none; b=LBc7F6ybLOVXBsqmCw2Tt2Us1lvyYADqPJVKX2O/btT7ByaJK8P5fh1PEh2uhsoMS9+Kty bvyafaaOShZXLGZH639kZ3/9NbeGs6ou4dA8nfYlrg7PgAzJ4iBSy85RL8JVlImQ735Vo4 FGK8R+gX0hNFK8z8yLFw+KIYpQfIWo4EWVA0ZBJk/Q7NoY7RNWcw/rH7S1ZX2RNKrzun1x 0CeZMnMPDT0Oqcc+dwPruhrHhhKSHdbHz8dpYuS3ca3c81g2ohMXLsdc30lIlYkiwuYx26 OSYQ/1vyU9Concq5cIp1TJYZygZQo/Wzo0xgegEXtPIm0Y3FZo6uusQ+K+aBjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716486340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zdcerXvjMvNzTp3aTHPHmknrAfZBH8kondIICJh2F9U=; b=T35l6wuLGrWIop0DXHXjmxGCTFMAvtsfbSNUF3cauZp+Ufjs3OYBTN2QX65nLgWD+5Va9P MOcdcBnBwu2Q0XGpJGdpTXWPVdl59v9OZG//DyetV2cbugSjloKh/PFWY1lG7QSYstD0v8 oZ3jqVOGn7qELW/pbNobggjAGUm6a7Ztf+CkMiCz4NCkn7/JIr7PrBYBYReJONYYYcK7H5 e5EkS9z/bpl/k118LdHrhGfLFqe5X3+eVAFIYecyK5rV4K2VvD8CQYD6qaZShTrEl6nhTo x9QlZlZKzPE35JYDtQVBCSoZgRxiinU78OEt/2ap65PV+rvl02ABBAdLCf+7xA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlbDh25FHzyrf; Thu, 23 May 2024 17:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44NHjeer082154; Thu, 23 May 2024 17:45:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44NHjej8082151; Thu, 23 May 2024 17:45:40 GMT (envelope-from git) Date: Thu, 23 May 2024 17:45:40 GMT Message-Id: <202405231745.44NHjej8082151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 9898f936aa69 - stable/13 - Fix scn_queue races on very old pools List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9898f936aa69d1b67bcd83d189acb6013f76bd43 Auto-Submitted: auto-generated The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=9898f936aa69d1b67bcd83d189acb6013f76bd43 commit 9898f936aa69d1b67bcd83d189acb6013f76bd43 Author: Alexander Motin AuthorDate: 2024-05-23 16:20:37 +0000 Commit: Alexander Motin CommitDate: 2024-05-23 17:43:02 +0000 Fix scn_queue races on very old pools Code for pools before version 11 uses dmu_objset_find_dp() to scan for children datasets/clones. It calls enqueue_clones_cb() and enqueue_cb() callbacks in parallel from multiple taskq threads. It ends up bad for scan_ds_queue_insert(), corrupting scn_queue AVL-tree. Fix it by introducing a mutex to protect those two scan_ds_queue_insert() calls. All other calls are done from the sync thread and so serialized. Reviewed-by: Brian Behlendorf Reviewed-by: Brian Atkinson Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #16162 PR: 278414 (cherry picked from commit 49086aa35d987b78dbc3c9ec94814fe338e07164) --- sys/contrib/openzfs/include/sys/dsl_scan.h | 1 + sys/contrib/openzfs/module/zfs/dsl_scan.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sys/contrib/openzfs/include/sys/dsl_scan.h b/sys/contrib/openzfs/include/sys/dsl_scan.h index d716510f879d..f2647a936c94 100644 --- a/sys/contrib/openzfs/include/sys/dsl_scan.h +++ b/sys/contrib/openzfs/include/sys/dsl_scan.h @@ -155,6 +155,7 @@ typedef struct dsl_scan { dsl_scan_phys_t scn_phys; /* on disk representation of scan */ dsl_scan_phys_t scn_phys_cached; avl_tree_t scn_queue; /* queue of datasets to scan */ + kmutex_t scn_queue_lock; /* serializes scn_queue inserts */ uint64_t scn_queues_pending; /* outstanding data to issue */ } dsl_scan_t; diff --git a/sys/contrib/openzfs/module/zfs/dsl_scan.c b/sys/contrib/openzfs/module/zfs/dsl_scan.c index f0a851ff53a9..6979f08cc9ff 100644 --- a/sys/contrib/openzfs/module/zfs/dsl_scan.c +++ b/sys/contrib/openzfs/module/zfs/dsl_scan.c @@ -469,6 +469,7 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg) avl_create(&scn->scn_queue, scan_ds_queue_compare, sizeof (scan_ds_t), offsetof(scan_ds_t, sds_node)); + mutex_init(&scn->scn_queue_lock, NULL, MUTEX_DEFAULT, NULL); avl_create(&scn->scn_prefetch_queue, scan_prefetch_queue_compare, sizeof (scan_prefetch_issue_ctx_t), offsetof(scan_prefetch_issue_ctx_t, spic_avl_node)); @@ -611,6 +612,7 @@ dsl_scan_fini(dsl_pool_t *dp) scan_ds_queue_clear(scn); avl_destroy(&scn->scn_queue); + mutex_destroy(&scn->scn_queue_lock); scan_ds_prefetch_queue_clear(scn); avl_destroy(&scn->scn_prefetch_queue); @@ -2402,8 +2404,10 @@ enqueue_clones_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) return (err); ds = prev; } + mutex_enter(&scn->scn_queue_lock); scan_ds_queue_insert(scn, ds->ds_object, dsl_dataset_phys(ds)->ds_prev_snap_txg); + mutex_exit(&scn->scn_queue_lock); dsl_dataset_rele(ds, FTAG); return (0); } @@ -2593,8 +2597,10 @@ enqueue_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) ds = prev; } + mutex_enter(&scn->scn_queue_lock); scan_ds_queue_insert(scn, ds->ds_object, dsl_dataset_phys(ds)->ds_prev_snap_txg); + mutex_exit(&scn->scn_queue_lock); dsl_dataset_rele(ds, FTAG); return (0); } From nobody Thu May 23 18:12:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VlbqK0wBrz5L173; Thu, 23 May 2024 18:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VlbqK07d0z4tfM; Thu, 23 May 2024 18:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716487933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qn5cuBY+WmkGM1sguhHLHkvuRUpmyw6zZPKUOauyujw=; b=EWEWEGAgiM9MeuIvGXxJEY/P/WVc+5m6D5hqzRogo4S4SXsv+T6NjbiZx6/9q9ZS6041fq vgECp8ehZrKLSMu4+PB86UiMbA8MbcoSltPqUbq9oaeiGFHo4na4iVbsk0o/+YkhnNbKLC GOWht2eHn5fnGxI+XUj/gQ5lTkDoqokzDahiYJUPUlfPUy1FFDxFH4pxdEzoUlrhlFCYfF gxQjWp8csSery6P3vDueaFi9JXGAE/cdcze+1yTYj1ScBmcLLPwayWVIcYSyyzx9oHQ9y3 74V+uvbd/DNlaCIhl4LgKW1zweVflz/t/5t+aJrxS2TL4ljjPGnHVl3Pdp5IYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716487933; a=rsa-sha256; cv=none; b=Y+dJhSrPVotk/67YAdbPQJkxbnCWVIjraSUoj6FzrgqwdtLrSz7isSpiiEUOZiDrZ/fG9B 9IvSnkItJdd5px+18zQLYRn/+0iAD4V/YLVy5bIZJw9SbmkZjxdfBue0d0BXPEu+U2VtX4 InTJ+Tp3trnNEruTHDkUAgFbNuxqEWPaaT8yQ9l3pH9riyHGxgruj/XiamzJGduOALoJyN +oczLCLrKcdI5By2yuQSodNfJ3vgswfyxheyHO15t9QkoTIUSODNNxdOofKyQtTJMe/jri 2Cl1MUczRc4nUSeOp8xVzlfk9gkd90j2FdeK24B3PvZ4Wk3+uVFfKALwjXmRoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716487933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qn5cuBY+WmkGM1sguhHLHkvuRUpmyw6zZPKUOauyujw=; b=s7a7ZajsimcZHWUCzDl/Ru1e2xsI2yjUjqA0NQKaG2aN0FVHKFIrPR0YEgFAmKfqg+fWXX KmzteAtchWEmArXWBNxAL1XCkCv1KjJbMj93P0GHWHgka2NlCnnZ2FoSbRrozJ/5ASzMzL KEuuN05CfkWfmwF5/F4OXewbyH2mde4B8NeoX4MZdGHhxoNLwAC6cvAiANF0oA2cfZ4otE R6MBCQ9aSp2EuFELlG4sYh1z1GucFBzdBenbXTWHsKu7k/UqJZTtMG1jGqpZF22NGwyJor s2bF2ET4qUF52AIrc8KeWO2cjNnKSsTDs33GdJxdkxurZzdCgv5ChvTEhOFgmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VlbqJ6rdnz10V6; Thu, 23 May 2024 18:12:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44NICCKV033051; Thu, 23 May 2024 18:12:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44NICCwQ033048; Thu, 23 May 2024 18:12:12 GMT (envelope-from git) Date: Thu, 23 May 2024 18:12:12 GMT Message-Id: <202405231812.44NICCwQ033048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 856d35337225 - releng/14.1 - Fix scn_queue races on very old pools List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 856d35337225d77948b43ee5d479baa2588963ec Auto-Submitted: auto-generated The branch releng/14.1 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=856d35337225d77948b43ee5d479baa2588963ec commit 856d35337225d77948b43ee5d479baa2588963ec Author: Alexander Motin AuthorDate: 2024-05-23 16:20:37 +0000 Commit: Alexander Motin CommitDate: 2024-05-23 18:11:36 +0000 Fix scn_queue races on very old pools Code for pools before version 11 uses dmu_objset_find_dp() to scan for children datasets/clones. It calls enqueue_clones_cb() and enqueue_cb() callbacks in parallel from multiple taskq threads. It ends up bad for scan_ds_queue_insert(), corrupting scn_queue AVL-tree. Fix it by introducing a mutex to protect those two scan_ds_queue_insert() calls. All other calls are done from the sync thread and so serialized. Reviewed-by: Brian Behlendorf Reviewed-by: Brian Atkinson Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #16162 PR: 278414 Approved by: re (cperciva) (cherry picked from commit 49086aa35d987b78dbc3c9ec94814fe338e07164) (cherry picked from commit 455ce1729353f2ffce9713ccc3574e73186a22f0) --- sys/contrib/openzfs/include/sys/dsl_scan.h | 1 + sys/contrib/openzfs/module/zfs/dsl_scan.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sys/contrib/openzfs/include/sys/dsl_scan.h b/sys/contrib/openzfs/include/sys/dsl_scan.h index 2e3452e5ebaa..f32f59a2bedf 100644 --- a/sys/contrib/openzfs/include/sys/dsl_scan.h +++ b/sys/contrib/openzfs/include/sys/dsl_scan.h @@ -173,6 +173,7 @@ typedef struct dsl_scan { dsl_scan_phys_t scn_phys; /* on disk representation of scan */ dsl_scan_phys_t scn_phys_cached; avl_tree_t scn_queue; /* queue of datasets to scan */ + kmutex_t scn_queue_lock; /* serializes scn_queue inserts */ uint64_t scn_queues_pending; /* outstanding data to issue */ /* members needed for syncing error scrub status to disk */ dsl_errorscrub_phys_t errorscrub_phys; diff --git a/sys/contrib/openzfs/module/zfs/dsl_scan.c b/sys/contrib/openzfs/module/zfs/dsl_scan.c index 34012db82dee..c509f402c44a 100644 --- a/sys/contrib/openzfs/module/zfs/dsl_scan.c +++ b/sys/contrib/openzfs/module/zfs/dsl_scan.c @@ -491,6 +491,7 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg) avl_create(&scn->scn_queue, scan_ds_queue_compare, sizeof (scan_ds_t), offsetof(scan_ds_t, sds_node)); + mutex_init(&scn->scn_queue_lock, NULL, MUTEX_DEFAULT, NULL); avl_create(&scn->scn_prefetch_queue, scan_prefetch_queue_compare, sizeof (scan_prefetch_issue_ctx_t), offsetof(scan_prefetch_issue_ctx_t, spic_avl_node)); @@ -646,6 +647,7 @@ dsl_scan_fini(dsl_pool_t *dp) scan_ds_queue_clear(scn); avl_destroy(&scn->scn_queue); + mutex_destroy(&scn->scn_queue_lock); scan_ds_prefetch_queue_clear(scn); avl_destroy(&scn->scn_prefetch_queue); @@ -2727,8 +2729,10 @@ enqueue_clones_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) return (err); ds = prev; } + mutex_enter(&scn->scn_queue_lock); scan_ds_queue_insert(scn, ds->ds_object, dsl_dataset_phys(ds)->ds_prev_snap_txg); + mutex_exit(&scn->scn_queue_lock); dsl_dataset_rele(ds, FTAG); return (0); } @@ -2919,8 +2923,10 @@ enqueue_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) ds = prev; } + mutex_enter(&scn->scn_queue_lock); scan_ds_queue_insert(scn, ds->ds_object, dsl_dataset_phys(ds)->ds_prev_snap_txg); + mutex_exit(&scn->scn_queue_lock); dsl_dataset_rele(ds, FTAG); return (0); } From nobody Fri May 24 00:07:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vllhz24gtz5Lcy8; Fri, 24 May 2024 00:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vllhz1YwDz4X8T; Fri, 24 May 2024 00:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ziV49G3zRfnfHmiCZIt6qo/WgLYeeLW2r5NYmx6mgA=; b=TOahm58Ejn4ZuJkvlWzPwdw7rhLREH0YIz/lhOySmr6bN06ELxA6W3ixcpO453/pUUQCdw +orudSMGiLRhYr4oOsUUkt7N6ZKx1vNAHciDhmcFpzvPMjs4MdTU/6idbd+vhyp/eNYVF+ 3nLLvY0AJ8Kbpx58C9I2pl/7Z1KBqNKwUqMWZBWYG2zArfAJO0fdkXxLDkuTGJ64qeyudU 5BL978Pe0WcuaElHwKgE0Bgbjl+86tdLCwDxP64IYFBvban9UIj0YuCtaQnIJeOvR3/K5g qC/EnV9Ms7F+a6MYU5NMki0bzzbGd+t1lFvX2EtnG+oN1oTeVhIRPtbVVNCi/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716509235; a=rsa-sha256; cv=none; b=mX9UzZqbl/QpZY8vtwxBDeoGuyvd7ZpLVZ4htCzz0E/fOOZh5lr0Rn/lbJ6Fchyn1zYlEI MAjDWo6huwY97O8bE8Tqw2JjE25TQvfun5knINsZqTJfOSWpdbJ70YRDHaeu5nYaWM4NN5 4KBDfryltzQu9DIwJGmiqTPdqCBsNylDMYzgA13XjQ6PBczU2kNvSkLKezDLK6qxYExYHB l18jR9l5TsK5LVbeZSlmRHY4hwIGarDYS4nBPccO4HHMmuVNxLhzd41cP6+w/pgwoQX9j0 DJQsIFXCVW0qndXnbq4Agd5zL5x4+4WyyMOVfugavFotZZAiTLGmgsLKlUruFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ziV49G3zRfnfHmiCZIt6qo/WgLYeeLW2r5NYmx6mgA=; b=KCS1qhDMbLwPQzspDGrAJkllTHmpPjs+a6i8tXl2lTbjmDvKDum+QPJMdiIVPkwKICFu9M VLm/Vs4qwDVmmYvatik6prRAtflLswHpZR0Dit8VfG/0vLdzK6ikxdt2W0GTl4AXTu6rOr 1nbyNi7ZcJ3so3aPIWkFdYYV0R6eIk7R6/gApKVEPjn2GmxbZGxFKTnsCF/IbnSqQaZYoM V2kTE65H39MQU4Pyy6QRHOHBvTM+PH/3bBJcoOlSrztAj2mBmFzJzpu8YgTatpDcAAuzuQ LYeVlqnL42F8jcl3y39vmoub3Xxs/HM5xeOYM51PvUzA+7sUEIOuRq9Er+3NwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vllhz18Lxz19c6; Fri, 24 May 2024 00:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44O07Fko027699; Fri, 24 May 2024 00:07:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44O07FuK027697; Fri, 24 May 2024 00:07:15 GMT (envelope-from git) Date: Fri, 24 May 2024 00:07:15 GMT Message-Id: <202405240007.44O07FuK027697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 9317a4a3a827 - stable/14 - pkg-stage.sh: add x11/sddm List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9317a4a3a82797f8128720ac46a36ece0a404349 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=9317a4a3a82797f8128720ac46a36ece0a404349 commit 9317a4a3a82797f8128720ac46a36ece0a404349 Author: Graham Perrin AuthorDate: 2024-02-02 23:35:42 +0000 Commit: Colin Percival CommitDate: 2024-05-24 00:06:44 +0000 pkg-stage.sh: add x11/sddm MFC After: 2 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/996 (cherry picked from commit 5ff76402daf17b9c36048bf11957dac7556272a6) --- release/scripts/pkg-stage.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index bdfa3643bacb..551876eca8c6 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -33,6 +33,7 @@ www/links x11-drivers/xf86-video-vmware x11/gnome x11/kde5 +x11/sddm x11/xorg" # If NOPORTS is set for the release, do not attempt to build pkg(8). From nobody Fri May 24 00:07:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vllj031hLz5LdBJ; Fri, 24 May 2024 00:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vllj02CP2z4XC2; Fri, 24 May 2024 00:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRV4OdVRfM3c0mAySEzzgv4jD137xZqyjob9GbekNAw=; b=SFDOcedUbFtFoC66mmAlfgg0ZxGdDmbnJMSuvp26E7H+pCTRcw1rLlMU3tKwddIEOMVoKU MC9ZGqtyvUUNeb672m+hWiLIlMvWxnaaO4kJ4dswXoWATLYgRMrNSyjHvvBr8L+Ut8mnK8 ad2k8k+/9dxKmXB4KIx4lTyqAmzrts5OA9Kuvf2UNKgxFJf3mBNSQ4cNuLfPG3W0Zg5wVE ZKndUnRKLhyVh6soxN5J0w0dm8Av1viNWj5/KYU4ffv5YSw114oAhtDZlWWERvSIU5h6W0 dk/d22UWZICYoNVuITjF/XZYGRw1mfqpvEkw/Z0hGfpDmAP6z5ie2/VbefO+PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716509236; a=rsa-sha256; cv=none; b=yoqbb/nhYSpiArL4CL1hbSokEWgBxCpEFhcI2MATNY08xkiH9PrvyDfw+lXst9hq087tSE APURRcsiuxotmSUnFQeGPeIIXVHsuq2yB6PuqfkwTaIenUdeovnGh1kOzq5KZCcm1GXpLB QGm+Wg0BcU0QTUO7HG3W2UxQ0xR17ayh3rroJBNXy46QWdnfFvcfw7leiDDq0XMaI8BxzP cMrjHMgf+Tnz7kT08VycDBOAksdjGkEJVB5f/vRn9CdirDHxfFzMyftwjX6gkv4DHStykN JxMS8MXAOq6SqrDoh5pYfPDAlDn23aMJ3yD9/ouM4laxfXweIFXu26GAi+8FBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRV4OdVRfM3c0mAySEzzgv4jD137xZqyjob9GbekNAw=; b=yKmR7RiRbh2d05zreCbWCSsHVwVsL9a2GApaS6tBn633GChwKDKisU8QJaH7ByoQk4rY1c eXfW82eM5WuYNVpjEI+SDylz39kMR9ej9h4xLW2dT0Xz9/RFtdrOv1c2lmVW9KGTuDkZ5p 6WuEWitTkSHxF6oMluZNXP548ipybwq+k6SOoc0yNZ540AfwRqnDrZTe2AhimsD+2u+xpq MzGpsXq5Vbf22c9kWbavJnWuD601FnOy97FCEva2zKqMPDJwOZNoZAVml5lJaOq2iT5cNo gO3FBPzfFuP94male9XbSsST4anKWwN1UDXubr88ExJwZ2+pt/vhBiSf7XZ7DA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vllj01q4Gz19M2; Fri, 24 May 2024 00:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44O07G34027750; Fri, 24 May 2024 00:07:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44O07G22027747; Fri, 24 May 2024 00:07:16 GMT (envelope-from git) Date: Fri, 24 May 2024 00:07:16 GMT Message-Id: <202405240007.44O07G22027747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 0543cdc36ac6 - stable/14 - Modernize DVD package set in preparation for 14.1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0543cdc36ac6c91dccc2f1c5ae1df42c6d4d2a1d Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0543cdc36ac6c91dccc2f1c5ae1df42c6d4d2a1d commit 0543cdc36ac6c91dccc2f1c5ae1df42c6d4d2a1d Author: Colin Percival AuthorDate: 2024-05-20 17:42:49 +0000 Commit: Colin Percival CommitDate: 2024-05-24 00:06:50 +0000 Modernize DVD package set in preparation for 14.1 Remove archivers/unzip (now in base) and emulators/linux_base-c7 (old and unlikely to be useful without other linux packages being installed), ports-mgmt/portmaster (now largely obsolete and discouraged in favour of using pkg and binary packages) and x11-drivers/xf86-video-vmware (questionably useful). Replace devel/git with devel/git@lite (sufficient for most purposes), and adjust the "ensure the ports exist to sanitize the list" code to ignore the @lite part when checking that /usr/ports/devel/git exists. Add sysutils/seatd and x11-wm/sway for wayland support. MFC after: 1 minute Differential Revision: https://reviews.freebsd.org/D45278 (cherry picked from commit d31ed58b9f9360cecd9acfbd12999190edca6e56) --- release/scripts/pkg-stage.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index 551876eca8c6..5742f84b0258 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -12,9 +12,7 @@ export ROOTDIR="$PWD/dvd" export PKGCMD="/usr/sbin/pkg -d --rootdir ${ROOTDIR}" export PORTSDIR="${PORTSDIR:-/usr/ports}" -_DVD_PACKAGES="archivers/unzip -devel/git -emulators/linux_base-c7 +_DVD_PACKAGES="devel/git@lite graphics/drm-kmod graphics/drm-510-kmod graphics/drm-515-kmod @@ -22,19 +20,19 @@ misc/freebsd-doc-all net/mpd5 net/rsync ports-mgmt/pkg -ports-mgmt/portmaster shells/bash shells/zsh security/sudo sysutils/screen +sysutils/seatd sysutils/tmux www/firefox www/links -x11-drivers/xf86-video-vmware x11/gnome x11/kde5 x11/sddm -x11/xorg" +x11/xorg +x11-wm/sway" # If NOPORTS is set for the release, do not attempt to build pkg(8). if [ ! -f ${PORTSDIR}/Makefile ]; then @@ -61,10 +59,10 @@ fi # Ensure the ports listed in _DVD_PACKAGES exist to sanitize the # final list. for _P in ${_DVD_PACKAGES}; do - if [ -d "${PORTSDIR}/${_P}" ]; then + if [ -d "${PORTSDIR}/${_P%%@*}" ]; then DVD_PACKAGES="${DVD_PACKAGES} ${_P}" else - echo "*** Skipping nonexistent port: ${_P}" + echo "*** Skipping nonexistent port: ${_P%%@*}" fi done From nobody Fri May 24 00:13:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vllqg6jMhz5LdvC; Fri, 24 May 2024 00:13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vllqg65cwz4YDd; Fri, 24 May 2024 00:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oSR+XPfcH0/XSZ1EAJ759RcmozodU8FeUje2tGpxcMg=; b=pISrbiQdIrNCg12eed0vrdURM15SsGWIJ4+4CKBe6w33N+LecX6SeSVkfiIuvTtPbbr0D2 QaZsrYZxJKcgYyIRYX2ZwtJ/QJzIckDi1pQpuKz/UYlXT08EePE7CSzj3xEFrbRPOh9sI3 wsW84R/XDWmfjpmfbryT19asYvtFhbfUerC3l8Kg4IcrsLSO8iVZWcPpCIeaGvvh1bQ66D wi+Rfk0joTwgdu1H2Nq4iLBSf88qzgx0dSdFK4OvA5DmArD91W8Y1na8vx4f+MtoDi0QBV RN1gdjTwxgxr46ilk/GHsES6fFwjh0tfOZVs7yiA60VNF7W7gwXvNHvDqSNneA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716509583; a=rsa-sha256; cv=none; b=GGqLJSdOKlWKy51WdEzj1LJ7TzFR/1R6v8qr77OS7R0XHI3x5TiqRWBLFzD4KnoFyFrPjF k+wlqLj0KmE9xsnjxbk2XjNLZEYBvEJzYxWNW8d4FvNtluSuHDLw9Df/D1CUfLWpk77OVa 2zKDxdQ1Q3Fx7yCsRARtvTZveWAssRSHIumDMsxJX2f88HWRvNvZGoplyyvsIuwKtqjXPR l3JWUqhhr28fyODJUbGcfjQSi3zNKJJciFGZekSTbJdruBNfRdzGsZuI+SmPT4Zu89MNfI K7aYeVVTc5nZJGo8eX4W3y9wZ7tEEMHFX82Qrg8Fc2JS+NeJlQ53jZXC6/h31g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oSR+XPfcH0/XSZ1EAJ759RcmozodU8FeUje2tGpxcMg=; b=MGio4t0AuFtyXL76qfxjWHwAfVtYYQkc0RTewvyR28V22BdDjABuJweVPbrA2tQqXgerJ7 3P7NU4iTiyv9OqQzAl/1+RolvF4Gn5e7Vmcx4kpixd1nlPsmWhgLACqIaUEiFb6ctRRLvc AmK+QJ0dx6C02/Ia0bXBKNA8mgkAq249sIYIR9OXvDSIudhsKDDdOCOxdVRDhtgon9h7gz M1QLIC5QmpnaJvhCTttU89cP73KygLykP5Bmu1DSPLxan6ENP0KANF6s4SyKuYv5Z5oph+ qyfqjfhEHUUJYMEV+UfWm65kUb6vA2m+1P3cepRUusYRpIO980sBMsOjj7gqWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vllqg5jMxz19NY; Fri, 24 May 2024 00:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44O0D3Yg043780; Fri, 24 May 2024 00:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44O0D39p043777; Fri, 24 May 2024 00:13:03 GMT (envelope-from git) Date: Fri, 24 May 2024 00:13:03 GMT Message-Id: <202405240013.44O0D39p043777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: cf1e3e15ddd0 - releng/14.1 - pkg-stage.sh: add x11/sddm List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: cf1e3e15ddd0a4aa7c18ed97dd504b66fa9c6a5d Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cf1e3e15ddd0a4aa7c18ed97dd504b66fa9c6a5d commit cf1e3e15ddd0a4aa7c18ed97dd504b66fa9c6a5d Author: Graham Perrin AuthorDate: 2024-02-02 23:35:42 +0000 Commit: Colin Percival CommitDate: 2024-05-24 00:08:22 +0000 pkg-stage.sh: add x11/sddm Approved by: re (cperciva) MFC After: 2 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/996 (cherry picked from commit 5ff76402daf17b9c36048bf11957dac7556272a6) (cherry picked from commit 9317a4a3a82797f8128720ac46a36ece0a404349) --- release/scripts/pkg-stage.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index bdfa3643bacb..551876eca8c6 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -33,6 +33,7 @@ www/links x11-drivers/xf86-video-vmware x11/gnome x11/kde5 +x11/sddm x11/xorg" # If NOPORTS is set for the release, do not attempt to build pkg(8). From nobody Fri May 24 00:13:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vllqj0hdFz5LdWs; Fri, 24 May 2024 00:13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vllqh73ykz4YXg; Fri, 24 May 2024 00:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6HQhFVAWha89bk8/HWdMmTcjKv6CO6WcyZu/VEwUKMs=; b=Jn8vqDcYaZq0KptqhmVowK7dYCei7FGnbfR9YKCMghc8ufOxge4LUPNAXrdxrRx6DQDPeK 1Gm2U7urrZAy9bIcC5ZzwxAVRVrIxIBKyqIdZss+qSQb2035eYp2vsetkysmCD9u45z0Ap FWAod2/OnhMvowL4vHtCOWSKP+PDWR9i/nXlxAfLiGbJOR9lVlCLROH1jt8kMQ768AORrX 9xJHGqiP+WXIxelsdda5ufTCC7tGK4A4ZpJOb43aWQZvSyKJX397AZptLGEITOl5e0fFB9 /Gyi6mLMil1nVSq2eNkxLA3lrEOrftAr5qZ/DRkrA7ctmgjj5dC9ORBax8vyWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716509585; a=rsa-sha256; cv=none; b=B7MY0JA4NqSc85WuzVOnb3uUaZ28vzs/6qCXbbuBFoNDE223B3+ki8NEp5uUIZ8WRHfg2i r60nUgqMV8O7KucFB3dUkIJB4/b0+LKIeex0SLpfpPs8DFd/7lhdYBZHqVYP5a5FLyXjBG LLqcEm6XKKym+wKi8IvGWeAAPeWZM5bzYy6odI612H+hdkW8hvr/nBlxfblot9S3n44qjF MVA+ktJpwyhj2U+SfzpP5tZDZwEmx3kFIoXmieFytQJJ47EBaRUkVd1l8xbx2bsuJphYB7 vLoxR9RBQwZeGpfOh7oWGml5MJf3DQIR73ChdykR0jhhBh7h6HqxwnNqo8nJUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6HQhFVAWha89bk8/HWdMmTcjKv6CO6WcyZu/VEwUKMs=; b=OyaYwgFfjLiHG8MNwY+2fhLbfJvULDO+VGXgufHXp+6J7Igd1C7qZrqlBwkORNeaM+AME8 m227wtpiB658Rx8+r1huD1hxRbhhvBAKjsXkZiQD5iM5AX1Tx2Oqq/m6PSXuGgbpgsqVPj Zh3RPe644+w/tfFpK9vsw3r0GNzwPnmhU2VgsG1NixKFGz6HDTsePIB/bok54blZ3Kxn5q zyEpK3uQ1D5jdv1hT9tWwUdM7mV3VgwOcNgX84CwVzpJiP/ICL76Vr4xUmVWppogxr1mBq +UC646b7sQXcO7IhepQEJYSX4jKPtPZWxF0dWiflMi/glCAoREEIX1BQoudTRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vllqh6hM6z19gJ; Fri, 24 May 2024 00:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44O0D4aC043831; Fri, 24 May 2024 00:13:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44O0D4gN043828; Fri, 24 May 2024 00:13:04 GMT (envelope-from git) Date: Fri, 24 May 2024 00:13:04 GMT Message-Id: <202405240013.44O0D4gN043828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 8f7da18ea248 - releng/14.1 - Modernize DVD package set in preparation for 14.1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 8f7da18ea2482e49bab7021ad759b4ca17366369 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=8f7da18ea2482e49bab7021ad759b4ca17366369 commit 8f7da18ea2482e49bab7021ad759b4ca17366369 Author: Colin Percival AuthorDate: 2024-05-20 17:42:49 +0000 Commit: Colin Percival CommitDate: 2024-05-24 00:08:37 +0000 Modernize DVD package set in preparation for 14.1 Remove archivers/unzip (now in base) and emulators/linux_base-c7 (old and unlikely to be useful without other linux packages being installed), ports-mgmt/portmaster (now largely obsolete and discouraged in favour of using pkg and binary packages) and x11-drivers/xf86-video-vmware (questionably useful). Replace devel/git with devel/git@lite (sufficient for most purposes), and adjust the "ensure the ports exist to sanitize the list" code to ignore the @lite part when checking that /usr/ports/devel/git exists. Add sysutils/seatd and x11-wm/sway for wayland support. Approved by: re (cperciva) MFC after: 1 minute Differential Revision: https://reviews.freebsd.org/D45278 (cherry picked from commit d31ed58b9f9360cecd9acfbd12999190edca6e56) (cherry picked from commit 0543cdc36ac6c91dccc2f1c5ae1df42c6d4d2a1d) --- release/scripts/pkg-stage.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index 551876eca8c6..5742f84b0258 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -12,9 +12,7 @@ export ROOTDIR="$PWD/dvd" export PKGCMD="/usr/sbin/pkg -d --rootdir ${ROOTDIR}" export PORTSDIR="${PORTSDIR:-/usr/ports}" -_DVD_PACKAGES="archivers/unzip -devel/git -emulators/linux_base-c7 +_DVD_PACKAGES="devel/git@lite graphics/drm-kmod graphics/drm-510-kmod graphics/drm-515-kmod @@ -22,19 +20,19 @@ misc/freebsd-doc-all net/mpd5 net/rsync ports-mgmt/pkg -ports-mgmt/portmaster shells/bash shells/zsh security/sudo sysutils/screen +sysutils/seatd sysutils/tmux www/firefox www/links -x11-drivers/xf86-video-vmware x11/gnome x11/kde5 x11/sddm -x11/xorg" +x11/xorg +x11-wm/sway" # If NOPORTS is set for the release, do not attempt to build pkg(8). if [ ! -f ${PORTSDIR}/Makefile ]; then @@ -61,10 +59,10 @@ fi # Ensure the ports listed in _DVD_PACKAGES exist to sanitize the # final list. for _P in ${_DVD_PACKAGES}; do - if [ -d "${PORTSDIR}/${_P}" ]; then + if [ -d "${PORTSDIR}/${_P%%@*}" ]; then DVD_PACKAGES="${DVD_PACKAGES} ${_P}" else - echo "*** Skipping nonexistent port: ${_P}" + echo "*** Skipping nonexistent port: ${_P%%@*}" fi done From nobody Fri May 24 00:13:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vllqk3NtTz5LdRL; Fri, 24 May 2024 00:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vllqk18Y2z4Y86; Fri, 24 May 2024 00:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sBkaI6KM6yYk/MaepipamoRuYkfQoMh/z9R0n+HPiOQ=; b=aFthAuBzn1X7Ai2iVL7YB8AwPmdiqhLaHvzSdtAwAVUxG6CHlAlbjGMn6aIPNEdT3vdYJ6 FJgHIzOUmvYfNS4LfJkJDucimdaCoKtcAK+KlRYxc8dOA66MN5KHyeAkN46hXo/oe7KNcb v6N+9mIfK6HC1+PCNxq22VxVuEZv8FR0Ex21+x+NzDdc0m+H6InGO5T2XtVcA1M8eFlMMK qczLAOCtkhtly4mmUQHLpvl8+UfI++oMBZq+yyOS3hn1hCkxNLe4i3WaNctv6qqtvKk9SU DdoK/ybkVRlLJisxRiCIV+x3DxZ75momqXFrhd79cLh6M19B+TNeTToYzpOf7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716509586; a=rsa-sha256; cv=none; b=mijkKu59Hgt2MXsO8T57AmrUj2XeEmBotXudxFiNARPkazdIeoJlFMdMVNvMh1blpoBMxI DbGVcRCgT1yrmPo0/iH5Tcn5HSkqKfTUKaWR3Q0lWfPT76TkJs5oLMe7Bcc3ycEiNhQQk1 voIg4dBUNNHuGmCwOu9+OnPXfnk9mRcxFI1wTUCD4pU3nLNISw/uxO5g9x0ElvvtKajkLZ F2XN8eUNUZNExK6Mb37oUpKKZ+bdotfKg5GZ1jfxWi8OtMWIcYeTphHTJ70dUw7CGs6HFS nfww+17rfstD4Rjc9eRzkdTLiJdUeox2mcHHy7yA8eaDN1citE0oNZhjvoCcmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716509586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sBkaI6KM6yYk/MaepipamoRuYkfQoMh/z9R0n+HPiOQ=; b=yxopq3F8j0Ye8mTiq1PiiYL6Q+OmphtBoZJZxtUlG25XaD1+2fv6HpHrNx20XhcSpR01Gr p9y+98Rca3aaazxRfTmVMdQGW8qbqh9/iPjnNvHWvUjCnbS8Kl/02hGtYEAz9fddT43WFR 9ont7I9AH8BIpwke/pZWPvuC0mkv/aOf3+TFwU4B4/8FzcA6YmNhhBWWpe4VwePrCvStzr BNryodRCVF+22fV3CiI8HXF7ORn/IBCz2I2UStBU2weNQMqlQM5+g1FuRxNTJ7yVp1Y20f 7RpVkx3uaOJ3Tgb1F+hXKe4uYxE5xG42DQQ0f88Y1aczdmXf9VZfDSo3MahVdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vllqk0kMMz19Zc; Fri, 24 May 2024 00:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44O0D6VA043874; Fri, 24 May 2024 00:13:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44O0D5Of043871; Fri, 24 May 2024 00:13:05 GMT (envelope-from git) Date: Fri, 24 May 2024 00:13:05 GMT Message-Id: <202405240013.44O0D5Of043871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 4de43de58f51 - releng/14.1 - 14.1: update to RC1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 4de43de58f519f5c7a68925ecadc77cdf37f9f30 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=4de43de58f519f5c7a68925ecadc77cdf37f9f30 commit 4de43de58f519f5c7a68925ecadc77cdf37f9f30 Author: Colin Percival AuthorDate: 2024-05-24 00:10:09 +0000 Commit: Colin Percival CommitDate: 2024-05-24 00:10:09 +0000 14.1: update to RC1 Now that we're at RC1, switch from "quarterly" packages to the release package set. Approved by: re (implicit) --- release/pkg_repos/release-dvd.conf | 2 +- sys/conf/newvers.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index 600c309d5979..d63faaa5fea7 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,5 +1,5 @@ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_1", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 76028e28d286..7ba6ed47b3b8 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.1" -BRANCH="BETA3" +BRANCH="RC1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri May 24 13:47:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vm5vJ1RHrz5L3wX; Fri, 24 May 2024 13:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vm5vH69N1z4gTW; Fri, 24 May 2024 13:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716558443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EKdmmZQ/10Bis0TCJzpWDNC/tCyrql12F5S4LnUF71Y=; b=jLU9EklS3wye1vH02X8yLfVkf2RPmRXZYdwtadntg2XPI9J18wYsDMIYo8yVMoCb5o7Xni 5nUpbFJT7uQO/M6NuwJZaJvjgg9QxYsusngYSYJgI1hsdkd1YcjKklcygnUyQCWCieOAIF HY/2RVum1JjeOGo4YxkyniC5HvziGXpnNsq4QtzRUQunezCYg8ssyYEmB5idXnmeB33TDW wlTvSniVEWmwDgfj7yCPu/DEz0VJzZhiPORMu37g5IkdwJNOG2Xn9p1s2bY5XHDLu9edaI XSAd2bgChgHXOKVZNDJlYzf4cOwcizw2284nbJzblniEcLKQEuOcOPfR90nwyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716558443; a=rsa-sha256; cv=none; b=tc9+fjWnM9nnldflYJZCkulyIKxOMvafUqZoGOS2RFWvXmHgIwh42TpqewDTq+a0iLDfC+ Gwe0/A4HMxYT2xdDsc/SEpVM8veB8f33+LSPeNAMaDCPlVrK0hXwbedcgxVu8+Ys1zJ+5N swClRhSCzipAhtrYU4ht7C+PRIh2fXwNZf1qpRuDPUeFWr0kzkl1oQDiT8pnqst7WCkDy0 xjHsmZj5g1u8CzfdjiQeoXzVVUAX6/7F8SrtJ52MoBIbrv04lv3qVMSOIGFON3GNdfB+Rh t1FGB5q2MIKJByty9ldKQyin7lnX/gQADoi8FdN5+AZDi0ibMV6FPKypYr624A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716558443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EKdmmZQ/10Bis0TCJzpWDNC/tCyrql12F5S4LnUF71Y=; b=C0noug3oqOY4eK/f5bBeRSU+IdRRxx+jlZaMZAbmPP/3mO9HO8JejkJuvCr2RHYOKGFgpC hLQBP2CVzuNpkloSvYCb9Xi399h4NPmLbudf/k1Rcqw7c5FPlEgY7uXXeosQHP1oG+54FM a+LTq+9YUVZni88F1HTEKCv1cTGCWJc2vF/RFzZxeMmCiogQ4uNrTX/VoKWuHgY/yu3iRg uSpVAybATNooOqAPlpE6gg0gGZlhWjO9Bn2TPnmLrumXSLm+KtkkMKurpKMosP5pOIo0a6 3SLPy4oSjlDNF7zdpAlrs2lno5LOeijerPGHsBJyaz/DZvCw9iZK7IjKsWV9vA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vm5vH5gbQzbsZ; Fri, 24 May 2024 13:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44ODlN53011743; Fri, 24 May 2024 13:47:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ODlNmU011740; Fri, 24 May 2024 13:47:23 GMT (envelope-from git) Date: Fri, 24 May 2024 13:47:23 GMT Message-Id: <202405241347.44ODlNmU011740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: c957e35ccbe9 - stable/14 - autofs manuals: align lists, tag SPDX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c957e35ccbe9cd8d1deb5903df21347bc4649da8 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c957e35ccbe9cd8d1deb5903df21347bc4649da8 commit c957e35ccbe9cd8d1deb5903df21347bc4649da8 Author: Alexander Ziaee AuthorDate: 2024-05-24 13:46:40 +0000 Commit: Warner Losh CommitDate: 2024-05-24 13:46:55 +0000 autofs manuals: align lists, tag SPDX MFC after: 3 days Fixes: 286c4906d60f (add -noauto), 3914ddf8a7b1 (import autofs) Pull Request: https://github.com/freebsd/freebsd-src/pull/1243 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1243 (cherry picked from commit 7839534a5a7b0d97131512888d6baa8ba5c20e56) --- usr.sbin/autofs/auto_master.5 | 5 ++++- usr.sbin/autofs/automount.8 | 5 ++++- usr.sbin/autofs/automountd.8 | 5 ++++- usr.sbin/autofs/autounmountd.8 | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/usr.sbin/autofs/auto_master.5 b/usr.sbin/autofs/auto_master.5 index 0d4753b18f95..2b79f7dd8647 100644 --- a/usr.sbin/autofs/auto_master.5 +++ b/usr.sbin/autofs/auto_master.5 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 The FreeBSD Foundation .\" .\" This software was developed by Edward Tomasz Napierala under sponsorship @@ -246,7 +249,7 @@ Special maps have names beginning with .Li - . Supported special maps are: .Pp -.Bl -tag -width "-hosts" -compact +.Bl -tag -width "-noauto" -compact .It Li -hosts Query the remote NFS server and map exported shares. This map is traditionally mounted on diff --git a/usr.sbin/autofs/automount.8 b/usr.sbin/autofs/automount.8 index 3dc423c3054f..f205665fe3e6 100644 --- a/usr.sbin/autofs/automount.8 +++ b/usr.sbin/autofs/automount.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 The FreeBSD Foundation .\" .\" This software was developed by Edward Tomasz Napierala under sponsorship @@ -49,7 +52,7 @@ or unmounts .Xr autofs 5 filesystems to match. These options are available: -.Bl -tag -width ".Fl v" +.Bl -tag -width "-D" .It Fl D Define a variable. It is only useful with diff --git a/usr.sbin/autofs/automountd.8 b/usr.sbin/autofs/automountd.8 index 4b2cf7d56336..032a106f433b 100644 --- a/usr.sbin/autofs/automountd.8 +++ b/usr.sbin/autofs/automountd.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 The FreeBSD Foundation .\" .\" This software was developed by Edward Tomasz Napierala under sponsorship @@ -54,7 +57,7 @@ forks a child process. The child process parses the appropriate map and mounts filesystems accordingly. Then it signals the kernel to release blocked processes that were waiting for the mount. -.Bl -tag -width ".Fl v" +.Bl -tag -width "-m maxproc" .It Fl D Define a variable. .It Fl i diff --git a/usr.sbin/autofs/autounmountd.8 b/usr.sbin/autofs/autounmountd.8 index 69b4565703e6..582e0d36b214 100644 --- a/usr.sbin/autofs/autounmountd.8 +++ b/usr.sbin/autofs/autounmountd.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 The FreeBSD Foundation .\" .\" This software was developed by Edward Tomasz Napierala under sponsorship @@ -52,7 +55,7 @@ After a specified time passes, attempts to unmount a filesystem, retrying after some time if necessary. .Pp These options are available: -.Bl -tag -width ".Fl v" +.Bl -tag -width "-d" .It Fl d Debug mode: increase verbosity and do not daemonize. .It Fl r From nobody Fri May 24 16:05:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vm8y54vfsz5LKgC; Fri, 24 May 2024 16:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vm8y546jJz41yn; Fri, 24 May 2024 16:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716566701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lcz39PcmFqbunav+06idOalJGwc1ITGRdlMLMI5cYhI=; b=cG8LkDhB5gblUAbqx1ReP6PUPBOsPkMdvPNV9OwQsIKtdT9xdoA5eXZiM5+5RwCuH/MLuH AUopPkBTO8NiSF/Gp9SK5m+oaDt3IzGm3angpI1dNLkeqN3XWnYY+15LfvliBDMzPHscYm FOc7egiqwVr7gCui5t3pZbSJcYkoZLyjdQVm1nX+XGfjy3szV7aG21szuwA+5p5KJ8itof f7Gy+/bX7K/Peam9MHoE64W/BgGICJvZkXzoABq5L2h3lXV9KPxIpTe/fTbsfOrc0RPIzQ fm8S8V/6cIkrwLSV1DunEH+RomoT72xjaFX6+VIz6CknN7qIqzMUC6ASQVKTag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716566701; a=rsa-sha256; cv=none; b=mGkOVw+B4vc0YtQdTf0/d1GbAxONrcfGE2oZq1js2+qyTFHMlpoCMD83yxLF8qnnQeU9tm vhvTy2GbHiyszeDfpfs1td6gvKCHFpKkB9EHG2L8YMb4tNmH3hSRmwKUPuIjyCVJx0s5sK /uqHr4UsiUw/iMxFwIUAiGnONzCIM66MM2WZvedK3Zv32xxl3OYjRQLgHh/69i3ySNMgjR HK4T5tuOfKFWGJgPEfoCX/2AqMg3ft7kwAZtggFN5DXipPoBKttjjTfzmNqFtpTzb2fpty Pd3V/seiJ2SgH1xjDmEl2uBITazWis5MM32E9lplGFqx49vz8yIntpGIoiv5YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716566701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lcz39PcmFqbunav+06idOalJGwc1ITGRdlMLMI5cYhI=; b=oRGegyelBfDhwZxAkFCASl9rsoPpr161LxZXcsXsy3+MijGRlKcNYxt2l1aQlbjKzzV0YD nD4IODVNXBnf1owuxwUW3xjXV7Bginl/ZcroblI6AR3frJvk5y2jT/AG7RG1QC/Md8mif2 PVrpFjl9AwrtTNcF81UIGSzJOOXiwTHYnzJLBGKakQTcxQlDEIyRfEVXnUxriTm4idmBTn oCnZW+gEUOcq+Q73pF+ltLn5BuWaduxceRz1u8AFH10nGVYEIWmgyAasIIPNCAcKOJMCTR hHongn/RtkSrsSij5GIPKVkHLdDW7PmwEnqisj9QUIv4080tvLkfzFBy2mtYIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vm8y53c8Fzfts; Fri, 24 May 2024 16:05:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44OG51b1056210; Fri, 24 May 2024 16:05:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44OG51PA056207; Fri, 24 May 2024 16:05:01 GMT (envelope-from git) Date: Fri, 24 May 2024 16:05:01 GMT Message-Id: <202405241605.44OG51PA056207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: c9188db6f956 - stable/14 - ifconfig: Redo fix vlan/vlanproto reconfiguration List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c9188db6f956b30344bc99a13baf57727d4ac97a Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c9188db6f956b30344bc99a13baf57727d4ac97a commit c9188db6f956b30344bc99a13baf57727d4ac97a Author: Zhenlei Huang AuthorDate: 2024-05-21 16:35:01 +0000 Commit: Zhenlei Huang CommitDate: 2024-05-24 16:03:02 +0000 ifconfig: Redo fix vlan/vlanproto reconfiguration When the if_vlan(4) interface has not been fully configured, i.e., a bare interface without a physical interface associated with it, retrieving the current settings of it and unconditionally overwriting `params` will result in losing vlandev settings in `params`. That will lead to failing to associate the if_vlan(4) interface with the requested physical interface and the false report 'both vlan and vlandev must be specified'. Fix that by checking if the vlan interface has been fully configured. The basic VLAN test is slightly modified to cover this case. PR: 279181 Reviewed by: kp Tested by: Mike Tancsa Fixes: b82b8055ad44 ifconfig: fix vlan/vlanproto reconfiguration MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45283 (cherry picked from commit 76df3c57a0abfd24652bfa33982ba136d9d0575b) --- sbin/ifconfig/ifvlan.c | 31 ++++++++++++++++++++++++++----- tests/sys/net/if_vlan.sh | 10 +++++++--- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/sbin/ifconfig/ifvlan.c b/sbin/ifconfig/ifvlan.c index a79ea35bc14b..0a2603f1736f 100644 --- a/sbin/ifconfig/ifvlan.c +++ b/sbin/ifconfig/ifvlan.c @@ -60,6 +60,7 @@ #include "ifconfig.h" #define NOTAG ((u_short) -1) +#define NOPROTO ((u_short) -1) static const char proto_8021Q[] = "802.1q"; static const char proto_8021ad[] = "802.1ad"; @@ -67,7 +68,7 @@ static const char proto_qinq[] = "qinq"; static struct vlanreq params = { .vlr_tag = NOTAG, - .vlr_proto = ETHERTYPE_VLAN, + .vlr_proto = NOPROTO, }; static void @@ -157,6 +158,8 @@ vlan_create(if_ctx *ctx, struct ifreq *ifr) errx(1, "must specify a tag for vlan create"); if (params.vlr_parent[0] == '\0') errx(1, "must specify a parent device for vlan create"); + if (params.vlr_proto == NOPROTO) + params.vlr_proto = ETHERTYPE_VLAN; ifr->ifr_data = (caddr_t) ¶ms; } ifcreate_ioctl(ctx, ifr); @@ -173,6 +176,8 @@ static void vlan_set(int s, struct ifreq *ifr) { if (params.vlr_tag != NOTAG && params.vlr_parent[0] != '\0') { + if (params.vlr_proto == NOPROTO) + params.vlr_proto = ETHERTYPE_VLAN; ifr->ifr_data = (caddr_t) ¶ms; if (ioctl(s, SIOCSETVLAN, (caddr_t)ifr) == -1) err(1, "SIOCSETVLAN"); @@ -196,8 +201,16 @@ setvlantag(if_ctx *ctx, const char *val, int dummy __unused) errx(1, "value for vlan out of range"); if (ioctl_ctx_ifr(ctx, SIOCGETVLAN, &ifr) != -1) { - vreq.vlr_tag = params.vlr_tag; - memcpy(¶ms, &vreq, sizeof(params)); + /* + * Retrieve the current settings if the interface has already + * been configured. + */ + if (vreq.vlr_parent[0] != '\0') { + if (params.vlr_parent[0] == '\0') + strlcpy(params.vlr_parent, vreq.vlr_parent, IFNAMSIZ); + if (params.vlr_proto == NOPROTO) + params.vlr_proto = vreq.vlr_proto; + } vlan_set(ctx->io_s, &ifr); } } @@ -230,8 +243,16 @@ setvlanproto(if_ctx *ctx, const char *val, int dummy __unused) errx(1, "invalid value for vlanproto"); if (ioctl_ctx_ifr(ctx, SIOCGETVLAN, &ifr) != -1) { - vreq.vlr_proto = params.vlr_proto; - memcpy(¶ms, &vreq, sizeof(params)); + /* + * Retrieve the current settings if the interface has already + * been configured. + */ + if (vreq.vlr_parent[0] != '\0') { + if (params.vlr_parent[0] == '\0') + strlcpy(params.vlr_parent, vreq.vlr_parent, IFNAMSIZ); + if (params.vlr_tag == NOTAG) + params.vlr_tag = vreq.vlr_tag; + } vlan_set(ctx->io_s, &ifr); } } diff --git a/tests/sys/net/if_vlan.sh b/tests/sys/net/if_vlan.sh index 675ed0090e8c..458e3cc36bc6 100755 --- a/tests/sys/net/if_vlan.sh +++ b/tests/sys/net/if_vlan.sh @@ -22,8 +22,12 @@ basic_body() jexec alcatraz ifconfig ${epair_vlan}a up jexec alcatraz ifconfig ${vlan0} 10.0.0.1/24 up - vlan1=$(jexec singsing ifconfig vlan create vlandev ${epair_vlan}b \ - vlan 42) + vlan1=$(jexec singsing ifconfig vlan create) + + # Test associating the physical interface + atf_check -s exit:0 \ + jexec singsing ifconfig ${vlan1} vlandev ${epair_vlan}b vlan 42 + jexec singsing ifconfig ${epair_vlan}b up jexec singsing ifconfig ${vlan1} 10.0.0.2/24 up @@ -37,7 +41,7 @@ basic_body() # And change back # Test changing the vlan ID atf_check -s exit:0 \ - jexec singsing ifconfig ${vlan1} vlandev ${epair_vlan}b vlan 42 + jexec singsing ifconfig ${vlan1} vlan 42 vlandev ${epair_vlan}b atf_check -s exit:0 -o ignore jexec singsing ping -c 1 10.0.0.1 } From nobody Fri May 24 23:59:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VmMTS28xgz5LZ0m; Fri, 24 May 2024 23:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VmMTR6vj2z4tCS; Fri, 24 May 2024 23:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716595164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0gilGHBDgXo62t+7ROHTbhTD+2pOG7VDkPrcqRrj8e0=; b=TwATDbNPz9s1sxujJpSUBm/MQAnt2qCSo3OA0QqtWYyUO3lQ2OeTHXEXOV/7Yqq3fIcAMX 11A/fdcUcAYkx9jIBYSvpYgKP9IFvreEFnMitQdIZ5gQee95tUt1aIt6EVbPugyzuqgP2H XP6gsu997vRU5C4SfCfQAGczw+DBafLqBEgbGwxahR5cdd3QPDHg9MS+71qVmYDGKWQHTL ChJtmWjtPShk9PUkR/y7A1CSMU8isfNICR8g13+LlaKNC8aLmKdFvOGGJJSp8AsnIYm02J HgXfgvpWQBvx0rYm9TJT1OJuyC1+KS70WFFS4G5Th/khCHl6hmk+fPBT3vB+MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716595164; a=rsa-sha256; cv=none; b=xpWqI6ngDYJsbbwEgD6XsxHNtam4UUAWJCsW7U1qAbxMK+7wwIKVd5/dR6PlLQxxTJou+1 2CQXia7dx495DPGfZoPxMPGs4dqhRryXgYJEzLSViRFf5iiv5vQTDiCeDxqSs1haPVxD67 3q2fqPJk7sFBZRMm5D+nPMXYMphK0HUa+8WL4xdBYV7u2l0GiJR3kaifaK2bPxONr5LVDs KB9vtTH7EoBdPDe02qo1llhAGOfcc9NlbzCSo0Sz5oRO/dkEPEkSAqkp54bOwrqo5hCvXS 07NK6DxbdlMdaLFq0FLJ5iMj2ZA5aKxM/KYBOu1eveLgva82yF4awMeRUEq3tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716595164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0gilGHBDgXo62t+7ROHTbhTD+2pOG7VDkPrcqRrj8e0=; b=ekz53rSQ87XFKe6KnOp/2ymOpxccb4DCVr68T6oFfom4JRbj2fyPOAPAN0Uy2GFRD6sgpH uLGjhfD+LduqIqU9ib3CjngjqsPv89udjRpIwO1aGF3x1cEEH8cWByPZjm3R6muRMbMJyp oVFcdj2EvR+tEoXYeXaCLE/3r5O7IGXDEybVeAflNcZ4jfmhK+tu4EhPQ6fQcEkqJD+oR9 G0Ra5MqAysQ8BfNfYu5G4X5HfnPWf4lGALpbrhkvKCgTg34mZ1MgOwexpvbi4F4m9R0wnA 14fIsL5YeytRO8gjSy/8gZ+q1jg6jad9nDiUzJEAI4DoAr3yp+jWhXx0t3f0tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VmMTR6P3Bztn9; Fri, 24 May 2024 23:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44ONxNTM050614; Fri, 24 May 2024 23:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44ONxNeY050611; Fri, 24 May 2024 23:59:23 GMT (envelope-from git) Date: Fri, 24 May 2024 23:59:23 GMT Message-Id: <202405242359.44ONxNeY050611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 1b7672ed9929 - stable/14 - diff: honour -B flag with -q List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1b7672ed992963e1c79ccc152f4afd72c91481f3 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1b7672ed992963e1c79ccc152f4afd72c91481f3 commit 1b7672ed992963e1c79ccc152f4afd72c91481f3 Author: Ed Maste AuthorDate: 2024-05-16 14:53:23 +0000 Commit: Ed Maste CommitDate: 2024-05-24 23:59:11 +0000 diff: honour -B flag with -q PR: 278988 Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45220 (cherry picked from commit fb623aab3927a6825ff7731198ec2e33426f7607) --- usr.bin/diff/diffreg.c | 3 ++- usr.bin/diff/tests/diff_test.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 8042003cd836..ffb3f90beede 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -383,7 +383,8 @@ diffreg(char *file1, char *file2, int flags, int capsicum) } if (diff_format == D_BRIEF && ignore_pats == NULL && - (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|D_STRIPCR)) == 0) + (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE| + D_SKIPBLANKLINES|D_STRIPCR)) == 0) { rval = D_DIFFER; status |= 1; diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 66596bae8a46..c29c0a93d5d8 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -11,6 +11,7 @@ atf_test_case brief_format atf_test_case b230049 atf_test_case stripcr_o atf_test_case b252515 +atf_test_case b278988 atf_test_case Bflag atf_test_case Nflag atf_test_case tabsize @@ -89,6 +90,14 @@ b252515_body() diff -qw b252515_a.in b252515_b.in } +b278988_body() +{ + printf 'a\nb\nn' > b278988.a.in + printf 'a\n\nb\nn' > b278988.b.in + atf_check -o empty -s eq:0 \ + diff -Bw b278988.a.in b278988.b.in +} + header_body() { export TZ=UTC @@ -365,6 +374,7 @@ atf_init_test_cases() atf_add_test_case b230049 atf_add_test_case stripcr_o atf_add_test_case b252515 + atf_add_test_case b278988 atf_add_test_case Bflag atf_add_test_case Nflag atf_add_test_case tabsize From nobody Sat May 25 19:31:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VmsTy4CzNz5LSxC; Sat, 25 May 2024 19:31: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VmsTy1KH5z4jf7; Sat, 25 May 2024 19:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SUqwIrxeG4TBdhFk3zDHk4ag5/2Lc/ZQ8RyqG8W/W/w=; b=FMXvrE7kgPyNvRWW3bJJ85JVUZJnYeFKrNlZnLVDOOM772/6WFeKVxnSHak8RpuokDtnCE tSYVPP+QYzlRKeFyUDyuni9QtOEq6+AbGJE32AKeS3iG5YSdqhNueyv4OUS6zcytWkqNgP FaSB+Z9okxJKM16hr+IfcsCpwdkIoBjBk+poDIlqSfu300AU0A9rC8MfrP987y0dozDj3+ tuXMh6X9xbZN7L1xPQBAoyr0W4l4yDmuytav0cnnQfYPFzfIOP+6oDvF3ba5MLI8hlJ3hh MkpNw+VdyiKSHb0cg4iXflv5gNVBbhy3MsaCNApeKq25V0iSVN0W7JgSRa6Jwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716665494; a=rsa-sha256; cv=none; b=Mh4bd6K1RcQzGcvpJx+VNOGt/9ytzfaH9XUDstx3bjkwcZgD8A53gPDO0H4LkNXf6xpMft sqOFvE9HBbZX8U9jxZu299jgH6nNyYvzevnw1jyM0af8DrSKwZ5VSYxiXR5ShF7kokHIyN lHYt4klnZb4qrhHTM1VKwCW3Azz/L2fdDAiYLhGEZ43S5/mN/6XYWG9IDmPBKWXsl4HvsQ X4IRuZC5oiLFJH9R4n7pfGXuPCxRgvnMxNb4COApsgXsJZalvJh4YZwosH7d+AuUFhPaR3 8Vdj5nMpQTe6rYW0+YhUOiwgNoezygDPHjVkBdHxQtKti78PAZst3n3KRkfioA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SUqwIrxeG4TBdhFk3zDHk4ag5/2Lc/ZQ8RyqG8W/W/w=; b=Vn9fyydUkcWKPJ4Wpb1Ga0ay3Vr/xtXVB7kigci0paukwCX9Bzp1mlk84/vPEBZvBQbwR5 eohsDjhLuUVOTZWw5R8qQTOME3vAfAuXzMqc6ZAEF1uVe/YZ1cw7RDAXFiyzSH08mREiW7 ihWqkHR+NZz1ZtKYLeWNEx0KDA4ivycKC1uQEjsZkPzP7LsXm5rT310+kZ0w1+TU0VX71d ViAV7L/ZdN960MTYIQevg7uIhv2luUjQQpq/w1yaocAM7nUE0fwUaMZDGjtbGWKF23h4Ri W+/NMhrOZPjCMDdRo2j0yoeTVJgpjVm1fGewvb/tRYT0U0mNx7HvxAacXGoBUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VmsTy0xMWzTLT; Sat, 25 May 2024 19:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44PJVYRW043336; Sat, 25 May 2024 19:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44PJVYr9043333; Sat, 25 May 2024 19:31:34 GMT (envelope-from git) Date: Sat, 25 May 2024 19:31:34 GMT Message-Id: <202405251931.44PJVYr9043333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: e8a80b4e50e8 - stable/14 - sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e8a80b4e50e8d992fe46a95509b37fc457288f93 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e8a80b4e50e8d992fe46a95509b37fc457288f93 commit e8a80b4e50e8d992fe46a95509b37fc457288f93 Author: Christos Margiolis AuthorDate: 2024-05-23 00:57:04 +0000 Commit: Christos Margiolis CommitDate: 2024-05-25 19:30:26 +0000 sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO FreeBSD's implementation of SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO does not exactly work as intended. The problem is essentially that both IOCTLs return the same information, while in fact the information returned currently by dsp_oss_audioinfo() is what _only_ SNDCTL_ENGINEINFO is meant to return. This behavior is also noted in the OSS manual [1] (see bold paragraph in "Audio engines and device files" section), but since e8c0d15a64fa ("sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)") we can actually fix this, because we now expose only a single device for each soundcard, and create the engines (channels) internally. SNDCTL_ENGINEINFO will now report info about all channels in a given device, and SNDCTL_AUDIOINFO[_EX] will only report information about /dev/dspX. To make this work, we also have to modify the SNDCTL_SYSINFO IOCTL to report the number of audio devices and audio engines correctly. While here, modernize the minimum and maximum channel counting in both SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO. Currently these IOCTLs will report only up to 2 channels, which is no longer the case. [1] http://manuals.opensound.com/developer/SNDCTL_AUDIOINFO.html PR: 246231, 252761 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45164 (cherry picked from commit e07f9178502b7cbc0769fc10e99ad0d013f437fd) --- sys/dev/sound/pcm/dsp.c | 179 +++++++++++++++++++++++++++++++++++++++++----- sys/dev/sound/pcm/dsp.h | 3 +- sys/dev/sound/pcm/mixer.c | 8 ++- sys/dev/sound/pcm/sound.c | 8 +-- 4 files changed, 173 insertions(+), 25 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 6e5fad048d40..4ee5d7c6738c 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -778,9 +778,15 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, ret = sound_oss_card_info((oss_card_info *)arg); break; case SNDCTL_AUDIOINFO: + ret = dsp_oss_audioinfo(i_dev, (oss_audioinfo *)arg, + false); + break; case SNDCTL_AUDIOINFO_EX: + ret = dsp_oss_audioinfo(i_dev, (oss_audioinfo *)arg, + true); + break; case SNDCTL_ENGINEINFO: - ret = dsp_oss_audioinfo(i_dev, (oss_audioinfo *)arg); + ret = dsp_oss_engineinfo(i_dev, (oss_audioinfo *)arg); break; case SNDCTL_MIXERINFO: ret = mixer_oss_mixerinfo(i_dev, (oss_mixerinfo *)arg); @@ -2034,8 +2040,152 @@ dsp_unit2name(char *buf, size_t len, struct pcm_channel *ch) return (NULL); } +/** + * @brief Handler for SNDCTL_AUDIOINFO. + * + * Gathers information about the audio device specified in ai->dev. If + * ai->dev == -1, then this function gathers information about the current + * device. If the call comes in on a non-audio device and ai->dev == -1, + * return EINVAL. + * + * This routine is supposed to go practically straight to the hardware, + * getting capabilities directly from the sound card driver, side-stepping + * the intermediate channel interface. + * + * @note + * Calling threads must not hold any snddev_info or pcm_channel locks. + * + * @param dev device on which the ioctl was issued + * @param ai ioctl request data container + * @param ex flag to distinguish between SNDCTL_AUDIOINFO from + * SNDCTL_AUDIOINFO_EX + * + * @retval 0 success + * @retval EINVAL ai->dev specifies an invalid device + */ +int +dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) +{ + struct pcmchan_caps *caps; + struct pcm_channel *ch; + struct snddev_info *d; + uint32_t fmts; + int i, minch, maxch, unit; + + /* + * If probing the device that received the ioctl, make sure it's a + * DSP device. (Users may use this ioctl with /dev/mixer and + * /dev/midi.) + */ + if (ai->dev == -1 && i_dev->si_devsw != &dsp_cdevsw) + return (EINVAL); + + for (unit = 0; pcm_devclass != NULL && + unit < devclass_get_maxunit(pcm_devclass); unit++) { + d = devclass_get_softc(pcm_devclass, unit); + if (!PCM_REGISTERED(d)) { + d = NULL; + continue; + } + + PCM_UNLOCKASSERT(d); + PCM_LOCK(d); + if ((ai->dev == -1 && d->dsp_dev == i_dev) || + (ai->dev == unit)) { + PCM_UNLOCK(d); + break; + } else { + PCM_UNLOCK(d); + d = NULL; + } + } + + /* Exhausted the search -- nothing is locked, so return. */ + if (d == NULL) + return (EINVAL); + + /* XXX Need Giant magic entry ??? */ + + PCM_UNLOCKASSERT(d); + PCM_LOCK(d); + + bzero((void *)ai, sizeof(oss_audioinfo)); + ai->dev = unit; + strlcpy(ai->name, device_get_desc(d->dev), sizeof(ai->name)); + ai->pid = -1; + ai->card_number = -1; + ai->port_number = -1; + ai->mixer_dev = (d->mixer_dev != NULL) ? unit : -1; + ai->legacy_device = unit; + snprintf(ai->devnode, sizeof(ai->devnode), "/dev/dsp%d", unit); + ai->enabled = device_is_attached(d->dev) ? 1 : 0; + ai->next_play_engine = 0; + ai->next_rec_engine = 0; + ai->busy = 0; + ai->caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER; + ai->iformats = 0; + ai->oformats = 0; + ai->min_rate = INT_MAX; + ai->max_rate = 0; + ai->min_channels = INT_MAX; + ai->max_channels = 0; + + /* Gather global information about the device. */ + CHN_FOREACH(ch, d, channels.pcm) { + CHN_UNLOCKASSERT(ch); + CHN_LOCK(ch); + + /* + * Skip physical channels if we are servicing SNDCTL_AUDIOINFO, + * or VCHANs if we are servicing SNDCTL_AUDIOINFO_EX. + */ + if ((ex && (ch->flags & CHN_F_VIRTUAL) != 0) || + (!ex && (ch->flags & CHN_F_VIRTUAL) == 0)) { + CHN_UNLOCK(ch); + continue; + } + + if ((ch->flags & CHN_F_BUSY) == 0) { + ai->busy |= (ch->direction == PCMDIR_PLAY) ? + OPEN_WRITE : OPEN_READ; + } + + ai->caps |= + ((ch->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) | + ((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : + PCM_CAP_INPUT); + + caps = chn_getcaps(ch); + + minch = INT_MAX; + maxch = 0; + fmts = 0; + for (i = 0; caps->fmtlist[i]; i++) { + fmts |= AFMT_ENCODING(caps->fmtlist[i]); + minch = min(AFMT_CHANNEL(caps->fmtlist[i]), minch); + maxch = max(AFMT_CHANNEL(caps->fmtlist[i]), maxch); + } + + if (ch->direction == PCMDIR_PLAY) + ai->oformats |= fmts; + else + ai->iformats |= fmts; + + ai->min_rate = min(ai->min_rate, caps->minspeed); + ai->max_rate = max(ai->max_rate, caps->maxspeed); + ai->min_channels = min(ai->min_channels, minch); + ai->max_channels = max(ai->max_channels, maxch); + + CHN_UNLOCK(ch); + } + + PCM_UNLOCK(d); + + return (0); +} + static int -dsp_oss_audioinfo_cb(void *data, void *arg) +dsp_oss_engineinfo_cb(void *data, void *arg) { struct dsp_cdevpriv *priv = data; struct pcm_channel *ch = arg; @@ -2047,10 +2197,10 @@ dsp_oss_audioinfo_cb(void *data, void *arg) } /** - * @brief Handler for SNDCTL_AUDIOINFO. + * @brief Handler for SNDCTL_ENGINEINFO * - * Gathers information about the audio device specified in ai->dev. If - * ai->dev == -1, then this function gathers information about the current + * Gathers information about the audio device's engine specified in ai->dev. + * If ai->dev == -1, then this function gathers information about the current * device. If the call comes in on a non-audio device and ai->dev == -1, * return EINVAL. * @@ -2066,11 +2216,9 @@ dsp_oss_audioinfo_cb(void *data, void *arg) * * @retval 0 success * @retval EINVAL ai->dev specifies an invalid device - * - * @todo Verify correctness of Doxygen tags. ;) */ int -dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) +dsp_oss_engineinfo(struct cdev *i_dev, oss_audioinfo *ai) { struct pcmchan_caps *caps; struct pcm_channel *ch; @@ -2113,7 +2261,7 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) CHN_LOCK(ch); if (ai->dev == -1) { if (devfs_foreach_cdevpriv(i_dev, - dsp_oss_audioinfo_cb, ch) != 0) { + dsp_oss_engineinfo_cb, ch) != 0) { devname = dsp_unit2name(buf, sizeof(buf), ch); } @@ -2182,18 +2330,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) * if any channel is mono, minch = 1; * and if all channels are mono, maxch = 1. */ - minch = 0; + minch = INT_MAX; maxch = 0; fmts = 0; for (i = 0; caps->fmtlist[i]; i++) { - fmts |= caps->fmtlist[i]; - if (AFMT_CHANNEL(caps->fmtlist[i]) > 1) { - minch = (minch == 0) ? 2 : minch; - maxch = 2; - } else { - minch = 1; - maxch = (maxch == 0) ? 1 : maxch; - } + fmts |= AFMT_ENCODING(caps->fmtlist[i]); + minch = min(AFMT_CHANNEL(caps->fmtlist[i]), minch); + maxch = max(AFMT_CHANNEL(caps->fmtlist[i]), maxch); } if (ch->direction == PCMDIR_PLAY) diff --git a/sys/dev/sound/pcm/dsp.h b/sys/dev/sound/pcm/dsp.h index b81e60dc19b5..7559e855d4e1 100644 --- a/sys/dev/sound/pcm/dsp.h +++ b/sys/dev/sound/pcm/dsp.h @@ -36,6 +36,7 @@ extern struct cdevsw dsp_cdevsw; int dsp_make_dev(device_t); void dsp_destroy_dev(device_t); char *dsp_unit2name(char *, size_t, struct pcm_channel *); -int dsp_oss_audioinfo(struct cdev *, oss_audioinfo *); +int dsp_oss_audioinfo(struct cdev *, oss_audioinfo *, bool); +int dsp_oss_engineinfo(struct cdev *, oss_audioinfo *); #endif /* !_PCMDSP_H_ */ diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 9811496853c8..130333c7c442 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -1282,9 +1282,13 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, case SNDCTL_CARDINFO: return (sound_oss_card_info((oss_card_info *)arg)); case SNDCTL_AUDIOINFO: + return (dsp_oss_audioinfo(i_dev, (oss_audioinfo *)arg, + false)); case SNDCTL_AUDIOINFO_EX: - case SNDCTL_ENGINEINFO: - return (dsp_oss_audioinfo(i_dev, (oss_audioinfo *)arg)); + return (dsp_oss_audioinfo(i_dev, (oss_audioinfo *)arg, + true)); + case SNDCTL_ENGINEINFO: + return (dsp_oss_engineinfo(i_dev, (oss_audioinfo *)arg)); case SNDCTL_MIXERINFO: return (mixer_oss_mixerinfo(i_dev, (oss_mixerinfo *)arg)); } diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index e66462af2a71..072d42c4e989 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -718,9 +718,9 @@ sound_oss_sysinfo(oss_sysinfo *si) /* * Iterate over PCM devices and their channels, gathering up data - * for the numaudios and openedaudio fields. + * for the numaudioengines and openedaudio fields. */ - si->numaudios = 0; + si->numaudioengines = 0; bzero((void *)&si->openedaudio, sizeof(si->openedaudio)); j = 0; @@ -737,7 +737,7 @@ sound_oss_sysinfo(oss_sysinfo *si) PCM_UNLOCKASSERT(d); PCM_LOCK(d); - si->numaudios += PCM_CHANCOUNT(d); + si->numaudioengines += PCM_CHANCOUNT(d); CHN_FOREACH(c, d, channels.pcm) { CHN_UNLOCKASSERT(c); @@ -751,7 +751,6 @@ sound_oss_sysinfo(oss_sysinfo *si) PCM_UNLOCK(d); } - si->numaudioengines = si->numaudios; si->numsynths = 0; /* OSSv4 docs: this field is obsolete */ /** @@ -769,6 +768,7 @@ sound_oss_sysinfo(oss_sysinfo *si) si->numtimers = 0; si->nummixers = mixer_count; si->numcards = devclass_get_maxunit(pcm_devclass); + si->numaudios = devclass_get_maxunit(pcm_devclass); /* OSSv4 docs: Intended only for test apps; API doesn't really have much of a concept of cards. Shouldn't be used by applications. */ From nobody Sat May 25 19:31:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VmsV10nD9z5LSxr; Sat, 25 May 2024 19:31:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VmsV03dsvz4jhK; Sat, 25 May 2024 19:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=foiaQ1gM5atx6NWyZ3Fv+dHJgEYVSndpWP/eM9go+Mk=; b=ULbJohLnlTqUiZ969nb4wg0qCTJsx1/qjwVCRLk2SO9yqaf6Ct5OasGJ9ulIq4iW5l0lxN ey/aDfxwiZ67b8ZmGY3a3UF8PzaIdS+jLngDI7yMndEnGsesfLWchYq5lTHjyZXzxcpySA +ldSxxJ554CcMlIHuKWBLGVRP5YffsPIz7gfQ9l077gVBla7VV0RkPkxpTVWUQlMAEUWsK EM0URr62qHUrQ+CeV3k5gArxHKAbY1OOMEXMy11Yuyn8S9k9jr2+AVtTBXHwKhTgtDz6Ry Q5NQ5YvlkLQCEN5GZ4TTM2LldIUUrlKQo+1VPyOM5bRBHI2RYo3M2ejZFUphqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716665496; a=rsa-sha256; cv=none; b=QRUvNXWprPioKGVQE9uuqoz0dJL4uFyCfaCvKPsPFObGfeaFUVPlyO892yiyTd45O6UyFT RP8KDwaxXx1wrirg+tJ9IPD5S9rOf+dV+TQNZ92Jek/PNWlLSnMVgQL8VC09Q7WAiKFews mPW0M/8ol+EzNXFb8og7Y0HWCerCKyx5Iqkj71hoS0aICTCYIpt+ZBzWI6eTsaDrxcPdQg JwIBO6lsy09MBysjmji9sbPkMOPTthmysA+IU7r5JoVFA+ylhtt9+EYnxnPeUFcBLyF2U7 f/2XlFvfrWolv8zZ89OFxPfdkoBIT+mYYba/KAfj0bLoEz5kyj0sfETu5pXbCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=foiaQ1gM5atx6NWyZ3Fv+dHJgEYVSndpWP/eM9go+Mk=; b=sMV3ItnSZcPjCvNndMrEqbi45pr10Cf6SgfvE3VtMJEW2V2FOoA48/tC1H/0wbTP/pZCPP 0OamXlCN4DAOBH87oR/ZR1M495s1EqSIqFJIIpjRsl3CQka4P1fQJ3RsPYZNT1+XcWWstu tEAycblAu4EmVp3Sp1QxhqkTzsBXYJM6HrtkWjVWsro8W+SThGWNTGFgXdMlVUMyP+9sGQ NbeZArXzuWi4vbVZaReEocBnDXBIMm/UCQVWukcd1h1xw56LS8bpUWrdMglXPXi3guJa7n Z/KbW0wewlsosHvmsxktyaeTWavSCc6FDpsbaswJUXf2u5lL7O1h9KSWrrrB7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VmsV031XQzV9q; Sat, 25 May 2024 19:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44PJVafW043441; Sat, 25 May 2024 19:31:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44PJVam5043438; Sat, 25 May 2024 19:31:36 GMT (envelope-from git) Date: Sat, 25 May 2024 19:31:36 GMT Message-Id: <202405251931.44PJVam5043438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: cd254b9243d3 - stable/14 - mixer(8): Ignore mixer_open() failures for the -a option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cd254b9243d3d0f4d86b388f919dc744086fb002 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cd254b9243d3d0f4d86b388f919dc744086fb002 commit cd254b9243d3d0f4d86b388f919dc744086fb002 Author: Christos Margiolis AuthorDate: 2024-05-23 00:57:25 +0000 Commit: Christos Margiolis CommitDate: 2024-05-25 19:30:49 +0000 mixer(8): Ignore mixer_open() failures for the -a option The most likely reason mixer_open() will fail is because either the device doesn't exist, or because it is disabled, so there is not reason to kill the application. Instead, continue and print the rest of the enabled mixers. PR: 277615 Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45151 (cherry picked from commit 0e80798518be673bdad7245b627cb5bd7ec08888) --- usr.sbin/mixer/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 47d8e6359b73..284ea955b7b4 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -99,7 +99,7 @@ main(int argc, char *argv[]) for (i = 0; i < n; i++) { (void)snprintf(buf, sizeof(buf), "/dev/mixer%d", i); if ((m = mixer_open(buf)) == NULL) - errx(1, "%s: no such mixer", buf); + continue; initctls(m); if (sflag) printrecsrc(m, oflag); From nobody Sat May 25 19:31:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VmsV30dZqz5LT3d; Sat, 25 May 2024 19:31: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VmsV265tzz4jhh; Sat, 25 May 2024 19:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iQ3eRUKVcg6+ouUWR91iPUwpmqFzSZrCdhpv1IQS3EE=; b=rLjjGAq0fDaJK02yxMCuWqRal1HfLSYt3NtO277qi/Ff8suECpyEcUWepMLsVmnTnNHSkU 5Vt0jgl9//4aYU+zPgDZmPjrQP/dIVhbJkXARaAxmjG09hQ9cVBgJN8BBk2S+IwbS2g7rg 7KrVPEcssoefDAv09diURSr3od60wKDDEk/Lj/4VchJjvYMwaIlV5Q7e+FdMkYPNd/v5Zl OG5IIxUZrSmssfy3SknAEJp7GHgq5ZvrPytckVFT1YA8rnjZ2lQr3H79droBFjSwfRXyIi 9fFsH60sDdJokzzZviPLB5cdTL4zTrd/suz/BqAWIAJCt/DY3jiEaSK6yZoICw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716665498; a=rsa-sha256; cv=none; b=V8IxLM/0wkxeIZ3CVdjjyTPgmWL3e8roEOppDRBEP9/1jscDKTxiIgn+VPtYxjKYsp6QX+ EkaQgF6dfh2ZZWcvwTm93hMRTsJcdpT815GF6rP7zpDZtEwSDSqGBnUqqNk/TBTrWsqjTY /8RVz6DPfHjwns2YZ7Ya60XXN49tlfhSpXbteh2KsQz3+nj3mZZzaaw2wnLrnIswWRVqm/ OHONHdZ16bb/qvYeTzeEf9gLnDct5F/tl8xCFT3I26nYSfCw0JCz2m+W9vlj3NREjFwrkh 9X3OluPmWa16xukjwOglaVLVrVwIGpezISpJ/5dCfBO79s9tUObOHHw13N9yCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iQ3eRUKVcg6+ouUWR91iPUwpmqFzSZrCdhpv1IQS3EE=; b=qUgzkoitrMoz8sBjZ7OU17XL98S7d+mmi86wLAxPHFQJ62+TM+XMap5trqS6zJxYnSpM39 jwSy113e98zPuUdxD1AwIMyViKt4qzTUnKq9ZtwhvS3SXcS5r8zoc/f32zwHde3ZEZ/55d rXNCRP0JuB+Fxo7XMF91w3wLP8cyLyKEVBrcVhgfIjQAQMga1Ii/krRgIpNnwDYDi1ItLr IwPkZYs5op5sHbB57h12FquqTtqXbC2TVVsJ/eUSOpJ+QBKVVCeLQIHbt42JMqlXrzB67x okepgzonrtuguW0Kb5qAdowejHdfrIU68SbKIK67wJGFxfjBS6C+aUFFqZMD4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VmsV24grKzVdw; Sat, 25 May 2024 19:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44PJVcfN043527; Sat, 25 May 2024 19:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44PJVcJu043524; Sat, 25 May 2024 19:31:38 GMT (envelope-from git) Date: Sat, 25 May 2024 19:31:38 GMT Message-Id: <202405251931.44PJVcJu043524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: e279b7aa5d31 - stable/14 - mixer(8): Use mixer_get_path() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e279b7aa5d31722d3edc83a47b0814168e5bce69 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e279b7aa5d31722d3edc83a47b0814168e5bce69 commit e279b7aa5d31722d3edc83a47b0814168e5bce69 Author: Christos Margiolis AuthorDate: 2024-05-23 00:57:43 +0000 Commit: Christos Margiolis CommitDate: 2024-05-25 19:31:12 +0000 mixer(8): Use mixer_get_path() Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45276 (cherry picked from commit e3b94b375e1d2098e9e2c07bd0079e92f6a6fe4f) --- usr.sbin/mixer/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 284ea955b7b4..07dd16536495 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -97,7 +97,7 @@ main(int argc, char *argv[]) if ((n = mixer_get_nmixers()) < 0) errx(1, "no mixers present in the system"); for (i = 0; i < n; i++) { - (void)snprintf(buf, sizeof(buf), "/dev/mixer%d", i); + (void)mixer_get_path(buf, sizeof(buf), i); if ((m = mixer_open(buf)) == NULL) continue; initctls(m); From nobody Sat May 25 19:31:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VmsV25Y8Bz5LT66; Sat, 25 May 2024 19:31: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VmsV22Ll9z4jbq; Sat, 25 May 2024 19:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B7TLZkPLd08r2ZJz6A1pXZqh63MHh0MzteiAPweii+k=; b=H6x6vRqGsk1UBg/MzA3wQWSOIWOWoLKOan3xSrVHqW7WcUqFC4zwUs0tSw1QCYxehvDKA+ i3TnyDOE/G3a1peN+C5XlJP/wFP6eCfNyzKqrXKT2j3PwKkBMVvXy349FCB8rO8gPJZ9Xg oTzIv6/1QrWrJ4qufAzuwMWmRa77WE97dx6aHFPs3bdFNyIjlTXOdJ9r9rCndvUksaFM9l l8p+H6/ixxHiBUX3l7s92iKVEGKy/L4JFPR0FxfPlwy21tHzsGwhwyNtJOdMU2hPHGJVOM USP8smGBB88NbbEujPRAbAG4SV4QbW83xtQ33y6plqHZLDGwsBA4swcOJyds5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716665498; a=rsa-sha256; cv=none; b=r0ibBiBmvIcds9MoXHq7qxmfG+NVBfJhNhuc46OeRlmQ7Sio85ifYrNIJb9gz9WTrhTMDN 4MGmL0abQyAlUOppN3Xs0r5lqv4MtnN8i9SGN/opMMWfHYHQ4jdCmeT0IZDzSWPrwdzOC/ ylXm33B5agsifAl77KvOzSCX4cyEz3BSo9L4zjf4TMK9naUgI7oTb3FvU5NCjJeDEqjA5y OR/BvXch/cosMN3y2vhIJ6lcvQDVjHMumK4lWTX8DBN8ywElqnVQsvc8WaZKT2rJaB+H0t KmlokEJTuKVZbtsI48EqsSD580RtRUC1ptoh3V/jx+o0H3xQNVqlBj6SuNEpNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B7TLZkPLd08r2ZJz6A1pXZqh63MHh0MzteiAPweii+k=; b=xCwycuCa2YT5ghTrePuKOSumVvCtxzHEbmXlmtYxgZsvBoxTaZnnzP5Vs+12eMO4h5STli CR40X6tFsxQBUvqpENx/mdxdBL569/sdaJjR98pT105ne05h6G6rXGFrnjN2zFHgxuhmZm 3pIU6t/RH6WjbXHQJ7j46rKrh5Q4mnCbmwKmtyj1bty/FeKSaHliW5rOHGv7+wNEXiQC7N kjitmSZaPf67uCF79Zl80cbeAT6i8Nf1Q5WXKsRYNIE7q8oA4RRV1Bf5MqCQp4pgxrUjAk S2zI7ML9OyezMDJ5OBNTzyKnc0MZgVJpnt7lD/dd05jHx5xU7F3g0Zh477exAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VmsV142CBzTPx; Sat, 25 May 2024 19:31:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44PJVbVH043481; Sat, 25 May 2024 19:31:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44PJVbiH043478; Sat, 25 May 2024 19:31:37 GMT (envelope-from git) Date: Sat, 25 May 2024 19:31:37 GMT Message-Id: <202405251931.44PJVbiH043478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 0a1eb394d7b6 - stable/14 - mixer(3): Implement mixer_get_path() function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0a1eb394d7b6dcc32d1d7411873886a835900dbd Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0a1eb394d7b6dcc32d1d7411873886a835900dbd commit 0a1eb394d7b6dcc32d1d7411873886a835900dbd Author: Christos Margiolis AuthorDate: 2024-05-23 00:57:36 +0000 Commit: Christos Margiolis CommitDate: 2024-05-25 19:31:05 +0000 mixer(3): Implement mixer_get_path() function This is better than hardcoding device paths in mixer applications. Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45275 (cherry picked from commit 67c89b21b95601c01bafe5a0c518d320a39111c0) --- lib/libmixer/Makefile | 1 + lib/libmixer/Symbol.map | 4 ++++ lib/libmixer/mixer.3 | 40 +++++++++++++++++++++++++++++++++++++--- lib/libmixer/mixer.c | 25 +++++++++++++++++++++++++ lib/libmixer/mixer.h | 1 + 5 files changed, 68 insertions(+), 3 deletions(-) diff --git a/lib/libmixer/Makefile b/lib/libmixer/Makefile index 6ca17a9d020d..3f8a4dad4a65 100644 --- a/lib/libmixer/Makefile +++ b/lib/libmixer/Makefile @@ -22,6 +22,7 @@ MLINKS+= mixer.3 mixer_get_dunit.3 MLINKS+= mixer.3 mixer_set_dunit.3 MLINKS+= mixer.3 mixer_get_mode.3 MLINKS+= mixer.3 mixer_get_nmixers.3 +MLINKS+= mixer.3 mixer_get_path.3 MLINKS+= mixer.3 MIX_ISDEV.3 MLINKS+= mixer.3 MIX_ISMUTE.3 MLINKS+= mixer.3 MIX_ISREC.3 diff --git a/lib/libmixer/Symbol.map b/lib/libmixer/Symbol.map index f16e13d66e4c..2ce39fd058ab 100644 --- a/lib/libmixer/Symbol.map +++ b/lib/libmixer/Symbol.map @@ -19,3 +19,7 @@ FBSD_1.7 { mixer_get_mode; mixer_get_nmixers; }; + +FBSD_1.8 { + mixer_get_path; +}; diff --git a/lib/libmixer/mixer.3 b/lib/libmixer/mixer.3 index a3593898ed68..c8a7ee1148a8 100644 --- a/lib/libmixer/mixer.3 +++ b/lib/libmixer/mixer.3 @@ -40,6 +40,7 @@ .Nm mixer_set_dunit , .Nm mixer_get_mode , .Nm mixer_get_nmixers , +.Nm mixer_get_path , .Nm MIX_ISDEV , .Nm MIX_ISMUTE , .Nm MIX_ISREC , @@ -86,6 +87,8 @@ Mixer library (libmixer, -lmixer) .Ft int .Fn mixer_get_nmixers "void" .Ft int +.Fn mixer_get_path "char * buf" "size_t size" "int unit" +.Ft int .Fn MIX_ISDEV "struct mixer *m" "int devno" .Ft int .Fn MIX_ISMUTE "struct mixer *m" "int devno" @@ -398,7 +401,21 @@ The function returns the maximum mixer unit number. Although this might sound as incorrect behavior, given that one would expect "nmixers" to refer to the total number of active mixers, it is more intuitive -for applications that want to loop through all mixer devices. +for applications that want to loop through all mixer devices (see the +.Sx EXAMPLES +section). +.Pp +The +.Fn mixer_get_path +function writes the path of the mixer device specified in the +.Ar unit +argument to the buffer specified in +.Ar buf . +.Ar unit +can be either -1, in which case +.Fn mixer_get_path +will fetch the path of the default mixer, or between 0 and the maximum mixer +unit. .Pp The .Fn MIX_ISDEV @@ -470,9 +487,10 @@ The .Fn mixer_set_mute , .Fn mixer_mod_recsrc , .Fn mixer_get_dunut , -.Fn mixer_set_dunit +.Fn mixer_set_dunit , +.Fn mixer_get_nmixers , and -.Fn mixer_get_nmixers +.Fn mixer_get_path functions return 0 or positive values on success and -1 on failure. .Pp The @@ -542,6 +560,22 @@ TAILQ_FOREACH(dp, &m->devs, devs) { (void)mixer_close(m); .Ed +.Ss Loop through all mixer devices in the system +.Bd -literal +struct mixer *m; +char buf[NAME_MAX]; +int n; + +if ((n = mixer_get_nmixers()) < 0) + errx(1, "no mixers present in the system"); +for (i = 0; i < n; i++) { + (void)mixer_get_path(buf, sizeof(buf), i); + if ((m = mixer_open(buf)) == NULL) + continue; + ... + (void)mixer_close(m); +} +.Ed .Sh SEE ALSO .Xr queue 3 , .Xr sysctl 3 , diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c index 93ace1d0c69b..4abbed9b27d3 100644 --- a/lib/libmixer/mixer.c +++ b/lib/libmixer/mixer.c @@ -493,3 +493,28 @@ mixer_get_nmixers(void) return (si.nummixers); } + +/* + * Get the full path to a mixer device. + */ +int +mixer_get_path(char *buf, size_t size, int unit) +{ + size_t n; + + if (!(unit == -1 || (unit >= 0 && unit < mixer_get_nmixers()))) { + errno = EINVAL; + return (-1); + } + if (unit == -1) + n = strlcpy(buf, BASEPATH, size); + else + n = snprintf(buf, size, BASEPATH "%d", unit); + + if (n >= size) { + errno = ENOMEM; + return (-1); + } + + return (0); +} diff --git a/lib/libmixer/mixer.h b/lib/libmixer/mixer.h index cb9575c5f012..80a4b5c91a82 100644 --- a/lib/libmixer/mixer.h +++ b/lib/libmixer/mixer.h @@ -115,6 +115,7 @@ int mixer_get_dunit(void); int mixer_set_dunit(struct mixer *, int); int mixer_get_mode(int); int mixer_get_nmixers(void); +int mixer_get_path(char *, size_t, int); __END_DECLS From nobody Sat May 25 19:31:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VmsV42KPsz5LT6T; Sat, 25 May 2024 19:31: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VmsV35zSbz4k39; Sat, 25 May 2024 19:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2SYJH8yWgHtU4Q1OdbY1CQSbv4kgj8WcXVfPPsOFRQ4=; b=aAz2gjIxrRUT8JZTPMExbyWa7tSFbTeB7etBQiurVsSnbC4eGcUz5fwae8WZZ1Z/gWs6vf wrKtpY6D/fw4M8UF4xESETjQzUUs9EFwHc6+uucDWu/r3I2SE0C3mO9bPUIuAwmVWABPb/ RgkYnL1ScwO6Nkegm7S6BoUPJhqMEV6dPSqGqAZ1hB1nemt3EWwnRSg3L54No1EXdKXRCA kG48cTzC09hUU9Lc67VQNmGfdcBJXx9yggYlKHsSt+AxnJ4oaJpAJk0uAg6R/OzVygkPdg KBA0vI6yOGpABVxpQY7mI3OkEtS/7fNF2eeZaP0+QCYGywPqrvN9SQFndZLPEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716665499; a=rsa-sha256; cv=none; b=qKLTiKINOgA55iQGb2Cu0up26kEv/1PtpRNdUg1sTTWwRGJSsnSlosnon1KWUfi2l7HAZv I+5u2YueMQzsSeUdfJK7n4ddE8h3xejBApEs3jnJMeAOABp8SR1vx6FaHof8OOqRYIJP7w OHJ63THGS0vZL0vBqq6JsJQCEacyQwNE8sxag+TnbePsuCp9dWnvJTXq9vHmMbLVoBmDCd MPBW28SmYYr2LS2Mrimx5bX8OPWyFTb3AEtZ8H7ywWAtPaVjZWBcj9JorG9Cx5c8dg5Fgt o4YBHtXHeiNjJwZNR+GVjTQRqpzx3CcNt59QLTj97ct3VXbWxIeLvzYfhCaHzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2SYJH8yWgHtU4Q1OdbY1CQSbv4kgj8WcXVfPPsOFRQ4=; b=rh/zCdSEY9DQXiiF/tKgOgjfHB7M1ELanqQWm0gVy1TeRbf64OPScCEdhHHRqcVHqVxob9 lCphH6AxggCuj/ehinuF1vjps1r3CJxxKPCYOV8uz6vfMAKW51c4ZGvctQuDXbLkR06MBK a+Wy//S8HqmQjGGa8woU4UupfraCq2KcVkEu3+loCBy/5AlxlGL1KrLTcotm4Ug5bEdWAh BGJ8sHAP6Hz5SVEa7vHHyWzBqHJhNIhoAUecYuYMfgsSIPkRM/dQ137KZp9Uf26Fmg8Lnx Q2Qyf6YsF3hh60/zrrLFhJcuWCIRIpYYg/On7NAfiNUBiYSY7eqsmPNYOQMdSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VmsV35WXxzVdx; Sat, 25 May 2024 19:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44PJVdON043576; Sat, 25 May 2024 19:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44PJVd25043573; Sat, 25 May 2024 19:31:39 GMT (envelope-from git) Date: Sat, 25 May 2024 19:31:39 GMT Message-Id: <202405251931.44PJVd25043573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 63be29379cb1 - stable/14 - mixer.3: Fix mandoc -Tlint warnings List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 63be29379cb11463bdb6170862e6df85087f5cbc Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=63be29379cb11463bdb6170862e6df85087f5cbc commit 63be29379cb11463bdb6170862e6df85087f5cbc Author: Christos Margiolis AuthorDate: 2024-05-23 00:57:49 +0000 Commit: Christos Margiolis CommitDate: 2024-05-25 19:31:19 +0000 mixer.3: Fix mandoc -Tlint warnings Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45290 (cherry picked from commit 1ab62c8d067454b77bc9fb1c5aac75f263bb4143) --- lib/libmixer/mixer.3 | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/libmixer/mixer.3 b/lib/libmixer/mixer.3 index c8a7ee1148a8..4008867ef2fb 100644 --- a/lib/libmixer/mixer.3 +++ b/lib/libmixer/mixer.3 @@ -19,7 +19,6 @@ .\" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN .\" THE SOFTWARE. .\" - .Dd May 22, 2024 .Dt MIXER 3 .Os @@ -168,13 +167,15 @@ is always equal to the number of that pcmX device. For example, if the audio device's number is 0 (i.e pcm0), then .Ar unit is 0 as well. -This number is useful when checking if the mixer's audio card is the default one. +This number is useful when checking if the mixer's audio card is the default +one. .It Fa ndev Number of devices in .Ar devs . .It Fa devmask Bit mask containing all supported devices for the mixer. -For example, if device 10 is supported, then the 10th bit in the mask will be set. +For example, if device 10 is supported, then the 10th bit in the mask will be +set. By default, .Fn mixer_open stores only the supported devices in devs, so it is very unlikely this mask will @@ -318,23 +319,27 @@ opens the default mixer (hw.snd.default_unit). The .Fn mixer_close function frees resources and closes the mixer device. -It is a good practice to always call it when the application is done using the mixer. +It is a good practice to always call it when the application is done using the +mixer. .Ss Manipulating the mixer The .Fn mixer_get_dev and .Fn mixer_get_dev_byname -functions select a mixer device, either by its number or by its name respectively. -The mixer structure keeps a list of all the devices, but only \ -one can be manipulated at a time. -Each time a new device is to be manipulated, one of the two functions has to be called. +functions select a mixer device, either by its number or by its name +respectively. +The mixer structure keeps a list of all the devices, but only one can be +manipulated at a time. +Each time a new device is to be manipulated, one of the two functions has to be +called. .Pp The .Fn mixer_set_vol function changes the volume of the selected mixer device. The .Ar vol -parameter is a structure that stores the left and right volumes of a given device. +parameter is a structure that stores the left and right volumes of a given +device. The allowed volume values are between MIX_VOLMIN (0.0) and MIX_VOLMAX (1.0). .Pp The @@ -355,7 +360,8 @@ Toggle the device's mute (e.g mute if unmuted and unmute if muted). The .Fn mixer_mod_recsrc function modifies a recording device. -The selected device has to be a recording device, otherwise the function will fail. +The selected device has to be a recording device, otherwise the function will +fail. The .Ar opt parameter has to be one of the following options: From nobody Sat May 25 19:31:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VmsV54BF0z5LTBm; Sat, 25 May 2024 19:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VmsV46xDsz4jhr; Sat, 25 May 2024 19:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E1BxgcK9UizVUMWg92aO1KUB8qtd+7ijt0gM35tVUqo=; b=akhDgcSzI6sqCvC6QbEw5FyYu7T1Qu2MtXaftjpQc1VieKdbkwsYNioVG6bX6+L7dSroIs yKH/7ZDifak/vWaZzRwi6touytTj7+Qrjbw4E/0LynUdhsTZhWUfbHP/pbT22hX3qO9jr6 xnFCoZVcvQupADxYRDdEHbGSjbfD2sZ7xR47KhK8+3JfW6vA1IUQn+I312MgE9KdLSQ2IY wwLXzyNRvtXCQPHPIxw9X/KDOE6vcXTTbPF0n+bXVImbJdJVdjWzy47gALKzx/PvTdKYZ2 I1DnbFPDLiR7EiPxK7LdKUP1lt7j4mVMxy0vuPeuMEQxuJw8iwIpUwNAZq/fqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716665501; a=rsa-sha256; cv=none; b=GTmorIHnzFUwopZP5879aTe1+X8DmYF0lBwhXm68X/xdbPKzpfNgKYEzVSi3lHvstp5fzE AmFGNFePfA5bD7KrDpwdcUcnRTZaeRnNFdZHM5lu0+P+XHgMBbU2wuwmmRNwG4gHzh4HYv a9Nw4eGX4jOcWFp7Fcad1pLLFvzcPv5iAGguYsK/GZdESHwnOcPzwp3ulIUzj7+E6UbQUK KMTDZEEnOVNr8StORg5hz9kaCL4ZZ4ExgUGWwn4zMX8wP7tjTd1HvO2zScIjECjBMvyqGf hexcCAY80fSikpuy/SLWtUcDt8oQsVhXFfX4XTvQt2tc20k82WJ5xLIBw8RPXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716665501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E1BxgcK9UizVUMWg92aO1KUB8qtd+7ijt0gM35tVUqo=; b=cGNoazvjVqSwvuFACG1xkWxpFv/7Lm1iAENRyLBwhu/1IQbU2Eg5pRmPO/7qHQLaS6v0Ml 3M7FURw+LiIq9e8YGxJfHejc+THpDJxpT1kic2aDORwUNASmW0hNmkmvcaRGMPjw0tZcj0 VtA1KGpCIQQNbRrtcFh4nJdWZXG7i3m5Z6Suj5v3jMDaf1uS66P7O7kUQ+D3tkBrfEb0Y0 xp0yJxXVk42mmcbSKTJgTGvZKgR70fldP3CU1MiMD08lApGn9V5ykRZHkH1iMy/rmFTkHR skvzEpJWQlx3a1ZC8pYs96jbTGEjzk31YIa4t2/G68scv6b+E0I69zRVLxi7DA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VmsV46YZXzTPy; Sat, 25 May 2024 19:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44PJVea5043638; Sat, 25 May 2024 19:31:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44PJVe4a043635; Sat, 25 May 2024 19:31:40 GMT (envelope-from git) Date: Sat, 25 May 2024 19:31:40 GMT Message-Id: <202405251931.44PJVe4a043635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 0aa767021c19 - stable/14 - sound: Fix minchn, maxchn and fmts in sndstat_get_caps() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0aa767021c19ece8ab5ba99eb65d045700b09869 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0aa767021c19ece8ab5ba99eb65d045700b09869 commit 0aa767021c19ece8ab5ba99eb65d045700b09869 Author: Christos Margiolis AuthorDate: 2024-05-23 00:57:55 +0000 Commit: Christos Margiolis CommitDate: 2024-05-25 19:31:26 +0000 sound: Fix minchn, maxchn and fmts in sndstat_get_caps() The current implementation (incorrectly) passes the channel encoding value to AFMT_CHANNEL(), which will always return 0, since the channel number bits are masked out by AFMT_ENCODING(). Also add missing fmts initialization and aggregate encoding formats into it directly. Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45312 (cherry picked from commit 425a7bc465d4a6393c88c2e79c5ad77befda2a97) --- sys/dev/sound/pcm/sndstat.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index bbcb2fda7c29..6880ce383ba4 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -330,7 +330,6 @@ sndstat_get_caps(struct snddev_info *d, bool play, uint32_t *min_rate, uint32_t *max_rate, uint32_t *fmts, uint32_t *minchn, uint32_t *maxchn) { struct pcm_channel *c; - unsigned int encoding; int dir; dir = play ? PCMDIR_PLAY : PCMDIR_REC; @@ -347,11 +346,11 @@ sndstat_get_caps(struct snddev_info *d, bool play, uint32_t *min_rate, return; } + *fmts = 0; *min_rate = UINT32_MAX; *max_rate = 0; *minchn = UINT32_MAX; *maxchn = 0; - encoding = 0; CHN_FOREACH(c, d, channels.pcm) { struct pcmchan_caps *caps; int i; @@ -364,9 +363,9 @@ sndstat_get_caps(struct snddev_info *d, bool play, uint32_t *min_rate, *min_rate = min(caps->minspeed, *min_rate); *max_rate = max(caps->maxspeed, *max_rate); for (i = 0; caps->fmtlist[i]; i++) { - encoding |= AFMT_ENCODING(caps->fmtlist[i]); - *minchn = min(AFMT_CHANNEL(encoding), *minchn); - *maxchn = max(AFMT_CHANNEL(encoding), *maxchn); + *fmts |= AFMT_ENCODING(caps->fmtlist[i]); + *minchn = min(AFMT_CHANNEL(caps->fmtlist[i]), *minchn); + *maxchn = max(AFMT_CHANNEL(caps->fmtlist[i]), *maxchn); } CHN_UNLOCK(c); } From nobody Sun May 26 05:36:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vn6vl3y6xz4fjhC; Sun, 26 May 2024 05:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vn6vl1Zhhz4mH8; Sun, 26 May 2024 05:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716701779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Os9auUrjZqg6Pds1kwcNaYgRq9UeROGaoa61ptA/Qs=; b=PNmeDSvItvncNlw/WY9Tq3oVdY1CFBEoKqokG7f/1TNjV9/8B3HQVpqiDL/+YorldjC+EC cMYWQpRh8TZOSv64bii+QMCCL1uqhcIlwxehmEmfek0eYTVFeB8fiXILe70ACfp1808W/v 8oVfXf+s6Txt/mmhjncC5FPFQGprlmwVGrX1jIE/PRgqUDBXYrbHmI/6hrjqWT212JAnWA BYngt8laKLWBBZkxo6QEBPTCSwnDRDshtux7Uey67zfAIi1BipGwy7zcdNKuk5qjSvwtCi pjzIZLWNgNYWDQ0tL1hBrh9imx5X61M4WAFydcqpFSO5Oni1UIpTFnqdOYiM9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716701779; a=rsa-sha256; cv=none; b=q5L/sFjSDUF+R5FE78RrNGPwj9ZYYuzoniaxGjoiapr4EUOw9Pl/aG6GQYEQ/hEh/l4k22 Tu3csCq4eLDvOgQBdH3AtRUnMppZo4OODG5dBHZj5Qae03nUIViyBc7Fyw+CjKO15KrAzv p/Y/aOqA/ycj/6/C8mwduCVNFU8wh8QC91HetkF/hQCSz5yxQ/R8XJCm/X+4yrZ6ja74XI V7ZdND5aT3bWqcPy1pbKGrKOXkf81jD8AIzyyJfXt1jZJ3oB85K+L6k1sitvXjrBOfoTA8 Fw27rbPNKuOt1ktZbFjVGQt+kEd1f16aq8dXYnIh0lclCeZLg0ydrDp8UYX4dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716701779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Os9auUrjZqg6Pds1kwcNaYgRq9UeROGaoa61ptA/Qs=; b=Z6aUjCMJazmPQKWS5H6h/jkcN1MUMuc593CXrZnXSvzsCmepopJbDDi1Vh3bKcEBZPiUFt xXkinBmAL4SQigMI4PEjg1lubGgXNryCoTAZ5KvyP0XKhdMfEAqjDATLGT4CqImsiKEvMV zeWpdtPFFn9OAuw1U+Y83LL5OLjDBB4a5rAAIPEP3xGCqB5hUKCLk+WoEzu8KGk4jog7/Y Ug9JpJjlBZgXYbLJMHyWrxzqC6mcNDn7jwVFhfwVCNx96sj+AlQ2cIZOKM5f/3lFVQ3m7d aygQmvq3Jc7cKulT9n8fIsYzm1J+fGak574OmmZKINk58RrsDos5972XG5DfNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vn6vl1B3VzndK; Sun, 26 May 2024 05:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44Q5aJtf060710; Sun, 26 May 2024 05:36:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44Q5aJ4r060708; Sun, 26 May 2024 05:36:19 GMT (envelope-from git) Date: Sun, 26 May 2024 05:36:19 GMT Message-Id: <202405260536.44Q5aJ4r060708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 432c0128bd3d - stable/14 - man: the exists function needs to validate the first parameter List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 432c0128bd3da3f7800e9fa525d677f8fb99d7a1 Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=432c0128bd3da3f7800e9fa525d677f8fb99d7a1 commit 432c0128bd3da3f7800e9fa525d677f8fb99d7a1 Author: Wolfram Schneider AuthorDate: 2024-05-20 16:02:21 +0000 Commit: Wolfram Schneider CommitDate: 2024-05-26 05:34:40 +0000 man: the exists function needs to validate the first parameter This fixes an issue with the ".so " macro for FreeBSD ports manual pages. PR: 275978 Reported by: Jamie Landeg-Jones MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45231 (discussion) --- usr.bin/man/man.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index cd047862727d..a4d23ff52aef 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -195,6 +195,10 @@ decho() { # Returns true if glob resolves to a real file and store the first # found filename in the variable $found exists() { + if [ -z "$1" ]; then + return 1 + fi + local IFS # Don't accidentally inherit callers IFS (breaks perl manpages) From nobody Sun May 26 05:44:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vn74z1jXcz4fkSd; Sun, 26 May 2024 05:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vn74z0SGHz4mrY; Sun, 26 May 2024 05:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716702259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXSojnX3gUMvADZLOYZd7NROmVYIve1pIdMr5nFif3M=; b=ZpEujaqwvmAViazdJ73Yn/Y5IQ+t3tLt5H6kMWwjQiL9Q79IfvwPd7Ycf19M9hTF3WnI7z P6aE8YYp9PhO7MEATYFteoNP5VzLLSvELjtqQ9SA9g0Tf/wXeUdg98/zjl/2KdISXuPqpI /uyYWp5j74PWfax+FTxvMAAzQgZzWC9OnW+qlm/9h7YjtQ73Qq6sT2Y+NdDgzPxMR7Gtr4 m2UgFYhAF39iVbn+Dax+I11VeELIrRhvJioFVhjc+SkATa7cPqIIL9NweQke/x1RoYmbAw +gwOdc0oHorqDXhr3VpnF2Y0baszee1cUvXJsgYhMAsp19NJEwR3U6LZ5tu3NQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716702259; a=rsa-sha256; cv=none; b=neEpSm4BJizuSz/AESSkgaDBAkRQ4zjnlBTXDFYwP6MoQI48Y3UqtbS7qnhSXta41jEHMn cEFhAR3YeyKkayQcreZSw/SDxj53QjQe+dmFWma2zMFobOWjYd4kymAtsr6s+BKACk62he bmbP6NxeCH8kznKbpmxwszR08Kv4P0bBLxL8ImefO44b0ePgroo8QFP29k38Qlpl4GI69d OGEQkeP8v8z3sLjtTLP9mY9Md8bCIliBNlxYrMKVJ5Kw9UklOylAgH3Oyeu7x9Ej9x+4ZC 4mbGkCKapvEgRpd1/CSPoWIXD2WwTnYBRogrQKdIAFgbINYtO/CI1VeTrlKzWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716702259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXSojnX3gUMvADZLOYZd7NROmVYIve1pIdMr5nFif3M=; b=sScUCdHkId7AwFJSpfuWrGurYQQeewMWQwhRuZ7lZEhRK4gp91mMpp2/BtsWNKr5+Awexv T15ZdthmQhYRAc+8FYAAk5Rn4ru7VBoWmsjADP94a/H0sXzg1BvAuIiwCAy9EQjqv0KSIF efyX7shx0AZKf/eWsFznwipKW8Q4x32uCEKYFYb7gcbvW9R8gixea/euUYc9b0ejOCf2O0 VVna743RaDb9pgyZEK3pQN33fsX1XwY7BQ+kwh5jlR7TnDvSrCOyX3by7BD5mJzGlVzHKG pTaVtwmUCIrDFoMDrrJ9039ImtpENi4Fdi2PZ3mXZkIVmI8VV2fj3az7m+wopQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vn74y6svgzp9M; Sun, 26 May 2024 05:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44Q5iISv076853; Sun, 26 May 2024 05:44:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44Q5iIEY076850; Sun, 26 May 2024 05:44:18 GMT (envelope-from git) Date: Sun, 26 May 2024 05:44:18 GMT Message-Id: <202405260544.44Q5iIEY076850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 36294c97c147 - stable/13 - man: the exists function needs to validate the first parameter List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 36294c97c147733c3f4408cb6ecfacb8de8cc282 Auto-Submitted: auto-generated The branch stable/13 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=36294c97c147733c3f4408cb6ecfacb8de8cc282 commit 36294c97c147733c3f4408cb6ecfacb8de8cc282 Author: Wolfram Schneider AuthorDate: 2024-05-20 16:02:21 +0000 Commit: Wolfram Schneider CommitDate: 2024-05-26 05:43:45 +0000 man: the exists function needs to validate the first parameter This fixes an issue with the ".so " macro for FreeBSD ports manual pages. PR: 275978 Reported by: Jamie Landeg-Jones MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45231 (discussion) --- usr.bin/man/man.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index ca9b002dfc08..33be10cd5bd6 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -195,6 +195,10 @@ decho() { # Returns true if glob resolves to a real file and store the first # found filename in the variable $found exists() { + if [ -z "$1" ]; then + return 1 + fi + local IFS # Don't accidentally inherit callers IFS (breaks perl manpages) From nobody Sun May 26 13:52:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VnKvm5lB9z5LTgp; Sun, 26 May 2024 13:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VnKvm5Fp6z4jxx; Sun, 26 May 2024 13:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716731524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWGkIGr3sh0vAVVN/1KoDJDIs4b4kiaKEX2dn8bUcVs=; b=dAWybWWbweZ6oaxuv9BWzDYFZY6u/JDO/ZUBh2WNgwGNZC/nmYqSFUxKRRjBwgVm6unqjq crHl9Y04boY4ihYE5yD2uIkM7D7cU6bIussBrHcYG8jZqSEtKzao2XojeM+Z9Dquc+4leI 98IEaa4prgXHQGeIV5Q3NULvWyAJL4BTLq1bZqoLeq5wTMGzynxDBMMkPVvdCjuMI9ea6V L6yYKbVRiSPwzCBLY0tQy51B+bOc71L/DjG1iOyZl2HPC/ZCZxTHQ5nTUJI3vv7O4fg/g1 jNb0EWzNgno2uSjwaqPNWUoVAddIu6+jDWohES3xqWcz/Od78cCNgil5Bb0k4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716731524; a=rsa-sha256; cv=none; b=JHW5Cb80/otXEkZRjVQWPLRpNMdqTB3j7bZsQMnpUPLJkxcPSXY9IfrgX+DsEJ2L2ltWvN lNjr74QSbeKK9ethXSUSbhyN9C9H8U3IsQ3Og54YabmSQy1JPNjMe/Wuy7AzyVUlKuwhBI SWv5RWhKuTWlR5pylQBmM0cfVkk7c0p9pO1UxxX7QYtpADO4Oedze1lxu6PpeJjGeJHDbe z8W7ak3VCc3d+qnG/Z9/uyiTjbnAZ1F7uEVkKGSL877TWehAZ9bCeit76yj7ZlrjktiDTu aV0W76fwDmVVDe9wrJde/hhXyp72kjcnpHiSsfbFu1L9v27d6NPKaB9TNnFEhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716731524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWGkIGr3sh0vAVVN/1KoDJDIs4b4kiaKEX2dn8bUcVs=; b=d+lwiSSWdJ8GJ57o65abdgMCnFPmf7kN9l5ncvRFR8LviDi2sZw46tH18jdoZqG7WPAgl5 Tyu8SxIT/1VAYDemm9Bmcyf7lt4epv8RGC10qZt6C8u+QhX1bAk3sz8y/tpAQDKdYi8OFw iVO/Jz/iI9/y5ZPgSwRzrVDfO5NEv2Bk7kYSyktEXosHdQzgktiors/bUGbf4mQMPub4RR 8lmEpRepZubCBWIsLumXNMD3DhGG1kKm6QLp9069lVcSXZousejpBdkDWDwcSY1nEFyJR9 +TUZmHAMmpHcDwC9ZAm+6R/uOaKVq4+KBd0x6dHYbdGXAGszTAvQ3uVuGHSVHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VnKvm4sFGz12Sb; Sun, 26 May 2024 13:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44QDq4cM098935; Sun, 26 May 2024 13:52:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44QDq4vS098932; Sun, 26 May 2024 13:52:04 GMT (envelope-from git) Date: Sun, 26 May 2024 13:52:04 GMT Message-Id: <202405261352.44QDq4vS098932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 38286d9f6828 - stable/14 - pcm: centralize 32-bit ioctl compat List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38286d9f68284e68ac8764b19f7862fd28acc689 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=38286d9f68284e68ac8764b19f7862fd28acc689 commit 38286d9f68284e68ac8764b19f7862fd28acc689 Author: Brooks Davis AuthorDate: 2024-05-23 16:14:36 +0000 Commit: Christos Margiolis CommitDate: 2024-05-26 13:51:33 +0000 pcm: centralize 32-bit ioctl compat Move all handlng of struct sndstioc_nv_arg(32) to sndstat_ioctl() and make the functions that actually do the work take a buffer and size or size pointer. The 32-bit compat work is minimal so just inline it. Remove checks that we've got a 32-bit process for 32-bit ioctls. We don't check that default ioctls are from 64-bit processes on 64-bit systems. Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D45307 (cherry picked from commit fb9013f215211f013eccc54786f299e39a1f8773) --- sys/dev/sound/pcm/sndstat.c | 95 ++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 66 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 6880ce383ba4..6670a1e43aac 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -45,9 +45,6 @@ #include #include #include -#ifdef COMPAT_FREEBSD32 -#include -#endif #include #include @@ -622,10 +619,9 @@ sndstat_refresh_devs(struct sndstat_file *pf) } static int -sndstat_get_devs(struct sndstat_file *pf, caddr_t data) +sndstat_get_devs(struct sndstat_file *pf, void *arg_buf, size_t *arg_nbytes) { int err; - struct sndstioc_nv_arg *arg = (struct sndstioc_nv_arg *)data; SNDSTAT_LOCK(); sx_xlock(&pf->lock); @@ -664,22 +660,22 @@ sndstat_get_devs(struct sndstat_file *pf, caddr_t data) SNDSTAT_UNLOCK(); - if (!arg->nbytes) { - arg->nbytes = pf->devs_nbytes; + if (*arg_nbytes == 0) { + *arg_nbytes = pf->devs_nbytes; err = 0; goto done; } - if (arg->nbytes < pf->devs_nbytes) { - arg->nbytes = 0; + if (*arg_nbytes < pf->devs_nbytes) { + *arg_nbytes = 0; err = 0; goto done; } - err = copyout(pf->devs_nvlbuf, arg->buf, pf->devs_nbytes); + err = copyout(pf->devs_nvlbuf, arg_buf, pf->devs_nbytes); if (err) goto done; - arg->nbytes = pf->devs_nbytes; + *arg_nbytes = pf->devs_nbytes; free(pf->devs_nvlbuf, M_NVLIST); pf->devs_nvlbuf = NULL; @@ -850,25 +846,24 @@ sndstat_dsp_unpack_nvlist(const nvlist_t *nvlist, struct sndstat_userdev *ud) } static int -sndstat_add_user_devs(struct sndstat_file *pf, caddr_t data) +sndstat_add_user_devs(struct sndstat_file *pf, void *nvlbuf, size_t nbytes) { int err; nvlist_t *nvl = NULL; const nvlist_t * const *dsps; size_t i, ndsps; - struct sndstioc_nv_arg *arg = (struct sndstioc_nv_arg *)data; if ((pf->fflags & FWRITE) == 0) { err = EPERM; goto done; } - if (arg->nbytes > SNDST_UNVLBUF_MAX) { + if (nbytes > SNDST_UNVLBUF_MAX) { err = ENOMEM; goto done; } - err = sndstat_unpack_user_nvlbuf(arg->buf, arg->nbytes, &nvl); + err = sndstat_unpack_user_nvlbuf(nvlbuf, nbytes, &nvl); if (err != 0) goto done; @@ -914,52 +909,17 @@ sndstat_flush_user_devs(struct sndstat_file *pf) return (0); } -#ifdef COMPAT_FREEBSD32 -static int -compat_sndstat_get_devs32(struct sndstat_file *pf, caddr_t data) -{ - struct sndstioc_nv_arg32 *arg32 = (struct sndstioc_nv_arg32 *)data; - struct sndstioc_nv_arg arg; - int err; - - arg.buf = (void *)(uintptr_t)arg32->buf; - arg.nbytes = arg32->nbytes; - - err = sndstat_get_devs(pf, (caddr_t)&arg); - if (err == 0) { - arg32->buf = (uint32_t)(uintptr_t)arg.buf; - arg32->nbytes = arg.nbytes; - } - - return (err); -} - -static int -compat_sndstat_add_user_devs32(struct sndstat_file *pf, caddr_t data) -{ - struct sndstioc_nv_arg32 *arg32 = (struct sndstioc_nv_arg32 *)data; - struct sndstioc_nv_arg arg; - int err; - - arg.buf = (void *)(uintptr_t)arg32->buf; - arg.nbytes = arg32->nbytes; - - err = sndstat_add_user_devs(pf, (caddr_t)&arg); - if (err == 0) { - arg32->buf = (uint32_t)(uintptr_t)arg.buf; - arg32->nbytes = arg.nbytes; - } - - return (err); -} -#endif - static int sndstat_ioctl( struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { int err; struct sndstat_file *pf; + struct sndstioc_nv_arg *arg; +#ifdef COMPAT_FREEBSD32 + struct sndstioc_nv_arg32 *arg32; + size_t nbytes; +#endif err = devfs_get_cdevpriv((void **)&pf); if (err != 0) @@ -967,27 +927,30 @@ sndstat_ioctl( switch (cmd) { case SNDSTIOC_GET_DEVS: - err = sndstat_get_devs(pf, data); + arg = (struct sndstioc_nv_arg *)data; + err = sndstat_get_devs(pf, arg->buf, &arg->nbytes); break; #ifdef COMPAT_FREEBSD32 case SNDSTIOC_GET_DEVS32: - if (!SV_CURPROC_FLAG(SV_ILP32)) { - err = ENODEV; - break; + arg32 = (struct sndstioc_nv_arg32 *)data; + nbytes = arg32->nbytes; + err = sndstat_get_devs(pf, (void *)(uintptr_t)arg32->buf, + &nbytes); + if (err == 0) { + KASSERT(nbytes < UINT_MAX, ("impossibly many bytes")); + arg32->nbytes = nbytes; } - err = compat_sndstat_get_devs32(pf, data); break; #endif case SNDSTIOC_ADD_USER_DEVS: - err = sndstat_add_user_devs(pf, data); + arg = (struct sndstioc_nv_arg *)data; + err = sndstat_add_user_devs(pf, arg->buf, arg->nbytes); break; #ifdef COMPAT_FREEBSD32 case SNDSTIOC_ADD_USER_DEVS32: - if (!SV_CURPROC_FLAG(SV_ILP32)) { - err = ENODEV; - break; - } - err = compat_sndstat_add_user_devs32(pf, data); + arg32 = (struct sndstioc_nv_arg32 *)data; + err = sndstat_add_user_devs(pf, (void *)(uintptr_t)arg32->buf, + arg32->nbytes); break; #endif case SNDSTIOC_REFRESH_DEVS: