From nobody Sat Mar 11 23:20:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PYzS2348Gz3x1CL; Sat, 11 Mar 2023 23:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PYzS21rDkz4LB0; Sat, 11 Mar 2023 23:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678576850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ptjIcxgKgNml5YQFKrBp7Iy2YEahVqgveXUFlF7Qe34=; b=G+Pt/+gTZsxU/2cTlXGEAq4YUkk/++ALrsj9DPwR2Ss6nxLeHZyKDbUuPtGsnB1SHEpl6o 3mejiS/W0nrxB8205D1lv9PsLhJBtNGN2fpGLXTcfpLhR2XLFJFT0PYtv1o25QD3U0lF4o /m3vSbLNK4ysnny4WEz0u59bvOgf6MMnTc5o8DsnQS3j9nNHi7c+zsSAn11LGmrc7WgQ1g 6jY6TI0KBHMcNPdmrd9IgPX8PhT4YshbLeFssby9iEaXUnDQ9kArRvZMmAf9AMVKs3u/eG ocPr7N+0VS+KsNUklAlLO57zuHebmgM1BQV8h8UqWFgLGScVTVvCxAWssIQfZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678576850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ptjIcxgKgNml5YQFKrBp7Iy2YEahVqgveXUFlF7Qe34=; b=R6uUW7T7B+ohAt5pwQkaF3EpaMbtGFnWBZWYM3UatGIInDNZVqk+sSfbcdHVFY1LDIqE2W rVCMjvXxQUDx2+OAsdK39W1tMysylNoBkr4TVD3LRDapPJgDx3FpBuZqA/P2jUxzNXbJEe KIE+405qewXPFgxvd/ZuSHUT8b4lsPRYZWpyc9MdjFIQE+mfb2a/IsOcIXPvhEeakxy64T tM0AFau2aD6Ah2N+e9uAZ/IwaMUAqaJuJh/c1NZp1jJ5r5k/ytLmrxxIb7w5RvZVZu6vxs sTQtnXdbqyMJqy+7k8vu7k0EyS+PVBWKDg1ENJ/BsbxZbzlPfs0XMG1iBybYPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678576850; a=rsa-sha256; cv=none; b=nsdXZ1VdSup7dlNWpbYEMqYpVSqb6PfY0cp2RglxgNkahjwUnXXu94XR1jzLEYOpBUTBFd Kn3YzmnrN9noML1SJMG3wJkPUXwXj/+laBvTtnGTV0lhPn4jkUXWyB8SWHtU/zQLf4czeB gQo33dbQe8R39SEXSdVXrcYxK422UX/4LmCJFqqgbNMY22HyGYucivEI/dVmOQG9UBnlSq x/gVJOx/lHUqMjbZZqrzdnQ9MW++0B/cTVXzDHKNoRks7qM3d+PQGcNUvh4wfSQC2DcTrg /hXPnyTdkglwSMrRVR3PFPrrj1ea35BhwZR3pV5HlULEngzqeuLoQMo7ei5U3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PYzS20wwRznxn; Sat, 11 Mar 2023 23:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32BNKoOg039515; Sat, 11 Mar 2023 23:20:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32BNKoJe039514; Sat, 11 Mar 2023 23:20:50 GMT (envelope-from git) Date: Sat, 11 Mar 2023 23:20:50 GMT Message-Id: <202303112320.32BNKoJe039514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c5c9d980c4b0 - main - libc/csu: rename ignore_init.c to libc_start1.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5c9d980c4b0ca3866cb2ad67ec3f7111f5c4285 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c5c9d980c4b0ca3866cb2ad67ec3f7111f5c4285 commit c5c9d980c4b0ca3866cb2ad67ec3f7111f5c4285 Author: Konstantin Belousov AuthorDate: 2023-03-11 22:56:46 +0000 Commit: Konstantin Belousov CommitDate: 2023-03-11 22:56:46 +0000 libc/csu: rename ignore_init.c to libc_start1.c The current name was a historical curiosity that started when init array support was added, and then the file appeared a convenient place for the addition of the MI common code to csu. It is now referenced by name in single place and the rename is easy, so do it. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks --- lib/libc/csu/Makefile.inc | 2 +- lib/libc/csu/{ignore_init.c => libc_start1.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/csu/Makefile.inc b/lib/libc/csu/Makefile.inc index 453303bea608..666744f27c8b 100644 --- a/lib/libc/csu/Makefile.inc +++ b/lib/libc/csu/Makefile.inc @@ -4,7 +4,7 @@ .include "${LIBC_SRCTOP}/csu/${LIBC_ARCH}/Makefile.inc" SRCS+= \ - ignore_init.c + libc_start1.c CFLAGS+= -I${LIBC_SRCTOP}/csu/${LIBC_ARCH} SYM_MAPS+=${LIBC_SRCTOP}/csu/Symbol.map diff --git a/lib/libc/csu/ignore_init.c b/lib/libc/csu/libc_start1.c similarity index 100% rename from lib/libc/csu/ignore_init.c rename to lib/libc/csu/libc_start1.c From nobody Sun Mar 12 06:23:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZ8qK1y8Nz3xSW6; Sun, 12 Mar 2023 06:23: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 4PZ8qK1Kzwz3ssG; Sun, 12 Mar 2023 06:23:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678602189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=71zf+G1qFpQABmKF7D2jorr7p9SSXdATZMKwBmaohXg=; b=ZshLXS6xKfTR49CZqPh4kEUI4UqXgzZF6zEuXWiHXREFCK6y0JSJHs5fvkYqs4XdX9as+W kNjcYIDB/Th26lJP7ZRGNbE5F9w7VDlwoTcoSrevmrS9GFnUaEBXScDPn0+leK+xGgLRFL w/M2fpSHcnI8/yZK2VqIDt9qZ1jcgdEfOwDk8rObqWEUZ8WY8d9Ez7Q+TSAGN53u1sedBT KNL8mWUOgzVx0A95MptMD0pS4y+xa+HnLjW7nADFrRm3YnsTwDYg/PG2REX28/1Wgb8FYL fa/Os2PrWWiQx3PEKUYplNhu/ao8TYqy9UA9HNJRz6G39ituZ/bOQpTHTUGbGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678602189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=71zf+G1qFpQABmKF7D2jorr7p9SSXdATZMKwBmaohXg=; b=kDqTqK5cTH/aAraOYxsmWZ4BzBOUGJdWQpYVhR7jSM+JsuMWGa3/UnP3Yi4XINTRa73qfy xsgHFrV/0xpf/ok4G10sHdyfKMBbDCdk2FN3NpyDCNaBjpEwwedeNyKi/SB/crK9YKnJX8 ydXTvMb0HLZAKpuCC4ULCdN6GpHu8qoRwPSHTtr/sY9VFcLcwmpQe/woLvYmK1RVDFD7U6 zNA2Z9DFsblKta4jna/w5N0P0dD2fUejKqXoQw4pmR7kxUvi0wn1CVeZa3nFkxcwmZjjdm YAIw6iUYQUctVjfNJ5v6K2IKBD7N3UojKM0AyfTS7WBq5eCrkpgVgdzhDdnXkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678602189; a=rsa-sha256; cv=none; b=rYUxpOR8OchSDQf3nzTnNAYfFPjWId2Vjr3E2pgqXZxWu7GHjRlHUGt6tPsFHXiNSyBkDi HWl7Rkh4w+GbNCj21gQdLxfFmgDYyCMEzHfDlbV4UVRjGwH6m/n3xccPUnQ2SYh4WQykmO MoBm33Rfowfx0xIcEEYY4rTPZ6Xz3iewAJKkveXCQSwtyP91cJ0V2x2YHFo20ortSV8QgF 6PS24Va5yHndA/jeYmtCPhqq1y+gvZIsUxMG9kBm7z0C5zC1D0Ujt96uIihG3pMAgMWSfr HBogaXofumD7jggYFLQVRdushyWped32rp/SRThQ8cyp7PNzJ7goz5TFOKU3MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZ8qK0PC4z11GX; Sun, 12 Mar 2023 06:23:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32C6N8iY035791; Sun, 12 Mar 2023 06:23:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32C6N83E035790; Sun, 12 Mar 2023 06:23:08 GMT (envelope-from git) Date: Sun, 12 Mar 2023 06:23:08 GMT Message-Id: <202303120623.32C6N83E035790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 63715498ac6b - main - powerpc: enable ZFS on 32 bit powerpc/powerpcspe List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63715498ac6b003a024e1fd0eefbc0db504f126e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=63715498ac6b003a024e1fd0eefbc0db504f126e commit 63715498ac6b003a024e1fd0eefbc0db504f126e Author: Alfredo Dal'Ava Junior AuthorDate: 2023-03-12 06:20:11 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2023-03-12 06:20:11 +0000 powerpc: enable ZFS on 32 bit powerpc/powerpcspe Enable ZFS on powerpc 32 bit since it appears to build and work correctly. MFC after: 3 weeks Relnotes: yes --- share/mk/src.opts.mk | 5 ----- sys/conf/kern.opts.mk | 5 ----- sys/modules/Makefile | 2 +- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 7cd1ef9731fc..7e865b31db25 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -356,11 +356,6 @@ __DEFAULT_NO_OPTIONS+=OPENMP BROKEN_OPTIONS+= OFED .endif -# ZFS is broken on 32-bit powerpc (missing atomics), but works on 64-bit -.if ${__T} == "powerpc" || ${__T} == "powerpcspe" -BROKEN_OPTIONS+= ZFS LOADER_ZFS -.endif - .include # diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 25057dcbb8d9..35ce97fae633 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -78,11 +78,6 @@ __DEFAULT_NO_OPTIONS = \ BROKEN_OPTIONS+= INIT_ALL_ZERO .endif -# ZFS is broken on 32-bit powerpc, missing atomics -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe" -BROKEN_OPTIONS+= ZFS -.endif - # Broken on 32-bit arm, kernel module compile errors .if ${MACHINE_CPUARCH} == "arm" BROKEN_OPTIONS+= OFED diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 3737dddb57ab..421fd1d3dd32 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -643,7 +643,7 @@ _mpr= mpr SUBDIR+= tests .endif -.if ${MK_ZFS} != "no" || (defined(ALL_MODULES) && ${MACHINE_CPUARCH} != "powerpc") +.if ${MK_ZFS} != "no" || defined(ALL_MODULES) SUBDIR+= zfs .endif From nobody Sun Mar 12 09:04:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZDPS74Qpz3xctq; Sun, 12 Mar 2023 09:04: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 4PZDPS6d7Hz4FQG; Sun, 12 Mar 2023 09:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678611868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S36OQdZIOkc8p+qe3RewrpBay0gp1gMgS9wNyH3N0JI=; b=SKDprF2N+onz6r01a326JL4IJBwVoWiGdHq0iUiMnO+FoKiINNWxbZ2jqiOZH1oyl7W4zw KHAPpCS42X6MXW9di9lDC7iclWiPGu7bGqO2v/kQ0BzMQgrAaXbWYGy8I2rLDxWPA7k9jI b8a0r2OzEnzAc6kAYJgVHIIK1IVHyuy/7ZU9qnyyGYaK7HzpNNCeXt1e8DpbuSumovxpzA 5DOPkH1TIQeZ64YqoPDuaMpDO3bFGSX4MHdNFPYXkmjWLn1ijpWLxF1rZ7prbA7ULNM1dX LnzleOmaXRQEhOgNLEALuVLWrZk/H8zxTUFFoJUpuQU4Cb56Vj2gHR97DOZTSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678611868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S36OQdZIOkc8p+qe3RewrpBay0gp1gMgS9wNyH3N0JI=; b=kB8Cdk+LeA/+GixITyDXBrPOHHCpKbAQfrNdEv1hY9HPlKY7Dhzp2jagnikKLEO+2b0Os0 ySGliXiAkRScSHr1CfYEQekm4vG3F8tKWWbuFcybuBwbU3XxbD8UB6a7xKp1rqNZIWYEpo r5cv64vE70rmM61ZymWsUTtj6DASqK5OZ6ZWalKOr5Q6QyLs0GUCDhiCFIO27ZMgd9/lhL K6+TIbFZU28GbpNKTd9xy3UM8IpN6JbF6Gx7ymd7i6tIDFDGob7yNtDZ8UhMC53TU7p30a +zGKpahlTZDTjnG/kqo3haOqc+SWvtssox8+k06zShawvZXwMP8gGr/G90/AMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678611868; a=rsa-sha256; cv=none; b=A/UX3VswkVUNnabfd5zd+bfn8nXkzc8p19hkNjqtNEIOFbZ1MqcC4vrgGt7Dy9nQTOKkb8 aKJGhgL+YPMhDw6twv6MCaQF69W2STCFL/2kJ7yeI3mkYkr9rInQrJmZzoBJPqbQIdNFqd puMSFjG5SbTS/0lq1RBIpMpkG1/ze7KBOMR52Fx5I1Fqf9e5EeN09tCTaS+WTJ06jMZnIY 5mOq9yMdzhOfqAFbSWzUkWcU+aIXKyi0Q1b36+61GNZ6shhPu7pO9ai434lDREHWprgvK5 i6T04AoNXNRwdeoNuwsow9uVCVaJlZRYLoP3i31NDTkuL6dj7KthdEDLG2TaPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZDPS5hPLz15L6; Sun, 12 Mar 2023 09:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32C94S11099593; Sun, 12 Mar 2023 09:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32C94S7p099592; Sun, 12 Mar 2023 09:04:28 GMT (envelope-from git) Date: Sun, 12 Mar 2023 09:04:28 GMT Message-Id: <202303120904.32C94S7p099592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: baf1e9713969 - stable/13 - hostid: Generate random UUID by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: baf1e9713969fccdaf7481e3568ca89b7237dafd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=baf1e9713969fccdaf7481e3568ca89b7237dafd commit baf1e9713969fccdaf7481e3568ca89b7237dafd Author: Tijl Coosemans AuthorDate: 2023-03-09 09:02:45 +0000 Commit: Tijl Coosemans CommitDate: 2023-03-12 08:59:58 +0000 hostid: Generate random UUID by default This way MAC addresses are no longer exposed. Discussed with: bapt MFC after: 3 days (cherry picked from commit 862aab6281a5e6b5dad89761ac17ca2a0e83ab32) --- libexec/rc/rc.conf | 1 + libexec/rc/rc.d/hostid | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 6b3aacacda61..23f9406da017 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -134,6 +134,7 @@ extra_netfs_types="NO" # List of network extra filesystem types for delayed hostname="" # Set this! hostid_enable="YES" # Set host UUID. hostid_file="/etc/hostid" # File with hostuuid. +hostid_uuidgen_flags="-r" # Flags to uuidgen. nisdomainname="NO" # Set to NIS domain if using NIS (or NO). dhclient_program="/sbin/dhclient" # Path to dhcp client program. dhclient_flags="" # Extra flags to pass to dhcp client. diff --git a/libexec/rc/rc.d/hostid b/libexec/rc/rc.d/hostid index 01697a1d1e11..7368681e8a91 100755 --- a/libexec/rc/rc.d/hostid +++ b/libexec/rc/rc.d/hostid @@ -117,7 +117,7 @@ hostid_generate() warn "hostid: unable to figure out a UUID from DMI data, generating a new one" sleep 2 # If not found, fall back to software-generated UUID. - uuid=`uuidgen` + uuid=`uuidgen ${hostid_uuidgen_flags}` fi hostid_set $uuid } From nobody Sun Mar 12 09:04:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZDPV1sSjz3xcVH; Sun, 12 Mar 2023 09:04: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 4PZDPV0nhqz4FWc; Sun, 12 Mar 2023 09:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678611870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEdqix6VtAmYo1ee4r6b5gCkqCVOSv62PuDD3tn0HEM=; b=usIIZ1EO0mAajoqvtRoqU3rHkWvMLn9p1nNAHcrtV5LUbjZQI3HqEvkPlO99A6Ym9GwZTk IwTR5a/028eVdeV4GhXSGQ4+sYeGYoIH2DiBTaTiGFxeU58MIsr84CJpDoFL2ZbyZiRQMf cS2cMCgm9l3ZytuSNtE//Vo2FPYH/84l4nwnUkFAI/R55Raf5126Vf1LKEpW6vqPGZfxSf 8Pp6pdau7KmNVTWyaFUqyehH5dUGMmaE0x+g1gBuE7ZOZb7A5c+huToHgtLEcTCsgHWtCW WKtUj+77qCh+3X5DypcOmQVv8G6+xiYXRRytT8Fm4NVp+aQ89dft8qkxuXzRSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678611870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEdqix6VtAmYo1ee4r6b5gCkqCVOSv62PuDD3tn0HEM=; b=YpI+NJglbXrlQitnWhxnTL12QqSRq6bd2NeTAKv/9vs5iN2Nc/TesnPP/R8YgzWP1Y2m79 Dhrr8YHJjL5Ttf052PT088eZvQo2fmdQstWIKotCBdxrVTvskMvBpx9dSxfw2K8OBNpxV9 GpXMPhPzU9Ck0oAC+n4e4PQIxJPhHUPsK72lYzVsp5aJwH467jkZnXTox7o6q6SzojTeaE lOBAqTLaASkG3lPXaUg0NHzED4vQpmdaHkZo75LbXMqlxkmGdgo5PWY9mrQ73C7w8uJv1F LnunI1XlCAZmrtNE3SR4htMYL6lUvce26A9ZT+mFaCdRTrlhF2By/QKxPoBFgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678611870; a=rsa-sha256; cv=none; b=q2OuJTETKz43QuIu8DYjhRkZ4Gln7Cl1kgtSXW+ryIb/AcYyfO8V9K5mUeIm48UDg9tRem qhPcLvmq7+vMvX0ZsqrXJebMTaoyA1zCRUOzdyjRCYQCQChhrs9hTXYLhpTEKE2IY5oaUt 8ARL/dFGAf4VsaYAoturtNJI2SNOWoAtJbiTO2RqMqT6sZJV9M5Sh3x5OvIuSPi6c5CBvd ybViKoT4S/MV+jr2Vb8rlI4erphgWRWUcIYRQMhhLpVtz11Ni7e9BUEvkI+pski1nRVXbR MrbKDhGVAbMGijWDA7stoQlMog74G6V89HNvUsTNGxYSKHJjL7XTP/eJxAtwzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZDPT6jlZz14yc; Sun, 12 Mar 2023 09:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32C94TGN099613; Sun, 12 Mar 2023 09:04:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32C94T3T099612; Sun, 12 Mar 2023 09:04:29 GMT (envelope-from git) Date: Sun, 12 Mar 2023 09:04:29 GMT Message-Id: <202303120904.32C94T3T099612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: d6852eed98ed - stable/13 - rc.d: Generate machine-id from hostid_save List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d6852eed98ed32ad51120a22aa1ebdf0601917b3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=d6852eed98ed32ad51120a22aa1ebdf0601917b3 commit d6852eed98ed32ad51120a22aa1ebdf0601917b3 Author: Tijl Coosemans AuthorDate: 2023-02-15 20:09:51 +0000 Commit: Tijl Coosemans CommitDate: 2023-03-12 08:59:58 +0000 rc.d: Generate machine-id from hostid_save rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid. Store the same UUID, without hyphens, in /etc/machine-id. The hypĥens are removed with a shell function because hostid_save runs before file systems are mounted so other tools may not be available yet. This eliminates some duplication between hostid and machine-id and for virtual machines machine-id now contains the UUID configured in the hypervisor like it does on Linux. Reviewed by: delphij Discussed with: bapt MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38811 (cherry picked from commit ecad3f5c4d922f93ceba455f8bff1c54e1ed4174) --- ObsoleteFiles.inc | 3 +++ etc/Makefile | 2 -- libexec/rc/rc.conf | 4 +--- libexec/rc/rc.d/Makefile | 1 - libexec/rc/rc.d/hostid_save | 28 ++++++++++++++++++++-------- libexec/rc/rc.d/machine_id | 34 ---------------------------------- sys/sys/param.h | 2 +- 7 files changed, 25 insertions(+), 49 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 37f07a708986..e6b2140af29d 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -52,6 +52,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20230308: machine-id merged into hostid_save +OLD_FILES+=etc/rc.d/machine-id + # 20230203: loader help files renamed OLD_FILES+=boot/loader.help diff --git a/etc/Makefile b/etc/Makefile index 49a7a12a41b5..104e40b6e345 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -58,8 +58,6 @@ distribution: ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt ${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \ ${DESTDIR}/etc/os-release - ${INSTALL_SYMLINK} -T "package=runtime" ../var/db/machine-id \ - ${DESTDIR}/etc/machine-id .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ ${INSTALL_SYMLINK} -T "package=unbound" \ diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 23f9406da017..af7b6ff6302e 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -135,6 +135,7 @@ hostname="" # Set this! hostid_enable="YES" # Set host UUID. hostid_file="/etc/hostid" # File with hostuuid. hostid_uuidgen_flags="-r" # Flags to uuidgen. +machine_id_file="/etc/machine-id" # File with machine-id. nisdomainname="NO" # Set to NIS domain if using NIS (or NO). dhclient_program="/sbin/dhclient" # Path to dhcp client program. dhclient_flags="" # Extra flags to pass to dhcp client. @@ -703,9 +704,6 @@ harvest_mask="511" # Entropy device harvests all but the very invasive sources. osrelease_enable="YES" # Update /var/run/os-release on boot (or NO). osrelease_file="/var/run/os-release" # File to update for os-release. osrelease_perms="444" # Default permission for os-release file. -machine_id_enable="YES" # Create /var/db/machine-id on boot if missing (or NO). -machine_id_file="/var/db/machine-id" # File to update for machine-id. -machine_id_perms="444" # Default permissions for machine-id file. dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot watchdogd_enable="NO" # Start the software watchdog daemon watchdogd_flags="" # Flags to watchdogd (if enabled) diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 188eae2e2f5b..40a1a212ca3a 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -51,7 +51,6 @@ CONFS= DAEMON \ local \ localpkg \ lockd \ - machine_id \ mixer \ motd \ mountcritlocal \ diff --git a/libexec/rc/rc.d/hostid_save b/libexec/rc/rc.d/hostid_save index f535ea2596f2..f737ed7f74cf 100755 --- a/libexec/rc/rc.d/hostid_save +++ b/libexec/rc/rc.d/hostid_save @@ -15,20 +15,32 @@ start_cmd="hostid_save" stop_cmd=":" rcvar="hostid_enable" +hostid_machine_id() +{ + local IFS + + IFS=- + set -- ${current_hostid} + IFS= + current_machine_id=$* +} + hostid_save() { current_hostid=`$SYSCTL_N kern.hostuuid` - if [ -r ${hostid_file} ]; then - read saved_hostid < ${hostid_file} - if [ ${saved_hostid} = ${current_hostid} ]; then - exit 0 - fi + read saved_hostid 2>/dev/null < ${hostid_file} + if [ "${saved_hostid}" != "${current_hostid}" ]; then + echo "${current_hostid}" > ${hostid_file} || + warn "could not store hostuuid in ${hostid_file}." fi - echo ${current_hostid} > ${hostid_file} - if [ $? -ne 0 ]; then - warn "could not store hostuuid in ${hostid_file}." + hostid_machine_id + + read saved_machine_id 2>/dev/null < ${machine_id_file} + if [ "${saved_machine_id}" != "${current_machine_id}" ]; then + echo "${current_machine_id}" > ${machine_id_file} || + warn "could not store hostuuid in ${machine_id_file}." fi } diff --git a/libexec/rc/rc.d/machine_id b/libexec/rc/rc.d/machine_id deleted file mode 100644 index 8bf3e41d0603..000000000000 --- a/libexec/rc/rc.d/machine_id +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# PROVIDE: machine_id -# REQUIRE: mountcritremote FILESYSTEMS -# BEFORE: LOGIN - -. /etc/rc.subr - -: ${machine_id_file:=/var/db/machine-id} -: ${machine_id_perms:=444} -name="machine_id" -desc="Update ${machine_id_file}" -rcvar="machine_id_enable" -start_cmd="machine_id_start" -stop_cmd=":" - - -machine_id_start() -{ - if [ ! -f ${machine_id_file} ] ; then - startmsg -n "Creating ${machine_id_file} " - t=$(mktemp -t machine-id) - /bin/uuidgen -r -c -o $t - install -C -o root -g wheel -m ${machine_id_perms} "$t" "${machine_id_file}" - rm -f "$t" - startmsg 'done.' - fi -} - -load_rc_config $name -run_rc_command "$1" diff --git a/sys/sys/param.h b/sys/sys/param.h index 12a407dd0464..564fbfd9c70d 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1302503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1302504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Sun Mar 12 13:59:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZLxf0wZ2z3xtwX; Sun, 12 Mar 2023 13:59:18 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZLxc3Nf4z3MYs; Sun, 12 Mar 2023 13:59:16 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of dchagin@heemeyer.club has no SPF policy when checking 195.93.173.158) smtp.mailfrom=dchagin@heemeyer.club; dmarc=none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.1/8.16.1) with ESMTP id 32CDx8b8003002; Sun, 12 Mar 2023 16:59:08 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 32CDx8bK003001; Sun, 12 Mar 2023 16:59:08 +0300 (MSK) (envelope-from dchagin) Date: Sun, 12 Mar 2023 16:59:08 +0300 From: Dmitry Chagin To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5b5b7e2ca2fa - main - vfs: always retain path buffer after lookup Message-ID: References: <202209170911.28H9Bf3W085276@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202209170911.28H9Bf3W085276@gitrepo.freebsd.org> X-Spamd-Result: default: False [-1.78 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.980]; FORGED_SENDER(0.30)[dchagin@freebsd.org,dchagin@heemeyer.club]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; R_DKIM_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[dchagin]; ARC_NA(0.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[dchagin@freebsd.org,dchagin@heemeyer.club] X-Rspamd-Queue-Id: 4PZLxc3Nf4z3MYs X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N On Sat, Sep 17, 2022 at 09:11:41AM +0000, Mateusz Guzik wrote: > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179 > > commit 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179 > Author: Mateusz Guzik > AuthorDate: 2022-09-17 09:10:38 +0000 > Commit: Mateusz Guzik > CommitDate: 2022-09-17 09:10:38 +0000 > > vfs: always retain path buffer after lookup > > This removes some of the complexity needed to maintain HASBUF and > allows for removing injecting SAVENAME by filesystems. > > Reviewed by: kib (previous version) > Differential Revision: https://reviews.freebsd.org/D36542 > --- > .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 23 +++- btw, by this change the usage of cn_origflags of struct componentname is retired, may be we should remove it? From nobody Sun Mar 12 15:52:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZPRk3Jfmz3y2RB; Sun, 12 Mar 2023 15:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZPRk2pLRz3nSx; Sun, 12 Mar 2023 15:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678636322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h6N0/bUFJGs1ekZD8ULFhLi9t5vwnw0NBh8hFcNNsOQ=; b=g2Abaz/xkbREK22qmCtstOSIi+PEfianaikN/r27yhIv4DNWuRJI7r/Mf+PMt1RswJ2IMs NKHjoeF2AqxIj5tHb4ib1wCCDdVZYSdtW9HKoLdMIYkVgiHk3hJNIlCFQgjnbTMi1UmqZC 3Zv8/GlS3lZwHbNWtTIox5fKqOlaxhWXvtORk2MAVVyux/4fr4f2FiGQHrpECsrHBf+Boq FzJwEcwsqqLC3yyeNcBouADESi2QNVsTCoVQXApEPyWwcD72pEOJpN5fw/yRr4xY3ZKvtY JDWp93xkLkBx/488cDle8Pr53q8mShjpyKDkC85VC21425zwlUyOpR5MM4hlCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678636322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h6N0/bUFJGs1ekZD8ULFhLi9t5vwnw0NBh8hFcNNsOQ=; b=jO72oJJvCjct3BB61jC+CZWUEZFjdurnagB41bJfJfO0gQ1OPpTBcxn+nDOR71zoNtI53a 3bdaOgMh3oBx8GdaX8mRy7JTxRjkaPZAz2Lz6O9e2SU8tn5uiphkcWAprQsIAthZw5rcoQ TDROsPz9AiBGLq5UywjvuLVbFE2d9/T/PqxL2HmE3R3l+EX+6NVH/WiKeNsIitQ1gj2kb7 1V7/pSojlzN1kyTd7K0jz7CBjKLRUws0bFmnWpOkpYgRlKdhRqfTGQNSl03OC9tb15gxIS oY3dAtegArzRAkgSLxtIdBVkvDkVAShFh1f5FTOXSGTWazLr68MmFVjzjykuaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678636322; a=rsa-sha256; cv=none; b=OfGSls4DSmxE32gBBU0J9eblfUiJ67aDqdRXoy754+yzZ2O/T5yt/n+ZfEku8Nc2uE5lZy pgiLKzNO5vUPASVz5/DU3CEDgqvw5F3h7TmFCayIZw/GodwJe3xI7CMbk+g7EqryDvBlVD ImCfnsuHrkECyWn02xdP/WZ36u7vBpRUbEV1851DIXqGDk+6xHlHdGMH4WCWwbnsI+Jr1E zkMe0UlKYc9zy5XcW7a6OZgsyNm17Ec2y6ht3QAvuYtnaC0MMUfFHpXtoGNdP6XzuzwJVG FUV9TR3uZZQxJt9lSjGmCkffghSk7ivgN6MLIoeXqg5z88S4vVm6C+VvABu3FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZPRk1YJPzHfC; Sun, 12 Mar 2023 15:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CFq1N0071828; Sun, 12 Mar 2023 15:52:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CFq1X5071827; Sun, 12 Mar 2023 15:52:01 GMT (envelope-from git) Date: Sun, 12 Mar 2023 15:52:01 GMT Message-Id: <202303121552.32CFq1X5071827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 6f0b2a235a13 - main - powerpc/pmap: Add pmap_sync_icache() for radix pmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f0b2a235a133a381634ba9a7f5f477c64db9873 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=6f0b2a235a133a381634ba9a7f5f477c64db9873 commit 6f0b2a235a133a381634ba9a7f5f477c64db9873 Author: Justin Hibbits AuthorDate: 2023-03-12 15:46:57 +0000 Commit: Justin Hibbits CommitDate: 2023-03-12 15:51:42 +0000 powerpc/pmap: Add pmap_sync_icache() for radix pmap DTrace pid provider writes to user space to set breakpoints. Failing to sync the icache can lead to SIGTRAP. Radix pmap is the only one missing a pmap_sync_icache() method, so the pid provider would only potentially crash a process on a POWER9 or later system. --- sys/powerpc/aim/mmu_radix.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 6e2203ccca45..1e7661ba8068 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -464,6 +464,7 @@ void mmu_radix_remove(pmap_t, vm_offset_t, vm_offset_t); void mmu_radix_remove_all(vm_page_t); void mmu_radix_remove_pages(pmap_t); void mmu_radix_remove_write(vm_page_t); +void mmu_radix_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz); void mmu_radix_unwire(pmap_t, vm_offset_t, vm_offset_t); void mmu_radix_zero_page(vm_page_t); void mmu_radix_zero_page_area(vm_page_t, int, int); @@ -542,6 +543,7 @@ static struct pmap_funcs mmu_radix_methods = { .remove = mmu_radix_remove, .remove_all = mmu_radix_remove_all, .remove_write = mmu_radix_remove_write, + .sync_icache = mmu_radix_sync_icache, .unwire = mmu_radix_unwire, .zero_page = mmu_radix_zero_page, .zero_page_area = mmu_radix_zero_page_area, @@ -5921,6 +5923,25 @@ mmu_radix_unmapdev(void *p, vm_size_t size) } } +void +mmu_radix_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ + vm_paddr_t pa = 0; + int sync_sz; + + while (sz > 0) { + pa = pmap_extract(pm, va); + sync_sz = PAGE_SIZE - (va & PAGE_MASK); + sync_sz = min(sync_sz, sz); + if (pa != 0) { + pa += (va & PAGE_MASK); + __syncicache((void *)PHYS_TO_DMAP(pa), sync_sz); + } + va += sync_sz; + sz -= sync_sz; + } +} + static __inline void pmap_pte_attr(pt_entry_t *pte, uint64_t cache_bits, uint64_t mask) { From nobody Sun Mar 12 16:58:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZQw84YTdz3xLBR; Sun, 12 Mar 2023 16:58: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 4PZQw84Ks6z3wHR; Sun, 12 Mar 2023 16:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678640296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4i2yE0Mi4WXR+WBNmfJEeXXADYFzDfo9OHJORGjp0bI=; b=wMdWDjPoLrtVNQBRjwvklMLMvS5Xh4CLZklHWQEOLlQ+wBg2/U+Luf7IEoAvr/C6i1/8Iw wN1mzZkpAs1t7LYX/xt8jqnpxAcAnzoOF5/arMDun9LZ5WMDe8Hrgg2BDnctWromS1iF2c 9Nqnaj8X65X2u2uIuIhgQajSOWPd60CfdRra09DTNsy9gviEyi7gXtIEyt0cIQMChgs/lE V7BlHWp8yPArBxrbQTCcfOTXiEZYfDI9E4Z11oINXDUzDYhSZMhXsHJOMNN5VYSNUjPTZL fU9d/hkKtTU8I8Lc6Vht9IbELVCGvltXV0WWTzLOCS/V4bPj2ZHv+Glp6TINgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678640296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4i2yE0Mi4WXR+WBNmfJEeXXADYFzDfo9OHJORGjp0bI=; b=Lf0p2T1FiIDs9dUfBl18UVKA2dhyHEt8g/eolSc8n5IfgWW5yKVrNOwiENv3CgbtdtKGNu G331V+cTOgaTukd0SoeWZCkvuZHspcdvTh+Pnm76F48cDePcf44GKBo0ThzsIwO9k/iUx9 ehKhrBDuJVLKJZt8GDGS896uJPUrcHrdweIWi/iqppOzBHIRkJGj6+D8CnODtlmCKMC3W0 oQdj/fsje1Dt4TYKjINdfi5XmSbcOg/A/IeJ6S6d9vP3a7roIeQ72EgXCVcIzQbCbl6vry WGaj8bdvEJAvgndltzfQDvG8F8dSthwMFdKhefouFRdxB+k1Kg1mjeiiuwaY3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678640296; a=rsa-sha256; cv=none; b=PjcDvTc+rIkz2n0MQsagF62g72amkjkzxjL3BXaHjpDeIoNknrDCNN6GLdEEy9cgb3uC0e iCnngZJQVKc3zjogguHDWHaE1Lre9eti3aiufx34f5i8cITwd+7GZkKe7FwYxNPixWYTNg MutY0xs44cXXmybe4aKrA1/NeBHvZnFsj/tTjiu+YOTfo1oQveUSeEEWd/3f9SMcKbvegI v7STsE5rn0B+7xf4WJ+hlUw/8JZe4rl3COd9K4GC1Ob7bt/+GVXfNHpvv1cpmKa+8SMV9W zkDG43axsVnQqVgd7QaCnB3eDwPTmMyZwjbBw5+X0S67Q3X+AgyZdHD0pmW0KQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZQw83Ng2zJwv; Sun, 12 Mar 2023 16:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CGwGCR072791; Sun, 12 Mar 2023 16:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CGwGTe072790; Sun, 12 Mar 2023 16:58:16 GMT (envelope-from git) Date: Sun, 12 Mar 2023 16:58:16 GMT Message-Id: <202303121658.32CGwGTe072790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 298a392ec318 - main - daemon: move variables into struct daemon_state List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 298a392ec31819c8440974eeb47dfed48568fd5e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=298a392ec31819c8440974eeb47dfed48568fd5e commit 298a392ec31819c8440974eeb47dfed48568fd5e Author: Ihor Antonov AuthorDate: 2023-03-12 16:07:34 +0000 Commit: Warner Losh CommitDate: 2023-03-12 16:57:41 +0000 daemon: move variables into struct daemon_state The fact that most of the daemon's state is stored on the stack of the main() makes it hard to split the logic smaller chunks. Which in turn leads to huge main func that does a a lot of things. struct log_params existed because some variables need to be passed into other functions together. This change renames struct log_params into daemon_state and moves the rest of the variables into it. This is a necessary preparation step for further refactroing. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/687 --- usr.sbin/daemon/daemon.c | 288 +++++++++++++++++++++++++---------------------- 1 file changed, 154 insertions(+), 134 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 3bbf092b500c..b215803cf3c6 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -59,14 +59,28 @@ __FBSDID("$FreeBSD$"); #define LBUF_SIZE 4096 -struct log_params { +struct daemon_state { + int pipe_fd[2]; + const char *child_pidfile; + const char *parent_pidfile; const char *output_filename; const char *syslog_tag; + const char *title; + const char *user; + struct pidfh *parent_pidfh; + struct pidfh *child_pidfh; + int keep_cur_workdir; + int restart_delay; + int stdmask; int syslog_priority; int syslog_facility; int keep_fds_open; int output_fd; + bool supervision_enabled; + bool child_eof; + bool restart_enabled; bool syslog_enabled; + bool log_reopen; }; static void restrict_process(const char *); @@ -74,13 +88,13 @@ static void handle_term(int); static void handle_chld(int); static void handle_hup(int); static int open_log(const char *); -static void reopen_log(struct log_params *); -static bool listen_child(int, struct log_params *); +static void reopen_log(struct daemon_state *); +static bool listen_child(int, struct daemon_state *); static int get_log_mapping(const char *, const CODE *); -static void open_pid_files(const char *, const char *, struct pidfh **, - struct pidfh **); -static void do_output(const unsigned char *, size_t, struct log_params *); +static void open_pid_files(struct daemon_state *); +static void do_output(const unsigned char *, size_t, struct daemon_state *); static void daemon_sleep(time_t, long); +static void daemon_state_init(struct daemon_state *); static volatile sig_atomic_t terminate = 0; static volatile sig_atomic_t child_gone = 0; @@ -144,36 +158,15 @@ usage(int exitcode) int main(int argc, char *argv[]) { - bool supervision_enabled = false; - bool log_reopen = false; - bool child_eof = false; - bool restart_enabled = false; char *p = NULL; - const char *child_pidfile = NULL; - const char *parent_pidfile = NULL; - const char *title = NULL; - const char *user = NULL; int ch = 0; - int keep_cur_workdir = 1; - int pipe_fd[2] = { -1, -1 }; - int restart_delay = 1; - int stdmask = STDOUT_FILENO | STDERR_FILENO; - struct log_params logparams = { - .syslog_enabled = false, - .syslog_priority = LOG_NOTICE, - .syslog_tag = "daemon", - .syslog_facility = LOG_DAEMON, - .keep_fds_open = 1, - .output_fd = -1, - .output_filename = NULL - }; - struct pidfh *parent_pidfh = NULL; - struct pidfh *child_pidfh = NULL; + struct daemon_state state; sigset_t mask_orig; sigset_t mask_read; sigset_t mask_term; sigset_t mask_susp; + daemon_state_init(&state); sigemptyset(&mask_susp); sigemptyset(&mask_read); sigemptyset(&mask_term); @@ -199,81 +192,81 @@ main(int argc, char *argv[]) while ((ch = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (ch) { case 'c': - keep_cur_workdir = 0; + state.keep_cur_workdir = 0; break; case 'f': - logparams.keep_fds_open = 0; + state.keep_fds_open = 0; break; case 'H': - log_reopen = true; + state.log_reopen = true; break; case 'l': - logparams.syslog_facility = get_log_mapping(optarg, + state.syslog_facility = get_log_mapping(optarg, facilitynames); - if (logparams.syslog_facility == -1) { + if (state.syslog_facility == -1) { errx(5, "unrecognized syslog facility"); } - logparams.syslog_enabled = true; - supervision_enabled = true; + state.syslog_enabled = true; + state.supervision_enabled = true; break; case 'm': - stdmask = strtol(optarg, &p, 10); - if (p == optarg || stdmask < 0 || stdmask > 3) { + state.stdmask = strtol(optarg, &p, 10); + if (p == optarg || state.stdmask < 0 || state.stdmask > 3) { errx(6, "unrecognized listening mask"); } break; case 'o': - logparams.output_filename = optarg; + state.output_filename = optarg; /* * TODO: setting output filename doesn't have to turn * the supervision mode on. For non-supervised mode * daemon could open the specified file and set it's * descriptor as both stderr and stout before execve() */ - supervision_enabled = true; + state.supervision_enabled = true; break; case 'p': - child_pidfile = optarg; - supervision_enabled = true; + state.child_pidfile = optarg; + state.supervision_enabled = true; break; case 'P': - parent_pidfile = optarg; - supervision_enabled = true; + state.parent_pidfile = optarg; + state.supervision_enabled = true; break; case 'r': - restart_enabled = true; - supervision_enabled = true; + state.restart_enabled = true; + state.supervision_enabled = true; break; case 'R': - restart_enabled = true; - restart_delay = strtol(optarg, &p, 0); - if (p == optarg || restart_delay < 1) { + state.restart_enabled = true; + state.restart_delay = strtol(optarg, &p, 0); + if (p == optarg || state.restart_delay < 1) { errx(6, "invalid restart delay"); } break; case 's': - logparams.syslog_priority = get_log_mapping(optarg, + state.syslog_priority = get_log_mapping(optarg, prioritynames); - if (logparams.syslog_priority == -1) { + if (state.syslog_priority == -1) { errx(4, "unrecognized syslog priority"); } - logparams.syslog_enabled = true; - supervision_enabled = true; + state.syslog_enabled = true; + state.supervision_enabled = true; break; case 'S': - logparams.syslog_enabled = true; - supervision_enabled = true; + state.syslog_enabled = true; + state.supervision_enabled = true; break; case 't': - title = optarg; + state.title = optarg; break; case 'T': - logparams.syslog_tag = optarg; - logparams.syslog_enabled = true; - supervision_enabled = true; + state.syslog_tag = optarg; + state.syslog_enabled = true; + state.supervision_enabled = true; break; case 'u': - user = optarg; + state.user = optarg; break; case 'h': usage(0); @@ -289,35 +282,35 @@ main(int argc, char *argv[]) usage(1); } - if (!title) { - title = argv[0]; + if (!state.title) { + state.title = argv[0]; } - if (logparams.output_filename) { - logparams.output_fd = open_log(logparams.output_filename); - if (logparams.output_fd == -1) { + if (state.output_filename) { + state.output_fd = open_log(state.output_filename); + if (state.output_fd == -1) { err(7, "open"); } } - if (logparams.syslog_enabled) { - openlog(logparams.syslog_tag, LOG_PID | LOG_NDELAY, - logparams.syslog_facility); + if (state.syslog_enabled) { + openlog(state.syslog_tag, LOG_PID | LOG_NDELAY, + state.syslog_facility); } /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently */ - open_pid_files(child_pidfile, parent_pidfile, &child_pidfh, &parent_pidfh); - if (daemon(keep_cur_workdir, logparams.keep_fds_open) == -1) { + open_pid_files(&state); + if (daemon(state.keep_cur_workdir, state.keep_fds_open) == -1) { warn("daemon"); goto exit; } /* Write out parent pidfile if needed. */ - pidfile_write(parent_pidfh); + pidfile_write(state.parent_pidfh); - if (supervision_enabled) { + if (state.supervision_enabled) { struct sigaction act_term = { 0 }; struct sigaction act_chld = { 0 }; struct sigaction act_hup = { 0 }; @@ -364,13 +357,13 @@ main(int argc, char *argv[]) * not have superuser privileges. */ (void)madvise(NULL, 0, MADV_PROTECT); - if (log_reopen && logparams.output_fd >= 0 && + if (state.log_reopen && state.output_fd >= 0 && sigaction(SIGHUP, &act_hup, NULL) == -1) { warn("sigaction"); goto exit; } restart: - if (pipe(pipe_fd)) { + if (pipe(state.pipe_fd)) { err(1, "pipe"); } /* @@ -389,33 +382,33 @@ restart: /* fork succeeded, this is child's branch or supervision is disabled */ if (pid == 0) { - pidfile_write(child_pidfh); + pidfile_write(state.child_pidfh); - if (user != NULL) { - restrict_process(user); + if (state.user != NULL) { + restrict_process(state.user); } /* * In supervision mode, the child gets the original sigmask, * and dup'd pipes. */ - if (supervision_enabled) { - close(pipe_fd[0]); + if (state.supervision_enabled) { + close(state.pipe_fd[0]); if (sigprocmask(SIG_SETMASK, &mask_orig, NULL)) { err(1, "sigprogmask"); } - if (stdmask & STDERR_FILENO) { - if (dup2(pipe_fd[1], STDERR_FILENO) == -1) { + if (state.stdmask & STDERR_FILENO) { + if (dup2(state.pipe_fd[1], STDERR_FILENO) == -1) { err(1, "dup2"); } } - if (stdmask & STDOUT_FILENO) { - if (dup2(pipe_fd[1], STDOUT_FILENO) == -1) { + if (state.stdmask & STDOUT_FILENO) { + if (dup2(state.pipe_fd[1], STDOUT_FILENO) == -1) { err(1, "dup2"); } } - if (pipe_fd[1] != STDERR_FILENO && - pipe_fd[1] != STDOUT_FILENO) { - close(pipe_fd[1]); + if (state.pipe_fd[1] != STDERR_FILENO && + state.pipe_fd[1] != STDOUT_FILENO) { + close(state.pipe_fd[1]); } } execvp(argv[0], argv); @@ -434,10 +427,10 @@ restart: warn("sigprocmask"); goto exit; } - close(pipe_fd[1]); - pipe_fd[1] = -1; + close(state.pipe_fd[1]); + state.pipe_fd[1] = -1; - setproctitle("%s[%d]", title, (int)pid); + setproctitle("%s[%d]", state.title, (int)pid); /* * As we have closed the write end of pipe for parent process, * we might detect the child's exit by reading EOF. The child @@ -460,7 +453,7 @@ restart: * to depart. To handle the second option, a different * approach would be needed (procctl()?) */ - if (child_gone && child_eof) { + if (child_gone && state.child_eof) { break; } @@ -468,7 +461,7 @@ restart: goto exit; } - if (child_eof) { + if (state.child_eof) { if (sigprocmask(SIG_BLOCK, &mask_susp, NULL)) { warn("sigprocmask"); goto exit; @@ -488,7 +481,7 @@ restart: goto exit; } - child_eof = !listen_child(pipe_fd[0], &logparams); + state.child_eof = !listen_child(state.pipe_fd[0], &state); if (sigprocmask(SIG_UNBLOCK, &mask_read, NULL)) { warn("sigprocmask"); @@ -496,27 +489,27 @@ restart: } } - if (restart_enabled && !terminate) { - daemon_sleep(restart_delay, 0); + if (state.restart_enabled && !terminate) { + daemon_sleep(state.restart_delay, 0); } if (sigprocmask(SIG_BLOCK, &mask_term, NULL)) { warn("sigprocmask"); goto exit; } - if (restart_enabled && !terminate) { - close(pipe_fd[0]); - pipe_fd[0] = -1; + if (state.restart_enabled && !terminate) { + close(state.pipe_fd[0]); + state.pipe_fd[0] = -1; goto restart; } exit: - close(logparams.output_fd); - close(pipe_fd[0]); - close(pipe_fd[1]); - if (logparams.syslog_enabled) { + close(state.output_fd); + close(state.pipe_fd[0]); + close(state.pipe_fd[1]); + if (state.syslog_enabled) { closelog(); } - pidfile_remove(child_pidfh); - pidfile_remove(parent_pidfh); + pidfile_remove(state.child_pidfh); + pidfile_remove(state.parent_pidfh); exit(1); /* If daemon(3) succeeded exit status does not matter. */ } @@ -533,34 +526,33 @@ daemon_sleep(time_t secs, long nsecs) } static void -open_pid_files(const char *pidfile, const char *ppidfile, - struct pidfh **pfh, struct pidfh **ppfh) +open_pid_files(struct daemon_state *state) { pid_t fpid; int serrno; - if (pidfile) { - *pfh = pidfile_open(pidfile, 0600, &fpid); - if (*pfh == NULL) { + if (state->child_pidfile) { + state->child_pidfh = pidfile_open(state->child_pidfile, 0600, &fpid); + if (state->child_pidfh == NULL) { if (errno == EEXIST) { errx(3, "process already running, pid: %d", fpid); } - err(2, "pidfile ``%s''", pidfile); + err(2, "pidfile ``%s''", state->child_pidfile); } } /* Do the same for the actual daemon process. */ - if (ppidfile) { - *ppfh = pidfile_open(ppidfile, 0600, &fpid); - if (*ppfh == NULL) { + if (state->parent_pidfile) { + state->parent_pidfh= pidfile_open(state->parent_pidfile, 0600, &fpid); + if (state->parent_pidfh == NULL) { serrno = errno; - pidfile_remove(*pfh); + pidfile_remove(state->child_pidfh); errno = serrno; if (errno == EEXIST) { errx(3, "process already running, pid: %d", fpid); } - err(2, "ppidfile ``%s''", ppidfile); + err(2, "ppidfile ``%s''", state->parent_pidfile); } } } @@ -603,17 +595,17 @@ restrict_process(const char *user) * continue reading. */ static bool -listen_child(int fd, struct log_params *logpar) +listen_child(int fd, struct daemon_state *state) { static unsigned char buf[LBUF_SIZE]; static size_t bytes_read = 0; int rv; - assert(logpar); + assert(state); assert(bytes_read < LBUF_SIZE - 1); if (do_log_reopen) { - reopen_log(logpar); + reopen_log(state); } rv = read(fd, buf + bytes_read, LBUF_SIZE - bytes_read - 1); if (rv > 0) { @@ -630,7 +622,7 @@ listen_child(int fd, struct log_params *logpar) while ((cp = memchr(buf, '\n', bytes_read)) != NULL) { size_t bytes_line = cp - buf + 1; assert(bytes_line <= bytes_read); - do_output(buf, bytes_line, logpar); + do_output(buf, bytes_line, state); bytes_read -= bytes_line; memmove(buf, cp + 1, bytes_read); } @@ -638,7 +630,7 @@ listen_child(int fd, struct log_params *logpar) if (bytes_read < LBUF_SIZE - 1) { return true; } - do_output(buf, bytes_read, logpar); + do_output(buf, bytes_read, state); bytes_read = 0; return true; } else if (rv == -1) { @@ -652,7 +644,7 @@ listen_child(int fd, struct log_params *logpar) } /* Upon EOF, we have to flush what's left of the buffer. */ if (bytes_read > 0) { - do_output(buf, bytes_read, logpar); + do_output(buf, bytes_read, state); bytes_read = 0; } return false; @@ -664,24 +656,24 @@ listen_child(int fd, struct log_params *logpar) * everything back to parent's stdout. */ static void -do_output(const unsigned char *buf, size_t len, struct log_params *logpar) +do_output(const unsigned char *buf, size_t len, struct daemon_state *state) { assert(len <= LBUF_SIZE); - assert(logpar); + assert(state); if (len < 1) { return; } - if (logpar->syslog_enabled) { - syslog(logpar->syslog_priority, "%.*s", (int)len, buf); + if (state->syslog_enabled) { + syslog(state->syslog_priority, "%.*s", (int)len, buf); } - if (logpar->output_fd != -1) { - if (write(logpar->output_fd, buf, len) == -1) + if (state->output_fd != -1) { + if (write(state->output_fd, buf, len) == -1) warn("write"); } - if (logpar->keep_fds_open && - !logpar->syslog_enabled && - logpar->output_fd == -1) { + if (state->keep_fds_open && + !state->syslog_enabled && + state->output_fd == -1) { printf("%.*s", (int)len, buf); } } @@ -730,15 +722,43 @@ open_log(const char *outfn) } static void -reopen_log(struct log_params *logparams) +reopen_log(struct daemon_state *state) { int outfd; do_log_reopen = 0; - outfd = open_log(logparams->output_filename); - if (logparams->output_fd >= 0) { - close(logparams->output_fd); + outfd = open_log(state->output_filename); + if (state->output_fd >= 0) { + close(state->output_fd); } - logparams->output_fd = outfd; + state->output_fd = outfd; } +static void +daemon_state_init(struct daemon_state *state) +{ + memset(state, 0, sizeof(struct daemon_state)); + *state = (struct daemon_state) { + .pipe_fd = { -1, -1 }, + .parent_pidfh = NULL, + .child_pidfh = NULL, + .child_pidfile = NULL, + .parent_pidfile = NULL, + .title = NULL, + .user = NULL, + .supervision_enabled = false, + .child_eof = false, + .restart_enabled = false, + .keep_cur_workdir = 1, + .restart_delay = 1, + .stdmask = STDOUT_FILENO | STDERR_FILENO, + .syslog_enabled = false, + .log_reopen = false, + .syslog_priority = LOG_NOTICE, + .syslog_tag = "daemon", + .syslog_facility = LOG_DAEMON, + .keep_fds_open = 1, + .output_fd = -1, + .output_filename = NULL, + }; +} From nobody Sun Mar 12 17:50:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZS4M0hjMz3xQ5v; Sun, 12 Mar 2023 17:50:27 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZS4L5pZLz41SM; Sun, 12 Mar 2023 17:50:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-17671fb717cso11549149fac.8; Sun, 12 Mar 2023 10:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678643425; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3tArA8qF6tn4m4wq1u1iSa4oE4KzdK73FHao4/+4aU4=; b=icGyHfwvuGpm0ahGTiOCCVZF22j0ZkuQE2oVOjsONCh+lM7mdUy0yVmcXAW4RcI/up zmQTNQy+8YnntklwEyH39EWJp1c6yhGdTF6zjLtbZUskNO6ytT6w5LZoal+jydqPNhGf 0GaPtugR5TA8U9CVV73+svo1ckcVPKw6mB0bYkKfRk8Ww+Izu3+7jmhcifXzFipGTdbh NHxQcxWwvy4WisSJINPnZQgtf8wil4Fp1wtaTWcNDEgHsAOKe5le8emoChMpS7Go5lLz ReITLXtkp1021a76/WAAB94DMeqNtyAdGqvJExoxB4fDHiijEZhLshQz/kOJnMU25LSD uTwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678643425; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3tArA8qF6tn4m4wq1u1iSa4oE4KzdK73FHao4/+4aU4=; b=MiVAAlTD2QkVR1CZvXBAaXBIDobf+OTYj8WcnFSmDMN1mwjxiTr4o+t6mQuM+jgjYW fNOupTEuQptYMguKUOif3y5LGjPI6NVJNPd0ChhHu+chFhkTokyRyCripg58TXpfqAsL 2ChHRaDTBar1N5UH8EFl4AbqxpYZS+3XPRaBj/QW0WI1fHXdruANQwY0M2zO5Eqi67Zf u9J698lD371rGktulwzoLdwrbBYZuDzgG5a8CsV8AEJe74rLEgKbZrHQuoBrVjtq5ALH 1tlYUugT/jreJcBzrU2/MGIsWx5nGmHK4oWfjTuat+H9ul22MdVf1YtaBfxQTCayiBF6 0Ezg== X-Gm-Message-State: AO0yUKVixwJXEaehO4U/60QUT4Eb28liNruejKBq1tVCrVHT3KJ1Luzg y+46/D8G1ChkkYKwHJX0BqCu2sz1g7rccEvfBLl+fT/k X-Google-Smtp-Source: AK7set8sXhrW6jEkKRs5eavYwsUDh4SIRRKbrN1V8SaMOKn1bvl90Vm+eJhjflkuulPhWqLNb/lexmcVMBITzAqCPS4= X-Received: by 2002:a05:6871:460e:b0:177:a028:3678 with SMTP id nf14-20020a056871460e00b00177a0283678mr1133033oab.11.1678643425290; Sun, 12 Mar 2023 10:50:25 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Received: by 2002:a05:6802:31f:b0:4c2:d201:fe1f with HTTP; Sun, 12 Mar 2023 10:50:24 -0700 (PDT) In-Reply-To: References: <202209170911.28H9Bf3W085276@gitrepo.freebsd.org> From: Mateusz Guzik Date: Sun, 12 Mar 2023 18:50:24 +0100 Message-ID: Subject: Re: git: 5b5b7e2ca2fa - main - vfs: always retain path buffer after lookup To: Dmitry Chagin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4PZS4L5pZLz41SM X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N so it is. please do the honors :) On 3/12/23, Dmitry Chagin wrote: > On Sat, Sep 17, 2022 at 09:11:41AM +0000, Mateusz Guzik wrote: >> The branch main has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179 >> >> commit 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179 >> Author: Mateusz Guzik >> AuthorDate: 2022-09-17 09:10:38 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2022-09-17 09:10:38 +0000 >> >> vfs: always retain path buffer after lookup >> >> This removes some of the complexity needed to maintain HASBUF and >> allows for removing injecting SAVENAME by filesystems. >> >> Reviewed by: kib (previous version) >> Differential Revision: https://reviews.freebsd.org/D36542 >> --- >> .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 23 +++- > > > btw, by this change the usage of cn_origflags of struct componentname is > retired, may be we should remove it? > -- Mateusz Guzik From nobody Sun Mar 12 19:08:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZTnt6XKpz3xVL1; Sun, 12 Mar 2023 19:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZTnt5vMvz4DMq; Sun, 12 Mar 2023 19:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678648082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fyL3HzeYFZtDSEc8KvQeO9lW5gTxdDwN1a2xFybm5iM=; b=lcOgkbBwtDFkGE3GHFRBsDMzvLzk67Gj0KxlNvEaWVoSEqQ4UxX4uxMfra2AXtc1JT8U91 QGBSsWJ2iInrKDnBlSDviHbO6eRz6rao1ro+j62dyAXMOMdTfQgb9v76Dy47amhKzViJWX +pA9vcs4NnNra8e2GFgwKOjFJUc8in4eCXKmo4w/82LlnUf75GNdqcklbUweZdKDDt/D2M uWqy2g+7rrq8Z+U2K0IBlxCrCm3ojx0y3JwENToiBAWN2gV0lh9Hkast+oOpOMgaW4oaog eB/tFjNqQEYlwJ12QBzWSuPZtHMJ8dc5ZLlPacdPZZR2Ctrlf0h89KPuTEJ9ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678648082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fyL3HzeYFZtDSEc8KvQeO9lW5gTxdDwN1a2xFybm5iM=; b=cUEDLuGHVomAEmaA2Ob6FLu40P+4xAzjS1HUm4UKiTccpNcJ31pAlC/gNR8GuYQfHGTFau 7YIBfHl3LkTmj1dtfyopqQFcqynWnYV8zy2hi3KhoZd+YoudURL4sQa8PhVcotrgP7tjJH C2FfUa8Fo8ZB2p7Qft01K37T31qS3YJB3QwXL9p8OkgzLGTV8UiIF5fuky/M4m4rzx/8UW EBSPYcF/ewRvnnHPMaF3GiKG+xR6aj5VSGYj84TR/RsSV/Fum+/r5ns9hDfRtcy69QhJUk hIn3mrgcclP/1dYt/V4upso4AkKUTIG7gjn2fKNLVmvSG87fn2wWS5DbKO3Pag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678648082; a=rsa-sha256; cv=none; b=cLM8UoWin9rem0EGGg3SRfH/sAG9IEn5rPyGLN7AcmDREPFJhzw58hCE4Oo7IFJ0aFAc+O N+CgmkdoEzFhdmrtebObA9bfmUXUsZFuft0VbJtxcGYEny3LlDYCXqqKNADedG2SARh2PT m1lt4XxliUM8UE4dO6dKlFLXAgQar15zKNOJgrkEOjd3yvYhBpviTPFEIujhge2MPSo561 lEU1Y5PJgBAhEtx1DIeQ4JoqXdICU/58QdZt3QewjG/uGvQs3O4mpcf5gVzBz0OwL+Nzhm 4VpJPjiWEwXjH1J5pSxKo7p4euMbuC2TI3ObU3fvjxfLRgSQiJ1EXkn6VpGdzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZTnt4tRzzNK7; Sun, 12 Mar 2023 19:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CJ82X6086976; Sun, 12 Mar 2023 19:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CJ82KC086975; Sun, 12 Mar 2023 19:08:02 GMT (envelope-from git) Date: Sun, 12 Mar 2023 19:08:02 GMT Message-Id: <202303121908.32CJ82KC086975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 35c872422c8c - main - vfs: whack leftover cn_origflags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35c872422c8cfb93d645c2f892c80422d902b1bf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=35c872422c8cfb93d645c2f892c80422d902b1bf commit 35c872422c8cfb93d645c2f892c80422d902b1bf Author: Mateusz Guzik AuthorDate: 2023-03-12 19:06:46 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-12 19:06:46 +0000 vfs: whack leftover cn_origflags Unused since 5b5b7e2ca2fa9a24 ("vfs: always retain path buffer after lookup") Reported by: dchagin --- sys/sys/namei.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/sys/namei.h b/sys/sys/namei.h index fb709b8713d7..e12d79b19c6e 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -47,7 +47,6 @@ struct componentname { /* * Arguments to lookup. */ - u_int64_t cn_origflags; /* flags to namei */ u_int64_t cn_flags; /* flags to namei */ struct ucred *cn_cred; /* credentials */ enum nameiop cn_nameiop; /* namei operation */ From nobody Sun Mar 12 19:08:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZTpS56Lqz3xVmm; Sun, 12 Mar 2023 19:08:32 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZTpR2bRpz4DMT; Sun, 12 Mar 2023 19:08:31 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=RrPNjhqa; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::32e as permitted sender) smtp.mailfrom=mjguzik@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ot1-x32e.google.com with SMTP id q11-20020a056830440b00b00693c1a62101so5747432otv.0; Sun, 12 Mar 2023 12:08:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678648110; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=R5xcKPE2K4oVQPqYwiz9VO3/wK8BtSoG4Vu1WxAaBrE=; b=RrPNjhqase4j4B0MuD0TUDTEjC/gH+sTcoaXe+dtI64njK4YQ2n13u3gN6baMp+p74 0/YjAXcxBq43HCIs+RVpsvsSb0idR+iEPEeQA2vNT3WF7drYtElq3UpVB18pgwTtLJlq y8trT/8LxyiFD/2LkAbvz5913Zfiz9Qz72prkk8VhSgwp6UPUAMab2TJGfRFlMUaRk4R UJQnGGg/HrtKZwU/2NqDjzw8LoSU3kM9D671WpdO0f/TfvcWkHh5O6+LUi4plDDNyMp0 wagPQcS3+e2j42ijivWo9pAY9vnqjgB+KcGDIK/aJtOo0dE/W9bryl8lYKg7pDDSPzE1 0YDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678648110; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R5xcKPE2K4oVQPqYwiz9VO3/wK8BtSoG4Vu1WxAaBrE=; b=ewSQZtn1w/qoHcIGUf+a1EM8JP7ZDItAU31dlBHxz3AOPpaM+/YjL/ZArYAHCD++6e cBujyx56h9Yd4sh4Y9+4zebXymwOOVHt7y6e0l+Q2EQerUm8aNiHfq2Lw9bqQECgunVv FnyYO5l+/yqSJplmF3QIUEZN9XLnXrCKEbCe+H9HDhgbVB7dOQi8PQLBvPHgFPmkyXjg 7UFRHMtXDe/IC7trUQ6654Bsw8p7avd0FgBQzlq4VRCcjojyrwPCkxHJy1EpWZtdJSB6 MG3JISEEEDxFYmmSnzvL1V+WDkyl0purIS3Y24qUjANb3rJIjf6xPo5EWvnRNwsZqbCy g6mA== X-Gm-Message-State: AO0yUKWFAJqyYczpXuP3ACxrFm1ZrMJ8jTXxw9Qu3cv3r76NjMo0E1gc CYeQAztT+3Sy3hjnSlJJb2xEtaVuHO6CFuPXH0vzv6RP X-Google-Smtp-Source: AK7set+6Uqw/lh83uKwGSFjeB3IJYAXsLUUYcRJ4eJWAErrPKpcWtyXiOa9RpQR2GE85SdjoD5x4UjY94Oxl5Sq+I1o= X-Received: by 2002:a9d:847:0:b0:693:bdd8:7b32 with SMTP id 65-20020a9d0847000000b00693bdd87b32mr3196512oty.3.1678648109958; Sun, 12 Mar 2023 12:08:29 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Received: by 2002:a05:6802:31f:b0:4c2:d201:fe1f with HTTP; Sun, 12 Mar 2023 12:08:29 -0700 (PDT) In-Reply-To: References: <202209170911.28H9Bf3W085276@gitrepo.freebsd.org> From: Mateusz Guzik Date: Sun, 12 Mar 2023 20:08:29 +0100 Message-ID: Subject: Re: git: 5b5b7e2ca2fa - main - vfs: always retain path buffer after lookup To: Dmitry Chagin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-3.70 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.70)[-0.698]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::32e:from]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4PZTpR2bRpz4DMT X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N sorted out in https://cgit.FreeBSD.org/src/commit/?id=35c872422c8cfb93d645c2f892c80422d902b1bf On 3/12/23, Mateusz Guzik wrote: > so it is. please do the honors :) > > On 3/12/23, Dmitry Chagin wrote: >> On Sat, Sep 17, 2022 at 09:11:41AM +0000, Mateusz Guzik wrote: >>> The branch main has been updated by mjg: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179 >>> >>> commit 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179 >>> Author: Mateusz Guzik >>> AuthorDate: 2022-09-17 09:10:38 +0000 >>> Commit: Mateusz Guzik >>> CommitDate: 2022-09-17 09:10:38 +0000 >>> >>> vfs: always retain path buffer after lookup >>> >>> This removes some of the complexity needed to maintain HASBUF and >>> allows for removing injecting SAVENAME by filesystems. >>> >>> Reviewed by: kib (previous version) >>> Differential Revision: https://reviews.freebsd.org/D36542 >>> --- >>> .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 23 +++- >> >> >> btw, by this change the usage of cn_origflags of struct componentname is >> retired, may be we should remove it? >> > > > -- > Mateusz Guzik > -- Mateusz Guzik From nobody Sun Mar 12 21:35:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZY403bYnz3xfyB; Sun, 12 Mar 2023 21:35: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 4PZY4036DCz4b54; Sun, 12 Mar 2023 21:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678656928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9lGYXHRdJ0ZiMTb6nqZ6pD/qA4LpUHIUwqTQczgDDUU=; b=ee7y9/wPKvI9Yrz9MPYLVAB/MqiiZRhtsMD1NRM0Q5nsb3BvJ3wPqZVy8uNIx4gvwE+fqp rcEto1yO5s14Tt6QWuc2KHn/307z4d/yboDUfbS8wPncUqjkBn89zkfEUcBAONc+uMhskC Uvp0EBWP9h6KZSTSA1wS4dzUu9SSTkivoQhm+T/HYINE8v3XXyE1zv/YiU/0mJRBFUPyBZ G6ey85s1TCj56q4BXXgKzlgsFSB2VuiSLCFI+yfJ3CenYOhGIRyjTlgW7vXG7M7ymD7fTy mXmyYhFPPh76UXBiom+VKSKkP75GGkja35Va1OHeNbl6KnFOAMtGemVY+p1khQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678656928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9lGYXHRdJ0ZiMTb6nqZ6pD/qA4LpUHIUwqTQczgDDUU=; b=OoIDhs4pe68MuaTCuCD9XoGZyCbRlUOJsF87A5opUo7RCfoa6r3gstFbWx87caE70P65xT bCFB6/FG3qmWm8x2lLYnoLiHxb92tEoTsb3OL/r0VWceM3EOH+VJFzdbEM4vUoQwvLTYNe DCpp+8Nfa2EZfR8aX6XFKaTVnFZ+ZcCVqx1QQL3H8JI+HvAzC2B1lrMscEzrfM67MR4zUk LbLefu+Q6c5FgZMOy5Kfxm2JC3bahtsmXmoP4rvTepsf8E/bS0e6IrBpY7Oaua2JKtNEOL DY/1iBUjeHa5NmHTHu0iEw6kOry8C5uJZxAXeXrQjHrrVpc5yR92duE8/5rZxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678656928; a=rsa-sha256; cv=none; b=w5N754ZhfPZrgRRIG43AiEi7n0ogWu1tMhP6iLKXcDV0N+T69+daIzZHcc/+4ZymX1vUmy rQ77bGGY8LjM+ald8+f8U/xFNwZCsinuWcDrrDblp/0jM0hjJG20zaeYIwe+o+Y5UbWEVk 18fqqhqUnUryfzi51sYJlKIgvtj51sZ/6htBr4dLvrFETUJKc6kyFOtZybqIU1Z7A9ZCxN gwGMm5e7r+fIANAMRiUe0DB5JVWolUhjPfutGWifTUx0Gf8xqL/6v1heN/2TOV7+7FG9Xb 8ttYpmvC0Bl4P6+u+lxwivDnlrA39P+6BnI+ixQ2I8lAYD+BcwkrtJmELgTMsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZY4029XczS8c; Sun, 12 Mar 2023 21:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CLZSOF032044; Sun, 12 Mar 2023 21:35:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CLZSuY032043; Sun, 12 Mar 2023 21:35:28 GMT (envelope-from git) Date: Sun, 12 Mar 2023 21:35:28 GMT Message-Id: <202303122135.32CLZSuY032043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 0bb08f21cc5c - main - rc.d: Fix NFS server startup scripts to enable vnet prison use List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0bb08f21cc5c62d0e2dfcea500521fa801058dd3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0bb08f21cc5c62d0e2dfcea500521fa801058dd3 commit 0bb08f21cc5c62d0e2dfcea500521fa801058dd3 Author: Rick Macklem AuthorDate: 2023-03-12 21:34:25 +0000 Commit: Rick Macklem CommitDate: 2023-03-12 21:34:25 +0000 rc.d: Fix NFS server startup scripts to enable vnet prison use Now that commit cbbb22031f9b is in main, it is possible to run nfsd(8), nfsuserd(8), mountd(8), gssd(8) and rpc.tlsservd(8) in an appropriately configured vnet prison if the "allow.nfsd" option is specified in jail.conf. This patch fixes the rc scripts for this. Mostly just replaces the "nojail" KEYWORD with "nojailvnet", but also avoids setting vfs.nfsd.srvmaxio in a prison, since it must be set outside of the prisons and applies to all nfsd(8) instances. Reviewed by: jamie MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D38809 --- libexec/rc/rc.d/gssd | 2 +- libexec/rc/rc.d/mountd | 2 +- libexec/rc/rc.d/nfsd | 4 ++-- libexec/rc/rc.d/nfsuserd | 2 +- libexec/rc/rc.d/tlsservd | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libexec/rc/rc.d/gssd b/libexec/rc/rc.d/gssd index 79dbf10ca575..8d67a3689b3c 100755 --- a/libexec/rc/rc.d/gssd +++ b/libexec/rc/rc.d/gssd @@ -6,7 +6,7 @@ # PROVIDE: gssd # REQUIRE: root mountcritlocal NETWORKING kdc # BEFORE: mountcritremote -# KEYWORD: nojail shutdown +# KEYWORD: nojailvnet shutdown . /etc/rc.subr diff --git a/libexec/rc/rc.d/mountd b/libexec/rc/rc.d/mountd index d75416736245..69391fe78e47 100755 --- a/libexec/rc/rc.d/mountd +++ b/libexec/rc/rc.d/mountd @@ -5,7 +5,7 @@ # PROVIDE: mountd # REQUIRE: NETWORKING rpcbind quota mountlate -# KEYWORD: nojail shutdown +# KEYWORD: nojailvnet shutdown . /etc/rc.subr diff --git a/libexec/rc/rc.d/nfsd b/libexec/rc/rc.d/nfsd index b746cf7cea9d..6c2d5c22d963 100755 --- a/libexec/rc/rc.d/nfsd +++ b/libexec/rc/rc.d/nfsd @@ -5,7 +5,7 @@ # PROVIDE: nfsd # REQUIRE: mountcritremote mountd hostname gssd nfsuserd -# KEYWORD: nojail shutdown +# KEYWORD: nojailvnet shutdown . /etc/rc.subr @@ -28,7 +28,7 @@ nfsd_precmd() # oids are available. load_kld nfsd || return 1 - if [ -n "${nfs_server_maxio}" ]; then + if [ -n "${nfs_server_maxio}" ] && ! check_jail jailed; then if ! sysctl vfs.nfsd.srvmaxio=${nfs_server_maxio} >/dev/null; then warn "Failed to set server max I/O" fi diff --git a/libexec/rc/rc.d/nfsuserd b/libexec/rc/rc.d/nfsuserd index 804b1243a4c4..6c9293a52c09 100755 --- a/libexec/rc/rc.d/nfsuserd +++ b/libexec/rc/rc.d/nfsuserd @@ -5,7 +5,7 @@ # PROVIDE: nfsuserd # REQUIRE: NETWORKING -# KEYWORD: nojail shutdown +# KEYWORD: nojailvnet shutdown . /etc/rc.subr diff --git a/libexec/rc/rc.d/tlsservd b/libexec/rc/rc.d/tlsservd index cca28ed60ffe..95a62060fe32 100755 --- a/libexec/rc/rc.d/tlsservd +++ b/libexec/rc/rc.d/tlsservd @@ -6,7 +6,7 @@ # PROVIDE: tlsservd # REQUIRE: NETWORKING root mountcritlocal sysctl # BEFORE: nfsd -# KEYWORD: nojail shutdown +# KEYWORD: nojailvnet shutdown . /etc/rc.subr From nobody Sun Mar 12 21:47:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZYKN0kBYz3xgLX; Sun, 12 Mar 2023 21:47: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 4PZYKN0D1jz4c3t; Sun, 12 Mar 2023 21:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLkDkj8Ai6Rsdp034cU9Wh9S/NH7FUmEzHRj5P+MSKc=; b=pwjNrrLTlBAHNJVbHhA0ghsfzndQl2B/Q4cAOMG5lGiNEKFQP4zIJ9D5xtpZi96atV47Ka 0/AnksHe+59vfzxTQTIBbGVP76XUihkJbH4fHLpQ1OWn3aSeoSnnbzGZG1hcEMVvOWFnh1 Kx1zP7v/oIPiCJMGna9mcZ+G1TEILTBXnw0od0VHyzt7VdRMpT41v0Kmn3oDqhRWrs+CUP kfmqa149H/jMrIfVPwSbawYooXeH8YKrC+XbEytroHv5bSsZeAYqB2FZ/JpKRzwaDqGUj8 OePi1BWXUL+KQX20zTfs67v7jjsSivcyd0YKImNEYtTLuJ3UGtiCUPlTAUPwHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLkDkj8Ai6Rsdp034cU9Wh9S/NH7FUmEzHRj5P+MSKc=; b=Aj+pUIJCBJ1e6RCkeslAf2uP8p3BXB9cMP07zR3n48CBVSSkbIfcD48+W/TnW0v9urcszB dLr9iG9bbCTDTiI6DbUwgecTY2Xl5KmRzu/dQLKL5KBmbSAVIcv3Yel/ENQBD8VFwPUW1I K2JfXJhOSyujMTiVZCC1cfww+tEILVoFze0zIgCBuyWJTfC2VYTEqE/tcuLdP7Qs4n3ew2 hLyWD7AzpZHtIwsednlSmdhcXBN/9birWyORXNap7APOWN7m8ZAfbhXo2cxdIATSVosDnT dP6D0BuqsetXYL8az5CGw0JioC7xs9c0rX6XgXXSEqhaOqszd4ossbKD+TFleQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678657624; a=rsa-sha256; cv=none; b=Wh7Y8oUbS1yIYZecwIZ+RF/1ZigvERvSSXPLpYqYTIoIgHGgYjbqZzVu0ufmaIXDpdHJzs xBHGi15SbYmZaR6u9tg+eutgqfVoOOm5qWLgnzCZwDChlkZv/QdDVtjkcw8lKCrfdRqZFj djZnJH9VFwB+hRSvbMhEuasq1KxcQzPboJtd4EbfgY85wnnrK/qvTEWn6NL7vgp02Kpt5A yoEESaLIRtVR9ThWkDknraloCHm2JSksrHdfAYCDbEvqI/J3DUBiao848I7zo2Yn8xxxO4 Ckg6xySmdOgD1ybSI4UiVCka8cSPrxwvLG1A2aWpw/qKeK5XwMEFYQwqpRgiIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZYKM6N0nzSBX; Sun, 12 Mar 2023 21:47:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CLl3X4049257; Sun, 12 Mar 2023 21:47:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CLl31I049256; Sun, 12 Mar 2023 21:47:03 GMT (envelope-from git) Date: Sun, 12 Mar 2023 21:47:03 GMT Message-Id: <202303122147.32CLl31I049256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: a379d5c5efb2 - releng/13.2 - hostid: Generate random UUID by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: a379d5c5efb2b606f2a12b94c0bfd450173b7c38 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=a379d5c5efb2b606f2a12b94c0bfd450173b7c38 commit a379d5c5efb2b606f2a12b94c0bfd450173b7c38 Author: Tijl Coosemans AuthorDate: 2023-03-09 09:02:45 +0000 Commit: Tijl Coosemans CommitDate: 2023-03-12 21:45:59 +0000 hostid: Generate random UUID by default This way MAC addresses are no longer exposed. Discussed with: bapt Approved by: re (cperciva) (cherry picked from commit 862aab6281a5e6b5dad89761ac17ca2a0e83ab32) (cherry picked from commit baf1e9713969fccdaf7481e3568ca89b7237dafd) --- libexec/rc/rc.conf | 1 + libexec/rc/rc.d/hostid | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 6b3aacacda61..23f9406da017 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -134,6 +134,7 @@ extra_netfs_types="NO" # List of network extra filesystem types for delayed hostname="" # Set this! hostid_enable="YES" # Set host UUID. hostid_file="/etc/hostid" # File with hostuuid. +hostid_uuidgen_flags="-r" # Flags to uuidgen. nisdomainname="NO" # Set to NIS domain if using NIS (or NO). dhclient_program="/sbin/dhclient" # Path to dhcp client program. dhclient_flags="" # Extra flags to pass to dhcp client. diff --git a/libexec/rc/rc.d/hostid b/libexec/rc/rc.d/hostid index 3cf7dd42eb6c..317b53e06db4 100755 --- a/libexec/rc/rc.d/hostid +++ b/libexec/rc/rc.d/hostid @@ -117,7 +117,7 @@ hostid_generate() warn "hostid: unable to figure out a UUID from DMI data, generating a new one" sleep 2 # If not found, fall back to software-generated UUID. - uuid=`uuidgen` + uuid=`uuidgen ${hostid_uuidgen_flags}` fi hostid_set $uuid } From nobody Sun Mar 12 21:47:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZYKP3ws8z3xh9N; Sun, 12 Mar 2023 21:47: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 4PZYKP1H2rz4byX; Sun, 12 Mar 2023 21:47:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CrhGcjUHeDn/oxK7IopU4WHK86rnwa2ykoicXkS0LgQ=; b=momHfzHfFCF63juaKRORLAhMWOpICBKi4HKNEfvyxlfhoX3EwRG0baQhdyDL+yB3kWAcY6 oU9VNijL8J5vntODcW2g0cd3I8p9aB+2MXGVUmhm7QVDXghODFauUT0NlargAmJm1kT+es pzrCX7OvE9QjNW4Sol42pS1CLgqMsNLiwKntLkbxaFLWGfhw75EK8Fam8EotjhyMZihHTu PUh15jlNiHyR14B6QKHxiK2Y4lopcL83hPFTP2WOTtXAoSsvoTgrnMvYp93jPpQqTrhLBO fLFiUt6C57qDOoEmBa1kQd+a8bi8etveVKVyeBMAqwtK10mRqdzGghMTXHSdMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CrhGcjUHeDn/oxK7IopU4WHK86rnwa2ykoicXkS0LgQ=; b=cqLV3RbgUSYLqsbpubUlamMi3j5ZVm2KxUQoBY3VC7qpIQ+qg7eDIT0i2MhfelST8P8/NP GVh8hPuW6GBJpviDDVuMx2LEDrxLamk07vEWvfyGmL3JEEqBuEGC7zK6+JifDDc7at2XEq TJbuh+/v7Nfq/5hbaUXc1+vigEjRlIq1xVqtsPIW3Y3lZb7Q8CKMAMfA2QbFFYiCnlxYHa WyKgW+n7zrhH8FodGQs89wzQTVL/IxFONkD4gVlro51mrMuN3eJ2t2GpIefuWeqIDLDhln HMrY3x4eHVI60fF3+lcdIOehI/JC0tVVrl0PqMu4dkTZWOBLgv2+WsfTY6k9+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678657625; a=rsa-sha256; cv=none; b=qirYZM0rrtjZBL7KCD77Ouq6vqcSMhaMsJH1ciodcCuN2vEfFAZXrR18BZ0EHxiq9l+Gtp elJ2b9/Z9Vj9Zwnlyzyv5kx/DpL+o7NDjKh/9VwN7FmzJev58OT/CZjfnOVzJSvHICOcqS KRc8o2P+iqQxHWTgw6mWWUB1RJFifj1mzlAB3LWEUbSXojZnhoosC0f55RsTvzVXIQdZoG 81QC3AYw59Bgjze32iOZh0ZZ5qUewAKorkddW0n01+HJFGTFxindmPCJfmjjh8agd4AupC 6q1krEzZlr1QANPR1prDqjyEyI1Gg/Vx8hwq8Bdmk4Wcmx+cIDTjIoxo4g+96g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZYKP0Mm8zSTt; Sun, 12 Mar 2023 21:47:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CLl4hW049276; Sun, 12 Mar 2023 21:47:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CLl4J7049275; Sun, 12 Mar 2023 21:47:04 GMT (envelope-from git) Date: Sun, 12 Mar 2023 21:47:04 GMT Message-Id: <202303122147.32CLl4J7049275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: 71d88613d129 - releng/13.2 - rc.d: Generate machine-id from hostid_save List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 71d88613d12984f6a9058f4ef7044e00853727ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=71d88613d12984f6a9058f4ef7044e00853727ed commit 71d88613d12984f6a9058f4ef7044e00853727ed Author: Tijl Coosemans AuthorDate: 2023-02-15 20:09:51 +0000 Commit: Tijl Coosemans CommitDate: 2023-03-12 21:46:07 +0000 rc.d: Generate machine-id from hostid_save rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid. Store the same UUID, without hyphens, in /etc/machine-id. The hyphens are removed with a shell function because hostid_save runs before file systems are mounted so other tools may not be available yet. This eliminates some duplication between hostid and machine-id and for virtual machines machine-id now contains the UUID configured in the hypervisor like it does on Linux. Reviewed by: delphij Discussed with: bapt Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38811 (cherry picked from commit ecad3f5c4d922f93ceba455f8bff1c54e1ed4174) (cherry picked from commit d6852eed98ed32ad51120a22aa1ebdf0601917b3) --- ObsoleteFiles.inc | 3 +++ etc/Makefile | 2 -- libexec/rc/rc.conf | 4 +--- libexec/rc/rc.d/Makefile | 1 - libexec/rc/rc.d/hostid_save | 28 ++++++++++++++++++++-------- libexec/rc/rc.d/machine_id | 34 ---------------------------------- sys/sys/param.h | 2 +- 7 files changed, 25 insertions(+), 49 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 64214e29e93f..b3b1b5e6cf1f 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -52,6 +52,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20230308: machine-id merged into hostid_save +OLD_FILES+=etc/rc.d/machine-id + # 20230203: loader help files renamed OLD_FILES+=boot/loader.help diff --git a/etc/Makefile b/etc/Makefile index 49a7a12a41b5..104e40b6e345 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -58,8 +58,6 @@ distribution: ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt ${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \ ${DESTDIR}/etc/os-release - ${INSTALL_SYMLINK} -T "package=runtime" ../var/db/machine-id \ - ${DESTDIR}/etc/machine-id .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ ${INSTALL_SYMLINK} -T "package=unbound" \ diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 23f9406da017..af7b6ff6302e 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -135,6 +135,7 @@ hostname="" # Set this! hostid_enable="YES" # Set host UUID. hostid_file="/etc/hostid" # File with hostuuid. hostid_uuidgen_flags="-r" # Flags to uuidgen. +machine_id_file="/etc/machine-id" # File with machine-id. nisdomainname="NO" # Set to NIS domain if using NIS (or NO). dhclient_program="/sbin/dhclient" # Path to dhcp client program. dhclient_flags="" # Extra flags to pass to dhcp client. @@ -703,9 +704,6 @@ harvest_mask="511" # Entropy device harvests all but the very invasive sources. osrelease_enable="YES" # Update /var/run/os-release on boot (or NO). osrelease_file="/var/run/os-release" # File to update for os-release. osrelease_perms="444" # Default permission for os-release file. -machine_id_enable="YES" # Create /var/db/machine-id on boot if missing (or NO). -machine_id_file="/var/db/machine-id" # File to update for machine-id. -machine_id_perms="444" # Default permissions for machine-id file. dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot watchdogd_enable="NO" # Start the software watchdog daemon watchdogd_flags="" # Flags to watchdogd (if enabled) diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 188eae2e2f5b..40a1a212ca3a 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -51,7 +51,6 @@ CONFS= DAEMON \ local \ localpkg \ lockd \ - machine_id \ mixer \ motd \ mountcritlocal \ diff --git a/libexec/rc/rc.d/hostid_save b/libexec/rc/rc.d/hostid_save index f535ea2596f2..f737ed7f74cf 100755 --- a/libexec/rc/rc.d/hostid_save +++ b/libexec/rc/rc.d/hostid_save @@ -15,20 +15,32 @@ start_cmd="hostid_save" stop_cmd=":" rcvar="hostid_enable" +hostid_machine_id() +{ + local IFS + + IFS=- + set -- ${current_hostid} + IFS= + current_machine_id=$* +} + hostid_save() { current_hostid=`$SYSCTL_N kern.hostuuid` - if [ -r ${hostid_file} ]; then - read saved_hostid < ${hostid_file} - if [ ${saved_hostid} = ${current_hostid} ]; then - exit 0 - fi + read saved_hostid 2>/dev/null < ${hostid_file} + if [ "${saved_hostid}" != "${current_hostid}" ]; then + echo "${current_hostid}" > ${hostid_file} || + warn "could not store hostuuid in ${hostid_file}." fi - echo ${current_hostid} > ${hostid_file} - if [ $? -ne 0 ]; then - warn "could not store hostuuid in ${hostid_file}." + hostid_machine_id + + read saved_machine_id 2>/dev/null < ${machine_id_file} + if [ "${saved_machine_id}" != "${current_machine_id}" ]; then + echo "${current_machine_id}" > ${machine_id_file} || + warn "could not store hostuuid in ${machine_id_file}." fi } diff --git a/libexec/rc/rc.d/machine_id b/libexec/rc/rc.d/machine_id deleted file mode 100644 index 8bf3e41d0603..000000000000 --- a/libexec/rc/rc.d/machine_id +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# PROVIDE: machine_id -# REQUIRE: mountcritremote FILESYSTEMS -# BEFORE: LOGIN - -. /etc/rc.subr - -: ${machine_id_file:=/var/db/machine-id} -: ${machine_id_perms:=444} -name="machine_id" -desc="Update ${machine_id_file}" -rcvar="machine_id_enable" -start_cmd="machine_id_start" -stop_cmd=":" - - -machine_id_start() -{ - if [ ! -f ${machine_id_file} ] ; then - startmsg -n "Creating ${machine_id_file} " - t=$(mktemp -t machine-id) - /bin/uuidgen -r -c -o $t - install -C -o root -g wheel -m ${machine_id_perms} "$t" "${machine_id_file}" - rm -f "$t" - startmsg 'done.' - fi -} - -load_rc_config $name -run_rc_command "$1" diff --git a/sys/sys/param.h b/sys/sys/param.h index 35ed7dab7b5f..b6ac2c897fad 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1302000 /* Master, propagated to newvers */ +#define __FreeBSD_version 1302001 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Sun Mar 12 21:48:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZYLb5zbRz3xhG4; Sun, 12 Mar 2023 21:48: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 4PZYLb5TnVz4cnR; Sun, 12 Mar 2023 21:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CA0Gs9K7+lkast+8RQmiGyW/lhlTV696TDOEaH6+rZQ=; b=fidRrVugN6j6zsuWUz+eH2kdLTRqxroOPSfOiRfuPSNSKKIVvu1Iodk71oDE4WDpsszoQZ HSjSGg7wsTCnQ9Dm67M3luIkmKdwnQ2QfRDaHlonidRCO1geyrTPGYY0VfSFhk/S+e0sIV hCRtM188bcF94+beWoAolnjE2hkoZXgFGLJ5SUq2lSHc+hAw/dqFS8yocW4aFYv2PprGsG lKkKKOeFy8Xc2QQaT+DYGmcMVnXLyL020J+A6bH0u5CyPsFjANxflys5J+vntbWEh86MwY 2RqvOmS448D9Gsbi3rQw5Tt3R5vgJho4rFShU4ukmtMRbH5LV5126TdnMtzYtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CA0Gs9K7+lkast+8RQmiGyW/lhlTV696TDOEaH6+rZQ=; b=sTCPcNUC4VGwG3NPqzVB0mqEux8kN0B/qiURLEuEjdFcz2v/ylTEYnY6D1wKZVMuv0KfgX GSvLDimgl2bozZiAm3JrPT5V4FUKfNpq2EqbkKEJO1vQdBZG2KdlwViyTSkTbmDU877IAl M5rNlLyJh7enwH5KdIKk8l8CJOaRTLUdjkGcmnuCbQ6RZU5Kaw0Xa86G2EGA266EmyBqPg jzqK4wXha+GzdRT1nJc+kxm+mnGlfZ3mc+ZgS14bDRIyMMyydZVtnJHA4fOtTHOwwSFp1Z srLnzPHNN4eVbXTg5HbmF3cTWf1zVYIpZoQm5wjex1YDz+GdPNpxS3SNocAHPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678657687; a=rsa-sha256; cv=none; b=YhGJfEPWG7YX7RvVEfb+jKuh3+jr4vK7w7xm8e9n8doook40UvKKhTEfmQiyso7OPSAWMl 198Bt5NgMWPacm8N9VuATpGNhbdQ1OBEB2WMAxCBGFw1wh4YDIAwm3HXoi8NOB0w8LkU2K JwHPR7bomgrivRnsXTCioE04rtDQAIEupVast7yWfkDE6OahouAfzdTY1lPm3ycThzsfjN PufMGs8ZDJr7ny1G32MB50N7KKmC9TN614ALct+4qmppwCsVk9FAFUBFai3EjPFzSnWx47 Ic9cFuUgXHLU9RQMbiZLGg1xRmHg6KLLAeyNdqbjg8KslZlQDT/gAhj2Pax7Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZYLb4XnszSRg; Sun, 12 Mar 2023 21:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CLm7Ba049540; Sun, 12 Mar 2023 21:48:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CLm7oC049539; Sun, 12 Mar 2023 21:48:07 GMT (envelope-from git) Date: Sun, 12 Mar 2023 21:48:07 GMT Message-Id: <202303122148.32CLm7oC049539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 94e3409e2d02 - main - libc/csu: add powerpcspe List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94e3409e2d02ce3e4817d1a94051dc798e520745 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=94e3409e2d02ce3e4817d1a94051dc798e520745 commit 94e3409e2d02ce3e4817d1a94051dc798e520745 Author: Konstantin Belousov AuthorDate: 2023-03-12 09:59:16 +0000 Commit: Konstantin Belousov CommitDate: 2023-03-12 21:47:41 +0000 libc/csu: add powerpcspe Reported and tested by: alfredo Sponsored by: The FreeBSD Foundation MFC after: 3 weeks --- lib/libc/csu/powerpcspe/Makefile.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/csu/powerpcspe/Makefile.inc b/lib/libc/csu/powerpcspe/Makefile.inc new file mode 100644 index 000000000000..2534e6579f38 --- /dev/null +++ b/lib/libc/csu/powerpcspe/Makefile.inc @@ -0,0 +1,4 @@ +# + +CFLAGS+= -DCRT_IRELOC_SUPPRESS \ + -DINIT_IRELOCS="" From nobody Sun Mar 12 21:49:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZYNH6V6bz3xh8n; Sun, 12 Mar 2023 21:49: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 4PZYNH5fyHz4cwS; Sun, 12 Mar 2023 21:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ca6oX4w6zWFw5hMf/tvIjwXCcNec6WJlKZ5BbczKXSE=; b=bvtUEfOqwXHSFebUgHJQ5jYxCwy8N1UzgTfivYyT/9NoKybMfCRpFOYCby31YVmNqA9/qV 6VXGc2gw/MTniiiwuSKSuecZbobBU83MLTrqqEDLmCjDv+JGOh4CuqftS+pz9BqJk6d8Dh KlW54WEntj4WnMHvE+qDmq+tq6+YJFU6Y1iuJ9yc37rDDVzMFn3P2AURZ+IVjCXenAPqEz s4X5RDEgLe18zKs4rzUI6TH93TbjgFjiAR7Bsm0wnUXAAxcNKmRRYGg8MOgqoV+xoAVLsZ 73DJ+dnNc2GS86/Yqnci3z/aXz0q2mj+a06w0Qjcm3fdfYa0KYEpjTGD7In47w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ca6oX4w6zWFw5hMf/tvIjwXCcNec6WJlKZ5BbczKXSE=; b=uu0ADEcnMAPbgqZE5iuPFYuj45BDMWfTe0/icr3bKL4SmHMQQ2cikxqmfNj9L+uiA9xKx5 wfep3HrOeCFsF5K3EK+VNmqOjxSyyZ+AGtIF0i1zJVlaFlAwGU47rg3sK7CIi7n9QW0u/x YXl7TZ0sDCSvLu7wWA8r8Q0CY9Xibv+U+ln0ry4g81ef7bNfTYeGqWUGJCyzinOoJMhcsz /++4AKFxhOHQRUG2zymG2NUwBfHXt3LZdOdZof9BpQRs/zItPwYRsI3PUeW1obRidkCWVP ljoRKYukWPIp1dCRctUUetLIStKn1LlhT4ky6uuskoHu/WglUsoHzzYl2MEF5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678657775; a=rsa-sha256; cv=none; b=Jg1sRALMyUDyn8F2dV+Oo4CHgLRzLkVqlPS5iMWGXyLrccShw4R02r+6LytKB/cpHZ3ckB wQdoNWmxCXl6UUq00FFoQuNMoDU7rHM4D0OhwJ9UP6f8KnZtP8DkY/CwzzENA9AYPqacb0 6x6UeCe1mwGqFAkDM1e4nCb2vu4vWMi///r0j/DFojaYBOL8xZUNP70SnjXWSr7QQ8bii5 ipN21Qhdhxi+IZa9gQhL+rajgL4gXfvjtuqsPkcHRm8rtIUmFSF/9SWYlGuTosXH+94+7S PghTtNUk49PBNgPDV41lzT3AO0TcUjPPPT/RLP95aX1Hk02NsvR6g88LutyxSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZYNH4jKXzS7h; Sun, 12 Mar 2023 21:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CLnZTp049826; Sun, 12 Mar 2023 21:49:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CLnZ2h049825; Sun, 12 Mar 2023 21:49:35 GMT (envelope-from git) Date: Sun, 12 Mar 2023 21:49:35 GMT Message-Id: <202303122149.32CLnZ2h049825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c383f4857f16 - main - lib/csu: do not compile the body of handle_static_init() for PIC build at all List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c383f4857f1696c4beb782db36323f46f0c4f6de Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c383f4857f1696c4beb782db36323f46f0c4f6de commit c383f4857f1696c4beb782db36323f46f0c4f6de Author: Konstantin Belousov AuthorDate: 2023-03-12 01:45:37 +0000 Commit: Konstantin Belousov CommitDate: 2023-03-12 21:47:41 +0000 lib/csu: do not compile the body of handle_static_init() for PIC build at all The referenced symbols that provide init array boundaries are weak, hidden, and undefined. The code that iterates over that arrays is not used for the case when libc is compiled as dso. This should fix linking with ld.bfd. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks --- lib/libc/csu/libc_start1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c index 346409e3f370..d6a973bf0fe0 100644 --- a/lib/libc/csu/libc_start1.c +++ b/lib/libc/csu/libc_start1.c @@ -94,6 +94,7 @@ finalizer(void) static void handle_static_init(int argc, char **argv, char **env) { +#ifndef PIC void (*fn)(int, char **, char **); size_t array_size, n; @@ -115,6 +116,7 @@ handle_static_init(int argc, char **argv, char **env) if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1) fn(argc, argv, env); } +#endif } static void From nobody Sun Mar 12 21:57:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZYXr2j0jz3xhKQ; Sun, 12 Mar 2023 21:57: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 4PZYXr1vbkz4lN9; Sun, 12 Mar 2023 21:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678658220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6TpKTA4UlQsag0lvYAnLOHjmC2hzolbXGLrHZxAPq8s=; b=enkrhBVLBQQA47yvs01kH1pfpmJc0XnKdYjpDEh1RCv5gv0aArg8sQyBF+8VwCDhNJ5zmt bUCCZsqDcg08scGdIL8vNSFb0qynuDnNo5g+LWYUrfeObMZT5jaciosU8e716SPCMMhC/c pob65PkGqR2OOf0BvBCOJwckavBxmbepeUzl8O9p91DLUaJmLGp0GqIapwB3/aG5L3NYb7 1UVnSqgZT1mkglQJs2KUG2e4LHle8N7k1bgEO1adRUA89Ya7NVTTJPeoTvKY2McAfmBgdQ DWPKugOAs3Du/BgPvkThmaLbgsvAaKZoweREYhG9oyBguj5EXnpZexmNHLhUxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678658220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6TpKTA4UlQsag0lvYAnLOHjmC2hzolbXGLrHZxAPq8s=; b=rg9KQbmFfWgwmT4eQtsIe8xIhYfdFabMASohd9mvzL097dugXrdIY2lyvMdSHwTCyw0hI6 B7YHSFbPmjsLIfpYQ16rY1W2YHUQ8yXcJ4lahhudMlGRbCviRahbjgk2k+JIhH4q5w/gLi cgjWDDQ2RNyvpLVJyi+WoRHkfqnfhrUEn/PQahv86H8y0U0BmGDr0zSHzEIGlj8idnz8VC WktRpQLkpBDrgLWSc8T2FVO9ujitPqRU01RhqzmLJ1kG+dvEoy3iBxukVwa5n45b24x2N8 WlYcnow+1wxd+FxrrOtshLuSdkKBMHD/VOaSIetCCebjaeStw5FW3v/0tp8Hsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678658220; a=rsa-sha256; cv=none; b=d+V+Nc2DARLPmHvVjFwWDWgnMY53nMP6cK7no7hBFdkSlUF9YzFc2Pmbc757tiEkOXY5iK +ByO6keNF5j16W3+JbDsTP6y4m6NRGYAquXqkZddhkez4CKFw4s8Ir5pV0t2JITEAAIPky /1Vi4du1yfzM7q5gcQJWoBbqekz2oWaf1Lgb5zjRqFeIRfgXOQwsRJehk+K1aFeM9bBEEe czpORTC6ZKcne7RsDK0r2yhAnp4GbiTwPrxcJ6M3a1CSpozYIB9Hrc2uC9Y9mYhImC+Uq7 xLNx3w/BYw4OzY2F+nhir7ngKWOnzpfWR1fcSa+03rEIuDjxZzFmVfbJZhvg5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZYXr0yTmzS88; Sun, 12 Mar 2023 21:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CLv0Gs065363; Sun, 12 Mar 2023 21:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CLv0tq065362; Sun, 12 Mar 2023 21:57:00 GMT (envelope-from git) Date: Sun, 12 Mar 2023 21:57:00 GMT Message-Id: <202303122157.32CLv0tq065362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 84eac070494d - main - RELNOTES: Add an entry for NFS server support in vnet prisons List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84eac070494d81d0e0ded098a0275791874e5251 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=84eac070494d81d0e0ded098a0275791874e5251 commit 84eac070494d81d0e0ded098a0275791874e5251 Author: Rick Macklem AuthorDate: 2023-03-12 21:55:46 +0000 Commit: Rick Macklem CommitDate: 2023-03-12 21:55:46 +0000 RELNOTES: Add an entry for NFS server support in vnet prisons --- RELNOTES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELNOTES b/RELNOTES index 92ab27e4be46..9e099e29fe37 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,16 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +7344856e3a6d and many others: + Add support so that nfsd(8), nfsuserd(8), mountd(8), gssd(8) + and rpc.tlsservd(8) can be run in an appropriately configured + vnet prison. The vnet prison must be on its own file system, + have the "allow.nfsd" jail parameter set on it and enforce_statfs + cannot be set to "0". Use of UDP and pNFS server configurations + are not permitted. (ie. The nfsd command line options "-u", "-p" + and "-m" are not supported.) + See jail(8), nfsd(8) and mountd(8). + 2fb4f839f3fc,d89513ed2050,3413ee88c39d,f97a19ecb985,021562c5020d,431d2a81d421: sendmail has been updated to the latest upstream version (8.17.1). From nobody Mon Mar 13 01:43:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZfZQ39jnz3xx4q; Mon, 13 Mar 2023 01:43: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 4PZfZQ2YGvz3nRK; Mon, 13 Mar 2023 01:43:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678671822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IHD3rm9RDQy1a7FqA6iLsYj8GLPN+FQZO2jjjd/6ePs=; b=DLoLWmT9NsKjXItQ4WQ9WEIrD9sAUUyjZYECyI+6g2YzXq4O9kNEr6G5RIKUw6JvWDv7Af 50fwujk+eMz22P2JbstSfy/XsK2+QMFzZdQ8y/urY6gcYiIGvvzcbvsQF7YGE8GUskbZI+ PQdFfKSxF7YkoKj+nzMrn0ZfXJmUSA5wjkji5kgJolnvL+iYKc6yrazyNLj2jSDzZeQaPu 2w8E/8y9Gap4BCTpdcfvf4fMkoFafPdY5lQBcWjGkSqCLEYMdkTg4q5wnS4UVtRpTivaiO r5wfDp8Y52pIbCP9IW+tuTGMAh38N2368utVQRwzW6Jxg7xqe1KtaTZBTMhWjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678671822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IHD3rm9RDQy1a7FqA6iLsYj8GLPN+FQZO2jjjd/6ePs=; b=pdOClMf1A5MZ0hJKSWHdzPGPkaFewPtj7UgvsVFUOt5oIAlNqrxLCU3nCu9bsHVXMaqG5b Ykm9l6JYC2pB0cF6FESyxvzPRRK4QoqqiOa5YNZTpXox1oc7oebxiBjiarhcR1d6494CQK FClN5VUg82aRIRkLFi04bXz9AwHO4W3YjQpmlJVASZbR7AqZq3C4XHqmYY5Fxxwb5xoIc+ SXDJT2AeVbGitoqywRWEUwI0kpy4U7TtbZajnVJhnbPRKGFKWKVNeHcZIE9Fe5puBshAVP mqp50j5nxhkE3ndTbnwzDt70Ex0hfFLXZZfOaKG1beRDlNTrL+eMsLecYjtH/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678671822; a=rsa-sha256; cv=none; b=wh1lYKImyhbqcwelUmCc9B9DC4P9lnGVcG85ckpjEBVNzHGb7KuFDYea95fePaOgT8keX1 5EyeMfXb2c3WE57PR4EeHSZ7AXC3g/q7y9N2YB+AXYmZzd0EssYQRbJgXkKXDW4YgB7IM9 +y7kQIGEARc3dksj1gjbDNKMj6iHBXAXmtD4fl4LxuL/JQXoKZKFzg77lFw3yHDKTpfZVm vxvO2GdZ06ovyzkRgUAQ3Iy7qIwvqWS8ts3uWioFtukSOn96MI8iRNM9CWVHKJPC6mMC2D SxD8ViI7QQb2fCeSWnCqhdZselqr4XqpFG0zC8o199k+aACiZRQmkpnImURcqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZfZQ1cBWzZZF; Mon, 13 Mar 2023 01:43:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32D1hghk043690; Mon, 13 Mar 2023 01:43:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32D1hgV3043689; Mon, 13 Mar 2023 01:43:42 GMT (envelope-from git) Date: Mon, 13 Mar 2023 01:43:42 GMT Message-Id: <202303130143.32D1hgV3043689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "David E. O'Brien" Subject: git: 65e9eb07012a - main - Look in getlocalbase() for the calendar-data package data List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obrien X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65e9eb07012a0bf2d6940175c98fb463d169c984 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by obrien: URL: https://cgit.FreeBSD.org/src/commit/?id=65e9eb07012a0bf2d6940175c98fb463d169c984 commit 65e9eb07012a0bf2d6940175c98fb463d169c984 Author: David E. O'Brien AuthorDate: 2023-03-08 03:51:27 +0000 Commit: David E. O'Brien CommitDate: 2023-03-13 01:40:07 +0000 Look in getlocalbase() for the calendar-data package data Fix d20d6550187a95a78bb532909aad8ef7ac62be66 where getlocalbase() wasn't used to fill out the printf(3) format of _PATH_INCLUDE_LOCAL. Differential Revision: https://reviews.freebsd.org/D38975 Reviewed by: imp --- usr.bin/calendar/io.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 5afcb1a33314..5a77455d0ff6 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -151,9 +151,12 @@ cal_fopen(const char *file) } warnx("can't open calendar file \"%s\"", file); - if (!warned && stat(_PATH_INCLUDE_LOCAL, &sb) != 0) { - warnx("calendar data files now provided by calendar-data pkg."); - warned = true; + if (!warned) { + snprintf(path, sizeof(path), _PATH_INCLUDE_LOCAL, getlocalbase()); + if (stat(path, &sb) != 0) { + warnx("calendar data files now provided by calendar-data pkg."); + warned = true; + } } return (NULL); From nobody Mon Mar 13 01:43:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZfZR3sXRz3xx4w; Mon, 13 Mar 2023 01:43: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 4PZfZR3CtVz3nJL; Mon, 13 Mar 2023 01:43:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678671823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDdaiz4CR0juY2fm0R7fkk5lvV1YNpkQpchjZzJTAzc=; b=htRbb8SzZnnOUBnuXL/uNmYJeRHYGn2AkCBCZQ4BeYlJL6MzkNL2ewk70l5gW+1jgtB7IS tSz+SjlMSx1R8QnSwhBkiO3Gv8rrIfv62izsNZjy9wyMqwf5fZ0W9lrwIiM14DH6L2XZBp Jymd7e2tqqFFpfGX2XNcUb/uRNu7aeFzCB9UikoI/T3xHGt3ksr8VHZO4gray8nsrUCsy7 Og2SKUzflmjcR3i2KL7FuV25ZVzT3JJLv3FqPnLAGOql6ARg8Cj4AhKNZ6kg/66sVo8trS HwgTOkwKWz0M7BkYUgWq1E8rkfvUiFJrMKp2BwPiNgNaan9JnxRYFRP6gflMEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678671823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDdaiz4CR0juY2fm0R7fkk5lvV1YNpkQpchjZzJTAzc=; b=n5y0fgolJRCxnuIZiQ00raP+WTdUFCxrrc0yCWtpK7rUOdb7YbM2wxVYVOczKDVSprv9pF StpjS5o6feC6512j//CqsNCH7aB+BsxEHNbEzO7INze+7tFmCg3ICARbJQxtQ2jlZdX2Jr OGCVKJ3UA7n2k4ntx4/yZO+1Q7oRhI5e01O26h7MThXgupJsa8GX+QFMkLwjHVAs5Ant0D 4kkCyip/wsZe4k400Qq/GHNzPyltIgrAqKqiMqRz9vF+/vSN4OVW6dcNPQ05gXhMN9xk55 HcLnG40i8muUAvTl6/3moorpT+NAMFmV0eCqmkGe1qdwaGzuVsowiL9+/exoGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678671823; a=rsa-sha256; cv=none; b=Tgp/NR9DAlSKjvqulmvXxWGzaS6Z1VV7fTfuguBttpYUWw8aAfbh5TSPa8balR130wct0c U48K4DO69j2FReCpb8x/weFuyY1njFYPCxhwmVO8uBWbNzNbEw2pnJyBKTSLzwMIH1T7bs mVAhJARFHKgDHWNxopI9Awe2VFb2mptwyp2h5ViZwfvCR4nH4MuiorGVlDErMsECFG0UNL nYsSMNguaxsblT4jsojj5Oy6USwh/X4X3rqWDw+ET8V9x8KL3fhMd+2wtgGinelqIu5VzU OuK4j1namRcx+Wsd/Wo57hHdVJFDAEeye/L/ntjNTiOoYzuPHri4sf73YTzz5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZfZR2FZrzZSY; Mon, 13 Mar 2023 01:43:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32D1hhJr043709; Mon, 13 Mar 2023 01:43:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32D1hhbY043708; Mon, 13 Mar 2023 01:43:43 GMT (envelope-from git) Date: Mon, 13 Mar 2023 01:43:43 GMT Message-Id: <202303130143.32D1hhbY043708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "David E. O'Brien" Subject: git: 47d0f36c3c43 - main - Document gethostbyname_r's public exposure in 6.2. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obrien X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47d0f36c3c439c65374d29937f3ccdf99a4356b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by obrien: URL: https://cgit.FreeBSD.org/src/commit/?id=47d0f36c3c439c65374d29937f3ccdf99a4356b6 commit 47d0f36c3c439c65374d29937f3ccdf99a4356b6 Author: David E. O'Brien AuthorDate: 2023-03-13 01:43:05 +0000 Commit: David E. O'Brien CommitDate: 2023-03-13 01:43:05 +0000 Document gethostbyname_r's public exposure in 6.2. --- lib/libc/net/gethostbyname.3 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/net/gethostbyname.3 b/lib/libc/net/gethostbyname.3 index 85b6806092e5..82b0522353ed 100644 --- a/lib/libc/net/gethostbyname.3 +++ b/lib/libc/net/gethostbyname.3 @@ -348,6 +348,10 @@ The function first appeared in .Tn BIND version 4.9.4. +The +.Fn gethostbyname_r +function first appeared in +.Fx 6.2 . .Sh CAVEATS The .Fn gethostent From nobody Mon Mar 13 03:00:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZhGy2qv4z3y2Nh; Mon, 13 Mar 2023 03:00: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 4PZhGy2FRqz3vJ3; Mon, 13 Mar 2023 03:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678676426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBs2twIdm0UUaTEU5glyQp3RpvwIy3FJax6XJBab9yI=; b=wVQIkdAfCklqd5kkEANracXgthbjpsm/Y+dToejfmmqCba5CbPmmUOtwB/q8W/EYOR8zeI rHHPSIb+Px0YZGHuOt9Yjw36FquXbMPMAEkR4ybDDHialGjOhqP08QgcOlvQVYxInlcYcM ZbbGPjD2m+IE9lFgXVPVW7toOSff3NF+OaTK0kK3Vg5iI9iUAkPZ9aCbnqk/Q5GyLSg8tb Q626iXJ/BaVwJvb/giWhNm3WCAPb/fZyjoaTauoDi/qa+qdngj46lNU9cwvP5RvDeBwmaw b910HzSWP8Qo3LbOUcDO0YOW7dBYingd1AUj66TnTZ+7du12CJwap+XRFo+XEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678676426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBs2twIdm0UUaTEU5glyQp3RpvwIy3FJax6XJBab9yI=; b=CzwS/yh1BadarwkTyfZxaDdrZz37gc+p44lAb+ORAuZaEZbbmPJ8hZsQLJJ+MyraTyO5NP Wt+TojPQLntA2CUPiBx1z7VAeGtbCTdPfpdjOLZmg7rxEtVJ/2s+w6ULetxTZnLeMVn8DJ Ljm9kGt3zP1+GCcPCSzhxKOb12SXbFgBNjVieOA84tM+vsXLB4OmAVDwJsGOJDAFwLtrqx GYyJ0x2gzYec4Cbk72p1GYGTqeJSscf3e3IqkKWUCp5xGzKAPbwHQTWxBOyGaTlMbd7t0q hyxO3CWF4OahfEX2Ju1q89+T8PDfTFCkE0L2CAaKECHbDXiqjL1HlVvntwLaFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678676426; a=rsa-sha256; cv=none; b=F/eiGPsqmn6rJHJ66sqNaW6RdodZxAyAhozBiSobCLbLYxlE3/B9eqUD5dSspyToRx2C1d 9xl3sh3oQ2wg8yIOq8yI1KUjG7YdABz2wyvSwr/hwaBzXUtuUQBAgXoDjw0dMkzatFonJU hJAeHr8d5vGuVeSc4XYKfmffgY6KLWxpdqg1mNI+WrkRyw78ZyogShCitRy2+nHQjzTtJ2 OQXO4P9LO5B8iZuNXp2Pag2NaT0q4d2XxvAm5JNb7zEd38xuBMELdIf9oKGf49iCPJcjuu HO+nK5YYjOmdVV/hQGk3qiSRoMmt1O4BBfPXsZINQ9W1nqSth56iB9Q3vZry5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZhGy1GZvzc2t; Mon, 13 Mar 2023 03:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32D30Qre068421; Mon, 13 Mar 2023 03:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32D30Q0K068420; Mon, 13 Mar 2023 03:00:26 GMT (envelope-from git) Date: Mon, 13 Mar 2023 03:00:26 GMT Message-Id: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 15e7fa83ef3cd909e1d1b3b2cada8d9073f2e22e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=15e7fa83ef3cd909e1d1b3b2cada8d9073f2e22e commit 15e7fa83ef3cd909e1d1b3b2cada8d9073f2e22e Author: Wei Hu AuthorDate: 2023-03-13 02:55:04 +0000 Commit: Wei Hu CommitDate: 2023-03-13 02:55:04 +0000 arm64: Hyper-V: Add vPCI and Mellanox driver modules into build These changes in conf and std.hyperv files got missed in previous commit. Reviewed by: whu Tested by: whu Obtained from: Souradeep Chakrabarti Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D38529 --- sys/arm64/conf/std.hyperv | 12 +++++++++++- sys/conf/files.arm64 | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/arm64/conf/std.hyperv b/sys/arm64/conf/std.hyperv index f87082f15c96..b742c75da131 100644 --- a/sys/arm64/conf/std.hyperv +++ b/sys/arm64/conf/std.hyperv @@ -3,4 +3,14 @@ # #hyper-v support -device hyperv +device hyperv + +options COMPAT_LINUXKPI +device xz + +device mlx5 +device mlxfw +device mlx5en +options RATELIMIT +options KERN_TLS +device firmware diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 684cb8cb23ba..22dd267b2b42 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -253,6 +253,7 @@ dev/hyperv/utilities/hv_kvp.c optional hyperv acpi dev/hyperv/netvsc/hn_nvs.c optional hyperv acpi dev/hyperv/netvsc/hn_rndis.c optional hyperv acpi dev/hyperv/netvsc/if_hn.c optional hyperv acpi +dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci acpi dev/ice/if_ice_iflib.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" From nobody Mon Mar 13 08:02:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZpzR4v8Fz3xM4L; Mon, 13 Mar 2023 08:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZpzR4VGXz4NqQ; Mon, 13 Mar 2023 08:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678694547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JGGrKzfPxiW9Eqt2weuKcp3TFEqq71Ja8vRCLWiYN3A=; b=GexlbW0HvKHV8V7DCM+9FA8J0HbYbtbHKDpGNA/iqPP9AA4BiOJYi3JdoZ8MRUubASuDKX 33pxB5CAQF50sfn/SeAFD8CwseRsyXpMgygCEQj8GoP1gHEIsPNo8Inmp0i2h+envLoUwQ sVIHb/f+jYE7cFuh5xyuDEPtZ1bzY7YUePcjJ4MA98u8sog5RwCA4CDaPy+s+0/ZglAbYZ DDladNC897Qcm4T/U2O6kcF2L0XWYJNnCjiTsmF0Vb40laP2KaALGosflP1rcfiBoVrNn1 ciBwNtaiB7glRVb/c99CJC99a/met1pJ8c3Hfa14Xs1Qi3IoaYo2Zh+7ofrNdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678694547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JGGrKzfPxiW9Eqt2weuKcp3TFEqq71Ja8vRCLWiYN3A=; b=GvM2dtcXwPR99NenlVRggM6Eq684GS4kVljChCErO3A7zwAKxTq56/4djQI01bKhX2QA0l jwRg+APQNkO67HvmS3ePDAR5b7jxNkhrGd9WWPN/QN+dtRCu6QCkss1eatWMi2/wlVV8B7 DlG/Pa6IimFpmjZIjT/Y4HUinP355Ngar3RI6WAuRbHyQdrMseGtueTNjNL6f2kbj+R/LM VwKINnLqitCVgUd29jyTI+WAtCWfKE+QMbSzHmT6jR7UDDRPUYYmnrvHoroeymbmHybMYZ MtkIumJRQwZ13skqnDdxiCe01OI5adrRf76+VAU8XzJnycO9OmA3IPSNlc2O1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678694547; a=rsa-sha256; cv=none; b=i6ALF/UJ+z8JrxknxSSqYi7wgNjPIP00+YfjKv9VZytvLeAlOJ6AEeFDfM0pWlcJFHMW/l z/kTD21dYkLVJmfveNylVDugNiVPw7k65bRVhPqHoYNPJrBq5sYdIvJ+nNZZJvaaBT5qVV Z21bHBOjm0R2uFqxZJtjBu/MC8/020rKSUuB03+2TDzyJV9IDSJx86SvaAAzaXNZFJ5Ij7 syuj7iZL5XGI2P48E5ZhAh2Q2mrckXcuu30pM4DPFgsU2dE4dqsoUo17NX6LVxI2Lte6sx TLLjdQ2V0T7feQg60zZmDYFB/3abOnq4+hy/3oDcISW7ydJjyTsZM+JCmHYJtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZpzR3Z6DzlYY; Mon, 13 Mar 2023 08:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32D82RSp068514; Mon, 13 Mar 2023 08:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32D82RjC068513; Mon, 13 Mar 2023 08:02:27 GMT (envelope-from git) Date: Mon, 13 Mar 2023 08:02:27 GMT Message-Id: <202303130802.32D82RjC068513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 43a51b8bfdf0 - stable/13 - route(8): Add an example how to print the routing tables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 43a51b8bfdf004236a7c7f980c5e29c07b208de4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=43a51b8bfdf004236a7c7f980c5e29c07b208de4 commit 43a51b8bfdf004236a7c7f980c5e29c07b208de4 Author: Gordon Bergling AuthorDate: 2021-04-13 04:44:04 +0000 Commit: Gordon Bergling CommitDate: 2023-03-13 08:01:24 +0000 route(8): Add an example how to print the routing tables The manual page currently doesn't show an example how to print the routing table, so add one and .Xr netstat while here. PR: 231579 Reported by: Pekka Järvinen Reviewed by: debdrup Differential Revision: https://reviews.freebsd.org/D29702 (cherry picked from commit bc54f5f1cd5c01aa5f941234034839fb0b8f54ed) --- sbin/route/route.8 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index 6f34795ce883..c353bfb73d62 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd January 9, 2019 +.Dd April 11, 2021 .Dt ROUTE 8 .Os .Sh NAME @@ -453,6 +453,10 @@ Delete a static route from the routing table: Remove all routes from the routing table: .Pp .Dl route flush +.Pp +List all routing tables: +.Pp +.Dl netstat -r .Sh DIAGNOSTICS .Bl -diag .It "add [host \&| network ] %s: gateway %s flags %x" @@ -493,6 +497,7 @@ The next-hop gateway should be reachable through a different route. .El .Sh SEE ALSO .\".Xr esis 4 , +.Xr netstat 1 , .Xr netintro 4 , .Xr route 4 , .Xr arp 8 , From nobody Mon Mar 13 08:02:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZpzS66xNz3xM8Q; Mon, 13 Mar 2023 08:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZpzS5QNHz4Nql; Mon, 13 Mar 2023 08:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678694548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gbQT/2rSV2E7VRVvc2XyuensYEp34gcBty3Lk9K+4eI=; b=RFSnQpRYKh5DXmld1oCE8jLGuFSiAoNfk3bXHqczK62m+NC81eOYBQiRKfYJjVsnCRGu/7 FrXNtsWce3YWk0XujQw7+HHYlSAxuadUsGZJTMPbIrilGT7MQRtR2867/KRsFvS2u9cYih Z7JJfIOibLqPpdXb5YjIeihace1ll/H+0YNkVF/31KLCx+jvTi9hr4L4qIOqvnXkHDsXRj ihyp7nQlScPFn1BW3zZ5ujJ2rrNUnHycFdIKSxGZfnigoqB9yCBs3W9t5kzLxv3gqkap6o 7SjVtfF4j6kPbvAAwsG8p3Y5z4rjDCNAZAQ3NBbjniAauxZt5XxTH+CSR6oeMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678694548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gbQT/2rSV2E7VRVvc2XyuensYEp34gcBty3Lk9K+4eI=; b=Nj/6EVX+c1poHPqsA6NJNByA1StuPVsaCw9Yo372ihzupZN27NyMD78HzYptJJ9yWjA9+R LrBskSarl58eqlWcdwSs2Vyf/bbEjhxPIH0STBH8LpyQx4d80kcQmNJeA4EKck1uKUejxM +Zif3DG8sKeaH6tmPi23Xy7O6LCX4SAiYMvycFO0J2VjyAHRbaZTfK67HcrCKH9X94GEjC oFXxCyImL7ZZdnysCUlqv1zIKIdvIm5ySD8lCqLTt+8MTGsd4gwYuampD0FeHk5aEerXGq 64tWB7OMld8g8Yw3cYHxyYw/nxl70Zt0527vzYT8wMwlZxW2ZoaNroRoWKGH1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678694548; a=rsa-sha256; cv=none; b=USI04s1G0HtqE3W/Z/AgjaczRs1Os4OQG3xQ1Tyhqn/MxlQVqO/wb6TqAQ0hIkOVRFduI2 D4cZ8uPzmGfHAvx+nxe4psr9J4m54JRpA3X5jdCTsiBGFYMfFq1GXORd9E2VNdKHhLzRQ5 sBgO5/J1DETMLbBT2v3DfREFU/VoZHP9Qb3ZxgJ9leRsNgHz4DQZPKR50m73oTEqkXpEDM Qxqk1Oc3CpjnmN1u3Ck7yH6CwxkoQfXfGukZxLNPHVI5qUd+MiR4E2TdQtk/dacpN7ioPD 4jVSwrO6sxoZKMrDdd/41Gb/YVbLfmZHCO2jO/N6uKkjiEy/2qhvpPjboOYjOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZpzS4DrzzlMZ; Mon, 13 Mar 2023 08:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32D82S5O068541; Mon, 13 Mar 2023 08:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32D82SG2068540; Mon, 13 Mar 2023 08:02:28 GMT (envelope-from git) Date: Mon, 13 Mar 2023 08:02:28 GMT Message-Id: <202303130802.32D82SG2068540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: d8d86ab91e0f - stable/13 - route(8): Remove obsolete information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d8d86ab91e0f92995b839d48e48a11c2a1872952 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=d8d86ab91e0f92995b839d48e48a11c2a1872952 commit d8d86ab91e0f92995b839d48e48a11c2a1872952 Author: Warner Losh AuthorDate: 2021-12-15 23:06:19 +0000 Commit: Gordon Bergling CommitDate: 2023-03-13 08:01:36 +0000 route(8): Remove obsolete information xns and osi are no longer relevant (or supported) so remove their vestiges. Noticed by: phk Sponsored by: Netflix (cherry picked from commit c6b2efb64e279b4d543aaa10073c63765bf6e790) --- sbin/route/route.8 | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index c353bfb73d62..161189e7a9d8 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd April 11, 2021 +.Dd December 15, 2021 .Dt ROUTE 8 .Os .Sh NAME @@ -143,8 +143,6 @@ command is specified, .Nm will ``flush'' the routing tables of all gateway entries. When the address family may is specified by any of the -.Fl osi , -.Fl xns , .Fl inet6 , or .Fl inet @@ -264,20 +262,6 @@ Alternately, if the interface is point to point the name of the interface itself may be given, in which case the route remains valid even if the local or remote addresses change. .Pp -The optional modifiers -.Fl xns , -.Fl osi , -and -.Fl link -specify that all subsequent addresses are in the -.Tn XNS -or -.Tn OSI -address families, -or are specified as link-level addresses, -and the names must be numeric specifications rather than -symbolic names. -.Pp The optional .Fl netmask modifier is intended @@ -502,7 +486,6 @@ The next-hop gateway should be reachable through a different route. .Xr route 4 , .Xr arp 8 , .Xr routed 8 -.\".Xr XNSrouted 8 .Sh HISTORY The .Nm From nobody Mon Mar 13 08:02:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZpzT6pVNz3xMVJ; Mon, 13 Mar 2023 08:02: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 4PZpzT6Kn4z4NrR; Mon, 13 Mar 2023 08:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678694549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LOxujEgT89PHwkea7l4HOi86q3HobonsTF5sDUQHDzg=; b=Kp02U9Zxhsle5eYxfP3l42WpZAtnayOJSjcYk1kE21dSjcliY0B4uXJVIQnlZRP04gMK4A 24xSjPADHzub2vB4T44olBZVrVd1R2tG8BHenSOJcWOqUBxIdF28eUIX9MUxRHcANaohGW aSc1+34nvF21eVv68zUVQLBIOZD6VS4ApP+/RwQhxbavpqel9ZaAh0FCwrtjW0PVKWso3I FZ3/p15bk9QNYCu1oeSG8SlAvDDfylaMFnHn8+E7kM5j/UyBrLv7Tw6/Pt6vpJueYkLdK8 aPaToQZfUNZvIW3KwHqlPBF3JcqkAxMZ7+nUiw5+i0qOTkVvOuWk9eM+8k+OWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678694549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LOxujEgT89PHwkea7l4HOi86q3HobonsTF5sDUQHDzg=; b=LiV8FuZMfrNMZUhdxtrAzJ7LkqHcPEKA5sFFn/O9cqiWy0Xs19OkJzCy7y0qjQVsR+BdIE kn9z0vdg0qWQX/wYF6Q32bR36pGE68UZfkFtGVcSvpPMZy56PRpgyUz+46Ll9nvC6F5ff5 6orrIBInOqGqUmMXrzTMk6sQgos/Qsq6xz+HxEiUpspo8wBKDImRSZ0ypG+cQvy+MdUTL5 Jk8uXSdjNR0TTIfyPwlgSeavTcDojLV24WelIhNhzXTb0FC7G7TnSDjbLMA/+bMyUjBefT LJh7pBVublSdYWIRx0YLI9UWdVCZowtvo46olX+uWgoCdmskBJGHM1avQds1uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678694549; a=rsa-sha256; cv=none; b=ycF4D3yHEKnzbso/ccqUi6yYFYXfcmZqGRbibXhMfBIWkWXzH7//7vqFiOfnHvDZuWY7Wt X7mJdOtt5luqVDZZMJBGOYHlenVkmJBqW648fYHcvZNiWUfa/5yNlgOV2oymrVIXYFoG7d lhp75wA3ewBHu1MbsXcmn4ckOrb3GM2J5q4c8UahuGe7XYqVCi9SzJmsab4S1pFm44yt0o 9aqXFghN7CgQHOUQQyGEOB4YX+jktjipNEKEAm0LSdh0js4lkqjFaS7cCv+birexRINn/x QdDZdABQ7qQvsZmQfYhxhvWuvRoo1udtH9DQGW9Zk4qUOND6ewOwD/ATYroKNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZpzT5RKCzlHF; Mon, 13 Mar 2023 08:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32D82Trh068560; Mon, 13 Mar 2023 08:02:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32D82TA1068559; Mon, 13 Mar 2023 08:02:29 GMT (envelope-from git) Date: Mon, 13 Mar 2023 08:02:29 GMT Message-Id: <202303130802.32D82TA1068559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: afca4c000b72 - stable/13 - route.8: Add information about ROUTE_MPATH and FIB_ALGO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: afca4c000b72cc22b4dd988f67a954cbfe0c84d5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=afca4c000b72cc22b4dd988f67a954cbfe0c84d5 commit afca4c000b72cc22b4dd988f67a954cbfe0c84d5 Author: Gordon Bergling AuthorDate: 2023-02-26 13:15:34 +0000 Commit: Gordon Bergling CommitDate: 2023-03-13 08:01:49 +0000 route.8: Add information about ROUTE_MPATH and FIB_ALGO Since the kernel options ROUTE_MPATH and FIB_ALGO are enabled per default for a while, it's good to have some user facing documetation about the general functionality of multipath routing and fib lookup algorithms. Reviewed by: pauamma, Jose Luis Duran Differential Revision: https://reviews.freebsd.org/D38783 (cherry picked from commit b06338167d64507e79e003500002e22fbe583832) --- sbin/route/route.8 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index 161189e7a9d8..c893ae5ab4b3 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd December 15, 2021 +.Dd February 26, 2023 .Dt ROUTE 8 .Os .Sh NAME @@ -405,6 +405,60 @@ and .Dv RTM_CHANGE . As such, only the super-user may modify the routing tables. +.Pp +.Fx provides support for scalable multipath routing. +It is activated by default, but can be turned off by setting the +.Va net.route.multipath +.Xr sysctl 8 +MIB to 0. +.Pp +There are multiple route lookup algorithms available. +They can be configured by setting +.Va net.route.algo.inet.algo +for IPv4 and +.Va net.route.algo.inet6.algo +for IPv6 +.Xr sysctl 8 +MIBs. +.Pp +A list of available algorithms can be obtained by accessing the +following +.Xr sysctl 8 +MIBs +.Va net.route.algo.inet.algo_list +for IPv4 and +.Va net.route.algo.inet6.algo_list +for IPv6. +.Pp +The following algorithms are available: +.Bl -tag -width radix_lockless +.It radix +Base system radix backend. +.It bsearch +Lockless binary search in a special IP array, tailored for a small FIB +with <16 routes. +This algorithm is only available for IPv4. +.It radix_lockless +Lockless immutable radix, re-created on every rtable change, +tailored for a small FIB with <1000 routes. +.It dpdk_lpm +DPDK DIR24-8-based lookups, lockless datastructure, optimized +for a large FIB. +In order to use the dpdk_lpm algorithm one or both of the +following kernel modules must be loaded via +.Xr loader.conf 5 : +.Bl -tag -width dpdk_lpm6.ko -compact +.It dpdk_lpm4.ko +DPDK implementation for IPv4. +.It dpdk_lpm6.ko +DPDK implementation for IPv6. +.El +.El +.Pp +The algorithms are selected automatically based on the size of the routing +table of the system. +They can be changed, but not every algorithm performs best for every +FIB size. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -484,6 +538,7 @@ The next-hop gateway should be reachable through a different route. .Xr netstat 1 , .Xr netintro 4 , .Xr route 4 , +.Xr loader.conf 5 , .Xr arp 8 , .Xr routed 8 .Sh HISTORY From nobody Mon Mar 13 08:02:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZpzW6qxpz3xM76; Mon, 13 Mar 2023 08:02: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 4PZpzW0R5Wz4P2R; Mon, 13 Mar 2023 08:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678694551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2g65WeP1ra7V51mleAYiFCEhFT6nWguJGukG7/a2pxo=; b=gvYbW0lTQWkXgQHfO0x7k1T5VDV9f6olZ4ORQP6Lr26HgvWByM9oTkflW+YxKg9TCCxiHa FcKBxQxomefOm3Tgoql043A3dL83Ekl5vHWvj7MolmLWUfD2vxxfajaY53QbrsgVP4/oYK N7QIHGM2dVii7Pu848bM5nAIMDnoAkarMGzchOWiHVR6LZuDag0CNSfYYdvWm08XXkdZze IF9e6NU/tX2Rn6rcJkDLsTtr1vym/aIQZ2PYnlTUTXLHJy5+Wh4BS7POZtCO2xHbJsDHlf Sfv9Mo3DVQlTkagWlG2gsXQ9ODZb/ndNNpBr7QRp7+9MOnbpSvCaCzvr1MujbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678694551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2g65WeP1ra7V51mleAYiFCEhFT6nWguJGukG7/a2pxo=; b=b5il09MASutflsuS+d8iZ6bKolzkGqMq5QanxBnU8c0ycXyztBns/KO1FSQt3HBAlVKr1p tO3mlM0aUxWkm3VrjSvoz54bHY/ISnirp6gPcE1yhIpfHfo6bwMtuRBJ/nSjx6lF0OhiA3 sgCClrB69IF5sBPM9iH9k7rxOHhhEicKBro1kFm18zRjN7nz9FknV2QR5K1+39Coimpsp/ IbXzhMrlOBFMNVl8XcjGALWHWdA8lofRxhjjRH2hzzvcByvooV8kwQDUzJdhY731R5cZvI aruV4eucBZcu3MChGQ51ux0c0FvLnTz4WHid51SLzHS3yM/UtLecslySHHL2wQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678694551; a=rsa-sha256; cv=none; b=INXV7hr6jjCuw7iTBNhBXJYev12pxF2hCSB2F/QMaUsfhH04GUzZb9CsOknL6cnOGrRLCY DmANyS41WgXaWR1JurHtwKcMY2kn53uPxq/WN56X3mlYNg1xUIpOKEMcuAhQ4BSzhPclb0 SqKZtzgA7N4gxZk82v2OtbZhkRqO7N0N1IKWDoJg6flJNOQwneEEIaJI8G0leQJ5FgieIb wr35KEbXwW5UdimuDsMQR48CU92QgL1A3iKf4oBBGys3Bq9LvQKVP7uemfUpHiXfGIPmgm EztJ8cg3k5/lU8l6jfryrGaiBi434UYfMTbH4ZNGfwoBpThx/o70bQycUUE32w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZpzV6MVCzlHG; Mon, 13 Mar 2023 08:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32D82UUB068579; Mon, 13 Mar 2023 08:02:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32D82UFk068578; Mon, 13 Mar 2023 08:02:30 GMT (envelope-from git) Date: Mon, 13 Mar 2023 08:02:30 GMT Message-Id: <202303130802.32D82UFk068578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ca1b471b50ee - stable/13 - route.8: Fix mandoc warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca1b471b50ee12d839b6b6284139b84aeafc6f00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=ca1b471b50ee12d839b6b6284139b84aeafc6f00 commit ca1b471b50ee12d839b6b6284139b84aeafc6f00 Author: Gordon Bergling AuthorDate: 2023-02-26 13:33:58 +0000 Commit: Gordon Bergling CommitDate: 2023-03-13 08:02:01 +0000 route.8: Fix mandoc warnings - skipping end of block that is not open: Oc - no blank before trailing delimiter - remove useless TN macros - remove commented out reference for esis(4) Differential Revision: https://reviews.freebsd.org/D38783 (cherry picked from commit 6dbfbe6e11a04f6e2ae893dbf46b059ab49eb517) --- sbin/route/route.8 | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index c893ae5ab4b3..5b6e13281447 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -134,7 +134,7 @@ The flush command has the syntax: .Bd -ragged -offset indent -compact .Nm .Op Fl n -.Cm flush Oc Oo Ar family Oc Op Fl fib Ar number +.Cm flush Oo Ar family Oc Op Fl fib Ar number .Ed .Pp If the @@ -228,10 +228,10 @@ is interpreted as .Fl host Li 128.32.0.130 ; .Fl net Li 128.32 is interpreted as -.Li 128.32.0.0; +.Li 128.32.0.0 ; .Fl net Li 128.32.130 is interpreted as -.Li 128.32.130.0; +.Li 128.32.130.0 ; and .Li 192.168.64/20 is interpreted as @@ -265,9 +265,7 @@ if the local or remote addresses change. The optional .Fl netmask modifier is intended -to achieve the effect of an -.Tn OSI -.Tn ESIS +to achieve the effect of an OSI ESIS redirect with the netmask option, or to manually add subnet routes with netmasks different from that of the implied network interface @@ -378,9 +376,7 @@ In a or .Cm add command where the destination and gateway are not sufficient to specify -the route (as in the -.Tn ISO -case where several interfaces may have the +the route (as in the ISO case where several interfaces may have the same address), the .Fl ifp or @@ -534,7 +530,6 @@ same route as the one being changed. The next-hop gateway should be reachable through a different route. .El .Sh SEE ALSO -.\".Xr esis 4 , .Xr netstat 1 , .Xr netintro 4 , .Xr route 4 , From nobody Mon Mar 13 10:18:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZt0X2wryz3xVkg; Mon, 13 Mar 2023 10:18: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 4PZt0X2Rk1z3NJf; Mon, 13 Mar 2023 10:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678702716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VLlhu8eeTwbgngX33baJbuj1XbKxw2rWGEQcb0q8JG0=; b=B0DAjAnNr2Z76NjU5fglsSp7u29MkZq/F8RhrHxB81NNCapfhbXRG9Al4ynQNgTFUKuoTU VYNS4JMlC2YBDA2rv8iXC6K+zrqI4pZLc9fzVmXPcbVKVdm+n4yeQWw02UhquREvh7IyVg 8bAkjTimERPBajQjVDL8eVNFR68o46wFzm1auyZnt1KElYd/sgtSWUUpCXMyLwQd22yBOr hCQPuxDsFCwLArxHrUh5A4Bn8LN4srGmPUrwRnRQX+lfHwXw4zZ/+Q6kk22TYhSsHSpRDy VdagQwjJorFR33YijfJnCNUE+SSXgu7VUvGugcgUoAsxVZguY47Ddx2bd38i8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678702716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VLlhu8eeTwbgngX33baJbuj1XbKxw2rWGEQcb0q8JG0=; b=F4TYmcvlTlr/5qmUS/zykNK54lzNKBFyh5ePnjtFV013govwh0m6ALt5yRj1hbnLCYC/2X ibfrNisITsOqXdXjPjJItOgHS6ULrqx0zKCZgKTm6H1vw+ZPpPdq183Qwc8SPQcgjT7Dxp 6+0tsXgiCefJTsdWdFlhRGFsITaq0JDlMUm+pQYiy9U5dYQrcAdg/cQlbGRBY0zVGWXPhB MnJ+x49Fv4gEc+VsSVxu5r351s/YH/cxE5hgUBG0P18XDXQNVU2hPWWDu4TNynxFhs4+Ga KQDU9jtFYyzLYVDsKPq3H0ruTqtMUbCxPjbj8Rl/aW5ffGOh8uX94aaWR7OCBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678702716; a=rsa-sha256; cv=none; b=Zl5OObv85JwVZRdr8x/VyE5kpxo6nFouewfyNkhEmibxKJUoKZy/YhpUXe+Uky2wAXiK6v zq8xW5n77wv92KAS1SAH6nYQndtfFTwyPWqZ0Cf/6F95Pilzu0fCZWwtpX28G+nZMA57SV /XjC/3erVS+R1uxoqfhebEOorcqCFlZvb86ayR9qamPOr6Zzmat6egnm3Ju4LI002gSKit Ao8w2DQACt/XF8ldGQXoFZXfbtBXb77bPxD9EKHtoceGtYlBneol90BqlaFbQAfgsN90Eb A9leW4+Qunhy/TIEghZ9mmLYQo/NAXYulNixFacBQ/nyWBYTz2+4QOA4Vp03dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZt0X1VQlzpNy; Mon, 13 Mar 2023 10:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DAIafu082187; Mon, 13 Mar 2023 10:18:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DAIaA3082186; Mon, 13 Mar 2023 10:18:36 GMT (envelope-from git) Date: Mon, 13 Mar 2023 10:18:36 GMT Message-Id: <202303131018.32DAIaA3082186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 90bc2120b51b - main - tests: fix python parsing of netlink nested attributes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90bc2120b51bc5ac9fbcb29763cc47562ee49977 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=90bc2120b51bc5ac9fbcb29763cc47562ee49977 commit 90bc2120b51bc5ac9fbcb29763cc47562ee49977 Author: Alexander V. Chernikov AuthorDate: 2023-03-13 10:17:36 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-03-13 10:17:36 +0000 tests: fix python parsing of netlink nested attributes MFC after: 2 weeks --- tests/atf_python/sys/net/netlink.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/atf_python/sys/net/netlink.py b/tests/atf_python/sys/net/netlink.py index bfbf3217d52a..053eb432e915 100644 --- a/tests/atf_python/sys/net/netlink.py +++ b/tests/atf_python/sys/net/netlink.py @@ -1082,6 +1082,7 @@ rtnl_ifla_attrs = prepare_attrs_map( AttrDescr(IflattrType.IFLA_BROADCAST, NlAttrMac), AttrDescr(IflattrType.IFLA_IFNAME, NlAttrStr), AttrDescr(IflattrType.IFLA_MTU, NlAttrU32), + AttrDescr(IflattrType.IFLA_LINK, NlAttrU32), AttrDescr(IflattrType.IFLA_PROMISCUITY, NlAttrU32), AttrDescr(IflattrType.IFLA_OPERSTATE, NlAttrU8), AttrDescr(IflattrType.IFLA_CARRIER, NlAttrU8), @@ -1279,8 +1280,8 @@ class StdNetlinkMessage(BaseNetlinkMessage): val = v["ad"].cls.from_bytes(data[off : off + nla_len], v["ad"].val) if "child" in v: # nested - attrs, _ = self.parse_attrs(data[off : off + nla_len], v["child"]) - val = NlAttrNested(raw_nla_type, attrs) + attrs, _ = self.parse_attrs(data[off + 4 : off + nla_len], v["child"]) + val = NlAttrNested(v["ad"].val, attrs) else: # unknown attribute val = NlAttr(raw_nla_type, data[off + 4 : off + nla_len]) From nobody Mon Mar 13 11:00:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZtxC6KPXz3xYF8; Mon, 13 Mar 2023 11:00: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 4PZtxC5mhxz3R1B; Mon, 13 Mar 2023 11:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678705247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=olstvcGd94np97MGpjdzRUJh2Xud9BY9eTpNzHGy5Xs=; b=LZWtXImd5oVP18e4txO5DDrBnx7ygnqOFoDTizCKVNLw4Y67WjYEDCmd5yFdheDbgPeSuw Dr4b0sXzEOMYcmmdh4Ix1RS2IiAHJbFYltYjzaY61eipsNoBUIH7oEVaHaXHKyd/ExxyCd KQ4mL7k0ccXHlXgB9crylYddOxHb7KdCD1GEtYQ+rFun4P+IzyWf1a18jP9H6oxttT4jWq u+PZBQWrXbYSUsdbgazmn4ZvSOnCKdKB8dzNY7HuLh3b7K5G4Gdapmg/9ov4kGqIIY4fBp ioPOj45OqEAl8M1tnksP0uIWY8BkPFTrg0Vys6gWd9GX5pVDWEBFXnHn98rBKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678705247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=olstvcGd94np97MGpjdzRUJh2Xud9BY9eTpNzHGy5Xs=; b=XXXzOk6TPtamYLFEHnrTxvKcyui0/GvqVF8LzRTOwrJYt8WLLGE9hbMeadTlHjZ7OijE0H oZZl4VTzJMasr4jo2ThgAdyGcbWOf2s6Ll+Zf6Nz/9TZn8SF3YNTY0HaNZBVnwPn6DinTs SvhFOdNYm9N3N0x5Ukj1EeAwCFgquPTpx2c9DigfnEtgFEuByj7y2QIMgW5M6u8mDX0slg XFzJziKwOOvW6VY/T44jE0xGzP4jeWcuCrauzZzu6qNH8bB044K+KpYRdkms+7QJayHAhC 6O8BXrOw1hcuaixK0kTiETzuz6GpRhqp9XcaYlOhsKO8ap5Yx8gqf3HKbcaCZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678705247; a=rsa-sha256; cv=none; b=v/0LYpRog5P4L8q8VBfT3vXEMyy8PAjBvWqSubbHRF7EC9BmySrvxcyucUYVDfcw1k+Oki Ik/yoxA9weH5w741QzVqAQsPD/IZiR3wezJE08QRKR2h3C2Cr7ninTxch82Det83CvUgzP niVCbnNolc4N/7Wf6ww9ZIwDN0i8yA1HRU0eyGlTBcpMVkUgcQ/+d0taAm7U30Fs/q11MX T+7HJqIjzwKd8XZz9qNlQJnEITLQP3TP8Nw98YRcM8JAgTcsMtEYLzFI7GLOTYxfQrSOkz +p8z22MiYePelMYivnP/cw9GOJAVxo4D5MV5eCVobOnLtzgwNe88UgshDRR2fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZtxC4rGMzqwg; Mon, 13 Mar 2023 11:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DB0lZ6059022; Mon, 13 Mar 2023 11:00:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DB0l2h059021; Mon, 13 Mar 2023 11:00:47 GMT (envelope-from git) Date: Mon, 13 Mar 2023 11:00:47 GMT Message-Id: <202303131100.32DB0l2h059021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 0a310c94eeb8 - main - vm: consistently prefix fault helpers with vm_fault_ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a310c94eeb8ffae1d96d1797d2b2e6cad8e5afe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0a310c94eeb8ffae1d96d1797d2b2e6cad8e5afe commit 0a310c94eeb8ffae1d96d1797d2b2e6cad8e5afe Author: Mateusz Guzik AuthorDate: 2023-03-12 18:38:29 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-13 11:00:28 +0000 vm: consistently prefix fault helpers with vm_fault_ Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39029 --- sys/vm/vm_fault.c | 80 +++++++++++++++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index fadd7dbd2fd5..056e6e12e8c8 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -195,7 +195,7 @@ SYSCTL_INT(_vm, OID_AUTO, pfault_oom_wait, CTLFLAG_RWTUN, "the page fault handler"); static inline void -fault_page_release(vm_page_t *mp) +vm_fault_page_release(vm_page_t *mp) { vm_page_t m; @@ -213,7 +213,7 @@ fault_page_release(vm_page_t *mp) } static inline void -fault_page_free(vm_page_t *mp) +vm_fault_page_free(vm_page_t *mp) { vm_page_t m; @@ -235,7 +235,7 @@ fault_page_free(vm_page_t *mp) * be checked quickly. */ static inline bool -fault_object_needs_getpages(vm_object_t object) +vm_fault_object_needs_getpages(vm_object_t object) { VM_OBJECT_ASSERT_LOCKED(object); @@ -244,7 +244,7 @@ fault_object_needs_getpages(vm_object_t object) } static inline void -unlock_map(struct faultstate *fs) +vm_fault_unlock_map(struct faultstate *fs) { if (fs->lookup_still_valid) { @@ -254,7 +254,7 @@ unlock_map(struct faultstate *fs) } static void -unlock_vp(struct faultstate *fs) +vm_fault_unlock_vp(struct faultstate *fs) { if (fs->vp != NULL) { @@ -264,29 +264,29 @@ unlock_vp(struct faultstate *fs) } static void -fault_deallocate(struct faultstate *fs) +vm_fault_deallocate(struct faultstate *fs) { - fault_page_release(&fs->m_cow); - fault_page_release(&fs->m); + vm_fault_page_release(&fs->m_cow); + vm_fault_page_release(&fs->m); vm_object_pip_wakeup(fs->object); if (fs->object != fs->first_object) { VM_OBJECT_WLOCK(fs->first_object); - fault_page_free(&fs->first_m); + vm_fault_page_free(&fs->first_m); VM_OBJECT_WUNLOCK(fs->first_object); vm_object_pip_wakeup(fs->first_object); } vm_object_deallocate(fs->first_object); - unlock_map(fs); - unlock_vp(fs); + vm_fault_unlock_map(fs); + vm_fault_unlock_vp(fs); } static void -unlock_and_deallocate(struct faultstate *fs) +vm_fault_unlock_and_deallocate(struct faultstate *fs) { VM_OBJECT_UNLOCK(fs->object); - fault_deallocate(fs); + vm_fault_deallocate(fs); } static void @@ -471,8 +471,8 @@ vm_fault_populate(struct faultstate *fs) pager_first = OFF_TO_IDX(fs->entry->offset); pager_last = pager_first + atop(fs->entry->end - fs->entry->start) - 1; - unlock_map(fs); - unlock_vp(fs); + vm_fault_unlock_map(fs); + vm_fault_unlock_vp(fs); res = FAULT_SUCCESS; @@ -781,7 +781,7 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objlocked) * Perform an unlock in case the desired vnode changed while * the map was unlocked during a retry. */ - unlock_vp(fs); + vm_fault_unlock_vp(fs); locked = VOP_ISLOCKED(vp); if (locked != LK_EXCLUSIVE) @@ -801,9 +801,9 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objlocked) vhold(vp); if (objlocked) - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); else - fault_deallocate(fs); + vm_fault_deallocate(fs); error = vget(vp, locked | LK_RETRY | LK_CANRECURSE); vdrop(vp); fs->vp = vp; @@ -875,7 +875,7 @@ vm_fault_lookup(struct faultstate *fs) VM_PROT_FAULT_LOOKUP, &fs->entry, &fs->first_object, &fs->first_pindex, &fs->prot, &fs->wired); if (result != KERN_SUCCESS) { - unlock_vp(fs); + vm_fault_unlock_vp(fs); return (result); } @@ -892,7 +892,7 @@ vm_fault_lookup(struct faultstate *fs) vm_map_lock(fs->map); if (vm_map_lookup_entry(fs->map, fs->vaddr, &fs->entry) && (fs->entry->eflags & MAP_ENTRY_IN_TRANSITION)) { - unlock_vp(fs); + vm_fault_unlock_vp(fs); fs->entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; vm_map_unlock_and_wait(fs->map, 0); } else @@ -1095,10 +1095,10 @@ vm_fault_next(struct faultstate *fs) } else if (fs->m != NULL) { if (!vm_fault_object_ensure_wlocked(fs)) { fs->can_read_lock = false; - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (FAULT_NEXT_RESTART); } - fault_page_free(&fs->m); + vm_fault_page_free(&fs->m); } /* @@ -1163,7 +1163,7 @@ vm_fault_allocate_oom(struct faultstate *fs) { struct timeval now; - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); if (vm_pfault_oom_attempts < 0) return (true); if (!fs->oom_started) { @@ -1203,7 +1203,7 @@ vm_fault_allocate(struct faultstate *fs) } if (fs->pindex >= fs->object->size) { - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (FAULT_OUT_OF_BOUNDS); } @@ -1215,7 +1215,7 @@ vm_fault_allocate(struct faultstate *fs) case FAULT_SUCCESS: case FAULT_FAILURE: case FAULT_RESTART: - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (res); case FAULT_CONTINUE: /* @@ -1248,7 +1248,7 @@ vm_fault_allocate(struct faultstate *fs) vm_object_color(fs->object, atop(fs->vaddr) - fs->pindex); #endif if (!vm_pager_can_alloc_page(fs->object, fs->pindex)) { - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (FAULT_FAILURE); } fs->m = vm_page_alloc(fs->object, fs->pindex, @@ -1309,7 +1309,7 @@ vm_fault_getpages(struct faultstate *fs, int *behindp, int *aheadp) * a shadow, then an earlier iteration of this loop * may have already unlocked the map.) */ - unlock_map(fs); + vm_fault_unlock_map(fs); status = vm_fault_lock_vnode(fs, false); MPASS(status == FAULT_CONTINUE || status == FAULT_RESTART); @@ -1364,8 +1364,8 @@ vm_fault_getpages(struct faultstate *fs, int *behindp, int *aheadp) */ if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) { VM_OBJECT_WLOCK(fs->object); - fault_page_free(&fs->m); - unlock_and_deallocate(fs); + vm_fault_page_free(&fs->m); + vm_fault_unlock_and_deallocate(fs); return (FAULT_OUT_OF_BOUNDS); } KASSERT(rv == VM_PAGER_FAIL, @@ -1396,11 +1396,11 @@ vm_fault_busy_sleep(struct faultstate *fs) */ vm_page_aflag_set(fs->m, PGA_REFERENCED); if (fs->object != fs->first_object) { - fault_page_release(&fs->first_m); + vm_fault_page_release(&fs->first_m); vm_object_pip_wakeup(fs->first_object); } vm_object_pip_wakeup(fs->object); - unlock_map(fs); + vm_fault_unlock_map(fs); if (fs->m != vm_page_lookup(fs->object, fs->pindex) || !vm_page_busy_sleep(fs->m, "vmpfw", 0)) VM_OBJECT_UNLOCK(fs->object); @@ -1434,7 +1434,7 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp) */ if ((fs->object->flags & OBJ_DEAD) != 0) { dead = fs->object->type == OBJT_DEAD; - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); if (dead) return (FAULT_PROTECTION_FAILURE); pause("vmf_de", 1); @@ -1467,11 +1467,11 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp) * or this is the beginning of the search, allocate a new * page. */ - if (fs->m == NULL && (fault_object_needs_getpages(fs->object) || + if (fs->m == NULL && (vm_fault_object_needs_getpages(fs->object) || fs->object == fs->first_object)) { if (!vm_fault_object_ensure_wlocked(fs)) { fs->can_read_lock = false; - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (FAULT_RESTART); } res = vm_fault_allocate(fs); @@ -1484,7 +1484,7 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp) * If not, skip to the next object without dropping the lock to * preserve atomicity of shadow faults. */ - if (fault_object_needs_getpages(fs->object)) { + if (vm_fault_object_needs_getpages(fs->object)) { /* * At this point, we have either allocated a new page * or found an existing page that is only partially @@ -1647,8 +1647,8 @@ RetryFault: MPASS(res_next == FAULT_NEXT_NOOBJ); if ((fs.fault_flags & VM_FAULT_NOFILL) != 0) { if (fs.first_object == fs.object) - fault_page_free(&fs.first_m); - unlock_and_deallocate(&fs); + vm_fault_page_free(&fs.first_m); + vm_fault_unlock_and_deallocate(&fs); return (KERN_OUT_OF_BOUNDS); } VM_OBJECT_UNLOCK(fs.object); @@ -1698,7 +1698,7 @@ found: if (!fs.lookup_still_valid) { rv = vm_fault_relookup(&fs); if (rv != KERN_SUCCESS) { - fault_deallocate(&fs); + vm_fault_deallocate(&fs); if (rv == KERN_RESTART) goto RetryFault; return (rv); @@ -1757,7 +1757,7 @@ found: /* * Unlock everything, and return */ - fault_deallocate(&fs); + vm_fault_deallocate(&fs); if (hardfault) { VM_CNT_INC(v_io_faults); curthread->td_ru.ru_majflt++; @@ -1909,7 +1909,7 @@ vm_fault_prefault(const struct faultstate *fs, vm_offset_t addra, if (!obj_locked) VM_OBJECT_RLOCK(lobject); while ((m = vm_page_lookup(lobject, pindex)) == NULL && - !fault_object_needs_getpages(lobject) && + !vm_fault_object_needs_getpages(lobject) && (backing_object = lobject->backing_object) != NULL) { KASSERT((lobject->backing_object_offset & PAGE_MASK) == 0, ("vm_fault_prefault: unaligned object offset")); From nobody Mon Mar 13 11:55:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZw8g1Qncz3xc0x; Mon, 13 Mar 2023 11:55:47 +0000 (UTC) (envelope-from melifaro@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZw8g0csrz3khB; Mon, 13 Mar 2023 11:55:47 +0000 (UTC) (envelope-from melifaro@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678708547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VllnY4WoJ0grWMt7VyALKuOgFsRznlf9yFjZH47x/Ok=; b=dcaCQN8nouP49+M3lYLRlvFmgkm/Q0ry2eurazE1dDzf2OSwIfi0HvF7S+KQ2GMI33Go4l DSLc1LHb1SiWWmQfQ9iwkaKVZaBQXFx//GqkJsmdBM1AViiCVia2AgRv3xLIWONz93uy/a EMfDmaNSwqGRpg/BDsgDwWWrI3lXb1BQEd0tfijjblbRjygdPAqU6ho3TKPQAt+OLyn5n5 h/Cmo7UE8BKirWJMw8gP3oCWsMrdRPgrFUSZvbkZuJpIFzsxCow2DV3DykqAevZCrWsHQ3 fPLgabv3Sww9XLLi4hor2o74QNAOASq6NBOVHUsiOL2ux2aG1fm1pqK8yyMgUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678708547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VllnY4WoJ0grWMt7VyALKuOgFsRznlf9yFjZH47x/Ok=; b=uvjm8a27cnAhk/LkGJnFFojN1hca4QBvl/1DN8E9fwRQyloF1+5XZQ6XKszkUbloEn3HPt TyiFdNbH/PAsbSJT4arl60JWSBZ0PO96zd2MU8Pc6NWHyLYhiWGcnGsNUjfVZ6xYbPeOnP o0cm7N5bru894qWD84WkCh534/UU3QebRIope9TxJ9IGIb/iykj7AQ6GSvO3hPO68b8AAp LGc0LYg4N0qbefJy51sCL9k0HYg9QEMWikHc0EGrjn2JN5CgHRb2IPgnmMXDAY+NEkPM0Q VSM4R7bqS6bZa03SVPT/ua+YUwKIa06n2FjDWXQ8x6h5BW43t5LpqcQbCHs1AQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678708547; a=rsa-sha256; cv=none; b=Wxnvee/3L2hJIfcH5ma9mFc60GsIFKheAnPqU7d7C2KgQHYIKFveQ2l2zkSlISIwAwdpry IJjAJJcwV9ADLVpynmhLTatWjIXicqWqEvsr6qNOr3KRBVWE23MHR3iqIzTltjL6hNnAO1 xj4wUPzvTwcj84qi1c87KSMgmQnYrnPlNP2Q+hozp1SOkb4w8nbCxQC2mvwbag//qIyyyj AkhNtYkh5CuhDgQ36dINuvJUJBmzeNsyHZtDLnm3/4VZO8u3WqYyL07lIXu5jJUy9JllzV becCgoGp4jdIv1+cIBEDtE5j5WVfHrgSgZanUb3mqS5cxD9qWNXhVdLqyFKCJw== Received: from smtpclient.apple (unknown [IPv6:2a02:8084:d6bb:510:fd30:dfc2:e56b:5278]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: melifaro/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PZw8f3134z1Lcl; Mon, 13 Mar 2023 11:55:46 +0000 (UTC) (envelope-from melifaro@freebsd.org) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: e80699a809a0 - main - netlink: add NETLINK to GENERIC. From: Alexander Chernikov In-Reply-To: <9C7C790F-68BD-4913-B554-6C72BE9174D5@freebsd.org> Date: Mon, 13 Mar 2023 11:55:35 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202301311425.30VEPYhj039848@gitrepo.freebsd.org> <9C7C790F-68BD-4913-B554-6C72BE9174D5@freebsd.org> To: Jessica Clarke X-Mailer: Apple Mail (2.3731.400.51.1.1) X-ThisMailContainsUnwantedMimeParts: N Hi Jessica, I=E2=80=99d like to apologise for the belated reply. > On 31 Jan 2023, at 15:05, Jessica Clarke wrote: >=20 > On 31 Jan 2023, at 14:25, Alexander V. Chernikov = wrote: >>=20 >> The branch main has been updated by melifaro: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3De80699a809a079c4e673940544d6ddd9= 44e8d08e >>=20 >> commit e80699a809a079c4e673940544d6ddd944e8d08e >> Author: Alexander V. Chernikov >> AuthorDate: 2023-01-31 14:22:11 +0000 >> Commit: Alexander V. Chernikov >> CommitDate: 2023-01-31 14:22:11 +0000 >>=20 >> netlink: add NETLINK to GENERIC. >>=20 >> This is a followup of 692e19cf5195 (add netlink to GENERIC@amd64). >>=20 >> Netlink is a communication protocol defined in RFC 3549. It is = async, >> TLV-based protocol, providing 1-1 and 1-many communications between = kernel >> and userland. Netlink is currently used in Linux kernel to modify, = read and >> subscribe for nearly all networking states. Interface state, = addresses, routes, >> firewall, rules, fibs, etc, are controlled via Netlink. >>=20 >> Netlink support was added in D36002. It has got a number of = improvements and >> first customers since then: >> * net/bird2 got netlink support, enabling route multipath in FreeBSD >> * netlink-based devd notifications are being worked on ( D37574 ). >> * linux(4) fully supports and depends on Netlink >>=20 >> Enabling Netlink in GENERIC targets two goals. >> The first one is to provide stability for the third-party userland = applications, >> so they can rely on the fact that netlink always exists since 14.0 = and potentially 13.2. >> Loadable module makes life of the app delepers harder. For example, = `net/bird2` can be >> either build with netlink or rtsock support, but not both. >>=20 >> The second goal is to enable gradual conversion of the base userland = tools >> to use netlink(4) interfaces. Converting tools like netstat = (D36529), route, >> ifconfig one-by-one simplifies testing and addressing the feedback. >> Othewise, switching all base to use netlink at once may be too big = of a leap. >>=20 >> MFC after: 1 week >> Differential Revision: https://reviews.freebsd.org/D37783 >> --- >> sys/arm/conf/std.armv7 | 1 + >> sys/arm64/conf/std.arm64 | 1 + >> sys/i386/conf/GENERIC | 1 + >> sys/powerpc/conf/GENERIC64 | 1 + >> sys/riscv/conf/GENERIC | 1 + >> 5 files changed, 5 insertions(+) >=20 > Why not 32-bit powerpc? And if this is to make it generally available The goal at the time was to get wider testing & feedback, joined with = having code suitable for merging to 13.2. > as a standard FreeBSD component, what about all the various = non-GENERIC > kernels (that don=E2=80=99t inherit from one of the ones you=E2=80=99ve = touched)? > Especially if base is going to start using it. You=E2=80=99re absolutely right, I=E2=80=99ve raised = https://reviews.freebsd.org/D39047 to make Netlink a standard kernel = component. >=20 > Jess >=20 >> diff --git a/sys/arm/conf/std.armv7 b/sys/arm/conf/std.armv7 >> index 8ace5c01eeab..03cc0ae5a2b8 100644 >> --- a/sys/arm/conf/std.armv7 >> +++ b/sys/arm/conf/std.armv7 >> @@ -11,6 +11,7 @@ options CC_CUBIC # include CUBIC congestion control >> options TCP_HHOOK # hhook(9) framework for TCP >> device crypto # core crypto support >> options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 >> +options NETLINK # netlink(4) support >> options SCTP_SUPPORT # Allow kldload of SCTP >> options FFS # Berkeley Fast Filesystem >> options SOFTUPDATES # Enable FFS soft updates support >> diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 >> index 6480ca6530e4..1e664a3ba90c 100644 >> --- a/sys/arm64/conf/std.arm64 >> +++ b/sys/arm64/conf/std.arm64 >> @@ -13,6 +13,7 @@ options INET # InterNETworking >> options INET6 # IPv6 communications protocols >> options CC_CUBIC # include CUBIC congestion control >> options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 >> +options NETLINK # netlink(4) support >> options ROUTE_MPATH # Multipath routing support >> options FIB_ALGO # Modular fib lookups >> options TCP_OFFLOAD # TCP offload >> diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC >> index 235713851016..5d30f2877c1c 100644 >> --- a/sys/i386/conf/GENERIC >> +++ b/sys/i386/conf/GENERIC >> @@ -32,6 +32,7 @@ options VIMAGE # Subsystem virtualization, e.g. = VNET >> options INET # InterNETworking >> options INET6 # IPv6 communications protocols >> options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 >> +options NETLINK # netlink(4) support >> options ROUTE_MPATH # Multipath routing support >> options TCP_HHOOK # hhook(9) framework for TCP >> options TCP_OFFLOAD # TCP offload >> diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 >> index bfd0cf342d95..37a78446f07a 100644 >> --- a/sys/powerpc/conf/GENERIC64 >> +++ b/sys/powerpc/conf/GENERIC64 >> @@ -42,6 +42,7 @@ options VIMAGE # Subsystem virtualization, e.g. = VNET >> options INET # InterNETworking >> options INET6 # IPv6 communications protocols >> options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 >> +options NETLINK # netlink(4) support >> options ROUTE_MPATH # Multipath routing support >> options TCP_OFFLOAD # TCP offload >> options TCP_BLACKBOX # Enhanced TCP event logging >> diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC >> index 2e35a49825d4..69c36511da80 100644 >> --- a/sys/riscv/conf/GENERIC >> +++ b/sys/riscv/conf/GENERIC >> @@ -31,6 +31,7 @@ options INET # InterNETworking >> options INET6 # IPv6 communications protocols >> options TCP_HHOOK # hhook(9) framework for TCP >> options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 >> +options NETLINK # netlink(4) support >> options ROUTE_MPATH # Multipath routing support >> options TCP_OFFLOAD # TCP offload >> options TCP_BLACKBOX # Enhanced TCP event logging >=20 From nobody Mon Mar 13 13:50:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZyjB4YmSz3xkXP; Mon, 13 Mar 2023 13:50: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 4PZyjB42B4z3t8d; Mon, 13 Mar 2023 13:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678715438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eVh1sXocCMNLrA5ErxjbDa7mtJ+AZXqSiZb7SA+ssPE=; b=IqPTHxujwpzglJ3VAeXQwhVVRP49nSoOXpmCbtzP3BPm8zTKLN7niSHNfvFtM/dFc0aqxi YIItEeb68MCELLqbxnTgB3gmHxNM48FZ1z07K07aUr7RPkg4YUIYELWX3GcUUV62QdE7qt W0mJvqXrfn44OGI+WZbDYDOKyDFBDgeLgA1FKQQmz8eY8dYd5YFjS4wHFqf7PUiIlLNezS N+LfQY8zICqFeD/RNA3V5V32uDiTaBuZpgna38Dw6UZsSd9Z/FM5wGF0nCARsZ8Q6FXizN JCrygElGbAZNZbRHSMtxd3n6Jq4sIthRT2wkKo0YubJ7P93V3F82lwfMjINuzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678715438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eVh1sXocCMNLrA5ErxjbDa7mtJ+AZXqSiZb7SA+ssPE=; b=MLs/L+EpcDvB57CbClrGf5MZKcRpHNqplb9YIHtw/LcPDynpDOGVqOfEvvXcQXtLMNOlY9 BsMuR7juE9oxS71YVYYon0ms8T+1RiaAjtJh19t34XRdzkAmenGnk5or3mvCaE/E3ysZN0 7LcKy/h2cXb4P61QUBfZcWhwR1PnE6BRzRZsS1CouAaGQF1Yri14Tqzpboq7Q1ZWWk7/80 q/S79g3xcxVc1UxrqcoJWE+dXCYGBndkTUjuQB9ptCxE4v1hwTtvATudxhaG19eqy0qL7U N8AC5jB+4ajQT8VDoiPGCocXrzsXVy8C6gyB8yFe7cO3Wupyu9JSGUjlZPrpYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678715438; a=rsa-sha256; cv=none; b=GWQcPg86/Q+jzY/TcUb6w+A7+dgcrX/lS6oFNovPUL1j64hkt2IONiFj3Q0DOz5eGynmGo lLeRG4oB7N/msH2aT0J0esCUWFVQL7ia0Ti9mxy1nqypM3gQnhdIEOCx3HNxsWcJCd/4ms EgIT2LawXCaTPLX9P6QhZO/GF3y9gu2KsnEBKzHnqzCJX6IkTzCZG+tR2b6aeL+6l4e5YT nzeNsCvUdjYYFuRYHNWUSXG/42D4cNH895JcS1D+k7dTdFC6Pok1kfdi/AoJYFscGU6fIQ /WCAQmmZdDiWRJg305qoh0GaTXtdvVnpnTn0p0GgObYdCtWwRInscibbPR7QEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZyjB34vCzvl1; Mon, 13 Mar 2023 13:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DDocfY036304; Mon, 13 Mar 2023 13:50:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DDocu7036303; Mon, 13 Mar 2023 13:50:38 GMT (envelope-from git) Date: Mon, 13 Mar 2023 13:50:38 GMT Message-Id: <202303131350.32DDocu7036303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 84f06098ef0a - main - zfs: Use .section .rodata instead of .rodata on FreeBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84f06098ef0a1c7d3d385e3b5d5f8009e985f6d2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=84f06098ef0a1c7d3d385e3b5d5f8009e985f6d2 commit 84f06098ef0a1c7d3d385e3b5d5f8009e985f6d2 Author: Dimitry Andric AuthorDate: 2023-02-25 00:45:48 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-13 13:48:05 +0000 zfs: Use .section .rodata instead of .rodata on FreeBSD In commit 0a5b942d4 the FreeBSD SECTION_STATIC macro was set to ".rodata". This assembler directive is supported by LLVM (as a convenience alias for ".section .rodata") by not by GNU as. This caused the FreeBSD builds that are done with gcc to fail. Therefore, use ".section .rodata" instead, similar to the other asm_linkage.h headers. [mjg: cherry-picked from upstream zfs bf1bec394e715de9f7ac4a54b5b1b884d7e41a32 to unbreak gcc12 build] Reviewed-by: Mateusz Guzik Reviewed-by: Attila Fülöp Reviewed-by: Jorgen Lundman Signed-off-by: Dimitry Andric Closes #14526 --- sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h | 2 +- .../openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h index 1ebfd8350661..d1f53cf22f41 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/ia32/asm_linkage.h @@ -36,7 +36,7 @@ #define ENDBR #define SECTION_TEXT .text -#define SECTION_STATIC .rodata +#define SECTION_STATIC .section .rodata #ifdef __cplusplus extern "C" { diff --git a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h index 08c73037990f..1c4d74423644 100644 --- a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h +++ b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h @@ -40,7 +40,7 @@ #define ENDBR #define SECTION_TEXT .text -#define SECTION_STATIC .rodata +#define SECTION_STATIC .section .rodata #ifdef __cplusplus extern "C" { From nobody Mon Mar 13 13:53:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZymc6LH5z3xkgd; Mon, 13 Mar 2023 13:53: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 4PZymc5X5Bz3tmq; Mon, 13 Mar 2023 13:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678715616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PGVbQhCMxYHB3Pyd/pRSYjfUT6+0B79oECarB104MZI=; b=Gms7FtHHhEHyE2ZbJpUUTvtK0vE2bPOYvzyARtA8Gaa/PFg0bu8Q+/vczY1XJeg3AxvZsB 7q3JyNp0duc7SQxoXU6r+VSFVxkw31Xk4NdxUEBqVt61KCgv9p0ymP8OQpBEndIXWPN6lu rOGSkA+wJIAlNzdk7t/yLoxuV+FcYj0SZLPPrDtaKcL0gCrRZ6N110/uIU+NB7kPPjh/jW exjAQS/EZSnnbtP8AjC05DKjWjDBRb1sR1VwIN2O5G+FMYpLGrmfio5bLm68cywkioqtyZ X/L8WxzGQPwZEYJmL1zfPRKGn1MVAFJXlbopsKGD98JPCdzlQzMn6TDwW9UXeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678715616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PGVbQhCMxYHB3Pyd/pRSYjfUT6+0B79oECarB104MZI=; b=x0BAQspIxjU/khmShoJk5CmpPAX2iGKB7uF7LQReoX/xZ6oRIvYWB/e+p7FP+G21/1tjlk BAdOYJwY56gE1VVVXQelvthSMtqiRyiL3Ux3n5evBPLGlQMDbb81w2yqOA8z4okEZIkoQB Bw02cOxV1HRjod9n/6zzq7kyGSVurxzXyW06hYVk0+Gu76GMmYP+F30QRcxdcHsRYNTTI9 ZKoUeX7E9KWifuc6jCMRqjRyB8V65F1gEbbK2S7Sa0sR+KWXnoHTPe1peQGAfAt0uvinj/ BIrILqdRnj5RL51NWA83jOrnmEXyzIwMXdETa/sNepDS35oUnvvQOo680PUuLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678715616; a=rsa-sha256; cv=none; b=DyipjP6DKyJtIuW2jDrVIWZ5QipFshNdecn8QwK5CUOyMDqdrVU/HrrRxdxqQvFMG5vKNq S8OO8vvDdyzFWfCWRyY3KQK0IyCMkN4OXbIych8FRi1yvZjxKpcjjb4VOENudyzCFwlH5n PsWfccAPoCjBMEhrhp2qvPDedjx/vFhiRP/uDuOBChlvGjNV2yowBoX3ZYQ3sd/HIX/2Ue Ce41htarAh9GgXjuZMYcgauNMxW2j9S6iiDa6KXNr8WhlGQZ16uLUconnzj63JRnhtKgyv jqnBZU4s/zgekzJihPqJFs8qOunXRVXCqjkY/HP9MBYJ5z6oCuxLRRaPHeM2pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZymc4crNzw71; Mon, 13 Mar 2023 13:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DDraDT042853; Mon, 13 Mar 2023 13:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DDravY042851; Mon, 13 Mar 2023 13:53:36 GMT (envelope-from git) Date: Mon, 13 Mar 2023 13:53:36 GMT Message-Id: <202303131353.32DDravY042851@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: 359b91804001 - stable/13 - Add NAMESPACE MANAGEMENT into admin_opcode[]. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 359b91804001d33c5ae19851baff2aac6dcfdec0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=359b91804001d33c5ae19851baff2aac6dcfdec0 commit 359b91804001d33c5ae19851baff2aac6dcfdec0 Author: Alexander Motin AuthorDate: 2023-03-08 20:42:31 +0000 Commit: Alexander Motin CommitDate: 2023-03-13 13:52:51 +0000 Add NAMESPACE MANAGEMENT into admin_opcode[]. MFC after: 1 week (cherry picked from commit 49ebbdb264fe185a685dce846985b95f28320e3f) --- sys/dev/nvme/nvme_qpair.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index ad6c1be91c3f..3db29d01e884 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -62,6 +62,7 @@ static struct nvme_opcode_string admin_opcode[] = { { NVME_OPC_SET_FEATURES, "SET FEATURES" }, { NVME_OPC_GET_FEATURES, "GET FEATURES" }, { NVME_OPC_ASYNC_EVENT_REQUEST, "ASYNC EVENT REQUEST" }, + { NVME_OPC_NAMESPACE_MANAGEMENT, "NAMESPACE MANAGEMENT" }, { NVME_OPC_FIRMWARE_ACTIVATE, "FIRMWARE ACTIVATE" }, { NVME_OPC_FIRMWARE_IMAGE_DOWNLOAD, "FIRMWARE IMAGE DOWNLOAD" }, { NVME_OPC_DEVICE_SELF_TEST, "DEVICE SELF-TEST" }, From nobody Mon Mar 13 13:53:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZymd6mTwz3xl1j; Mon, 13 Mar 2023 13:53: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 4PZymd650mz3tL4; Mon, 13 Mar 2023 13:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678715617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eeJJyLycVDT13XdOZ6yii7af7HfhJ2lJ9mfXrWsQKrg=; b=AlwZN+D+qHetZliu2Sz3+5ps9JqCE70JLbAf3K6TvRpftvF0hyh/dFZ22grLLGdS92y0X5 a9L2j7MOUaGhptVXlqw7pgoDbfvDem6EHaq/FSFhlss6v91vmCuG/iaMenyfIeAYErCOII 7ZVJz/bQYx72Je9M+erWOfhlJ6amdBHpqEkk0aC0wkhSicqBr8VVbqR9xkuWC9gKRKBXZZ Ah7Ku+leJy0s8suXxupybvLw8d3ILGm6e0yWT5vnue/5JCN+Fk0LWe2DmRU2TBPyP6QyXa V8FPRlYStnDQWQQWvgnBm6Bli2RHwffG+G/IcvbNkaw8fZp0YS0XzLTK6mlZ4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678715617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eeJJyLycVDT13XdOZ6yii7af7HfhJ2lJ9mfXrWsQKrg=; b=oWPe2+GLOCSgp1+I8KPIaQ9nNhmKuSRriqKrSfERBRGmEBr8l2c76lg/sWjARuKJd2TiND +k46IOCsKXUCvvxqAusWTTxH+ec7P3m8ZkChUm3JNMfMcgw68jiIa8RbUKf8hl+4hVJFh9 K+BCvhDwbuOYfa0GhjCkEvNb04Eh1bYIfiIbpGKw1KquPCuN8IsV1kbthgVwEiraX5zT20 Usntq1P5O0Lf1mksw0yZzS9iWOj7ppmXh9nbrXNT6vKOFnwoa+zYkSWhiY60ZSq1Qg5g+c ZnLrRYo56e2yfWF+t20ZeB6F+hUJaI3kiit4KQSmzNvJ78M1I6FTuqZSXYFgMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678715617; a=rsa-sha256; cv=none; b=GUJ7OHeoO2aJYZthuNLroKkMt+8+i+4fZdXbDhvGUy3aLCAs9gfgdKjb7X7iSnaDDU7P4a qTsES/4bhNU+EIXsSxZsZp+QJibHYQGy/8F/iPF4Z1qvP5CvF+/TkTun1LcQjNr1e99m47 2KSLwHYLX7MkHM+SAzySpfp6QTSYwVI+Dj61tKPxUlAlzjsQhyJOK19tdozPzbmFiK2jse swI23B470ftkYnH+Ebsw9GSCY1ldSmRBb3oFl3lZ8BZw0PAiHWj7PbwtSgo0scOkQ5fa59 xcPy1XbIvp2BvSwhMVT/dKSnglTY4eEzOsXYzP97jXndwe9VPc9iNESrnDM1jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZymd5BfBzvpM; Mon, 13 Mar 2023 13:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DDrbNC042872; Mon, 13 Mar 2023 13:53:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DDrbom042871; Mon, 13 Mar 2023 13:53:37 GMT (envelope-from git) Date: Mon, 13 Mar 2023 13:53:37 GMT Message-Id: <202303131353.32DDrbom042871@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: de0b02cb7b11 - stable/13 - nvmecontrol: Fix default ns create parameters. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: de0b02cb7b112947191af96dd34e7a95b760019c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=de0b02cb7b112947191af96dd34e7a95b760019c commit de0b02cb7b112947191af96dd34e7a95b760019c Author: Alexander Motin AuthorDate: 2023-03-09 15:19:00 +0000 Commit: Alexander Motin CommitDate: 2023-03-13 13:53:03 +0000 nvmecontrol: Fix default ns create parameters. Instead of passing 0xff's for all unset parameters, prefer reasonable defaults. It is much easier to use it this was without specs in hand. PR: 269912 (cherry picked from commit 20dc2c4d11ddaa980c491116b65c51ab522028e9) --- sbin/nvmecontrol/ns.c | 56 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index 763c12aa11af..040918caf9c5 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -577,30 +577,48 @@ nscreate(const struct cmd *f, int argc, char *argv[]) NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); - /* Allow namespaces sharing if Multi-Path I/O is supported. */ - if (create_opt.nmic == NONE) { - create_opt.nmic = cd.mic ? (NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK << - NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) : 0; - } - memset(&nsdata, 0, sizeof(nsdata)); nsdata.nsze = create_opt.nsze; nsdata.ncap = create_opt.cap; - if (create_opt.flbas == NONE) - nsdata.flbas = ((create_opt.lbaf & NVME_NS_DATA_FLBAS_FORMAT_MASK) - << NVME_NS_DATA_FLBAS_FORMAT_SHIFT) | - ((create_opt.mset & NVME_NS_DATA_FLBAS_EXTENDED_MASK) - << NVME_NS_DATA_FLBAS_EXTENDED_SHIFT); - else + if (create_opt.flbas != NONE) { nsdata.flbas = create_opt.flbas; - if (create_opt.dps == NONE) - nsdata.dps = ((create_opt.pi & NVME_NS_DATA_DPS_MD_START_MASK) - << NVME_NS_DATA_DPS_MD_START_SHIFT) | - ((create_opt.pil & NVME_NS_DATA_DPS_PIT_MASK) - << NVME_NS_DATA_DPS_PIT_SHIFT); - else + } else { + /* Default to the first format, whatever it is. */ + nsdata.flbas = 0; + if (create_opt.lbaf != NONE) { + nsdata.flbas |= (create_opt.lbaf & + NVME_NS_DATA_FLBAS_FORMAT_MASK) + << NVME_NS_DATA_FLBAS_FORMAT_SHIFT; + } + if (create_opt.mset != NONE) { + nsdata.flbas |= (create_opt.mset & + NVME_NS_DATA_FLBAS_EXTENDED_MASK) + << NVME_NS_DATA_FLBAS_EXTENDED_SHIFT; + } + } + if (create_opt.dps != NONE) { nsdata.dps = create_opt.dps; - nsdata.nmic = create_opt.nmic; + } else { + /* Default to protection disabled. */ + nsdata.dps = 0; + if (create_opt.pi != NONE) { + nsdata.dps |= (create_opt.pi & + NVME_NS_DATA_DPS_MD_START_MASK) + << NVME_NS_DATA_DPS_MD_START_SHIFT; + } + if (create_opt.pil != NONE) { + nsdata.dps |= (create_opt.pil & + NVME_NS_DATA_DPS_PIT_MASK) + << NVME_NS_DATA_DPS_PIT_SHIFT; + } + } + if (create_opt.nmic != NONE) { + nsdata.nmic = create_opt.nmic; + } else { + /* Allow namespaces sharing if Multi-Path I/O is supported. */ + nsdata.nmic = cd.mic ? (NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK << + NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) : 0; + } nvme_namespace_data_swapbytes(&nsdata); memset(&pt, 0, sizeof(pt)); From nobody Mon Mar 13 14:51:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb02y2BSkz3xnl8; Mon, 13 Mar 2023 14:51: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 4Pb02y1lZPz40ph; Mon, 13 Mar 2023 14: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=1678719066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51eygRdwn+wj+a44gkxqf4SiN3008S0jEw9vE2UeIzE=; b=SI7VjGhvLaWAXk5nl/vbfp+4+snFrI5CAcHu2+AE7MO4AxILfsWLYfp/h0Zbs1Fnd8Xvmx /loo2y3K3osX/fOeFEzD5IFL9UBLoKUSo7LkRcbuMlCULDOlUDX/f+7dFoO2YvucQ1h4gt WMq5RLv3bO9MBosvFy/Kyng2HxafDkGLuIzMROT4hql8UiDj3z/ADZWLJqf+l/hq6gLys4 eNPO1prYMMeZYhtqpJG29y37OzrEp8Fb7wQHyh5Bll6E5jO+RPcP1To8iLRo6L5u8jnPN5 H2HJiIZS9a4piSsZ/vjDKHGFcriDdW/fw09jBaBc8DfE9sxliZzxswbNRzEN+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678719066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51eygRdwn+wj+a44gkxqf4SiN3008S0jEw9vE2UeIzE=; b=GrXAN8vr9hrcndivDwMcZ9DawCwjXM3uvIfnr/r5OYnfh0JjhTAczAmoW9ZlfqHHj6edTv 8+Xz8oADuzcWHt4nB1gMo/LFYb4V7bwRlE2ZFmsbyr+nG3vIoWr+QiNfaJNqdD7HKPSGli ZCrS10ZacvANzfGp8uMFJY9hxApNTz4KS4RtckxykM+nzq2tdnNDawnybNElCHFxX5/l3K Ouz8gOVLL/lsE08h+89T/7JhOWh3JeGbp0N4cmAEGnObXc2jihNADBGgd7D04C2dUuSozj jIYWqAKx6YzTepx458R8sbTIuAAvpW2v44Xjjj7aJgFboIH4lbrSBcv6dQrLaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678719066; a=rsa-sha256; cv=none; b=JzGEoUGrgai9xOkG66fXvzWV3NS6mK9qy3inVWYiez9Xw7Cmq74ZmpmZFiwoIHXAoPgcW6 Z2ffD1GCIv6qELZTISA+TdrS0/zxMvp/FfoWgpTbWry7+yIlobshvFwj7BmhrYvpzQiOpX BK1GYtnH9ocVWYnGLCip8kLVMfuMQTL6Qt8Vv8I63UCXrlhOkCEYMR6ZgdKWxsqkLJ1m5c AsPk4CFJLajh8mO0YgxYoT94+XVZhID2bCZ0KSbV4b38XP8Emgp2qh+OA9+fl+f9WZe6pZ RfN51stJiCv0A9lvfbHPzDq6aMCDLJBoS67H7nGBl9RWhuy6uQAzL8IUG/dw1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb02y0qhbzxcW; Mon, 13 Mar 2023 14:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DEp67r037333; Mon, 13 Mar 2023 14:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DEp6J0037332; Mon, 13 Mar 2023 14:51:06 GMT (envelope-from git) Date: Mon, 13 Mar 2023 14:51:06 GMT Message-Id: <202303131451.32DEp6J0037332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 683853a92477 - main - sendfile tests: Mount filesystems under the test workdir List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 683853a92477a18f19b29d6bd8dd71ebe5553f89 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=683853a92477a18f19b29d6bd8dd71ebe5553f89 commit 683853a92477a18f19b29d6bd8dd71ebe5553f89 Author: Mark Johnston AuthorDate: 2023-03-12 18:50:14 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 14:45:35 +0000 sendfile tests: Mount filesystems under the test workdir Otherwise they can't be run in parallel as they share a mount point. MFC after: 1 week --- tests/sys/kern/sendfile_test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/sendfile_test.sh b/tests/sys/kern/sendfile_test.sh index 11bd03705f53..3c700beeb7d5 100755 --- a/tests/sys/kern/sendfile_test.sh +++ b/tests/sys/kern/sendfile_test.sh @@ -37,7 +37,7 @@ # MD_DEVS="md.devs" -MNT=/mnt +MNT=mnt FILE=$MNT/file HELPER="$(atf_get_srcdir)/sendfile_helper" BSIZE=4096 @@ -134,10 +134,11 @@ common_body_setup() { us=$1 + atf_check mkdir $MNT atf_check -o ignore -e ignore newfs -b $BSIZE -U -j /dev/${us} atf_check mount /dev/${us} $MNT atf_check -e ignore dd if=/dev/zero of=$FILE bs=1m count=1 - atf_check umount /mnt + atf_check umount $MNT load_gnop atf_check gnop create /dev/${us} From nobody Mon Mar 13 14:51:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb02z2jkJz3xnlF; Mon, 13 Mar 2023 14: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 4Pb02z2Cgmz411g; Mon, 13 Mar 2023 14:51:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678719067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2y2GH+PxVJT2I4S1BWsw+Dl9pDuualN6ZX/B9m08OCk=; b=j3nF9PQt1+MpCKHkCFveDd6sngvWLbrd2mnoPl6ZgpYr9cqnSXCPR+13AD7cmLOU5e/G3f JkUQqa3yrAOoAKY9wexWeh2ljXdL3ZDpL/QH0mOIMhm7bA1lRaMF9g8QTAZH0KT3ao1gB+ X2f720ti11QrYv29fFewdfHNmwoQDmQs+WgUxaHT/EpzG0k8ifeVg1pX+RGdWr7rmcABzM lczsfFeQCTgcuE+dClk5FNtb7inFESw2vf0WR54zrWPjkKGvAsEinjM2SjIuFn9TKwXJd9 IbwWpYmmq9h7G/ixeDivhVLIAR8IotQp3jzv9MZwY0qddk5V67gMpoxHgncRPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678719067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2y2GH+PxVJT2I4S1BWsw+Dl9pDuualN6ZX/B9m08OCk=; b=iH1dGbkbMhp7hG78ZVr1ed51WkvJvacDDpThyn0tQWWVOO3m/gpboxwYWp0YdIhe//Wwaj ad4ITZFp+fOuNTC3SZeo86Y5OtXGlqLsJ82aL7eXVe5GlYF+SrZz55pocsdIHbU5bhXR3j Vdg3pje4exuBr0zGhYtXmGJddZgMUfSKZC4i3MmnmhDTAnLomwxr6XP5/UUCHa3+0UJAzi 7STLmbzYv4B5li9Qk1eEZrqaKXZWVKaUcFblSsGKsqnz2y/CaS/kc6FuCsc5QexjyPRo+Q Dk0TR1Im/hqSlICE9W9BOZEXpl9iOZk3HelG6Ziig1pNg9yvEQUE4dd7SR4PeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678719067; a=rsa-sha256; cv=none; b=mBZR/t8oTJcmdtAZUXjcb+0tY9qdNKpv0mQMqxgsXdJK+HlFAXIVndxrpKMXW942GyQzEk 15ynKXBDtKoa8gSW8N2peS66D04qcnQZre94EbYXditIqjT9gjX5i19dSWup5ZQoNenJqh rS1eC7g2T3syE7iQsxOFdMuoyTv6c2t9vpKkzKgjdXbz7QW+3jphanCr+kGKlwi9DI+01w 9CrN8T6Qtp8LHQyudwVDnB2kHTPzau85xEphl+FhflyZc9IMq8OgVORC/H7wvBbR+QSzYI c2wOtUPaQr1HYgdlVJVxCIRFegQ++KgHhR/JEzDKIC+UdShxeowyfCrGkEQS6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb02z1KNvzxQ7; Mon, 13 Mar 2023 14:51:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DEp7Jr037352; Mon, 13 Mar 2023 14:51:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DEp7DQ037351; Mon, 13 Mar 2023 14:51:07 GMT (envelope-from git) Date: Mon, 13 Mar 2023 14:51:07 GMT Message-Id: <202303131451.32DEp7DQ037351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: cd133525fad1 - main - smr: Remove the return value from smr_wait() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd133525fad197ac8cbbd4bd68860a4dd51a561f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cd133525fad197ac8cbbd4bd68860a4dd51a561f commit cd133525fad197ac8cbbd4bd68860a4dd51a561f Author: Mark Johnston AuthorDate: 2023-02-07 21:38:07 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 14:45:35 +0000 smr: Remove the return value from smr_wait() This is supposed to be a blocking version of smr_poll(), so there's no need for a return value. No functional change intended. MFC after: 1 week --- share/man/man9/smr.9 | 2 +- sys/kern/subr_smr.c | 1 + sys/sys/smr.h | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/share/man/man9/smr.9 b/share/man/man9/smr.9 index 7b2ed65b4368..32ef313c0988 100644 --- a/share/man/man9/smr.9 +++ b/share/man/man9/smr.9 @@ -64,7 +64,7 @@ .Fo smr_synchronize .Fa "smr_t smr" .Fc -.Ft bool +.Ft void .Fo smr_wait .Fa "smr_t smr" .Fa "smr_seq_t goal" diff --git a/sys/kern/subr_smr.c b/sys/kern/subr_smr.c index cbbf185fee79..df2520005673 100644 --- a/sys/kern/subr_smr.c +++ b/sys/kern/subr_smr.c @@ -579,6 +579,7 @@ out: */ atomic_thread_fence_acq(); + KASSERT(success || !wait, ("%s: blocking poll failed", __func__)); return (success); } diff --git a/sys/sys/smr.h b/sys/sys/smr.h index 1319e2bf465b..2b6dbeb998da 100644 --- a/sys/sys/smr.h +++ b/sys/sys/smr.h @@ -241,11 +241,11 @@ void smr_destroy(smr_t smr); /* * Blocking wait for all readers to observe 'goal'. */ -static inline bool +static inline void smr_wait(smr_t smr, smr_seq_t goal) { - return (smr_poll(smr, goal, true)); + (void)smr_poll(smr, goal, true); } /* From nobody Mon Mar 13 14:51:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb03040JWz3xnhR; Mon, 13 Mar 2023 14:51: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 4Pb03039hmz40sh; Mon, 13 Mar 2023 14:51:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678719068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cTh26JoZP4xaCvwoFpveapxStiECRjr9VvZ6l1afTL4=; b=n53Wnk02dBuVxTRANDHuw0aq7D11VXKJsBYS3xWqE92ooePsndQyb69bs4Xd5wg5woNt+L zgeanfKs+MBtSYcwSMDZgxNHuS0r7/nJJhUmwKo2Hgk0jQXR0chxQhsljZw9F76ZPrzrUC spDivOpNJbNz4/AVqTcXQOCisWIIEBcecsn3sk9EERFyXveO1v6KhHtGkB1035PPZ5rHPG p7pCQ6xwuddkRdcDasZc/Wfpa67eUFhz+bo/UquT4uOHdVXIQF6MH0w80wN8GngCBaLXSp mIrBH0ez5mkKnzKWZ+awXxzgofbyYUjcGaSdhDfI4EXEg/bHu19LtcrOiuR0uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678719068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cTh26JoZP4xaCvwoFpveapxStiECRjr9VvZ6l1afTL4=; b=dJq3p5Fg+0jKANTw9oocZKlJKhAtAwpNea8TR3tnIfjniR2yXfzb+tuGyG4AMyl4Qg/QGu hrcQ5ocRIEzbYpCVXE8D1CFkF2nsIzgAydzioNm4UIuQMjYIduL/smIrk92RKQ0EghVR6Q 8kWkUd4F/TBnmTV2Kx011XcDZRFcRLDJBWVoQtPj5ZFt6SNqY9CzbRJ+ALH3OCjvYLetHr w00z5ITh6+IRXT34+37AD9/9ADKQlw/DWgrXzvRC208jxw382tHSxIeMxvvTLlr58MKrTu 8XLNYHEmyywdfd411vEnTt/VjwIqdX+6aVqr8inC5D+1/NGt+X3KX79G16Wouw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678719068; a=rsa-sha256; cv=none; b=drDpiR9fdH64sSuVGY32JpFYKYf0JwpUfVAgpryT1zrI+U4iXKddahOr8IJqas9NESkAkA K2qL0LnKxjHxBpih2n9kDbpVKKjwmqlwzbm/w2N8G1r6Fc2FRTE+4I8ZjSnbnScdzP5+Zv /olq/qsHn+sAzEmOJyKosY9i+WgVqFokU9yyjmRYS2D55J6PooTVVrcU1WgO6yXHvIbS82 BD3TeWt3b6n9jecSIK1nwrlBcrhzaCbRWA1YE/dRwCXCUiXPXBKWlZjRF86BLbGBJaZdwY 8sV8J2AzhkvNa11r2HbaeV53/TTFEWVqRqREhIVI9J3D1i+CItlB+aeYq9a4vw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb03028HlzxM6; Mon, 13 Mar 2023 14:51:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DEp8Jr037371; Mon, 13 Mar 2023 14:51:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DEp8eE037370; Mon, 13 Mar 2023 14:51:08 GMT (envelope-from git) Date: Mon, 13 Mar 2023 14:51:08 GMT Message-Id: <202303131451.32DEp8eE037370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 29c9b1673305 - main - epair: Remove unneeded includes and sort some of the rest List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29c9b1673305406dc64161aa7b565a296526fa67 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=29c9b1673305406dc64161aa7b565a296526fa67 commit 29c9b1673305406dc64161aa7b565a296526fa67 Author: Mark Johnston AuthorDate: 2023-03-13 13:27:47 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 14:45:35 +0000 epair: Remove unneeded includes and sort some of the rest No functional change intended. MFC after: 1 week --- sys/net/if_epair.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 32fd3afe309b..aeed993249f5 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -45,7 +45,9 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include +#include #include #include #include @@ -59,10 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include #include #include From nobody Mon Mar 13 14:51:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb03204cLz3xnfW; Mon, 13 Mar 2023 14:51: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 4Pb0314HK2z40wr; Mon, 13 Mar 2023 14:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678719069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aq0Gx1d0rCjqVtAXIX2qrIsom9PAn8RgZ7Eji7WAe2Q=; b=eBAw0LlLIhvz5kG1KH1VBybEqjENrIVE5p/9mRDQVoggc82EOfEwG4ej45tCD/wTXSWIcF QF0D4cIM5CY5qLc5E+GipHgHK8AIRFFqorSCtBkpuMI53z0XslJ+oTFNoLRem+yD8oWLgJ lPfxZHsyGkR3wuGWTSa91ybM4nsJiHO29MhTbrM2a3bqLd5SPmVweIG7fBUX3tLXPYP6jo 9lP/lXHIpfDj0MprwRn0y0Kr/6azS9HXobK3YAL+UhF8ZwniNq0kc7LKbeCGFAA2mQwL7m t2Qni56AEzze4i56AJ27NIZgeEo5EzvtIta9hEXGHF8PAoNVtL9NgT/Id7xOCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678719069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aq0Gx1d0rCjqVtAXIX2qrIsom9PAn8RgZ7Eji7WAe2Q=; b=lxqggqG836FBd3YVQ3wI94prauCSBXfk2AaMa1mhU8rRjMUKb3PLSECxBx7ipQgCLFIYBF 0Fv9BRwnPTk79hLTHi7Qv0yKyMQI6hWzUroApN4YQIhPESR/sovlp9XEFxH+Gq286WV3Y4 BgJqikmPQjBHCHxFb75ocC6fY2TOJQULDGXTHLebx6mLI5Yx/0KpumTn90sZt9RU+9cTFC Cd90/qRwf3Vyq2ZmGJcv3PPm0inh1H5ByzbjwqxUEZEAfWHmifhbjHg7qejiSjg46ax7kK qTJf8A6TPuKJUPNXz2YXWnKe6yQrnT1PQw4lLA/Zh5xHVU+QT4ysVPD/ztuYmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678719069; a=rsa-sha256; cv=none; b=U/F3g20ZNcu62kjOapxJ3P1Gzf3QL+0PwU2R+wjFnMWRYH9iegeQ5hS3jbPMYCvPFdH50e eC282HL2S1wXgOZ6M8GV7jZVpWTV3O4AFyBjJ38H+e04npjSa/GeO24XN6q/Ug4/x3TjH+ ztSOkdpPWt4XxBZL1V5LmHmklo0H9fatS0QQHfl6fC1aVwqgL0KaPQeji/8BS5Ikb69CrH J1QxDPqxH9WyJolQSGBlX0c077orVIrmZKPFD23bcg+a+1maHdQLDhfsj52G5kIah+6GSi vwrrLm+g6A59280NmSoypetHiaxe3kEW15PT8KlZW/FzqnBwkhuVeF7rbdafuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb0313JRbzxLD; Mon, 13 Mar 2023 14:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DEp90J037390; Mon, 13 Mar 2023 14:51:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DEp9tN037389; Mon, 13 Mar 2023 14:51:09 GMT (envelope-from git) Date: Mon, 13 Mar 2023 14:51:09 GMT Message-Id: <202303131451.32DEp9tN037389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: aa71d6b4a2ec - main - netinet: Disallow unspecified addresses in ICMP-embedded packets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa71d6b4a2ec3609303ca87ba75d0a2c539da9df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aa71d6b4a2ec3609303ca87ba75d0a2c539da9df commit aa71d6b4a2ec3609303ca87ba75d0a2c539da9df Author: Mark Johnston AuthorDate: 2023-03-13 14:45:56 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 14:45:56 +0000 netinet: Disallow unspecified addresses in ICMP-embedded packets Reported by: glebius Reported by: syzbot+981c528ccb5c5534dffc@syzkaller.appspotmail.com Reviewed by: tuexen, glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38936 --- sys/netinet/ip_icmp.c | 3 ++- sys/netinet6/icmp6.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 98f290486ec5..9352289d62fe 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -561,7 +561,8 @@ icmp_input(struct mbuf **mp, int *offp, int proto) if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr))) goto badcode; /* Filter out responses to INADDR_ANY, protocols ignore it. */ - if (icp->icmp_ip.ip_dst.s_addr == INADDR_ANY) + if (icp->icmp_ip.ip_dst.s_addr == INADDR_ANY || + icp->icmp_ip.ip_src.s_addr == INADDR_ANY) goto freeit; #ifdef ICMPPRINTFS if (icmpprintfs) diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 5c94a0c56be1..4166cabdc5cb 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1070,6 +1070,14 @@ icmp6_notify_error(struct mbuf **mp, int off, int icmp6len) */ eip6 = (struct ip6_hdr *)(icmp6 + 1); + /* + * Protocol layers can't do anything useful with unspecified + * addresses. + */ + if (IN6_IS_ADDR_UNSPECIFIED(&eip6->ip6_src) || + IN6_IS_ADDR_UNSPECIFIED(&eip6->ip6_dst)) + goto freeit; + icmp6dst.sin6_len = sizeof(struct sockaddr_in6); icmp6dst.sin6_family = AF_INET6; if (IN6_IS_ADDR_UNSPECIFIED(&icmp6dst.sin6_addr)) From nobody Mon Mar 13 15:38:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1596rDgz3xrX8; Mon, 13 Mar 2023 15:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pb1596LwXz45bL; Mon, 13 Mar 2023 15:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678721885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OO47LGkNCTKX+IZTF/BlhTMvR1zTsJ8eHx/aojMu2L8=; b=k/vj7faOr4tnPW3Vb4CEPY7UJnqA85Nzaoig5tkadT1AizvmxZA8QwSiODfYV+tz84jzmN Xh+rWjP9ZzNzmO4v+MhFedZ9p+RUNJcALMVAo1iNI1RkNRpfztpWWrJVQinkytVrn3B6J6 V1c1ub4CR9HxoLTQo1m7rT7rB5NFfpsFUEdmQigOAVd6MJb3ULZ7T4yup2lHcpI1m6hkmg n43xHNhhU8LWAN1hCtq+k0MwptygqXDPrk24PT4W8gYmV6f06NnXk+K24JMjF1VsRobYpz 6e7CPFvcAoUR/TeFN2bKM81WIibWmY/4tQsEia4PFpwAwSaLXuQAMGPARWsVsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678721885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OO47LGkNCTKX+IZTF/BlhTMvR1zTsJ8eHx/aojMu2L8=; b=WaCwRTajopJwHgJOqcL8ua8MHwToceVdFUgiebblWqJoICJPkQopEKzppl3+tVd9TJ3NlJ 036m4ukExTrp0P/pogmgUEIZr24P5NOGRZr0uiLD+JVqypjldAWHVwmxbaeDe490H2p+xO PpO8s43y/IynGpW2FQFT48vYiLxZSezl0VKQuJ/G73lNd24pRdwZArv0G5gW1EE1yIW1SV PwfhI32SCrXlTbVifJrzW6kFpqKgLt6tm0heFND4VhaBkogoKu7XH2XyA3ITOaSOT0fS6S p0DyRLv98DTf+4sToi9R1tl9mRKZ2Qhnhzk4NCK6L0fOpqKnO+UTY17hD1586A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678721885; a=rsa-sha256; cv=none; b=sGsnvGIukT81vmSKe/iAIRpaK87GrBfY+a2+f8fHyTe4QNVFbKmzsbbORzsHjKUWU3rtqw 9V92tmf+n/iMUtZCJoS0hIUsnIupXvCtcZQYpkcAVCLc1fLRfihB4Ygvi1Io+/PqjH8IMJ 31bnb2ST4VyRe2LTr1QLD8rZVxspQt8Y8x+wNGZEHklW4KdtkCVyExgJrM+RTblM5zhQaF QjrnsP5YJV09+M1beCIbOrXq6vs/ULKA88sWCFVVOWKpLzkYxOCDDLRpPWrUUJqinQ55bF 9ouEkfbNpkFRNj4HeOba8IVbb2kdJ8ojFJdQVxj2Tjh/+eaCACsjNWThZd9PIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1595PRMzypx; Mon, 13 Mar 2023 15:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFc5X9008404; Mon, 13 Mar 2023 15:38:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFc59G008403; Mon, 13 Mar 2023 15:38:05 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:38:05 GMT Message-Id: <202303131538.32DFc59G008403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: e620e088cbd1 - main - dtrace/powerpc: Remove accidental commented out line List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e620e088cbd1c062655eee825aaf4f80bd255e1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=e620e088cbd1c062655eee825aaf4f80bd255e1f commit e620e088cbd1c062655eee825aaf4f80bd255e1f Author: Justin Hibbits AuthorDate: 2023-03-13 15:33:17 +0000 Commit: Justin Hibbits CommitDate: 2023-03-13 15:37:40 +0000 dtrace/powerpc: Remove accidental commented out line Fixes: 3e1155ade1b --- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c index 2139be1ccec7..1fca72e5b7fd 100644 --- a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c @@ -163,7 +163,6 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, break; osp = sp; dtrace_next_sp_pc(osp, &sp, &callpc, &lr); - //printf("sp: %#lx, pc: %#lx, lr: %#lx\n", sp, callpc, lr); if (aframes > 0) { aframes--; From nobody Mon Mar 13 15:53:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1Qp6WCSz3xsbJ; Mon, 13 Mar 2023 15:53: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 4Pb1Qp5tDlz47g7; Mon, 13 Mar 2023 15:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vp0bQqLuyZJSXEq+dECdZDis0hHhqpML63aOeyWvm3o=; b=tpvcs/D2OHI8WVcMJU6g9UiQ7M0UjR9hYNjYKp0t9Hd4wC167NgHeNsWosS8Nq01o+zrQ0 MsU34Yu+NcuG4LZ5RN9TCBydXOJ0+/DlLcInQ631rHA9ZrKACqdskDYhx/PtxMy8P0Mnds sZzyj6BKTw5u8QhZKtOMtq3QfiM3tjsA3s1vbSJZD37rGWeeWEtDu4ziNqA5th+XXeQ4Ua rgmAhSoi7d7ydlWEc+Q+QKthxsE/muZpXv3w01B+gciQ+w4cLjJU9qVHlwUdn21E91TlC7 u2gH5NAPlEtyBg+jzBzN6H/FK6CQeCGBPgmgcGtzfBsPsXD0lXo6j4xPASe+XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vp0bQqLuyZJSXEq+dECdZDis0hHhqpML63aOeyWvm3o=; b=nnczIXC5fwjb3oCVD6TJgRb33N7SAP0d0izr64EFFyC3pcEs8FQ160Bde2uxqGPc9hExsE 0XlTTMTMpSw8dc4xTJm/2/n4y7eaIQOyh468kkw5DCoZAVWPJyQ4qmLo2WWuJABN4gDCik ndbX0uaZWf5i8uG7bTLzLqa+sBHnGf2hB8K20nF8T/+9hqQzqcStWAKFFipxhwZyjBjn3x KmjXjbF/NctjJG07xYw9ho+r4vZp4D5Mc2suRv2kF55NPG7Inwiijc6slrKmU1Y01nhaXm tmLg7G1QoayxLFc4wKIzABNJIXtHCnyuvuEJOVZQqpZeeMWTlf8Nc/7cwOIASA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678722802; a=rsa-sha256; cv=none; b=XYuJ4QvMK14Z9JUIqDdFZrWH+dk1Ck6tXeoy/MEo9SUnoRdek6ynOv4A1TEGQsPF3LBx0p 58oDZLrVj0RJONIriwGWVY72gbqbBp1Hbat4oxnjaHuQ4C0iGMiRLY2U+tHOZOEUpHPXAI ZUdzNPudsSqZ/QhT4UilCoEwY99j0imh9B2K5M29umBouypRLGg7ghIWOK4z71ub7i1P2t nzjRwGRcDBVRcO8VPI9af+R9oxhJpH+q0P4sF7Fwh72eSHBrH13s1wZRpuZNztbhafrUzL kZj3C3A/7wcXjg4IBzPvV+d1nkeS47kkNTJ/6sGK7jQTacqP8h6HFuOlC8pSsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1Qp4wn1z10DW; Mon, 13 Mar 2023 15:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFrMvO039762; Mon, 13 Mar 2023 15:53:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFrMxp039761; Mon, 13 Mar 2023 15:53:22 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:53:22 GMT Message-Id: <202303131553.32DFrMxp039761@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: db7f871eea7f - stable/13 - buf: Make buf_daemon_shutdown() a no-op after a panic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: db7f871eea7f29d2769e5bf67dc350d6b978b7ba Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=db7f871eea7f29d2769e5bf67dc350d6b978b7ba commit db7f871eea7f29d2769e5bf67dc350d6b978b7ba Author: Mark Johnston AuthorDate: 2023-03-01 15:07:56 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 15:53:15 +0000 buf: Make buf_daemon_shutdown() a no-op after a panic As in commit 9d7cc536e261a7, there is no need to do anything in this context. MFC after: 1 week (cherry picked from commit bcd8cd859e694bc4a4dfb6fdb8f55de3a96833b4) --- sys/kern/vfs_bio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 98047f161077..174a6e0b556a 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3406,6 +3406,9 @@ buf_daemon_shutdown(void *arg __unused, int howto __unused) { int error; + if (KERNEL_PANICKED()) + return; + mtx_lock(&bdlock); bd_shutdown = true; wakeup(&bd_request); From nobody Mon Mar 13 15:53:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1Qr0gSJz3xs6k; Mon, 13 Mar 2023 15:53: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 4Pb1Qr01Lhz47R9; Mon, 13 Mar 2023 15:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZKz/n54JfqHeEVUIAnM2uMT3wMBTHBUL1feorQw3W0w=; b=VIQN2pq1DUyKEsCMeUj9qWrEpPj37qxQrthul7bViyk1iA3GEcz9A/MOSclislGOvOPacS 8z2SIi71vM+Wu18oI/1l6aZJTosWeA4im5BK7Tze720Xtq39tFuEEnH1X2i0K0ewL0DtaN BI4mrejEyqVVCRiS0vm28f99uFt46MaTxmnV5oA/ttVXcpr5nVaTljzCkTW2IJTxMhx6UP 3TWV//tWD3Rr3l2UgBPlVMY5dx0rrlyiU7CQMNrkdnzMo66OyQQ568k3H97QWGtz+Y1yQK N3NY9cWY1RhuNA2WUxCppFeezzLdgZzT7L+IFCsegGWWIxv9nIj96xDXo/X6IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZKz/n54JfqHeEVUIAnM2uMT3wMBTHBUL1feorQw3W0w=; b=tFASZ+DbOSVnjjRslRfWBOnF0NjMF9G2qB5tvy2Bs6rU3HdVvt1TZ86z15m8iTKGpHZvtd MfcoqthHAwFDlwECk5a9C/tYRiKwBI8rnkZXGRMw4h3wUCKX4Njj81I32zMtWc3B0nrgMd R9Tr1uqAz4n29iU1Y59V32/AQ1P6+sK/jkq5Jgd7WH9PX6oYxrnMGhmwwD9x2w3J4Vz4PI ofjDPezShuv+Mr15GOiVKZoNy4WNeq1IfgyS7X+z0swtot1hKi7tDInOG7f4VDgXTsvZrc M2FXW5ucBNyKgLiF2jIpeh67JqY4+l6ta+7fR4s1Fl7LjI+BlPcb5OU/ttveRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678722804; a=rsa-sha256; cv=none; b=YQ9YrEuFAkq48A5CA34CCMYuWlTDfHnVkPJe1MuMxvecrzUzRkDBQsyoZZhid1uAmUD4Kh mkezK9HD/yz9ea03HkcrCI+Q9asNyIcvaJzNaYR7agf4nsaxiLpKtZuEoDO5rYz86/Y33R 4cJPAGQlDyAUPoLU5Uu5CFW7KNFLfu3cqa2X0b4vkedCoX+uxJ1l/AtiXNCiwoLu/MQIgn RTVhFICzCjBJsBsl/ymdnJbvJdRNUO3bzBpUxm4qnFQdrzRyBYdTyowUMKKL5DrG4GMmDS 3p/2PYNhWyyOwOI/YjTffYSGMB3SJs1Ab3PmosHxzr9wYyXsuUvhaiAAOD6lLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1Qq65x7z10DX; Mon, 13 Mar 2023 15:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFrNve039785; Mon, 13 Mar 2023 15:53:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFrNB5039784; Mon, 13 Mar 2023 15:53:23 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:53:23 GMT Message-Id: <202303131553.32DFrNB5039784@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: ee429a15e499 - stable/13 - posixshm tests: Correct page size index checks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee429a15e49933e51d9c00a7e063815f59b4cc45 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ee429a15e49933e51d9c00a7e063815f59b4cc45 commit ee429a15e49933e51d9c00a7e063815f59b4cc45 Author: Mark Johnston AuthorDate: 2023-03-03 16:16:21 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 15:53:16 +0000 posixshm tests: Correct page size index checks MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. (cherry picked from commit 560f9cd5e1e36ba725f3c677d7b8e514af9f3a85) --- tests/sys/posixshm/posixshm_test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c index f0784f7b8769..50cba2cf7816 100644 --- a/tests/sys/posixshm/posixshm_test.c +++ b/tests/sys/posixshm/posixshm_test.c @@ -1092,7 +1092,8 @@ ATF_TC_BODY(largepage_basic, tc) for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) { ATF_REQUIRE_MSG((vec[p] & MINCORE_INCORE) != 0, "page %zu is not mapped", p); - ATF_REQUIRE_MSG((vec[p] & MINCORE_PSIND(i)) != 0, + ATF_REQUIRE_MSG((vec[p] & MINCORE_SUPER) == + MINCORE_PSIND(i), "page %zu is not in a %zu-byte superpage", p, ps[i]); } @@ -1253,7 +1254,8 @@ ATF_TC_BODY(largepage_mmap, tc) for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) { ATF_REQUIRE_MSG((vec[p] & MINCORE_INCORE) != 0, "page %zu is not resident", p); - ATF_REQUIRE_MSG((vec[p] & MINCORE_PSIND(i)) != 0, + ATF_REQUIRE_MSG((vec[p] & MINCORE_SUPER) == + MINCORE_PSIND(i), "page %zu is not resident", p); } @@ -1588,7 +1590,7 @@ ATF_TC_BODY(largepage_minherit, tc) *(volatile char *)addr = 0; if (mincore(addr, PAGE_SIZE, &v) != 0) _exit(1); - if ((v & MINCORE_PSIND(i)) == 0) + if ((v & MINCORE_SUPER) == 0) _exit(2); _exit(0); } @@ -1737,7 +1739,7 @@ ATF_TC_BODY(largepage_reopen, tc) ATF_REQUIRE(vec != NULL); ATF_REQUIRE_MSG(mincore(addr, ps[psind], vec) == 0, "mincore failed; error=%d", errno); - ATF_REQUIRE_MSG((vec[0] & MINCORE_PSIND(psind)) != 0, + ATF_REQUIRE_MSG((vec[0] & MINCORE_SUPER) == MINCORE_PSIND(psind), "page not mapped into a %zu-byte superpage", ps[psind]); ATF_REQUIRE_MSG(shm_unlink(test_path) == 0, From nobody Mon Mar 13 15:53:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1Qs1KWsz3xsMs; Mon, 13 Mar 2023 15:53: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 4Pb1Qs0qvdz480P; Mon, 13 Mar 2023 15:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GuIGvxYuqiEg7z9wzl6x5G+vIp5Hho7411UlQjGu6Vg=; b=S+zqRQ+IwA3DfY1ANvPsVbohhA9uDkr+LqVLotph6D4zmLcdLpp9QMrypyaXTcd3vfjd9b SFxL+AtU6THYN0DlhXRX45MVerr3o6oZNNltvaV8m5R3PHPPhctlY3AXm2CYcG5uzJcs+3 MQ5zdwDfDVc9f5W/0RRpM7tRTDnp5eASpAbZl+T1KZw/IA5U/gyezOSep5Q1v4dbyeSPcL VGzRiaTJpt88W1R/KFgnAh6KX9HJn+AD2/geDa9p7yMime1iYKgNCHe37u85cqTuq6c1ha QgcwzIv3eI+q2cUchpVG4LRrAOQIFKjDgMGK4OK6wj3CB03fnBzAAGEZS5wcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GuIGvxYuqiEg7z9wzl6x5G+vIp5Hho7411UlQjGu6Vg=; b=Oet/jjjhO8kVL5MgvE7emafFi/++Lx8U9yJh/DvdBoxaexmZ9XHg6BtB6PjZdAxDNWlSZx HqNqrR5fnKwG+9gx9QxEJ7+ZQA3alVBdqWU6Z0EpQ8GwTUr4KMzZluFh72dDOtIYXXHl9R oktpx9lGRsQod7o4ldZNfa16T7kAwN6Wto1pthb3up38VkrXUlQlDbtZnrPaptV40Oaxp9 1O1u78Qc7mW+eE9e6xLLOiHYlKMe39J6xROIndXGOmnYQ42QlBwLws/E6BXHyzu4Aopn6I gA0awH0vtunpGiHyD2v7n9bT6p99tKeDg8GqXtGKr/i8eI6fhBmJeJcb4xU5qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678722805; a=rsa-sha256; cv=none; b=Vh6S2XEtj3IxN1uGml01aVM7Mx2Mo7cUQKs5XxKXww4wlu2Py3iWOU9v8bWfFaFM+arPKk H3JepL9CRcHNvSe/6FojCqj8girrl4o45MvW1J6n+C9CAs0LiAIEMBfY7NK+bnsH2GmOEN LCPGGxx8sAmNUqPYsc3hDTFI9QDFAy4Zu1A5zTylHswrg2ibn2YQQY9EgMySZIodfhgZCI 9cqzzEbG3j4QV5Dr0hX1zRC0qzxzW32sVo+d7jdDZvmoP7c0TFg33z2XIy5BaEYRpm2rDL uEq8BFbFdmdTJHjkgiDBaBSillAxzVLHLpdtD5IqlY35re/Q97UowbabJUNOBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1Qr736mz10DY; Mon, 13 Mar 2023 15:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFrODU039804; Mon, 13 Mar 2023 15:53:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFrOOl039803; Mon, 13 Mar 2023 15:53:24 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:53:24 GMT Message-Id: <202303131553.32DFrOOl039803@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: cc7b54d6ec76 - stable/13 - bhyveload: Address compiler warnings and bump WARNS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cc7b54d6ec76fba7b743ed03de8a0897687e34cd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cc7b54d6ec76fba7b743ed03de8a0897687e34cd commit cc7b54d6ec76fba7b743ed03de8a0897687e34cd Author: Mark Johnston AuthorDate: 2023-03-03 14:52:17 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 15:53:16 +0000 bhyveload: Address compiler warnings and bump WARNS Mostly sprinkle __unused. Also duplicate strings passed to addenv() so that constant string literals can be passed. No functional change intended. Reviewed by: corvink, rew, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38840 (cherry picked from commit ad43dd69cec7b568846b45ff990da6dc86e58467) --- usr.sbin/bhyveload/Makefile | 2 -- usr.sbin/bhyveload/bhyveload.c | 68 ++++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/usr.sbin/bhyveload/Makefile b/usr.sbin/bhyveload/Makefile index 48bed64c26e4..59672cca47b5 100644 --- a/usr.sbin/bhyveload/Makefile +++ b/usr.sbin/bhyveload/Makefile @@ -7,8 +7,6 @@ PACKAGE= bhyve LIBADD= vmmapi -WARNS?= 3 - CFLAGS+=-I${SRCTOP}/stand/userboot .include diff --git a/usr.sbin/bhyveload/bhyveload.c b/usr.sbin/bhyveload/bhyveload.c index 1a24b5f0044a..09a9653ece34 100644 --- a/usr.sbin/bhyveload/bhyveload.c +++ b/usr.sbin/bhyveload/bhyveload.c @@ -118,7 +118,7 @@ static void cb_exit(void *arg, int v); */ static void -cb_putc(void *arg, int ch) +cb_putc(void *arg __unused, int ch) { char c = ch; @@ -126,7 +126,7 @@ cb_putc(void *arg, int ch) } static int -cb_getc(void *arg) +cb_getc(void *arg __unused) { char c; @@ -136,7 +136,7 @@ cb_getc(void *arg) } static int -cb_poll(void *arg) +cb_poll(void *arg __unused) { int n; @@ -160,7 +160,7 @@ struct cb_file { }; static int -cb_open(void *arg, const char *filename, void **hp) +cb_open(void *arg __unused, const char *filename, void **hp) { struct cb_file *cf; char path[PATH_MAX]; @@ -202,7 +202,7 @@ out: } static int -cb_close(void *arg, void *h) +cb_close(void *arg __unused, void *h) { struct cb_file *cf = h; @@ -216,7 +216,7 @@ cb_close(void *arg, void *h) } static int -cb_isdir(void *arg, void *h) +cb_isdir(void *arg __unused, void *h) { struct cb_file *cf = h; @@ -224,7 +224,7 @@ cb_isdir(void *arg, void *h) } static int -cb_read(void *arg, void *h, void *buf, size_t size, size_t *resid) +cb_read(void *arg __unused, void *h, void *buf, size_t size, size_t *resid) { struct cb_file *cf = h; ssize_t sz; @@ -239,8 +239,8 @@ cb_read(void *arg, void *h, void *buf, size_t size, size_t *resid) } static int -cb_readdir(void *arg, void *h, uint32_t *fileno_return, uint8_t *type_return, - size_t *namelen_return, char *name) +cb_readdir(void *arg __unused, void *h, uint32_t *fileno_return, + uint8_t *type_return, size_t *namelen_return, char *name) { struct cb_file *cf = h; struct dirent *dp; @@ -266,7 +266,7 @@ cb_readdir(void *arg, void *h, uint32_t *fileno_return, uint8_t *type_return, } static int -cb_seek(void *arg, void *h, uint64_t offset, int whence) +cb_seek(void *arg __unused, void *h, uint64_t offset, int whence) { struct cb_file *cf = h; @@ -278,7 +278,7 @@ cb_seek(void *arg, void *h, uint64_t offset, int whence) } static int -cb_stat(void *arg, void *h, struct stat *sbp) +cb_stat(void *arg __unused, void *h, struct stat *sbp) { struct cb_file *cf = h; @@ -299,7 +299,7 @@ cb_stat(void *arg, void *h, struct stat *sbp) */ static int -cb_diskread(void *arg, int unit, uint64_t from, void *to, size_t size, +cb_diskread(void *arg __unused, int unit, uint64_t from, void *to, size_t size, size_t *resid) { ssize_t n; @@ -314,8 +314,8 @@ cb_diskread(void *arg, int unit, uint64_t from, void *to, size_t size, } static int -cb_diskwrite(void *arg, int unit, uint64_t offset, void *src, size_t size, - size_t *resid) +cb_diskwrite(void *arg __unused, int unit, uint64_t offset, void *src, + size_t size, size_t *resid) { ssize_t n; @@ -329,7 +329,7 @@ cb_diskwrite(void *arg, int unit, uint64_t offset, void *src, size_t size, } static int -cb_diskioctl(void *arg, int unit, u_long cmd, void *data) +cb_diskioctl(void *arg __unused, int unit, u_long cmd, void *data) { struct stat sb; @@ -359,7 +359,7 @@ cb_diskioctl(void *arg, int unit, u_long cmd, void *data) * Guest virtual machine i/o callbacks */ static int -cb_copyin(void *arg, const void *from, uint64_t to, size_t size) +cb_copyin(void *arg __unused, const void *from, uint64_t to, size_t size) { char *ptr; @@ -374,7 +374,7 @@ cb_copyin(void *arg, const void *from, uint64_t to, size_t size) } static int -cb_copyout(void *arg, uint64_t from, void *to, size_t size) +cb_copyout(void *arg __unused, uint64_t from, void *to, size_t size) { char *ptr; @@ -389,7 +389,7 @@ cb_copyout(void *arg, uint64_t from, void *to, size_t size) } static void -cb_setreg(void *arg, int r, uint64_t v) +cb_setreg(void *arg __unused, int r, uint64_t v) { int error; enum vm_reg_name vmreg; @@ -418,7 +418,7 @@ cb_setreg(void *arg, int r, uint64_t v) } static void -cb_setmsr(void *arg, int r, uint64_t v) +cb_setmsr(void *arg __unused, int r, uint64_t v) { int error; enum vm_reg_name vmreg; @@ -446,7 +446,7 @@ cb_setmsr(void *arg, int r, uint64_t v) } static void -cb_setcr(void *arg, int r, uint64_t v) +cb_setcr(void *arg __unused, int r, uint64_t v) { int error; enum vm_reg_name vmreg; @@ -481,7 +481,7 @@ cb_setcr(void *arg, int r, uint64_t v) } static void -cb_setgdt(void *arg, uint64_t base, size_t size) +cb_setgdt(void *arg __unused, uint64_t base, size_t size) { int error; @@ -495,7 +495,7 @@ cb_setgdt(void *arg, uint64_t base, size_t size) } static void -cb_exec(void *arg, uint64_t rip) +cb_exec(void *arg __unused, uint64_t rip) { int error; @@ -518,14 +518,14 @@ cb_exec(void *arg, uint64_t rip) */ static void -cb_delay(void *arg, int usec) +cb_delay(void *arg __unused, int usec) { usleep(usec); } static void -cb_exit(void *arg, int v) +cb_exit(void *arg __unused, int v) { tcsetattr(consout_fd, TCSAFLUSH, &oldterm); @@ -533,7 +533,7 @@ cb_exit(void *arg, int v) } static void -cb_getmem(void *arg, uint64_t *ret_lowmem, uint64_t *ret_highmem) +cb_getmem(void *arg __unused, uint64_t *ret_lowmem, uint64_t *ret_highmem) { *ret_lowmem = vm_get_lowmem_size(ctx); @@ -548,17 +548,21 @@ struct env { static SLIST_HEAD(envhead, env) envhead; static void -addenv(char *str) +addenv(const char *str) { struct env *env; env = malloc(sizeof(struct env)); - env->str = str; + if (env == NULL) + err(EX_OSERR, "malloc"); + env->str = strdup(str); + if (env->str == NULL) + err(EX_OSERR, "strdup"); SLIST_INSERT_HEAD(&envhead, env, next); } static char * -cb_getenv(void *arg, int num) +cb_getenv(void *arg __unused, int num) { int i; struct env *env; @@ -574,22 +578,22 @@ cb_getenv(void *arg, int num) } static int -cb_vm_set_register(void *arg, int vcpu, int reg, uint64_t val) +cb_vm_set_register(void *arg __unused, int vcpu, int reg, uint64_t val) { return (vm_set_register(ctx, vcpu, reg, val)); } static int -cb_vm_set_desc(void *arg, int vcpu, int reg, uint64_t base, u_int limit, - u_int access) +cb_vm_set_desc(void *arg __unused, int vcpu, int reg, uint64_t base, + u_int limit, u_int access) { return (vm_set_desc(ctx, vcpu, reg, base, limit, access)); } static void -cb_swap_interpreter(void *arg, const char *interp_req) +cb_swap_interpreter(void *arg __unused, const char *interp_req) { /* From nobody Mon Mar 13 15:53:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1Qt2YvPz3xsMv; Mon, 13 Mar 2023 15:53: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 4Pb1Qt1jR7z47mk; Mon, 13 Mar 2023 15:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IJ66CWuGJTrW78xf8Jxckyge2v+hVcsexgWCVBRBzow=; b=wjAYYO6Ujdk5Fe0vhddJiXcxiWakYwwGawHwWofpvUQaeeRJHlKf1gjB4Dmagb6JgyVqTz J4n20EBJtyWckEDz98qNOnog+B7h8HP/d6IyQd6hxbZivgtsIxTycjeKNwYJhp6nBjLB+l ik5D/c0i6i8lCpuFrn6sI6OwuebTSOyTLn7yuK2+FDJ1JdKxp+u7V6AW42aOMCmhP+m6ZW ZO8ufg0+0KnQJQNAvOokVKtcTdpo/hzF0KdghWDcSkct3xbtd3bfnk7jiH/jaeThGK8B+H b1PEPZ60fsj6c9YSdMwxkQcML3zNz+wEAZJu8iuwrYDtH56vzMpK20ao+f7otQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IJ66CWuGJTrW78xf8Jxckyge2v+hVcsexgWCVBRBzow=; b=tqgkKoCeNV0EC9uiGMVXgmp6jd1iNNhU+NfU3eE9F77OFpxxt5TmSYQaeqARaSIebdOCKr GhdvVIdYcFyDgk1YGq+C2ldH3nT13sGkBrio2bfE1PcTeK/XuZLmz65h4Vb8bQ9nRXJavi n1lCzSZVD0ysqt5ysfevEKmbTVztabi4pWXLjPzYFYLmq0IPDjyH97yW2tb5riJgSSarBA jJqQCqeUDGaEZR3dnTG0dYSamUOD3SQY0xtVMw2s639SUYYnmdC0zy+OsiAcsj/52h1wbN d2lRhU+pMZHBkpxRoHODGg8z9ZgSIytgO8MSRrKx8dm8d8t8cT+O1fkbyvDRWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678722806; a=rsa-sha256; cv=none; b=WXPFjbeEbHBQPvK1nO/XmH7IYMLD+CPBawWzyLY1mytSfmh8Az053+d8NDHDRoTh40TTKS 1JXhGjXJUI5XmiF3sIbtt/Jsq58JLsUmIqiKoiubBxs6EsU1/WVjlQkw3o4OyQyTlAgL0g Rubd33s2rwYYqALgfJ/mgG6pB/OQLKVX18lxOiq3wqXCYHmbJn41tPgpClqehBnuKZnqsq 6aUSII/NlckgRq+klU3tBcAqQVUj2YjIu0UQyRkeGpvEgj8yNurzudd61J8dquO9G089Gl uQ/Q+O5GujttKZewL+8QAzjby1+uQz8Sy2JnBR4KAgUWxNVRIkdIBmgsN/wHXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1Qt0lBQz10DZ; Mon, 13 Mar 2023 15:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFrQuj039823; Mon, 13 Mar 2023 15:53:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFrQJH039822; Mon, 13 Mar 2023 15:53:26 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:53:26 GMT Message-Id: <202303131553.32DFrQJH039822@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: 054f0a64547f - stable/13 - deadlkres: Make parameters settable with tunables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 054f0a64547fc0d88deecc489c2d9491cc624ed5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=054f0a64547fc0d88deecc489c2d9491cc624ed5 commit 054f0a64547fc0d88deecc489c2d9491cc624ed5 Author: Mark Johnston AuthorDate: 2023-03-03 16:16:16 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 15:53:16 +0000 deadlkres: Make parameters settable with tunables MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. (cherry picked from commit 831601773e5ab58b9485c1b111eb8c7c7343abf6) --- sys/kern/kern_clock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index e03245a6c492..8ee42a92aee9 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -304,13 +304,13 @@ SYSINIT(deadlkres, SI_SUB_CLOCKS, SI_ORDER_ANY, kthread_start, &deadlkres_kd); static SYSCTL_NODE(_debug, OID_AUTO, deadlkres, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Deadlock resolver"); -SYSCTL_INT(_debug_deadlkres, OID_AUTO, slptime_threshold, CTLFLAG_RW, +SYSCTL_INT(_debug_deadlkres, OID_AUTO, slptime_threshold, CTLFLAG_RWTUN, &slptime_threshold, 0, "Number of seconds within is valid to sleep on a sleepqueue"); -SYSCTL_INT(_debug_deadlkres, OID_AUTO, blktime_threshold, CTLFLAG_RW, +SYSCTL_INT(_debug_deadlkres, OID_AUTO, blktime_threshold, CTLFLAG_RWTUN, &blktime_threshold, 0, "Number of seconds within is valid to block on a turnstile"); -SYSCTL_INT(_debug_deadlkres, OID_AUTO, sleepfreq, CTLFLAG_RW, &sleepfreq, 0, +SYSCTL_INT(_debug_deadlkres, OID_AUTO, sleepfreq, CTLFLAG_RWTUN, &sleepfreq, 0, "Number of seconds between any deadlock resolver thread run"); #endif /* DEADLKRES */ From nobody Mon Mar 13 15:53:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1Qv5knXz3xsbR; Mon, 13 Mar 2023 15:53: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 4Pb1Qv2DN3z47xl; Mon, 13 Mar 2023 15:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PuS6LC3VNSDn16J0TgpiW9r+bCeVD0XfZSqdONzJfsk=; b=mDfoh2gCmqzpcsxpHxyVZBv4iHsrM2Je6dzACRHIID1FcJfiQRAQJ5P8rhzfJB5Z0/zAdH ZHgen/nLNbgr5Maa92rX1wlH+bDSCR3wK4/bnmSoKevWQwyTDGmoN0fIUwL+oILSf8+u23 P4qvL4DIt/UL0MTmCDiucA2KukZnlTqEpkmAovPyOswKQChECH+3a9iUC25jHcCxaoKXiP vgZwg7ZpleGF1CUf5EPYAjubWDotdGW+QMNQGVE+R3Mo3n+A7pyPesM7udV3VPrb8WLegO LMoBcTEvZl7a0C0zD12Jx4yr2UsuPxXADST105agT18thPsOoR+5iKfSVJSj7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PuS6LC3VNSDn16J0TgpiW9r+bCeVD0XfZSqdONzJfsk=; b=U8d/RiZBNRsw7VUIzuBLbICCbuEBuKInhiZseRhNxHA8DPt+HbH9u2GgU8eKztYE+3+7Dq rFO08v0dONShmZoWGAA8C3UvAmQJlk3wvpCGxrYea6+bNttDXwltu7DLH8aIKvKIvMgk+B oLsmOSR1enhxmYVFTNJ2ANgk0UHOVydimJH4HHZ8Pk8uc1ewd1TGjpu7h/6SQ4noCDfMcL n0V515+r97DzCae6wwQ/utufiIAfeQa7jlADNH2xj9Ovl4TrXwo2QK9FzUve+msHoZpvSV 5jfoWHInqEkH6L1k2jcbZnifFG7Uzzai3aCaEjXa77TqQRJ3YxrWruXKXLSM5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678722807; a=rsa-sha256; cv=none; b=qskst+tAwxbXm/e6b966AK1yKLHL8lL8IOK2Mb2SWUDeta+OOhdQzbGDImHCZO4qBDsQlh HJrh88I3t7cam4CIPiog7BlNeOWcbQUauxXirSEhIJOC9NfE57FAr12cFVJllAK+0w9E/q 1fear/BoYWExMiIw7HUIXwWS5w5YPzIvLOfHBYyg+EMEGL8a+5HgMjexRNIkcr1uReF6Ce LOJgR+Npfhcb2s/RMpmcKJ6StRMdsO5Yqkhgz9QRqT4MhggI2eyvn/NjaWtxcn4tXYPGd0 9trU2xhyQJglPyz3QlNFl59adnhEzM5FLteJfaGmmv/vtpAtWszPnBAAQe+pJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1Qv1KxHz10GZ; Mon, 13 Mar 2023 15:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFrRKq039842; Mon, 13 Mar 2023 15:53:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFrRa5039841; Mon, 13 Mar 2023 15:53:27 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:53:27 GMT Message-Id: <202303131553.32DFrRa5039841@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: 25766cfd83b2 - stable/13 - bhyvectl: Address compiler warnings and bump WARNS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25766cfd83b29c5a32e7c02501adabe754eaa255 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=25766cfd83b29c5a32e7c02501adabe754eaa255 commit 25766cfd83b29c5a32e7c02501adabe754eaa255 Author: Mark Johnston AuthorDate: 2023-03-03 14:32:48 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 15:53:16 +0000 bhyvectl: Address compiler warnings and bump WARNS Avoid unaligned accesses in cpu_vendor_intel() and address a few other nits. No functional change intended. Reviewed by: corvink, rew, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38839 (cherry picked from commit 3f5d875a27318a909f23a2b7463c4b2d963085df) --- usr.sbin/bhyvectl/Makefile | 2 -- usr.sbin/bhyvectl/bhyvectl.c | 30 ++++++++++++------------------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/usr.sbin/bhyvectl/Makefile b/usr.sbin/bhyvectl/Makefile index c004d603c8db..5b1c04e8ac88 100644 --- a/usr.sbin/bhyvectl/Makefile +++ b/usr.sbin/bhyvectl/Makefile @@ -12,8 +12,6 @@ MAN= bhyvectl.8 LIBADD= vmmapi util -WARNS?= 3 - CFLAGS+= -I${SRCTOP}/sys/amd64/vmm .if ${MK_BHYVE_SNAPSHOT} != "no" diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 14ab6c7ad33e..cab1e6d72c56 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -294,7 +294,7 @@ static int set_desc_ldtr, get_desc_ldtr; static int set_cs, set_ds, set_es, set_fs, set_gs, set_ss, set_tr, set_ldtr; static int get_cs, get_ds, get_es, get_fs, get_gs, get_ss, get_tr, get_ldtr; static int set_x2apic_state, get_x2apic_state; -enum x2apic_state x2apic_state; +static enum x2apic_state x2apic_state; static int unassign_pptdev, bus, slot, func; static int run; static int get_cpu_topology; @@ -316,7 +316,6 @@ static int get_pinbased_ctls, get_procbased_ctls, get_procbased_ctls2; static int get_eptp, get_io_bitmap, get_tsc_offset; static int get_vmcs_entry_interruption_info; static int get_vmcs_interruptibility; -uint32_t vmcs_entry_interruption_info; static int get_vmcs_gpa, get_vmcs_gla; static int get_exception_bitmap; static int get_cr0_mask, get_cr0_shadow; @@ -497,8 +496,8 @@ dump_intel_msr_pm(const char *bitmap, int vcpu) static int dump_msr_bitmap(int vcpu, uint64_t addr, bool cpu_intel) { + char *bitmap; int error, fd, map_size; - const char *bitmap; error = -1; bitmap = MAP_FAILED; @@ -648,25 +647,20 @@ print_intinfo(const char *banner, uint64_t info) static bool cpu_vendor_intel(void) { - u_int regs[4]; - char cpu_vendor[13]; + u_int regs[4], v[3]; do_cpuid(0, regs); - ((u_int *)&cpu_vendor)[0] = regs[1]; - ((u_int *)&cpu_vendor)[1] = regs[3]; - ((u_int *)&cpu_vendor)[2] = regs[2]; - cpu_vendor[12] = '\0'; + v[0] = regs[1]; + v[1] = regs[3]; + v[2] = regs[2]; - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { - return (false); - } else if (strcmp(cpu_vendor, "HygonGenuine") == 0) { - return (false); - } else if (strcmp(cpu_vendor, "GenuineIntel") == 0) { + if (memcmp(v, "GenuineIntel", sizeof(v)) == 0) return (true); - } else { - fprintf(stderr, "Unknown cpu vendor \"%s\"\n", cpu_vendor); - exit(1); - } + if (memcmp(v, "AuthenticAMD", sizeof(v)) == 0 || + memcmp(v, "HygonGenuine", sizeof(v)) == 0) + return (false); + fprintf(stderr, "Unknown cpu vendor \"%s\"\n", (const char *)v); + exit(1); } static int From nobody Mon Mar 13 15:53:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1Qw3X1Yz3xscF; Mon, 13 Mar 2023 15:53: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 4Pb1Qw30JRz484X; Mon, 13 Mar 2023 15:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPTJjMiDtyaH7wBzcziudKgX8vELppY68E2JefbG9pc=; b=tdsw15BkZXeLpOtdKF9GAdHWN6lATru6CdjB43Or5wBTR0nSb3wnVDnCedYEnKmdQMMswB hOdA7bjAcRfUaeZN/mUECjJY1qJbyqBAatfMgMAg+e3dK9T9oRlq9tSWkEL7yvBCodeLVB zkQouqFCSMZaODTcEXffaHgwHImaV9p1Qrkt5JUsN3xyGPVsRGxrdZ2JuXiUjrPtVzVILe I0L2RBVUoDY6JAXvItpt+32mtNaWpduhAqG6WH5xaneS1toM0RI/qWNYq1Auz1FAglyiNL x617j92c2UFNp1tLevI9cWBbSHLFPq8BeXBncYKrEz66Ly2zJS4xbAB8U6Yd3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPTJjMiDtyaH7wBzcziudKgX8vELppY68E2JefbG9pc=; b=bnedotS/Bl4LFAPVtcvl97nx8YVLaA5ngvZuGU2zBPmRLqZKON+qhpoNgszKAY1acvRZk5 CeD6hOZ/Rv3wEAEQx7nXexKz2YzdXhdg/ypOb2c0qxqQOYAxn4XeIZeEe1nj3E5yhWg2A6 lIKjPIgjdzIKVppvNCaqCcihsYypdmg/MCLRJblUCUNQSaUk/HpNNAijhlBTaSnJeTW4VL grj5MDm2szs38Bay+O1pqamRk30UMaGQQrMKBtQqB2vGCoAXE/1GmxCBX2ltwGUxICyESP ypjzEuu1bcuaLRl5N/i9VDypIoFxW66fnX2AdNrIXO9saCueGXbS7mawhkOyGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678722808; a=rsa-sha256; cv=none; b=Oqd99kg5zZc7nSnBjSXywDNm3nhqC0iK1ZnDECrwOcWTtBJLNBLB3naGCFSpxHUA7khIaw FaTaSEQSN8NsNyVGO8ep1PKPwGjDo7EdEo+YqN8/WSDUg2wo3sD9Py7phFmAg8dDADxFoI /2gAUu5myVvPdtucVaYiUBd74Pazzlmm+Bm6mc9bsq8EUQ8ooEpkgRXYU/yWZHh1U7PFcL nv6yen9T4cZiL+j+pIjYYfk0OqzUUHFOHNT7Bu17xyiHjS8/e4DCjJWSoAdObf+gg4is1Z 1htfGsf7VDN+1Z+kMDxIO/WG36SFcjjI3EJEtBo/oyY1QY8Ay1JyK+Tt0BjYfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1Qw23thzytT; Mon, 13 Mar 2023 15:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFrSxs039868; Mon, 13 Mar 2023 15:53:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFrSlT039867; Mon, 13 Mar 2023 15:53:28 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:53:28 GMT Message-Id: <202303131553.32DFrSlT039867@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: 25e0844eda66 - stable/13 - netmap: Fix compiler warnings in tools List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25e0844eda663f82f270b959df9e0935982044d3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=25e0844eda663f82f270b959df9e0935982044d3 commit 25e0844eda663f82f270b959df9e0935982044d3 Author: Mark Johnston AuthorDate: 2023-02-27 18:41:58 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 15:53:16 +0000 netmap: Fix compiler warnings in tools - Remove write-only variables, or hide them in cases where their use is conditional or commented out. - Check for errors from cmd_apply() in nmreplay. - Use ANSI C definitions. Reviewed by: vmaffione MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38752 (cherry picked from commit 538c66eabda55afccebc25fb66548115e5ed8151) --- tools/tools/netmap/lb.c | 5 ++--- tools/tools/netmap/nmreplay.c | 2 ++ tools/tools/netmap/pkt-gen.c | 12 +++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/tools/netmap/lb.c b/tools/tools/netmap/lb.c index 778360d9ed6a..66d7aab8f6e1 100644 --- a/tools/tools/netmap/lb.c +++ b/tools/tools/netmap/lb.c @@ -388,7 +388,8 @@ static void sigint_h(int sig) signal(SIGINT, SIG_DFL); } -static void usage() +static void +usage(void) { printf("usage: lb [options]\n"); printf("where options are:\n"); @@ -617,7 +618,6 @@ int main(int argc, char **argv) int ch; uint32_t i; int rv; - unsigned int iter = 0; int poll_timeout = 10; /* default */ glob_arg.ifname[0] = '\0'; @@ -897,7 +897,6 @@ run: while (!do_abort) { u_int polli = 0; - iter++; for (i = 0; i < npipes; ++i) { struct netmap_ring *ring = ports[i].ring; diff --git a/tools/tools/netmap/nmreplay.c b/tools/tools/netmap/nmreplay.c index e0a9e2146119..390877677403 100644 --- a/tools/tools/netmap/nmreplay.c +++ b/tools/tools/netmap/nmreplay.c @@ -1249,6 +1249,8 @@ main(int argc, char **argv) err += cmd_apply(delay_cfg, d[i], qs, &qs->c_delay); err += cmd_apply(bw_cfg, b[i], qs, &qs->c_bw); err += cmd_apply(loss_cfg, l[i], qs, &qs->c_loss); + if (err != 0) + exit(1); } pthread_create(&bp[0].cons_tid, NULL, nmreplay_main, (void*)&bp[0]); diff --git a/tools/tools/netmap/pkt-gen.c b/tools/tools/netmap/pkt-gen.c index c6cf78ad85ee..b06fef05579d 100644 --- a/tools/tools/netmap/pkt-gen.c +++ b/tools/tools/netmap/pkt-gen.c @@ -1306,7 +1306,7 @@ ping_body(void *data) struct targ *targ = (struct targ *) data; struct pollfd pfd = { .fd = targ->fd, .events = POLLIN }; struct netmap_if *nifp = targ->nmd->nifp; - int i, m, rx = 0; + int i, m; void *frame; int size; struct timespec ts, now, last_print; @@ -1399,7 +1399,9 @@ ping_body(void *data) } #endif /* BUSYWAIT */ /* see what we got back */ - rx = 0; +#ifdef BUSYWAIT + int rx = 0; +#endif for (i = targ->nmd->first_rx_ring; i <= targ->nmd->last_rx_ring; i++) { ring = NETMAP_RXRING(nifp, i); @@ -1434,7 +1436,9 @@ ping_body(void *data) buckets[pos]++; /* now store it in a bucket */ ring->head = ring->cur = nm_ring_next(ring, ring->head); +#ifdef BUSYWAIT rx++; +#endif } } //D("tx %d rx %d", sent, rx); @@ -1502,7 +1506,7 @@ pong_body(void *data) struct pollfd pfd = { .fd = targ->fd, .events = POLLIN }; struct netmap_if *nifp = targ->nmd->nifp; struct netmap_ring *txring, *rxring; - int i, rx = 0; + int i; uint64_t sent = 0, n = targ->g->npackets; if (targ->g->nthreads > 1) { @@ -1544,7 +1548,6 @@ pong_body(void *data) src = NETMAP_BUF(rxring, slot->buf_idx); //D("got pkt %p of size %d", src, slot->len); rxring->head = rxring->cur = nm_ring_next(rxring, head); - rx++; if (txavail == 0) continue; dst = NETMAP_BUF(txring, @@ -1579,7 +1582,6 @@ pong_body(void *data) #ifdef BUSYWAIT ioctl(pfd.fd, NIOCTXSYNC, NULL); #endif - //D("tx %d rx %d", sent, rx); } targ->completed = 1; From nobody Mon Mar 13 15:53:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1Qx54GMz3xsHl; Mon, 13 Mar 2023 15:53: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 4Pb1Qx49wRz48PF; Mon, 13 Mar 2023 15:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s0+a8nYhgx4ixQDny+f72+d9BQDTeAuPIf2JqhDAXIQ=; b=xeIioZrPVL/I8CwKqLuObWmBz/0XZ5UkSDQMjUa6NKzf7kr5ii99MyGqqIsIZIUb0pWElL i/85h9yrWxp1+HWv5Y1Wa6qDKq2gBizv+sh9g2SIuD9HRMVVjXIeSn2n2nqGeLgp3afvwH MXSZ1OW8zDxLiwFS6Is4u4pAUkFs4bL4ugHMCpbdts4klKpbdL07KSkUNDGLgmPJm5WuMm xVXxxhPR6smA8LkmAUVTXcRUxvXpg2PBFHRksqh1YX6Aedb/nPuu8YpBZ+71HkcduTDTqz 2bsPp6I54AORLQl2IDZVblSaIaViSTrgHQCJIOMb2aDBAn9FmvkcDGR9COHz8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s0+a8nYhgx4ixQDny+f72+d9BQDTeAuPIf2JqhDAXIQ=; b=dUyb47yvFqsfGzRw/hSXX1lqZ41HPWsrjzxnkrSpV40CM2K2815S/9muRWRYAwLrx49clS KA874amwJDu4SBxMm8m+r4jTOst318AoyBdXD8XFE5UrtP8J8FJacCJPVplpoCEcplpKBU yWV9qS2gGROff4ddHxo9WJNExOqv+gjaNKSpvVjfcEGzHTPOC76tTTwo4a4p85hBSOKEeT WHEZOUw9TIa+LKZoGrNKX6y759cFHs2SPkYxoiBNd9xmw8MC9fMSj32esJGEyNh5Xy3w7h PBSABQYyH/KoTVLHFt5FMkN30EFolnUKMSmGyR3cdsnzxfj5NSuvDVNNiParbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678722809; a=rsa-sha256; cv=none; b=fg72C36qH26h/Y1td0BDSVtzOcyoNSW/k1ZkGEKbLQ//BGuCTLT/TrMXlzCUNnLRoG1jof ovrr9RuZICIuzkdnuFWRotpbf3vYARa3nla6GvdZDJh931JCSwi+i67SE54ret3fQ60TE5 Ikz3xKUbl0lyMio/dTksmbV2v9Om8KIZkKuanOG8Tw3og1zCOL4pQ8o68uqpoCcrTv7L74 diDKwGZMeK3Y4xrAM0yFEDutaEEvP3kwip4JAdZ+Yl7924+59uezYvfvzOWHosX77EDwp2 mohkzKkDjNrtpry0OPz/EbR34ozwKcCBz5+9J1NZjR8bvOgV1rUGQNTbI4U3BA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1Qx3DQQz105X; Mon, 13 Mar 2023 15:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFrTei039887; Mon, 13 Mar 2023 15:53:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFrTJP039886; Mon, 13 Mar 2023 15:53:29 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:53:29 GMT Message-Id: <202303131553.32DFrTJP039886@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: c3bd32f225ec - stable/13 - epair: Avoid loading m_flags into a short List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c3bd32f225ec093ba0f7cd7fc1a000b02aad5211 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c3bd32f225ec093ba0f7cd7fc1a000b02aad5211 commit c3bd32f225ec093ba0f7cd7fc1a000b02aad5211 Author: Mark Johnston AuthorDate: 2023-03-06 14:39:17 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 15:53:16 +0000 epair: Avoid loading m_flags into a short The m_flags field of struct mbuf is 24 bits wide and so gets truncated in a couple of places in the epair code. Instead of preserving the entire flag set, just remember whether M_BCAST or M_MCAST is set. MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit 48227d1c6db8fceaceebbf8578612302d64ca170) --- sys/net/if_epair.c | 95 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 41 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index e7257f5fa551..05667633fa42 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -188,39 +188,14 @@ epair_tx_start_deferred(void *arg, int pending) if_rele(sc->ifp); } -static int -epair_menq(struct mbuf *m, struct epair_softc *osc) +static struct epair_queue * +epair_select_queue(struct epair_softc *sc, struct mbuf *m) { - struct ifnet *ifp, *oifp; - int len, ret; - int ridx; - short mflags; - struct epair_queue *q = NULL; uint32_t bucket; #ifdef RSS struct ether_header *eh; -#endif - - /* - * I know this looks weird. We pass the "other sc" as we need that one - * and can get both ifps from it as well. - */ - oifp = osc->ifp; - ifp = osc->oifp; - - M_ASSERTPKTHDR(m); - epair_clear_mbuf(m); - if_setrcvif(m, oifp); - M_SETFIB(m, oifp->if_fib); - - /* Save values as once the mbuf is queued, it's not ours anymore. */ - len = m->m_pkthdr.len; - mflags = m->m_flags; - - MPASS(m->m_nextpkt == NULL); - MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); + int ret; -#ifdef RSS ret = rss_m2bucket(m, &bucket); if (ret) { /* Actually hash the packet. */ @@ -246,7 +221,43 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) #else bucket = 0; #endif - q = &osc->queues[bucket]; + return (&sc->queues[bucket]); +} + +static void +epair_prepare_mbuf(struct mbuf *m, struct ifnet *src_ifp) +{ + M_ASSERTPKTHDR(m); + epair_clear_mbuf(m); + if_setrcvif(m, src_ifp); + M_SETFIB(m, src_ifp->if_fib); + + MPASS(m->m_nextpkt == NULL); + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); +} + +static void +epair_menq(struct mbuf *m, struct epair_softc *osc) +{ + struct ifnet *ifp, *oifp; + int len, ret; + int ridx; + bool mcast; + + /* + * I know this looks weird. We pass the "other sc" as we need that one + * and can get both ifps from it as well. + */ + oifp = osc->ifp; + ifp = osc->oifp; + + epair_prepare_mbuf(m, oifp); + + /* Save values as once the mbuf is queued, it's not ours anymore. */ + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_BCAST | M_MCAST)) != 0; + + struct epair_queue *q = epair_select_queue(osc, m); atomic_set_long(&q->state, (1 << BIT_MBUF_QUEUED)); ridx = atomic_load_int(&q->ridx); @@ -255,7 +266,7 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) /* Ring is full. */ if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); m_freem(m); - return (0); + return; } if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); @@ -265,15 +276,13 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) * the logic another time. */ if_inc_counter(ifp, IFCOUNTER_OBYTES, len); - if (mflags & (M_BCAST|M_MCAST)) + if (mcast) if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); /* Someone else received the packet. */ if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); if (!atomic_testandset_long(&q->state, BIT_QUEUE_TASK)) - taskqueue_enqueue(epair_tasks.tq[bucket], &q->tx_task); - - return (0); + taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); } static void @@ -317,8 +326,10 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) { struct epair_softc *sc; struct ifnet *oifp; - int error, len; - short mflags; +#ifdef ALTQ + int len; + bool mcast; +#endif if (m == NULL) return (0); @@ -355,10 +366,12 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) m_freem(m); return (0); } - len = m->m_pkthdr.len; - mflags = m->m_flags; #ifdef ALTQ + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_BCAST | M_MCAST)) != 0; + int error = 0; + /* Support ALTQ via the classic if_start() path. */ IF_LOCK(&ifp->if_snd); if (ALTQ_IS_ENABLED(&ifp->if_snd)) { @@ -368,7 +381,7 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) IF_UNLOCK(&ifp->if_snd); if (!error) { if_inc_counter(ifp, IFCOUNTER_OBYTES, len); - if (mflags & (M_BCAST|M_MCAST)) + if (mcast) if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); epair_start(ifp); } @@ -377,8 +390,8 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) IF_UNLOCK(&ifp->if_snd); #endif - error = epair_menq(m, oifp->if_softc); - return (error); + epair_menq(m, oifp->if_softc); + return (0); } static int From nobody Mon Mar 13 15:53:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1Qy5tpWz3xsQN; Mon, 13 Mar 2023 15:53: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 4Pb1Qy4rQFz488l; Mon, 13 Mar 2023 15:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FFfiReEknZJqOhoEVLUY2knrSrqVarc3T4v1i2VMcLo=; b=ZhnC1850I5vRwLqvWCVujbIoGiUV3n2LQc8qTwNASBdBbUHcs/HFr3bdwahqPS1qxJukFU i3fiJhrFlXZuwngGh1Sc6opNIE4cgQU76PBrDMQjP3NaOjXlludiRgtvNIuLWqQiCqBFMT b0WsxJFFdawaWlEmGZEt11uXxapa0GCfWxGSFr/gi2shHm1H82bRDXh9Gi+dOeHmtgzmnp otL8VYSpLvOwrEPe5/QnRmZpSEGa1KPPEMFRW8iV5Kbf6+hhhBButlPcJtQ1PCk5B5mC7V YjNy/nAwD28wsfYk3sWuD+juC8H+roqrK0yi+++4BBi0r4CS5/cSLV9O4WCCQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678722810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FFfiReEknZJqOhoEVLUY2knrSrqVarc3T4v1i2VMcLo=; b=hgxF7Ue6um2O6ttxDymYhS3gDSETDqLWooM7jGxj7NYbKNFkG672350hhteWHm+GUO3Wpj WiEa3Ed/LuHh45X0h2tMtcO9XZ0DIpU+nOnPpPCYQqIcWSCbEa4kxS5H8cKVnbjF19ew6i kEaP4bTFDuYCVH1w91fCZfU9tUd25tQg0m7tMhsB+Rv5IjnTDWoBUqFbVmh5yIIShzaMlr yZtFbIQF/8RFsWo9VMN2rFP6Mbi66RrtsznVDWONbDTlBPuNDvzUOT1rDsiJYgMN6uq/W9 K7PFYdsJP/A+UxlxSwFnp3itLjNkxJIodxJi0dFp5nN1e/xyIjAr/gNW9qnaTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678722810; a=rsa-sha256; cv=none; b=OdWbWTdShJX2pwonbi+lo5ykNMgx7fyAApMZVH73ewtRvsd/4c20BRsxOxf+z4sEA9U7gY KRgVJl2YdKUJV2ZOxHPdwzE8HF4JVHZzsogDaYwPe25k+nTcTOn7i1OQ8x/dfzFiWz5mu5 Bqk6ZLWTVrmtelMr7/mlgDHT0sxOJvQRcFkpe57Hqp++71P3z1i5kxEwku5fNiuy3OicLo d8X6KlyBf1KlQ99ExNOD6VVvLoKsHmddzEAQpUMuu29ltBSohoGPWwS8s2odHjE1NR2I73 m7KWP58An1LGbM9rkeCFgQnI+4PMEkWG+Kp8JfalD2hVPOlW1Zz2dSOoLzlkjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1Qy3whbz10Db; Mon, 13 Mar 2023 15:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DFrUQL039906; Mon, 13 Mar 2023 15:53:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DFrU3f039905; Mon, 13 Mar 2023 15:53:30 GMT (envelope-from git) Date: Mon, 13 Mar 2023 15:53:30 GMT Message-Id: <202303131553.32DFrU3f039905@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: 762ad964ee34 - stable/13 - epair: Simplify the transmit path and address lost wakeups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 762ad964ee346cffdbf3eaa6ff87fa5b32d30738 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=762ad964ee346cffdbf3eaa6ff87fa5b32d30738 commit 762ad964ee346cffdbf3eaa6ff87fa5b32d30738 Author: Mark Johnston AuthorDate: 2023-03-01 20:21:30 +0000 Commit: Mark Johnston CommitDate: 2023-03-13 15:53:16 +0000 epair: Simplify the transmit path and address lost wakeups epairs currently shuttle all transmitted packets through a single global taskqueue thread. To hand packets over to the taskqueue thread, each epair maintains a pair of ring buffers and a lockless scheme for notifying the thread of pending work. The implementation can lead to lost wakeups, causing to-be-transmitted packets to end up stuck in the queue. Rather than extending the existing scheme, simply replace it with a linked list protected by a mutex, and use the mutex to synchronize wakeups of the taskqueue thread. This appears to give equivalent or better throughput with >= 16 producer threads and eliminates the lost wakeups. Reviewed by: kp MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D38843 (cherry picked from commit df7bbd8c354a907d2c2f85a6e18f356f76458f57) --- sys/net/if_epair.c | 162 ++++++++++++++++++++++++++--------------------------- 1 file changed, 79 insertions(+), 83 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 05667633fa42..68b68c11af06 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -104,15 +104,16 @@ static unsigned int next_index = 0; #define EPAIR_LOCK() mtx_lock(&epair_n_index_mtx) #define EPAIR_UNLOCK() mtx_unlock(&epair_n_index_mtx) -#define BIT_QUEUE_TASK 0 -#define BIT_MBUF_QUEUED 1 - struct epair_softc; struct epair_queue { + struct mtx mtx; + struct mbufq q; int id; - struct buf_ring *rxring[2]; - volatile int ridx; /* 0 || 1 */ - volatile long state; /* taskqueue coordination */ + enum { + EPAIR_QUEUE_IDLE, + EPAIR_QUEUE_WAKING, + EPAIR_QUEUE_RUNNING, + } state; struct task tx_task; struct epair_softc *sc; }; @@ -148,44 +149,49 @@ epair_clear_mbuf(struct mbuf *m) } static void -epair_if_input(struct epair_softc *sc, struct epair_queue *q, int ridx) +epair_tx_start_deferred(void *arg, int pending) { - struct ifnet *ifp; - struct mbuf *m; + struct epair_queue *q = (struct epair_queue *)arg; + if_t ifp; + struct mbuf *m, *n; + bool resched; + + ifp = q->sc->ifp; - ifp = sc->ifp; + if_ref(ifp); CURVNET_SET(ifp->if_vnet); - while (! buf_ring_empty(q->rxring[ridx])) { - m = buf_ring_dequeue_mc(q->rxring[ridx]); - if (m == NULL) - continue; - MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); - (*ifp->if_input)(ifp, m); + mtx_lock(&q->mtx); + m = mbufq_flush(&q->q); + q->state = EPAIR_QUEUE_RUNNING; + mtx_unlock(&q->mtx); + while (m != NULL) { + n = STAILQ_NEXT(m, m_stailqpkt); + m->m_nextpkt = NULL; + if_input(ifp, m); + m = n; } - CURVNET_RESTORE(); -} -static void -epair_tx_start_deferred(void *arg, int pending) -{ - struct epair_queue *q = (struct epair_queue *)arg; - struct epair_softc *sc = q->sc; - int ridx, nidx; - - if_ref(sc->ifp); - ridx = atomic_load_int(&q->ridx); - do { - nidx = (ridx == 0) ? 1 : 0; - } while (!atomic_fcmpset_int(&q->ridx, &ridx, nidx)); - epair_if_input(sc, q, ridx); - - atomic_clear_long(&q->state, (1 << BIT_QUEUE_TASK)); - if (atomic_testandclear_long(&q->state, BIT_MBUF_QUEUED)) + /* + * Avoid flushing the queue more than once per task. We can otherwise + * end up starving ourselves in a multi-epair routing configuration. + */ + mtx_lock(&q->mtx); + if (mbufq_len(&q->q) > 0) { + resched = true; + q->state = EPAIR_QUEUE_WAKING; + } else { + resched = false; + q->state = EPAIR_QUEUE_IDLE; + } + mtx_unlock(&q->mtx); + + if (resched) taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); - if_rele(sc->ifp); + CURVNET_RESTORE(); + if_rele(ifp); } static struct epair_queue * @@ -239,9 +245,9 @@ epair_prepare_mbuf(struct mbuf *m, struct ifnet *src_ifp) static void epair_menq(struct mbuf *m, struct epair_softc *osc) { + struct epair_queue *q; struct ifnet *ifp, *oifp; - int len, ret; - int ridx; + int error, len; bool mcast; /* @@ -257,32 +263,26 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) len = m->m_pkthdr.len; mcast = (m->m_flags & (M_BCAST | M_MCAST)) != 0; - struct epair_queue *q = epair_select_queue(osc, m); + q = epair_select_queue(osc, m); - atomic_set_long(&q->state, (1 << BIT_MBUF_QUEUED)); - ridx = atomic_load_int(&q->ridx); - ret = buf_ring_enqueue(q->rxring[ridx], m); - if (ret != 0) { - /* Ring is full. */ - if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); - m_freem(m); - return; + mtx_lock(&q->mtx); + if (q->state == EPAIR_QUEUE_IDLE) { + q->state = EPAIR_QUEUE_WAKING; + taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); } + error = mbufq_enqueue(&q->q, m); + mtx_unlock(&q->mtx); - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - /* - * IFQ_HANDOFF_ADJ/ip_handoff() update statistics, - * but as we bypass all this we have to duplicate - * the logic another time. - */ - if_inc_counter(ifp, IFCOUNTER_OBYTES, len); - if (mcast) - if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); - /* Someone else received the packet. */ - if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - - if (!atomic_testandset_long(&q->state, BIT_QUEUE_TASK)) - taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); + if (error != 0) { + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); + } else { + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); + if (mcast) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); + } } static void @@ -561,10 +561,9 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) for (int i = 0; i < sca->num_queues; i++) { struct epair_queue *q = &sca->queues[i]; q->id = i; - q->rxring[0] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); - q->rxring[1] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); - q->ridx = 0; - q->state = 0; + q->state = EPAIR_QUEUE_IDLE; + mtx_init(&q->mtx, "epaiq", NULL, MTX_DEF | MTX_NEW); + mbufq_init(&q->q, RXRSIZE); q->sc = sca; NET_TASK_INIT(&q->tx_task, 0, epair_tx_start_deferred, q); } @@ -584,10 +583,9 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) for (int i = 0; i < scb->num_queues; i++) { struct epair_queue *q = &scb->queues[i]; q->id = i; - q->rxring[0] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); - q->rxring[1] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); - q->ridx = 0; - q->state = 0; + q->state = EPAIR_QUEUE_IDLE; + mtx_init(&q->mtx, "epaiq", NULL, MTX_DEF | MTX_NEW); + mbufq_init(&q->q, RXRSIZE); q->sc = scb; NET_TASK_INIT(&q->tx_task, 0, epair_tx_start_deferred, q); } @@ -707,18 +705,18 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) static void epair_drain_rings(struct epair_softc *sc) { - int ridx; - struct mbuf *m; + for (int i = 0; i < sc->num_queues; i++) { + struct epair_queue *q; + struct mbuf *m, *n; - for (ridx = 0; ridx < 2; ridx++) { - for (int i = 0; i < sc->num_queues; i++) { - struct epair_queue *q = &sc->queues[i]; - do { - m = buf_ring_dequeue_sc(q->rxring[ridx]); - if (m == NULL) - break; - m_freem(m); - } while (1); + q = &sc->queues[i]; + mtx_lock(&q->mtx); + m = mbufq_flush(&q->q); + mtx_unlock(&q->mtx); + + for (; m != NULL; m = n) { + n = m->m_nextpkt; + m_freem(m); } } } @@ -764,8 +762,7 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) ifmedia_removeall(&scb->media); for (int i = 0; i < scb->num_queues; i++) { struct epair_queue *q = &scb->queues[i]; - buf_ring_free(q->rxring[0], M_EPAIR); - buf_ring_free(q->rxring[1], M_EPAIR); + mtx_destroy(&q->mtx); } free(scb->queues, M_EPAIR); free(scb, M_EPAIR); @@ -776,8 +773,7 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) ifmedia_removeall(&sca->media); for (int i = 0; i < sca->num_queues; i++) { struct epair_queue *q = &sca->queues[i]; - buf_ring_free(q->rxring[0], M_EPAIR); - buf_ring_free(q->rxring[1], M_EPAIR); + mtx_destroy(&q->mtx); } free(sca->queues, M_EPAIR); free(sca, M_EPAIR); From nobody Mon Mar 13 16:16:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb1xj2cQbz3xtkg; Mon, 13 Mar 2023 16:16: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 4Pb1xj28JQz4DPc; Mon, 13 Mar 2023 16:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678724201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dkf6LGvXyPQoOgvMpIPtmMvzlIUAW6nRvdjqiBQzSJY=; b=Mf3+Z3JIwNyMgIyhL1frnuLKKL5j7N3Z1gDwHKv8Ai9ZMUCye9JyqD+eceR5WrAeGFSXIo itGZeltUKq0rMiqCBbArrJGYNHRyPfAE4Lp/NEG7YB1KD8NftsHofL9+OFX2LlgeF5RDeQ WEOgbVUmzmGEXfbLYV1vJU4SNFJz0BcOUN6I+fjcoCJjeciuEMaV/8/viXc2ROrBlVpX32 7fNh3QSH4mTqo/kGzrTThj3SCJlktF1JRxkYRSOPCLFXxPaavnesMZlz++sUVgvZEJO+9a G6QZwLeBualuuF1GOxnZswvGB4sa+qWeFz/zKmmHiJJnmVm7dc+ncGcIHBJKoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678724201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dkf6LGvXyPQoOgvMpIPtmMvzlIUAW6nRvdjqiBQzSJY=; b=l8ggn/wv2HixS8Yq9PU+gsTrMAe2PNqAtgYxoH8g7b0/bkuEFhIqP9LchPLSNfmMGL/97O gJ+LznvJNX0jk4GKqkEJ8j32jSS+2qLYhu8nEySI8Hk4S1A6cFwMOtMEt//hIzbchMNFNG fuZ/Q6e/Rl8yWz3o4pn4EnLL1FHCpcUV1/o/2L61stifwYx2wzWKDBln78kiBZwrwHxmNY xl95BVCYTRHWmST556rQCfZrar+X9pAlFb7BH7tlOJpoN/Ix6ddfaOWdsCSqQR5IDguvH4 9r4FT++qwHaG1MYwEfsyCoWWggqqJTSSMDeCfkLUsDyOBaAbZQi2C2kFT0eLmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678724201; a=rsa-sha256; cv=none; b=Yjp5MQ74nQ0GRANDbqLBE37SfVn+wJq2zP+T2C7D4JoIo44oKJF3MgFPzJTDMxk+x915Cr /kvzsSJVAQUcUKzdf9+XhSGZiomFBCDb2eOAq42rWB1jYWUPnQGeSiDNGpMKSUNHng+zLb 21kWSP/lgyQOOhriJtOwOeO/Jz8YBDj/WkESkpGeVVLxIXg62Is7WnFZMzAE6OWyRMQVDA 6fbGEEVkQFMOxcchigpOzVLS4IKSR95WKoLEaIbnNp/C4apy1RCsDWBGIBowLTbgxyvcwP hg1ZJmc3XPZ1hY7UXoPAS+MyOOFdGVNXbU1HpNorjIMl6HvIhWV88nAFQc4k2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb1xj0v62z10Hh; Mon, 13 Mar 2023 16:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DGGfEj074359; Mon, 13 Mar 2023 16:16:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DGGfLf074358; Mon, 13 Mar 2023 16:16:41 GMT (envelope-from git) Date: Mon, 13 Mar 2023 16:16:41 GMT Message-Id: <202303131616.32DGGfLf074358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: fc76ddee9be0 - main - tftp: Add test cases for URL mode. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc76ddee9be0d7f98c9f9a162627950f8102964e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fc76ddee9be0d7f98c9f9a162627950f8102964e commit fc76ddee9be0d7f98c9f9a162627950f8102964e Author: Dag-Erling Smørgrav AuthorDate: 2023-03-13 16:16:10 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-13 16:16:26 +0000 tftp: Add test cases for URL mode. Sponsored by: Klara, Inc. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D39014 --- usr.bin/tftp/tests/tftp_test.sh | 59 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/usr.bin/tftp/tests/tftp_test.sh b/usr.bin/tftp/tests/tftp_test.sh index 96e375f51aeb..a4c9f3b898e7 100644 --- a/usr.bin/tftp/tests/tftp_test.sh +++ b/usr.bin/tftp/tests/tftp_test.sh @@ -386,6 +386,62 @@ tftp_put_multi_host_cleanup() { stop_tftpd } +atf_test_case tftp_url_host cleanup +tftp_url_host_head() { + atf_set "descr" "URL with hostname" + atf_set "require.user" "root" +} +tftp_url_host_body() { + start_tftpd + local remote_file="${tftp_dir}/hello.txt" + echo "Hello, $$!" >"${remote_file}" + local local_file="${remote_file##*/}" + atf_check -o match:"Received [0-9]+ bytes" \ + tftp tftp://localhost/"${remote_file##*/}" + atf_check cmp -s "${local_file}" "${remote_file}" +} +tftp_url_host_cleanup() { + stop_tftpd +} + +atf_test_case tftp_url_ipv4 cleanup +tftp_url_ipv4_head() { + atf_set "descr" "URL with IPv4 address" + atf_set "require.user" "root" +} +tftp_url_ipv4_body() { + start_tftpd + local remote_file="${tftp_dir}/hello.txt" + echo "Hello, $$!" >"${remote_file}" + local local_file="${remote_file##*/}" + atf_check -o match:"Received [0-9]+ bytes" \ + tftp tftp://127.0.0.1/"${remote_file##*/}" + atf_check cmp -s "${local_file}" "${remote_file}" +} +tftp_url_ipv4_cleanup() { + stop_tftpd +} + +atf_test_case tftp_url_ipv6 cleanup +tftp_url_ipv6_head() { + atf_set "descr" "URL with IPv6 address" + atf_set "require.user" "root" +} +tftp_url_ipv6_body() { + sysctl -q kern.features.inet6 || atf_skip "This test requires IPv6 support" + atf_expect_fail "tftp does not support bracketed IPv6 literals in URLs" + start_tftpd + local remote_file="${tftp_dir}/hello.txt" + echo "Hello, $$!" >"${remote_file}" + local local_file="${remote_file##*/}" + atf_check -o match:"Received [0-9]+ bytes" \ + tftp tftp://"[::1]"/"${remote_file##*/}" + atf_check cmp -s "${local_file}" "${remote_file}" +} +tftp_url_ipv6_cleanup() { + stop_tftpd +} + atf_init_test_cases() { atf_add_test_case tftp_get_big atf_add_test_case tftp_get_host @@ -403,4 +459,7 @@ atf_init_test_cases() { atf_add_test_case tftp_put_two atf_add_test_case tftp_put_more atf_add_test_case tftp_put_multi_host + atf_add_test_case tftp_url_host + atf_add_test_case tftp_url_ipv4 + atf_add_test_case tftp_url_ipv6 } From nobody Mon Mar 13 16:49:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb2gR4fBFz3xwTQ; Mon, 13 Mar 2023 16:49: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 4Pb2gR4C2Vz4JQG; Mon, 13 Mar 2023 16:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678726163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NzsMKhp/pHXyfn3gPOpZqgq8+2yP5ecyyL9qNNAnLR8=; b=v0gZVjurNZrJi2L9O5axdJY9JfEhZOuDu6zJVwcdEETpAePeoV64dO77lMzScfGj0qWm0Y 9cXadskXwi5i22ucXThvrW8XKOSzqJLGM15q5UiRRfQJhwfb/7Ep3CKfwxXMBX2cGwlv3W fBHzH4YnypJXBxcWQgYNdpxKNNb/kfSlpYRmM22BzMDcxAdLp2elq0OCQ3wyuzqoZbhXsl ncrZFKy6BqUnMgIsGp0kJyAt3mGCJJnG3gW8zgC5juHdg/6l261ir7ii59lUUcIm46e/Fa 0QFgZuv1A4DZ20YI86MgtAJ6PW14xzEONU3ZkyJUNS8VgTwRclz7Ero/4CZ2cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678726163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NzsMKhp/pHXyfn3gPOpZqgq8+2yP5ecyyL9qNNAnLR8=; b=VnCq7shXOeJvBCClkgZ5LYnQtrnNh0UQ1LL9nrdoTffnvNMuTo6Y45YOj72DWmIKbTsLsl CWX14mhXDS+VqOr2A1ryOXbmd3CETRgPcPhXz94+c6RY7Kh5hJOs6iQTpalbghGpNhLTZr u0lYR3N7P5c7eGKIH5b/iOxA3CimKOqIcfVmmZ9zNsuI6F4s4+MhqJm4k8uiJoH1MmuJVf u4/hUv5bQ9mzXx6y0l6dSzJlNqTv3NyR07cecz2nIGIi/6W23OZUsXjSTGtH+X4o6h2OmS hRxXAW9Msh2/Muuga1EaKJVSFjGmvb/KMoQytFPJ0DyaUqZPWaRcqT4G+XCH6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678726163; a=rsa-sha256; cv=none; b=TH7GSUCqr0WBOZ2LBd0d7MQ0tFRKBTcs7le/I9Gvpo8JbvZo0zKjqydLEVYKrGdDxZ/z8B ITJIhY39IOc+SBRPtcunci6GwRPFNsera7zkWmZVJUBsr/jWbY9ZTo4OYfjBGEJh9xpqs9 4oVBcM2mnlehNgbWpEn/7600UCcFKQPL+HzLW9xGrp8FTW+/9HHq4uFeTLEAUVIZRT2n4c cLgTYvfrMIibC5uMqSmishxTGFQS0HZu7xVoxbUHebDbjZmKZQ0Xc525xNcWQLrAic5QgM Pq/fj4XD7pGhHI5alXYi7yKg622jYw0QKYdPu1OqGZcwcQTjTQZrhpV1Z4cXQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb2gR2yrfz11Kc; Mon, 13 Mar 2023 16:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DGnNgh023756; Mon, 13 Mar 2023 16:49:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DGnNxn023755; Mon, 13 Mar 2023 16:49:23 GMT (envelope-from git) Date: Mon, 13 Mar 2023 16:49:23 GMT Message-Id: <202303131649.32DGnNxn023755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pawel Biernacki Subject: git: 3eaffc626589 - main - netinet6: allow disabling excess log messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kaktus X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3eaffc626589eb2fc20a3c9c87eb8ab0ee89e783 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kaktus: URL: https://cgit.FreeBSD.org/src/commit/?id=3eaffc626589eb2fc20a3c9c87eb8ab0ee89e783 commit 3eaffc626589eb2fc20a3c9c87eb8ab0ee89e783 Author: Pawel Biernacki AuthorDate: 2023-03-13 16:36:11 +0000 Commit: Pawel Biernacki CommitDate: 2023-03-13 16:46:21 +0000 netinet6: allow disabling excess log messages RFC 4443 specifies cases where certain packets, like those originating from local-scope addresses destined outside of the scope shouldn't be forwarded. The current practice is to drop them, send ICMPv6 message where appropriate, and log the message: cannot forward src fe80:10::426:82ff:fe36:1d8, dst 2001:db8:db8::10, nxt 58, rcvif vlan5, outif vlan2 At times the volume of such messages cat get very high. Let's allow local admins to disable such messages on per vnet basis, keeping the current default (log). Reported by: zarychtam@plan-b.pwste.edu.pl Reviewed by: zlei (previous version), pauamma (docs) Differential Revision: https://reviews.freebsd.org/D38644 --- share/man/man4/inet6.4 | 20 ++++++++++++++++++-- sys/netinet6/in6_proto.c | 5 +++++ sys/netinet6/ip6_forward.c | 6 ++++-- sys/netinet6/ip6_mroute.c | 3 ++- sys/netinet6/ip6_var.h | 3 +++ 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/share/man/man4/inet6.4 b/share/man/man4/inet6.4 index 87c57ea2c3d2..3a950e746266 100644 --- a/share/man/man4/inet6.4 +++ b/share/man/man4/inet6.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2021 +.Dd February 22, 2023 .Dt INET6 4 .Os .Sh NAME @@ -185,7 +185,9 @@ The .Tn ICMPv6 message protocol is accessible from a raw socket. .Ss MIB Variables -A number of variables are implemented in the net.inet6 branch of the +A number of variables are implemented in the +.Va net.inet6 +branch of the .Xr sysctl 3 MIB. In addition to the variables supported by the transport protocols @@ -341,6 +343,11 @@ mapped address on .Dv AF_INET6 sockets. Defaults to on. +.It Va ip6.log_cannot_forward +Boolean: log packets that can't be forwarded because of unspecified source +address or destination address beyond the scope of the source address as +described in RFC4443. +Enabled by default. .It Va ip6.source_address_validation Boolean: perform source address validation for packets destined for the local host. @@ -440,6 +447,15 @@ sockets. .Xr ip6 4 , .Xr tcp 4 , .Xr udp 4 +.Rs +.%A A. Conta +.%A S. Deering +.%A M. Gupta +.%T "Internet Control Message Protocol (ICMPv6) for the Internet" \ + "Protocol Version 6 (IPv6) Specification" +.%R RFC 4443 +.%D March 2006 +.Re .Sh STANDARDS .Rs .%A Tatsuya Jinmei diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index ca1257456326..1f2a41dd51de 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -179,6 +179,7 @@ VNET_DEFINE(int, ip6stealth) = 0; #endif VNET_DEFINE(int, nd6_onlink_ns_rfc4861) = 0;/* allow 'on-link' nd6 NS * (RFC 4861) */ +VNET_DEFINE(bool, ip6_log_cannot_forward) = 1; /* icmp6 */ /* @@ -342,6 +343,10 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_STEALTH, stealth, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6stealth), 0, "Forward IPv6 packets without decrementing their TTL"); #endif +SYSCTL_BOOL(_net_inet6_ip6, OID_AUTO, + log_cannot_forward, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(ip6_log_cannot_forward), 1, + "Log packets that cannot be forwarded"); /* net.inet6.icmp6 */ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, rediraccept, diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index a95e58ba09a1..fc00eab4b784 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -114,7 +114,8 @@ ip6_forward(struct mbuf *m, int srcrt) IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { IP6STAT_INC(ip6s_cantforward); /* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */ - if (V_ip6_log_time + V_ip6_log_interval < time_uptime) { + if (V_ip6_log_cannot_forward && + (V_ip6_log_time + V_ip6_log_interval < time_uptime)) { V_ip6_log_time = time_uptime; log(LOG_DEBUG, "cannot forward " @@ -221,7 +222,8 @@ again: IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(nh->nh_ifp, ifs6_in_discard); - if (V_ip6_log_time + V_ip6_log_interval < time_uptime) { + if (V_ip6_log_cannot_forward && + (V_ip6_log_time + V_ip6_log_interval < time_uptime)) { V_ip6_log_time = time_uptime; log(LOG_DEBUG, "cannot forward " diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index e690cb64894f..cdccd04abc63 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1099,7 +1099,8 @@ X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) */ if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { IP6STAT_INC(ip6s_cantforward); - if (V_ip6_log_time + V_ip6_log_interval < time_uptime) { + if (V_ip6_log_cannot_forward && + (V_ip6_log_time + V_ip6_log_interval < time_uptime)) { V_ip6_log_time = time_uptime; log(LOG_DEBUG, "cannot forward " diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 32158534ef5b..469b49459e2c 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -339,6 +339,9 @@ VNET_DECLARE(int, nd6_ignore_ipv6_only_ra); #define V_nd6_ignore_ipv6_only_ra VNET(nd6_ignore_ipv6_only_ra) #endif +VNET_DECLARE(bool, ip6_log_cannot_forward); +#define V_ip6_log_cannot_forward VNET(ip6_log_cannot_forward) + extern struct pr_usrreqs rip6_usrreqs; struct sockopt; From nobody Mon Mar 13 16:49:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb2gT0pW8z3xwQp; Mon, 13 Mar 2023 16:49: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 4Pb2gS4mw7z4Jc7; Mon, 13 Mar 2023 16:49:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678726164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ZaomUTVa8TDOm+W7rnzAMr24bvx9mPjB/f0lIQvsu4=; b=s3iHCUi48kM6KQJ0e8Fy+6eJ8f91H+UqP0cKjTgIfC3o043CYcq0xXcz6pYPSuK5McgIWT v+oEYegjox87Uj5DTu2O8V8ZRSSNaS9Fx+vmyaBwipj861GqR+uu5m8q1pq01HvM7WQKEB 6ZVQOSFvnthTP3CMoFjoBlf7Tr5xm/HM3Bmr6C8WBbwCjkDHFMClAw+yxWQD7T/v958lwm G0eKq0jRkyTY2ddo7kVWZHXqQBy3YcxdSZl8+kGbsUa3K8zb9w7IeyJNUOpgqIBgFkeqB+ BkbvPpBLgxttPNGQ2YHQjnzQBZWu0SotY3NcHvvtFNzVOq3l0rcOWZXg5n1B/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678726164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ZaomUTVa8TDOm+W7rnzAMr24bvx9mPjB/f0lIQvsu4=; b=LyLc7FQiA2INFqaoHOnA3qigV1BL4vvGR1ALofLQC7mWDHG1pZit0MYKVQ7VZeHGd5sQcP q7kmKKOwf0ZNCWtVViJ3Yv+IAwZnuysCsv5/EnoltZOhpyhobWYLqSg7aCQ2gCyFPYaOfX 2fslbgc19314lhH/MMYh4ft1vka2RdfYarXoaDtDiEYilWYsPh2023iCdj/aj0xhGcExF0 X2gkVPkpBs42RTlHZCaLHRa2PJwkd93zLRU8lra3UOkXBlalfiRc2ZEWMDhwiKdV1Rt7lx RjKQeCGK+zmdqR3I+JTHLdZbKeUjiem5h/mWSoroAyPFtSJ4Q0dBO7D7Wc04pQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678726164; a=rsa-sha256; cv=none; b=sc4hKF8xa+xGdDSAAOXJMYZDMvvZWHYy/aJxETLXUw546t08bHZ12M8N5irYq9Fz/TX05j hGZpXmjK9wgV1Gp3rTsgmmnGrsIoRVPlAwnhFl3pu+l09sY45DK8mOeu+iP7ZGFH77nw70 13wEUKpVmKfD2AiiYoEKzifhKrJcgOYH28JxteDnsh1PndXOSxGQKg9q6IHi9FBsGwhngP 0Kzpo0ohiG85c/zbs5w7i20fyH+5Gli7MmV24NnMv8tvpuGED8L2vK5SEC9pmdZkAoL118 eQzEGP+x1JqJtM1lKZJ87aPTwWGzTfuS2ELrrtDU4DmVOifdEeI2hISpQ4LJUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb2gS3st9z11Kf; Mon, 13 Mar 2023 16:49:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DGnOLR023775; Mon, 13 Mar 2023 16:49:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DGnOrT023774; Mon, 13 Mar 2023 16:49:24 GMT (envelope-from git) Date: Mon, 13 Mar 2023 16:49:24 GMT Message-Id: <202303131649.32DGnOrT023774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pawel Biernacki Subject: git: 35b6e52c30a2 - main - net.inet6.ip6.log_interval: use ppsratecheck(9) internally List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kaktus X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35b6e52c30a290e081710b87ff0be21f4941d3f4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kaktus: URL: https://cgit.FreeBSD.org/src/commit/?id=35b6e52c30a290e081710b87ff0be21f4941d3f4 commit 35b6e52c30a290e081710b87ff0be21f4941d3f4 Author: Pawel Biernacki AuthorDate: 2023-03-13 16:39:20 +0000 Commit: Pawel Biernacki CommitDate: 2023-03-13 16:47:06 +0000 net.inet6.ip6.log_interval: use ppsratecheck(9) internally Reported by: mjg Differential Revision: https://reviews.freebsd.org/D38758 --- sys/netinet6/in6_proto.c | 18 ++++++++++++++++-- sys/netinet6/ip6_forward.c | 8 ++------ sys/netinet6/ip6_mroute.c | 4 +--- sys/netinet6/ip6_var.h | 6 ++---- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 1f2a41dd51de..971b61c74899 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -161,7 +161,6 @@ VNET_DEFINE(int, ip6_accept_rtadv) = 0; VNET_DEFINE(int, ip6_no_radr) = 0; VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_rfc6204w3) = 0; -VNET_DEFINE(int, ip6_log_interval) = 5; VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we * process? */ VNET_DEFINE(int, ip6_dad_count) = 1; /* DupAddrDetectionTransmits */ @@ -173,7 +172,6 @@ VNET_DEFINE(int, ip6_rr_prune) = 5; /* router renumbering prefix VNET_DEFINE(int, ip6_mcast_pmtu) = 0; /* enable pMTU discovery for multicast? */ VNET_DEFINE(int, ip6_v6only) = 1; -VNET_DEFINE(time_t, ip6_log_time) = (time_t)0L; #ifdef IPSTEALTH VNET_DEFINE(int, ip6stealth) = 0; #endif @@ -199,6 +197,14 @@ VNET_DEFINE(int, icmp6_nodeinfo) = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK); VNET_DEFINE(int, icmp6_nodeinfo_oldmcprefix) = 1; +VNET_DEFINE_STATIC(int, ip6_log_interval) = 5; +VNET_DEFINE_STATIC(int, ip6_log_count) = 0; +VNET_DEFINE_STATIC(struct timeval, ip6_log_last) = { 0 }; + +#define V_ip6_log_interval VNET(ip6_log_interval) +#define V_ip6_log_count VNET(ip6_log_count) +#define V_ip6_log_last VNET(ip6_log_last) + /* * sysctl related items. */ @@ -254,6 +260,14 @@ sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS) return (0); } +int +ip6_log_ratelimit(void) +{ + + return (ppsratecheck(&V_ip6_log_last, &V_ip6_log_count, + V_ip6_log_interval)); +} + SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_forwarding), 0, "Enable forwarding of IPv6 packets between interfaces"); diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index fc00eab4b784..293fcd977344 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -114,9 +114,7 @@ ip6_forward(struct mbuf *m, int srcrt) IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { IP6STAT_INC(ip6s_cantforward); /* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */ - if (V_ip6_log_cannot_forward && - (V_ip6_log_time + V_ip6_log_interval < time_uptime)) { - V_ip6_log_time = time_uptime; + if (V_ip6_log_cannot_forward && ip6_log_ratelimit()) { log(LOG_DEBUG, "cannot forward " "from %s to %s nxt %d received on %s\n", @@ -222,9 +220,7 @@ again: IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(nh->nh_ifp, ifs6_in_discard); - if (V_ip6_log_cannot_forward && - (V_ip6_log_time + V_ip6_log_interval < time_uptime)) { - V_ip6_log_time = time_uptime; + if (V_ip6_log_cannot_forward && ip6_log_ratelimit()) { log(LOG_DEBUG, "cannot forward " "src %s, dst %s, nxt %d, rcvif %s, outif %s\n", diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index cdccd04abc63..9b2325c8e7a2 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1099,9 +1099,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) */ if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { IP6STAT_INC(ip6s_cantforward); - if (V_ip6_log_cannot_forward && - (V_ip6_log_time + V_ip6_log_interval < time_uptime)) { - V_ip6_log_time = time_uptime; + if (V_ip6_log_cannot_forward && ip6_log_ratelimit()) { log(LOG_DEBUG, "cannot forward " "from %s to %s nxt %d received on %s\n", diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 469b49459e2c..bfc9f72be8ea 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -293,8 +293,6 @@ VNET_DECLARE(int, ip6_norbit_raif); /* Disable R-bit in NA on RA * receiving IF. */ VNET_DECLARE(int, ip6_rfc6204w3); /* Accept defroute from RA even when forwarding enabled */ -VNET_DECLARE(int, ip6_log_interval); -VNET_DECLARE(time_t, ip6_log_time); VNET_DECLARE(int, ip6_hdrnestlimit); /* upper limit of # of extension * headers */ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionTransmits */ @@ -304,8 +302,6 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionTransmits */ #define V_ip6_no_radr VNET(ip6_no_radr) #define V_ip6_norbit_raif VNET(ip6_norbit_raif) #define V_ip6_rfc6204w3 VNET(ip6_rfc6204w3) -#define V_ip6_log_interval VNET(ip6_log_interval) -#define V_ip6_log_time VNET(ip6_log_time) #define V_ip6_hdrnestlimit VNET(ip6_hdrnestlimit) #define V_ip6_dad_count VNET(ip6_dad_count) @@ -415,6 +411,8 @@ u_int32_t ip6_randomid(void); u_int32_t ip6_randomflowlabel(void); void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset); +int ip6_log_ratelimit(void); + /* * Argument type for the last arg of ip6proto_ctlinput_t(). * From nobody Mon Mar 13 18:55:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb5Sk4bMvz3y4QX; Mon, 13 Mar 2023 18:55:18 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4Pb5Sk2f0Tz4YJJ; Mon, 13 Mar 2023 18:55:18 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by glebi.us (Postfix, from userid 1000) id A009054196; Mon, 13 Mar 2023 11:55:11 -0700 (PDT) Date: Mon, 13 Mar 2023 11:55:11 -0700 From: Gleb Smirnoff To: Pawel Biernacki Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 35b6e52c30a2 - main - net.inet6.ip6.log_interval: use ppsratecheck(9) internally Message-ID: References: <202303131649.32DGnOrT023774@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202303131649.32DGnOrT023774@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4Pb5Sk2f0Tz4YJJ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Mon, Mar 13, 2023 at 04:49:24PM +0000, Pawel Biernacki wrote: P> The branch main has been updated by kaktus: P> P> URL: https://cgit.FreeBSD.org/src/commit/?id=35b6e52c30a290e081710b87ff0be21f4941d3f4 P> P> commit 35b6e52c30a290e081710b87ff0be21f4941d3f4 P> Author: Pawel Biernacki P> AuthorDate: 2023-03-13 16:39:20 +0000 P> Commit: Pawel Biernacki P> CommitDate: 2023-03-13 16:47:06 +0000 P> P> net.inet6.ip6.log_interval: use ppsratecheck(9) internally P> P> Reported by: mjg P> Differential Revision: https://reviews.freebsd.org/D38758 I'd suggest to use counter_ratecheck() as we do with IPv4 ICMP. I can provide you a patch if you are willing to test it. -- Gleb Smirnoff From nobody Mon Mar 13 20:39:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb7nN4txxz3y9jl; Mon, 13 Mar 2023 20:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pb7nN48K1z3CR8; Mon, 13 Mar 2023 20:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678739992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IfsRD/4ZvNXas7h5ShHiP2YYfSTwOg57ExBbQU6c96U=; b=QYDHQEo2DSY8BBNWt3FkEzFzcikA0U52gLpGNHhooUXLbizMrpBE6+of99DRkEeN0tgvA6 hJJ6hEf2dQpxkCUDIVDhlg1JQxVL1RfD9hbS5k0OKC0ZByO1bigz8ktzm05Ou9cufh8L7U j/aNuOESlRVzTs93t0cAfl6jQ0nsb59GDe6hIaf4So61INh9R6HmeF3eAnvOwr/jzOcZXM dzgpLXtSkJbk7GEjejfDsLk9hluQs5PNeZIiiN4ix+jqezVxwrAbA9ZnQe9oxfDjRW6Lp+ b7V3k4Q3oW7n/mc6GyXkM9AKTBYWiwPZ7lttpEM1HlCaIoTGEqwWUpNVetKV/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678739992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IfsRD/4ZvNXas7h5ShHiP2YYfSTwOg57ExBbQU6c96U=; b=q/MOhP1nXNesPyGBGIDgz59jcSZNq/1T+LnRD+z0+/FotmWVzCMz6MGgiZ1lykRMQcs8Ke VSp8NKf5olzXVkPCbsKq9TjKZhrt8lXyoncF4rQOiw+T8jIQe6nYUG7QqTNEtEVmI+k++w GBkaVhmhDLVU3zY17tKpnfL9rqacEb64syupYM0nhtDXnamWbzbjbHKYVlx9J2tlzQDkCt 4OflKg/LB2EFh5r2us16s4NYX5o8FzpTJjrM8GPOVPDU6it1fAwnLsO2DqOFXS9Oc2ZxhP ba1PKMKjCOuWOQJv5B5TKfYK42AD/QC00ztY3UcGDdgN/0ISABqyB2CIl+UWmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678739992; a=rsa-sha256; cv=none; b=EpPTkAinOXdjgpG39ctgHWMI6z+qcalUn1en32OsMn0FHkEEAIyZ196RhGHmtHS5SQ5+AT lk9IDvbx3x8wYXP1Ct80JAw55TM3RM9rFmfSRq9UypxfoKS/u3dCCrJQeyI9B4puG9JqC5 +u0DXhuQ8GwmysFWDzFgIROCfKPwJx7GFOrM9E8kVmSp6QyRfch6hDOEMuDlFLYAHZ1S2K ubpEnBSk29LZF9WacV5d8uAQqDebwJSwPWjBN0RYd1hVOltXKp4uQBfyjT0e8J6nViuXSx TZ7J8faBlfUV5sKlkHa5wqeC4J9EBBOo+JSuu3amjpcv1z0zkm+GbpT3xIZ7Jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb7nN32jCz173s; Mon, 13 Mar 2023 20:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DKdqSZ001898; Mon, 13 Mar 2023 20:39:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DKdqru001897; Mon, 13 Mar 2023 20:39:52 GMT (envelope-from git) Date: Mon, 13 Mar 2023 20:39:52 GMT Message-Id: <202303132039.32DKdqru001897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 370e009188ba - main - makefs: make msdos creation go fast List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 370e009188ba90c3290b1479aa06ec98b66e140a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=370e009188ba90c3290b1479aa06ec98b66e140a commit 370e009188ba90c3290b1479aa06ec98b66e140a Author: Warner Losh AuthorDate: 2023-03-13 20:28:51 +0000 Commit: Warner Losh CommitDate: 2023-03-13 20:38:36 +0000 makefs: make msdos creation go fast Add missing brelse(bp). Without it the cache grows and we have a n^2 lookup. I'm not entirely sure why we read the block before we write it back out, since the only side effect of that is to allocate memory, clear the memory, read it in from disk, throw it away with the contents of the file being written out. We likely should just do a getblk() here instead, but even with all that, this takes the time it takes to create a 150MB msdos fs image down from 5 minutes to 30 seconds. Old: 317.663u 0.685s 5:18.34 100.0% 198+360k 0+19io 1009pf+0w New: 7.330u 23.841s 0:31.17 100.0% 198+360k 0+250522io 4pf+0w See code review for how we got this. tl;dr: netbsd move brelse into bwrite and we picked up msdos code after that, but not the move. That change should be picked up later. Sponsored by: Netflix Reviewed by: emaste MFC After: 1 day (13.2 is coming fast) Differential Revision: https://reviews.freebsd.org/D39025 --- usr.sbin/makefs/msdos/msdosfs_vnops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/makefs/msdos/msdosfs_vnops.c b/usr.sbin/makefs/msdos/msdosfs_vnops.c index 5bc9b495c586..c04ed6f742a1 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vnops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c @@ -500,6 +500,7 @@ msdosfs_wfile(const char *path, struct denode *dep, fsnode *node) cpsize = MIN((nsize - offs), blsize - on); memcpy(bp->b_data + on, dat + offs, cpsize); bwrite(bp); + brelse(bp); offs += cpsize; } From nobody Tue Mar 14 00:31:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbDwg5PZKz3yPbx; Tue, 14 Mar 2023 00:31: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 4PbDwg4rSgz3mFT; Tue, 14 Mar 2023 00:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678753891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TlLKwoiDtDXRZayD8pfVmMmI3vjJentkOH8rvA3yZbQ=; b=eQEJU4VwjoODcXA5viJ+8TueJxRKoF46OCehqFXAnVZLSW5hinpuzPE6opolmzThDIOhXJ C5Mn6iwbh7TpAoOPirE0SoAn2ZqRkh68OfvJeK0pihemzWbvu7OojZtmPJf/Yu3bWtnk1D /XLdCeiw03XdBkUTdee46yWpq2Kyd/7uLLCGLHwq6yydRyQmN9xZmXM+7a6Corx25yzZcN kkvwivQlLNd1pEBD165f8GaS8itzcRVYofR9QGtdz4nSq2zgrWD6qnLeLaa0V3p/kJdKgm AyBpCYUvo+W8BngoOd0FNMLiVaFnjP/pkH1TjfWBSyyEaEF2vEffXyQds65jwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678753891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TlLKwoiDtDXRZayD8pfVmMmI3vjJentkOH8rvA3yZbQ=; b=bGgF93iuwiHzgK+jbiY/0DcqaQUABgtpNrCqWmXZ4tkRDKClBGpe4wumaHdT14hk8wqF8n IRUXYMUmKJ7snWGHKQX559cGMj5yGo77DULmhQnsue9FBnH9GGC9fo6mkeOTN4JPLZNghD ZWG7WZEPwIpFrHuOUQHCsd+4/p7UmCXm5dGevGd6eVDvJxOi6EKIZIzJG4kr9139pfbBDz zY3vYkGrFaPReUJeyfKjW4XT1TMZ2nIRTPVmKpkwDiHGdcaRGe9xsf08jrn1he/GC4sULz OSMRUoZD+vQVcv4l2DZh+JYl2TRO2aSgkKq1h4tIy0WWYILQA2/IFdvps523Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678753891; a=rsa-sha256; cv=none; b=L6D62BTgsiqRkrffqQ4r48XKCmUv9UrZ2yV5orCskcgSrkRCRlzjFWJo+vdTR/0iq+XLTI gOtXXvhmfYFKF7Bbgrob8cC9OynV1GkO9x7Z/T9qpLnJolL0fddTq/5qN3iF5Cs+XzAwxY VCE2lLnv7KfGS/RW8Hz7mnFobvW7srZ31movGXV3/TBIzFIcqx8QKs9rUoOpG1IuzO4U38 g+BP4XLaGGoVfwO/x1sT6YODKsj8kC0eKBTrOdgzX261/VGEV8EPSJe/nJyIHZ52QOlabT 0QvUZc72/0LnKSyoNzxHCojAEZK049zBDOI1UxemJosykOPF7duErVOiyGLvuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbDwg3vt8zFNs; Tue, 14 Mar 2023 00:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32E0VVU2092130; Tue, 14 Mar 2023 00:31:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E0VVKx092129; Tue, 14 Mar 2023 00:31:31 GMT (envelope-from git) Date: Tue, 14 Mar 2023 00:31:31 GMT Message-Id: <202303140031.32E0VVKx092129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 91b2da13702f - main - arm: generic_timer: use interrupt-names when available List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91b2da13702fb3cfb40a3219feed6e5af651039d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=91b2da13702fb3cfb40a3219feed6e5af651039d commit 91b2da13702fb3cfb40a3219feed6e5af651039d Author: Kyle Evans AuthorDate: 2023-03-05 00:49:04 +0000 Commit: Kyle Evans CommitDate: 2023-03-14 00:30:28 +0000 arm: generic_timer: use interrupt-names when available Offsets for all of thse can be a bit complicated as not all interrupts will be present, only phys and virt are actually required, and sec-phys could optionally be specified before phys. Push idx/name pairs into a new config struct and maintain the old indices while still getting the correct timers. Split fdt/acpi attach out independently and allocate interrupts before we head into the common attach(). The secure physical timer is also optional there, so mark it so to avoid erroring out if we run into problems. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D38911 --- sys/arm/arm/generic_timer.c | 185 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 174 insertions(+), 11 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index b19248327683..5d694e8e9660 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -79,8 +79,9 @@ __FBSDID("$FreeBSD$"); #define GT_PHYS_SECURE 0 #define GT_PHYS_NONSECURE 1 #define GT_VIRT 2 -#define GT_HYP 3 -#define GT_IRQ_COUNT 4 +#define GT_HYP_PHYS 3 +#define GT_HYP_VIRT 4 +#define GT_IRQ_COUNT 5 #define GT_CTRL_ENABLE (1 << 0) #define GT_CTRL_INT_MASK (1 << 1) @@ -107,13 +108,49 @@ struct arm_tmr_softc { static struct arm_tmr_softc *arm_tmr_sc = NULL; -static struct resource_spec timer_spec[] = { - { SYS_RES_IRQ, GT_PHYS_SECURE, RF_ACTIVE }, +#ifdef DEV_ACPI +static struct resource_spec timer_acpi_spec[] = { + { SYS_RES_IRQ, GT_PHYS_SECURE, RF_ACTIVE | RF_OPTIONAL }, { SYS_RES_IRQ, GT_PHYS_NONSECURE, RF_ACTIVE }, - { SYS_RES_IRQ, GT_VIRT, RF_ACTIVE | RF_OPTIONAL }, - { SYS_RES_IRQ, GT_HYP, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, GT_VIRT, RF_ACTIVE }, + { SYS_RES_IRQ, GT_HYP_PHYS, RF_ACTIVE | RF_OPTIONAL }, { -1, 0 } }; +#endif + +static const struct arm_tmr_irq_defs { + int idx; + const char *name; + int flags; +} arm_tmr_irq_defs[] = { + { + .idx = GT_PHYS_SECURE, + .name = "sec-phys", + .flags = RF_ACTIVE | RF_OPTIONAL, + }, + { + .idx = GT_PHYS_NONSECURE, + .name = "phys", + .flags = RF_ACTIVE, + }, + { + .idx = GT_VIRT, + .name = "virt", + .flags = RF_ACTIVE, + }, + { + .idx = GT_HYP_PHYS, + .name = "hyp-phys", + .flags = RF_ACTIVE | RF_OPTIONAL, + }, + { + .idx = GT_HYP_VIRT, + .name = "hyp-virt", + .flags = RF_ACTIVE | RF_OPTIONAL, + }, +}; + +static int arm_tmr_attach(device_t); static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc); @@ -384,6 +421,108 @@ arm_tmr_fdt_probe(device_t dev) return (ENXIO); } + +static int +arm_tmr_fdt_attach(device_t dev) +{ + struct arm_tmr_softc *sc; + const struct arm_tmr_irq_defs *irq_def; + size_t i; + phandle_t node; + int error, rid; + bool has_names; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + has_names = OF_hasprop(node, "interrupt-names"); + for (i = 0; i < nitems(arm_tmr_irq_defs); i++) { + int flags; + + /* + * If we don't have names to go off of, we assume that they're + * in the "usual" order with sec-phys first and allocate by idx. + */ + irq_def = &arm_tmr_irq_defs[i]; + rid = irq_def->idx; + flags = irq_def->flags; + if (has_names) { + error = ofw_bus_find_string_index(node, + "interrupt-names", irq_def->name, &rid); + + /* + * If we have names, missing a name means we don't + * have it. + */ + if (error != 0) { + /* + * Could be noisy on a lot of platforms for no + * good cause. + */ + if (bootverbose || (flags & RF_OPTIONAL) == 0) { + device_printf(dev, + "could not find irq for %s interrupt '%s'\n", + (flags & RF_OPTIONAL) != 0 ? + "optional" : "required", + irq_def->name); + } + + if ((flags & RF_OPTIONAL) == 0) + goto out; + + continue; + } + + /* + * Warn about failing to activate if we did actually + * have the name present. + */ + flags &= ~RF_OPTIONAL; + } + + sc->res[irq_def->idx] = bus_alloc_resource_any(dev, + SYS_RES_IRQ, &rid, flags); + + if (sc->res[irq_def->idx] == NULL) { + device_printf(dev, + "could not allocate irq for %s interrupt '%s'\n", + (flags & RF_OPTIONAL) != 0 ? "optional" : + "required", irq_def->name); + + if ((flags & RF_OPTIONAL) == 0) { + error = ENXIO; + goto out; + } + + continue; + } + + if (bootverbose) { + device_printf(dev, + "allocated irq for '%s'\n", irq_def->name); + } + } + + error = arm_tmr_attach(dev); +out: + if (error != 0) { + for (i = 0; i < GT_IRQ_COUNT; i++) { + if (sc->res[i] != NULL) { + /* + * rid may not match the index into sc->res in + * a number of cases; e.g., optional sec-phys or + * interrupt-names specifying them in a + * different order than expected. + */ + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->res[i]), sc->res[i]); + } + } + } + + return (error); + +} #endif #ifdef DEV_ACPI @@ -436,12 +575,31 @@ arm_tmr_acpi_probe(device_t dev) device_set_desc(dev, "ARM Generic Timer"); return (BUS_PROBE_NOWILDCARD); } + +static int +arm_tmr_acpi_attach(device_t dev) +{ + struct arm_tmr_softc *sc; + int error; + + sc = device_get_softc(dev); + if (bus_alloc_resources(dev, timer_acpi_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + error = arm_tmr_attach(dev); + if (error != 0) + bus_release_resources(dev, timer_acpi_spec, sc->res); + return (error); +} #endif static int arm_tmr_attach(device_t dev) { struct arm_tmr_softc *sc; + const struct arm_tmr_irq_defs *irq_def; #ifdef FDT phandle_t node; pcell_t clock; @@ -482,9 +640,12 @@ arm_tmr_attach(device_t dev) return (ENXIO); } - if (bus_alloc_resources(dev, timer_spec, sc->res)) { - device_printf(dev, "could not allocate resources\n"); - return (ENXIO); + /* Confirm that non-optional irqs were allocated before coming in. */ + for (i = 0; i < nitems(arm_tmr_irq_defs); i++) { + irq_def = &arm_tmr_irq_defs[i]; + + MPASS(sc->res[irq_def->idx] != NULL || + (irq_def->flags & RF_OPTIONAL) != 0); } #ifdef __aarch64__ @@ -513,6 +674,8 @@ arm_tmr_attach(device_t dev) arm_tmr_intr, NULL, sc, &sc->ihl[i]); if (error) { device_printf(dev, "Unable to alloc int resource.\n"); + for (int j = first_timer; j < i; j++) + bus_teardown_intr(dev, sc->res[j], &sc->ihl[j]); return (ENXIO); } } @@ -550,7 +713,7 @@ arm_tmr_attach(device_t dev) #ifdef FDT static device_method_t arm_tmr_fdt_methods[] = { DEVMETHOD(device_probe, arm_tmr_fdt_probe), - DEVMETHOD(device_attach, arm_tmr_attach), + DEVMETHOD(device_attach, arm_tmr_fdt_attach), { 0, 0 } }; @@ -567,7 +730,7 @@ EARLY_DRIVER_MODULE(timer, ofwbus, arm_tmr_fdt_driver, 0, 0, static device_method_t arm_tmr_acpi_methods[] = { DEVMETHOD(device_identify, arm_tmr_acpi_identify), DEVMETHOD(device_probe, arm_tmr_acpi_probe), - DEVMETHOD(device_attach, arm_tmr_attach), + DEVMETHOD(device_attach, arm_tmr_acpi_attach), { 0, 0 } }; From nobody Tue Mar 14 02:41:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbHpY6X29z3xY56; Tue, 14 Mar 2023 02:41: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 4PbHpY5yH1z3xMp; Tue, 14 Mar 2023 02:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678761685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q7qzaauhGJxhkqPyc/x+1siV7+cqhngJ6fSIIWHrSTU=; b=R8kHENW9SyBugX0avUtuzuqVFkqeMJ/BLB1Tk0bLUR5zw/jKyyBtUvrqyTjiSGMGnyrnQ0 a4Oyt9w2cwynG5kOTI0RofoSHdx69hET2snT7cK06IrhiVCa71ChB6XaUwbiuBke0epZsX LugBff4FAIOcIhlmNUL0MWD7ibEEPrAktzwu6rbPohoXFeQBV/rxB8QQ+lXj8P/JVVfIqY t6GgMbZSnXWYlfEZVyuJ6FTQXf9M3y7qvYJTBxRtX/+hU6FpOwZLlCUFecIzf9Q0LPabMN gLVim1CzwdiI+mzLUgmqiXmVKaggmwEnqWwopGEB/EIET1Od6bWYXb2uf5m04Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678761685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q7qzaauhGJxhkqPyc/x+1siV7+cqhngJ6fSIIWHrSTU=; b=dcWekhb7gpl85IUEZzToOiDNmEOy3zaeRQcIdb+HEql9e767dS4nmhbfrU/WYkGJl7s2mJ rz8w+zB3qDlFjXsL+Iy75qpUqpsGJPTTsHSfb1a9hZR97SeU+UB4oOlGDMtHJwOPtz2JVJ Vjvwmpb5g/s4CpnG7rMNgYasdYs8ljZO+JZLL8+MItp4Y/ZKieKutCg/fX0uQ4PQgD5Hji ZXOtHbsKBb22uADJezZ97dAnXJdWa2kt3UVo+Votih4CKA5zEwcexGbvP/F2GllLhpgmL1 fE7sZxEvYIqbsZG5/Vgjr0zSAfCSP59HaHAJt4egVui1Y08Kxj8pwHdY+PKYWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678761685; a=rsa-sha256; cv=none; b=DAUB8HMwvNugVkdW9RjMcFHsFUyu1S93ClB/ngn4/TvkvAqtsCLEQBb7IoTvzuWZOhbxnh KqwClxr6qCMBe7POIgZee/MD7HY4DatDewNUoDvi+WZRr76dPZhqjlcG6z9SH56UupW8ds 520x53iLumDQY/r37BNb9BPJ3yp78tJwBt3FZsVhaiKUWiXL7MoOxxKyHvT65Kpro3KsUO 3cfexJeHf2/adLN3pMkzpQIcy2V69umpamHKNErfFqr3JI5lmdpZNZwcbsZZVTdVCtqELM D9X8eWgS3O6aG8RaSozlUwppIiW7hFMenOV0/3xjcemJaQe+Q17UR7kX3siWhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbHpY518pzJG6; Tue, 14 Mar 2023 02:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32E2fPOE004458; Tue, 14 Mar 2023 02:41:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E2fPf2004457; Tue, 14 Mar 2023 02:41:25 GMT (envelope-from git) Date: Tue, 14 Mar 2023 02:41:25 GMT Message-Id: <202303140241.32E2fPf2004457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: bc33c99234a6 - main - makefs: do not call brelse if bread returns an error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc33c99234a676c41cde63cce389dd6b8b70adfc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bc33c99234a676c41cde63cce389dd6b8b70adfc commit bc33c99234a676c41cde63cce389dd6b8b70adfc Author: Ed Maste AuthorDate: 2023-03-13 20:51:51 +0000 Commit: Ed Maste CommitDate: 2023-03-14 02:39:09 +0000 makefs: do not call brelse if bread returns an error If bread returns an error there is no bp to brelse. One of these changes was taken from NetBSD commit 0a62dad69f62 ("This works well enough to populate..."), the rest were found by looking for the same pattern. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39069 --- usr.sbin/makefs/ffs/ffs_alloc.c | 2 -- usr.sbin/makefs/msdos/msdosfs_lookup.c | 4 ---- 2 files changed, 6 deletions(-) diff --git a/usr.sbin/makefs/ffs/ffs_alloc.c b/usr.sbin/makefs/ffs/ffs_alloc.c index ff0e72c56af0..4dee635fba96 100644 --- a/usr.sbin/makefs/ffs/ffs_alloc.c +++ b/usr.sbin/makefs/ffs/ffs_alloc.c @@ -305,7 +305,6 @@ ffs_alloccg(struct inode *ip, int cg, daddr_t bpref, int size) error = bread((void *)ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NULL, &bp); if (error) { - brelse(bp); return (0); } cgp = (struct cg *)bp->b_data; @@ -449,7 +448,6 @@ ffs_blkfree(struct inode *ip, daddr_t bno, long size) error = bread((void *)ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NULL, &bp); if (error) { - brelse(bp); return; } cgp = (struct cg *)bp->b_data; diff --git a/usr.sbin/makefs/msdos/msdosfs_lookup.c b/usr.sbin/makefs/msdos/msdosfs_lookup.c index fb2f4deceaf2..68fee52cdd88 100644 --- a/usr.sbin/makefs/msdos/msdosfs_lookup.c +++ b/usr.sbin/makefs/msdos/msdosfs_lookup.c @@ -125,7 +125,6 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, diroffset &= pmp->pm_crbomask; if ((error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, &bp)) != 0) { - brelse(bp); return error; } ndep = bptoep(pmp, bp, ddep->de_fndoffset); @@ -157,7 +156,6 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } ndep = bptoep(pmp, bp, ddep->de_fndoffset); @@ -213,7 +211,6 @@ m_readep(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, bn = detobn(pmp, dirclust, diroffset); if ((error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, bpp)) != 0) { - brelse(*bpp); *bpp = NULL; return (error); } @@ -274,7 +271,6 @@ uniqdosname(struct denode *dep, struct componentname *cnp, u_char *cp) error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, &bp); if (error) { - brelse(bp); return error; } for (dentp = (struct direntry *)bp->b_data; From nobody Tue Mar 14 02:46:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbHwr0lHQz3xYLp; Tue, 14 Mar 2023 02:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbHwq700sz3y7m; Tue, 14 Mar 2023 02:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678762012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fvIKPYcXpA2Lg4jaOKo48VTxlNqKYh9mPiTkcs8PGWI=; b=ozvkHIl3q5pYnHQuxEtm51Qs5UaKTOQyOYrelpRhZXngRhhaK2Ej3eYAdVVjLcydUP3ga3 QXKPkYuwM2rSfKOXv7H8SlysPG6vvWrQ7Gny7c1D60fHYgoorWFvKYJWWjsysxcXiQKHz2 RTx9KUxgCrQ88RPRfFAPewAXzNjWhTd2bSP6eGLrV3A+5kik4WU4cKb3PsyKcG7AXWcLj7 H/3fmSJ6kj+NamG2CZK3TDAHni+0kFXPHh74kXqU8w3aDhv6Efy7YR6IuBzjmoavnbJr4A k4sEesnKV+wf8ieUa5nkREch16tcmohJuvwlcxEYIOXl095dCEirPyaXmbvd/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678762012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fvIKPYcXpA2Lg4jaOKo48VTxlNqKYh9mPiTkcs8PGWI=; b=jEn75YO2NtoDR5mJrdPc2ElNMbAC3E5d+exRLySVGMFnVFWdnGue9icnId7qaRC9myg1Hv sCpMQUcnlnaFW6sUWRACcHgSzoLDPqt634PdKz3q0xNpRfDN+gyiAGnwFfXQLhuX7rAJDO x+pBfm8ReHBkpKWkb3Sd1bHTHA9emTeawu7C6LNraQiKUn84htzRD/XBtrhn85r3BaeI94 uj2k5Msh0vvaMmihKoPQOjVD19NoL/3KTznUqsKq1OIADeL67ryRb/IkwUEZRmvi2txtUe gln3Ufl4w0zYJfXtmd0/vhzXAfJD57SQCjhMOCSfhiceqf0kjTE8DEtPp1VGUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678762012; a=rsa-sha256; cv=none; b=hxH06J2QPq99IuUja4x5GXpktk5EzSOEomxM2ReRYzZuntkBfdWNW4l7z+gRZ+joVSgb4h 7o309C2JzZ9TtsMtBP6hML7DKL2usgEYZOzbDXoE7fBgslo6vqwK7oCSIqRXw//ijB07nS RKRji2YTjh7pX+O7gSaW3d1dLejoyO28v1tj6e6nDGcmR8B416Yr39CtybZsVUPk4dASMV fnAJZFbM+f9Q26yfTdk+zRei9MfLbudbtGIU7YQBBu9B5HP7VA2fBS54kTf3KEJsmnrhGH sdYCft/sBbdisPG+bsHUS1WSBdyzaLbXYll75F5RQmACnq0TjekzZW/dt8TzpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbHwq5xSdzJZH; Tue, 14 Mar 2023 02:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32E2kpBF008994; Tue, 14 Mar 2023 02:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E2kpJ4008993; Tue, 14 Mar 2023 02:46:51 GMT (envelope-from git) Date: Tue, 14 Mar 2023 02:46:51 GMT Message-Id: <202303140246.32E2kpJ4008993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7f3c3606465f - main - Parse /kboot.conf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f3c3606465f36040bacd85e1f9443ae6b5ca39a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7f3c3606465f36040bacd85e1f9443ae6b5ca39a commit 7f3c3606465f36040bacd85e1f9443ae6b5ca39a Author: Warner Losh AuthorDate: 2023-03-14 02:33:35 +0000 Commit: Warner Losh CommitDate: 2023-03-14 02:45:50 +0000 Parse /kboot.conf If there's a kboot.conf, prase it after the command line args are parsed. It's not always easy to get all the right command line args depending on the environment. Allow an escape hatch. While we can't do everything one might like in this file, we can do enough. Sponsored by: Netflix --- stand/kboot/main.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/stand/kboot/main.c b/stand/kboot/main.c index 849ad46add6c..3895f7e76773 100644 --- a/stand/kboot/main.c +++ b/stand/kboot/main.c @@ -195,6 +195,31 @@ has_acpi(void) return rsdp != 0; } +static void +parse_file(const char *fn) +{ + struct stat st; + int fd = -1; + char *env = NULL; + + if (stat(fn, &st) != 0) + return; + fd = open(fn, O_RDONLY); + if (fd == -1) + return; + env = malloc(st.st_size + 1); + if (env == NULL) + goto out; + if (read(fd, env, st.st_size) != st.st_size) + goto out; + env[st.st_size] = '\0'; + boot_parse_cmdline(env); +out: + free(env); + close(fd); +} + + int main(int argc, const char **argv) { @@ -221,6 +246,8 @@ main(int argc, const char **argv) /* Parse the command line args -- ignoring for now the console selection */ parse_args(argc, argv); + parse_file("host:/kboot.conf"); + /* * Set up console. */ From nobody Tue Mar 14 03:57:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbKV92KXSz3xd9f for ; Tue, 14 Mar 2023 03:57:21 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbKV82H1Jz43mK for ; Tue, 14 Mar 2023 03:57:20 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wr1-f46.google.com with SMTP id r18so13116631wrx.1 for ; Mon, 13 Mar 2023 20:57:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678766238; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mp3FM/PV1EUNS+nrH64RDtpGRW/JfQ+NSInm04/k8xI=; b=lfbW+IOMukRBBAH2cIraJrPU7RoYYuUPLcHfdX4/Pat+J72pF3XEx+fadK/mZqdGwb J/XZBwumPWe23LyyHQPMkLof9+bNAp3uxz9TboHrb+wWjOD0ZfSkykOFCgOEw5M1ED2V eXP16ZE8tgIUUQxbyFTetsIqHbACsACw0sbU6v0xCHsQKfE0G6yJkXL6f8SwwqFnET09 QbCNYF34KonjaCHING7IcDukfB9DxxnG3AoDcPJdQjIaXXZQ89ZN66/LHpAgcJuhOzDr LAYGpTp1P709c/bQsaIPIXW2OfTFEaptpsuhSKJD9jxzqlqTP9u5vQFzVKJpNIUvRE04 XRoA== X-Gm-Message-State: AO0yUKUEWyufMn3lH7hlHuHSUrhsLeoUIvnvj/RsWGiKi23jiQFJCTAs 59GbYKLxDjzRVfjvltZK5Dy/f8k5LDqR6ExxLQCxwA== X-Google-Smtp-Source: AK7set+mPJx5nGXnZybw+95mTAC6FGyAL85ZL160MIyWd+RSDQnikRM+66VfqUCZyzn5LLjPd3Qkdg== X-Received: by 2002:a5d:4bd1:0:b0:2c5:594f:121d with SMTP id l17-20020a5d4bd1000000b002c5594f121dmr22518281wrt.12.1678766238547; Mon, 13 Mar 2023 20:57:18 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id r2-20020adff702000000b002c573cff730sm955867wrp.68.2023.03.13.20.57.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2023 20:57:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build From: Jessica Clarke In-Reply-To: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> Date: Tue, 14 Mar 2023 03:57:17 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> To: Wei Hu X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spamd-Result: default: False [-2.37 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.87)[-0.867]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.46:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.46:from] X-Rspamd-Queue-Id: 4PbKV82H1Jz43mK X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 13 Mar 2023, at 03:00, Wei Hu wrote: >=20 > The branch main has been updated by whu: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D15e7fa83ef3cd909e1d1b3b2cada8d90= 73f2e22e >=20 > commit 15e7fa83ef3cd909e1d1b3b2cada8d9073f2e22e > Author: Wei Hu > AuthorDate: 2023-03-13 02:55:04 +0000 > Commit: Wei Hu > CommitDate: 2023-03-13 02:55:04 +0000 >=20 > arm64: Hyper-V: Add vPCI and Mellanox driver modules into build What does Mellanox have to do with Hyper-V? I doubt it=E2=80=99s being = emulated. Jess > These changes in conf and std.hyperv files got missed in previous = commit. > Reviewed by: whu > Tested by: whu > Obtained from: Souradeep Chakrabarti > Sponsored by: Microsoft > Differential Revision: https://reviews.freebsd.org/D38529 > --- > sys/arm64/conf/std.hyperv | 12 +++++++++++- > sys/conf/files.arm64 | 1 + > 2 files changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/sys/arm64/conf/std.hyperv b/sys/arm64/conf/std.hyperv > index f87082f15c96..b742c75da131 100644 > --- a/sys/arm64/conf/std.hyperv > +++ b/sys/arm64/conf/std.hyperv > @@ -3,4 +3,14 @@ > # >=20 > #hyper-v support > -device hyperv > +device hyperv > + > +options COMPAT_LINUXKPI > +device xz > + > +device mlx5 > +device mlxfw > +device mlx5en > +options RATELIMIT > +options KERN_TLS > +device firmware > diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 > index 684cb8cb23ba..22dd267b2b42 100644 > --- a/sys/conf/files.arm64 > +++ b/sys/conf/files.arm64 > @@ -253,6 +253,7 @@ dev/hyperv/utilities/hv_kvp.c = optional hyperv acpi > dev/hyperv/netvsc/hn_nvs.c optional hyperv acpi > dev/hyperv/netvsc/hn_rndis.c optional hyperv acpi > dev/hyperv/netvsc/if_hn.c optional hyperv acpi > +dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci acpi >=20 > dev/ice/if_ice_iflib.c optional ice pci = \ > compile-with "${NORMAL_C} -I$S/dev/ice" From nobody Tue Mar 14 04:04:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbKfQ1w57z3xdRC for ; Tue, 14 Mar 2023 04:04:30 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbKfP3G1jz44hT for ; Tue, 14 Mar 2023 04:04:29 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wm1-f54.google.com with SMTP id m18-20020a05600c3b1200b003ed2a3d635eso1458642wms.4 for ; Mon, 13 Mar 2023 21:04:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678766668; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=98+sWG7asc9QY5NV6/1S26MCjVF4ePHoilh6QHM7C7g=; b=8GFxJP1JZQUGUXSRovRGn1igPR9SlfTPwwJmWeqiQP0ABZHg3ekREiouzcaLNREMn1 XT8tPVhID9TnYxhD7Ca2ar0iNufR1Afb6AvZZzUzGnZ2wvvXw9JseBLdb7dMFTZaCtL3 oD4Q9ESDcDsDpsClDsVaN1zBVDIxJllnkMNftZ/QsPZCWhwQbTCTFOb1CDc86QwCjwvX 9QEe70zMWdZ+xzwCUoDuTNhlrSpyHZy2xQGdTyZl2150fx49LTcUrCc0wxTCQubl3go1 ZrmuFw3NHhsOBESvhym/re8hvwU5UQwV2nAVUe890Gh5suG2KIJhEFRF8vlr9QVMITFX M12w== X-Gm-Message-State: AO0yUKUZ4sgpz3XgcVfQ8iL2kUYyIk3G6F9+sftEmuknx01tcv1xcScL 6AyIyRxFC5lqYMunvd1xxlVinQ== X-Google-Smtp-Source: AK7set/3tQghowAHZlsv6wU0WPqdPwytsAE2FAjWy3AYVK7jFVQVNEHymRUDiYmXiyP4FQs0IIr7oA== X-Received: by 2002:a05:600c:4506:b0:3ed:253c:621b with SMTP id t6-20020a05600c450600b003ed253c621bmr5162587wmo.21.1678766667904; Mon, 13 Mar 2023 21:04:27 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id a16-20020a5d4570000000b002c5539171d1sm985615wrc.41.2023.03.13.21.04.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2023 21:04:27 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build From: Jessica Clarke In-Reply-To: Date: Tue, 14 Mar 2023 04:04:26 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4F72E2FD-6E84-40F1-981D-A18C8DE22FDD@freebsd.org> References: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> To: Wei Hu X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spamd-Result: default: False [-2.36 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.86)[-0.858]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.54:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.54:from] X-Rspamd-Queue-Id: 4PbKfP3G1jz44hT X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 14 Mar 2023, at 03:57, Jessica Clarke wrote: >=20 > On 13 Mar 2023, at 03:00, Wei Hu wrote: >>=20 >> The branch main has been updated by whu: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D15e7fa83ef3cd909e1d1b3b2cada8d90= 73f2e22e >>=20 >> commit 15e7fa83ef3cd909e1d1b3b2cada8d9073f2e22e >> Author: Wei Hu >> AuthorDate: 2023-03-13 02:55:04 +0000 >> Commit: Wei Hu >> CommitDate: 2023-03-13 02:55:04 +0000 >>=20 >> arm64: Hyper-V: Add vPCI and Mellanox driver modules into build >=20 > What does Mellanox have to do with Hyper-V? I doubt it=E2=80=99s being = emulated. I guess because Azure Accelerated Networking has Mellanox hardware. In which case it doesn=E2=80=99t belong in std.hyperv, it belongs in = std.azure, as std.hyperv is for things needed for Hyper-V, not platforms that happen to use Hyper-V. Jess >> These changes in conf and std.hyperv files got missed in previous = commit. >> Reviewed by: whu >> Tested by: whu >> Obtained from: Souradeep Chakrabarti >> Sponsored by: Microsoft >> Differential Revision: https://reviews.freebsd.org/D38529 >> --- >> sys/arm64/conf/std.hyperv | 12 +++++++++++- >> sys/conf/files.arm64 | 1 + >> 2 files changed, 12 insertions(+), 1 deletion(-) >>=20 >> diff --git a/sys/arm64/conf/std.hyperv b/sys/arm64/conf/std.hyperv >> index f87082f15c96..b742c75da131 100644 >> --- a/sys/arm64/conf/std.hyperv >> +++ b/sys/arm64/conf/std.hyperv >> @@ -3,4 +3,14 @@ >> # >>=20 >> #hyper-v support >> -device hyperv >> +device hyperv >> + >> +options COMPAT_LINUXKPI >> +device xz >> + >> +device mlx5 >> +device mlxfw >> +device mlx5en >> +options RATELIMIT >> +options KERN_TLS >> +device firmware >> diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 >> index 684cb8cb23ba..22dd267b2b42 100644 >> --- a/sys/conf/files.arm64 >> +++ b/sys/conf/files.arm64 >> @@ -253,6 +253,7 @@ dev/hyperv/utilities/hv_kvp.c = optional hyperv acpi >> dev/hyperv/netvsc/hn_nvs.c optional hyperv acpi >> dev/hyperv/netvsc/hn_rndis.c optional hyperv acpi >> dev/hyperv/netvsc/if_hn.c optional hyperv acpi >> +dev/hyperv/pcib/vmbus_pcib.c optional hyperv = pci acpi >>=20 >> dev/ice/if_ice_iflib.c optional ice pci = \ >> compile-with "${NORMAL_C} -I$S/dev/ice" >=20 From nobody Tue Mar 14 04:17:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbKxr6h74z3xfJ5; Tue, 14 Mar 2023 04:17:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbKxr67RPz454j; Tue, 14 Mar 2023 04:17:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678767472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TREnVB7qomg6dD2pAoSCPA0u3Uw1sg/VH0t1Ti02a9g=; b=xgCCQzlz2FyyEXj3h3veIH4AR4zHsQ6pPuND90Mg//mzqSvth+2/NXCxg57bb8M7d8j5zE 9wCfThAcqQL6sO2NiRxHcnOEqVSgQJNbeedJkogf5FJqlZXNA+2mJjz80BgO1gQ2yhJRDW dFWct0/Sd6vvhnuYvuzWEJyQVYuRbqBYx3DEUpcgcEE4/t853Jos3jCapwNTe6zVmIyHDS H2Lj3FiTOtrVYg9xGKU24WV7V5xFhZDwWd/Mo61kMo+1a24PJn+Q3vYxLjjoyFd75c/HPB zO167WKBFEBd3NZRg57xDmWTaXPV+zmAAYizIDLyp3laNzaynFkgfbiFS0en1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678767472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TREnVB7qomg6dD2pAoSCPA0u3Uw1sg/VH0t1Ti02a9g=; b=BFsL5deM8IkFB8urJSoYnGSnFMr0ZjBGRID4+IVEarLtrHHGl+kLbf5pAMChd2zouUJCT6 Aq8H1EcWmWIXpfQo+FEObiBsqYxtR0/vXdlSiOIOSlSbVT3qmButT0ji9JAZgfaxohlxHD +yVxK6YzCyTsYdL9DkTW85Kq1E34ZlEzSKe8AukkAbEvNVVYTA0rhLPsQeUxMHBwphbfLA lkr3MNF9TTQunF+zWcan463WMbqg+iVbtk2fLLRXA/oDHHB4eTzC4yQp4aLphrLD+ckgmu ZhfBOae3jvslUSvKXqC9SgEAv5Ppo76Ar7uQwYLRzuWxvYfb3LG5BM0DfmDPiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678767472; a=rsa-sha256; cv=none; b=mnA/X0OQl75Xl+crXyvWotE8074XFkcIsJ1oczzuEcQ1huKnUcuLKq3dl/oDVBMoSmPi4y +E89Q+sWV755HDRnGM/b7Fw4+4021ZxypCS8IAEmFLNSFdFPQipzTwUSPt/wXBgJc6Chfh EAU6MYujKhIOAEj8mAhcFCRjGib9JArJkArb86qXTQJJpaN4UnkROy4agsGBNtJTTKH2Rb uzuLdC1DtE4Efiq9JtfXMcef2ZGyu3layzg5DgB5n7rQ2m0ZO856edA/MVuVRvrJBFnIqg D1C8/gDsb31CTeUsO728amoq1Gq32948LY67bdagWyRwl2tr/fkoCbbn7biu6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbKxr5B2PzLml; Tue, 14 Mar 2023 04:17:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32E4HqUH058061; Tue, 14 Mar 2023 04:17:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E4Hqn8058060; Tue, 14 Mar 2023 04:17:52 GMT (envelope-from git) Date: Tue, 14 Mar 2023 04:17:52 GMT Message-Id: <202303140417.32E4Hqn8058060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: aa39abd8e58f - main - arm64: Move Azure-specific config from std.hyperv to std.azure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa39abd8e58f6559ad87ac7e9de2096c202ccce2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=aa39abd8e58f6559ad87ac7e9de2096c202ccce2 commit aa39abd8e58f6559ad87ac7e9de2096c202ccce2 Author: Jessica Clarke AuthorDate: 2023-03-14 04:12:31 +0000 Commit: Jessica Clarke CommitDate: 2023-03-14 04:12:31 +0000 arm64: Move Azure-specific config from std.hyperv to std.azure Hyper-V does not provide Mellanox hardware, some of Azure's instances do, thus the configuration to enable them does not belong in the generic std.hyperv config. Fixes: 15e7fa83ef3c ("arm64: Hyper-V: Add vPCI and Mellanox driver modules into build") --- sys/arm64/conf/GENERIC | 1 + sys/arm64/conf/std.azure | 15 +++++++++++++++ sys/arm64/conf/std.hyperv | 10 ---------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index c53132b0c225..2267429f16d0 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -29,6 +29,7 @@ include "std.allwinner" include "std.altera" include "std.amd" include "std.arm" +include "std.azure" include "std.broadcom" include "std.cavium" include "std.ec2" diff --git a/sys/arm64/conf/std.azure b/sys/arm64/conf/std.azure new file mode 100644 index 000000000000..97ce7f0ae24c --- /dev/null +++ b/sys/arm64/conf/std.azure @@ -0,0 +1,15 @@ +# +# Azure support +# + +device hyperv + +options COMPAT_LINUXKPI +device xz + +device mlx5 +device mlxfw +device mlx5en +options RATELIMIT +options KERN_TLS +device firmware diff --git a/sys/arm64/conf/std.hyperv b/sys/arm64/conf/std.hyperv index b742c75da131..97492e6179b5 100644 --- a/sys/arm64/conf/std.hyperv +++ b/sys/arm64/conf/std.hyperv @@ -4,13 +4,3 @@ #hyper-v support device hyperv - -options COMPAT_LINUXKPI -device xz - -device mlx5 -device mlxfw -device mlx5en -options RATELIMIT -options KERN_TLS -device firmware From nobody Tue Mar 14 04:17:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbKxt0qntz3xf0K; Tue, 14 Mar 2023 04:17: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 4PbKxt0JTfz45Tc; Tue, 14 Mar 2023 04:17:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678767474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcB7dUM15wvvjYMl96VVxL36wIxbzMcKXi0SWpAemEU=; b=aUdN5xbxTRNX8zMYcU+nQHF+rJCW8MU9qZHBQiHzWx2UvWHBhHHpkILClkA2MAFWc3Z/Eo /r4/DgojLOsIMuLnk9GGZQ6lOymXUnn8+vRDZykEdkEprQLCEqN8kY1iWz8S7MuWCgnm9F jbjbKnOj61Sxx4Kc9dGbRONwysNER2vIZ7Yt40RraUFYD1T3SYgs+Z6tiImZxjOaYFyECT gSfnd0OJKxNxkhmjJ5bhZNtOppuNn5Jy0fTXjM5L5BaV5uzYvGhjqSsuR7dMImC2G1kH+6 ti6yLTxlLtx/khBGlHz9l/eZRLVD1uRl7wydEqN5D+rItQnNB3GNdIF8Yd64Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678767474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcB7dUM15wvvjYMl96VVxL36wIxbzMcKXi0SWpAemEU=; b=LMlde+41Xt5fmrOnNC0GP15DgKP4aVC7UN2+fizFIo0Pq7uoMlDtzeHiwOfGq6M7GLTptd /TL7MgksGKPD6dwMyiWh9Fkk7FUTMP7UK21q+8pWyNa0c4cn0wCphLUIROKSgsvk2KPbOO 9889X3wB+GhMVoNAjuAIt+UWfxDXLcBYLwna18h72XYyrKCAlvDoD93wreSDgiBnoSki7r f2HRb/bCmJ7DX1cGAAZQF2TrS5bYQDBj3KKtuZQfOJZvoYDEdTa+L0SJOaVyNFe9PwNR3y APuZ2lD58cKkIEC0e/Xz/8SK7aNnx/bPtjLHK/L/FI8F9SWiNi8mFQ7yKdMLXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678767474; a=rsa-sha256; cv=none; b=RXwcXLmxjjxwk7dX3zNOGe+TucyM1VjxGKsefF80SoLr7+XhJSV7FON3ezPx3z2tWTT1CN E0K6CJv0b/cB/UUQpot54t4QWV/5A04uoNFoA73b5auCSZ2oVpUDAP2+ajQFPV7Kbz/oUz MHabs4/MLmUbZeETCa2sUMgyWATxrVqRmw+5pRrVpc+T2i2l5/SvO+lwR3bbw8U8g/f80w Tu2NA5Zrz1FxYzC0+4P7cyYcayI1GSRrJGpLVZs1nVuqly9v8S9M8rIyC+sFpGx6NnYP0J awwhucLk3w/eA3pBzSewkYHYjzEeZS1KD1zIcRTvy4/zsD5v80PKN3FYQcT6oA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbKxs65FFzL4w; Tue, 14 Mar 2023 04:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32E4Hro2058080; Tue, 14 Mar 2023 04:17:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E4Hrxj058079; Tue, 14 Mar 2023 04:17:53 GMT (envelope-from git) Date: Tue, 14 Mar 2023 04:17:53 GMT Message-Id: <202303140417.32E4Hrxj058079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 4f7b3120bc60 - main - arm64: Delete redundant badly formatted and capitalised comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f7b3120bc6049df3b1eabb4fca40b02294aace6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4f7b3120bc6049df3b1eabb4fca40b02294aace6 commit 4f7b3120bc6049df3b1eabb4fca40b02294aace6 Author: Jessica Clarke AuthorDate: 2023-03-14 04:15:03 +0000 Commit: Jessica Clarke CommitDate: 2023-03-14 04:15:03 +0000 arm64: Delete redundant badly formatted and capitalised comment Fixes: 9729f076e4d9 ("arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)") --- sys/arm64/conf/std.hyperv | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/arm64/conf/std.hyperv b/sys/arm64/conf/std.hyperv index 97492e6179b5..d6b6fa96447a 100644 --- a/sys/arm64/conf/std.hyperv +++ b/sys/arm64/conf/std.hyperv @@ -2,5 +2,4 @@ # Hyper-V support (Hyper-v Gen 2) # -#hyper-v support device hyperv From nobody Tue Mar 14 04:19:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbL0C2pcgz3xf2d; Tue, 14 Mar 2023 04:19: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 4PbL0C2Jsmz4630; Tue, 14 Mar 2023 04:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678767595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6RboLYR9ctEO9BHDasvWVVZMRkwZExSgiE/a3lVyv5Q=; b=JjkPgOtC/mRTC929N2XqXfBbpatyvGOmeq8zi2sqLsOkm2Tt+ZgqI2sTorNt1QkLK1cDN0 KAS5ErSid4HwA7kO3C41aG8/xFh5yCSokGJqVH6cRXasUet/PJ65O2E/iFPIyCkJgGftFu 4oWouvp47Wry46wR2SzAcrohMeY9V2mmZ33jmyfH5jGbz4cYgexAN6uI1giANihTOchFbG b1HT3gH7gP/WukSrg1cekpoqu+eKE5QQ90NbMYevLkWWpVt+maalKDILHovHgnx1TZ/qoJ Tvlb1bXLYUZrdX4dqLHD7yOUrkWiG/FQIFp4IJXNlgSdtCsQfT5JIBgSFOSqoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678767595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6RboLYR9ctEO9BHDasvWVVZMRkwZExSgiE/a3lVyv5Q=; b=dBn9/VMAIiqaoZqAEWmkWpDdXfJM382QRSG/okGmlmxiw5sbeEwwyYXHin1n80FiB9fWmm KpET0GkWjIynqUBqTicDJCMub1zvIlUdb3sn++b/15BKv7y6cgjTlkXZsET4EoGVN33/52 F1IooYWtrCIVKugf7V49S5a8bWblSXLFUpF5ZFn1TFsgHPzwgSTyFNd6YoN/CQf6Rvz2V6 5DSd1E3GoOl7FL3tHtaAK+Qvqq0MjIbqRqoQcVpW+lsFIl313KkiXht+GtGSDnS5hVkS+l jEDzmC/XjI2wDME8/hej80zXE9vHtYaBEyKZF7nKsJ9KES3bey69RTdEvZK+VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678767595; a=rsa-sha256; cv=none; b=PBwYYJNFrY5wipC9b+xQUpEgJNyV8ZtRCK0BozUCb/jAeOEcj9M6XiMnFinglZKV2zbdS0 8Rin1wzmCweHcsiM5WrlXu6RYnU5Z2AH3BXNcDLpTc1KNqpZX0OUo6Dfdg48+5/LingWrk RVGgLgO4LsT5U93d+GGPqGXpgkZvMN7mcD5sLoBjBX+o4ep4av8YL/FPzHcRKpPTbIhbQi ZCC99uCngO8ri1Rtr/k+DTpS8qqhXJ/M01nyjrXSIUutjMVvFjbKYl8u0YXXxGeXTx/DwM pV1bnnhI5mHhLDfhPq3CQPA/ylnKZaU9WG+rHC0aGE6/RJHwfigibmVCbK+BLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbL0C1MsVzLkr; Tue, 14 Mar 2023 04:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32E4JtKk058393; Tue, 14 Mar 2023 04:19:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E4Jtsd058392; Tue, 14 Mar 2023 04:19:55 GMT (envelope-from git) Date: Tue, 14 Mar 2023 04:19:55 GMT Message-Id: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adeca21464d25bc61f98968a5c1e76ab3c808ae4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=adeca21464d25bc61f98968a5c1e76ab3c808ae4 commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 Author: lucy AuthorDate: 2023-03-13 22:01:12 +0000 Commit: Warner Losh CommitDate: 2023-03-14 04:19:24 +0000 Add GNU glibc compatible secure_getenv Add mostly glibc and msl compatible secure_getenv. Return NULL if issetugid() indicates the process is tainted, otherwise getenv(x). The rational behind this is the fact that many Linux applications use this function instead of getenv() as it's widely consider a, "best practice". Reviewed by: imp, mjg (feedback) Pull Request: https://github.com/freebsd/freebsd-src/pull/686 Signed-off-by: Lucy Marsh --- include/stdlib.h | 1 + lib/libc/stdlib/Makefile.inc | 4 ++-- lib/libc/stdlib/Symbol.map | 1 + lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- lib/libc/stdlib/getenv.c | 12 ++++++++++++ 5 files changed, 41 insertions(+), 3 deletions(-) diff --git a/include/stdlib.h b/include/stdlib.h index 01629ed84a11..c41e8704e810 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, int (* _Nonnull)(const void *, const void *)); int rand(void); void *realloc(void *, size_t) __result_use_check __alloc_size(2); +char *secure_getenv(const char *); void srand(unsigned); double strtod(const char * __restrict, char ** __restrict); float strtof(const char * __restrict, char ** __restrict); diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc index 8ace2c051b82..964e7ce30594 100644 --- a/lib/libc/stdlib/Makefile.inc +++ b/lib/libc/stdlib/Makefile.inc @@ -46,8 +46,8 @@ MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 \ MLINKS+=a64l.3 l64a.3 a64l.3 l64a_r.3 MLINKS+=atol.3 atoll.3 MLINKS+=exit.3 _Exit.3 -MLINKS+=getenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \ - getenv.3 unsetenv.3 +MLINKS+=getenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 secure_getenv.3 \ + getenv.3 setenv.3 getenv.3 unsetenv.3 MLINKS+=getopt_long.3 getopt_long_only.3 MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3 MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3 diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map index 9d2944fdb7e9..a105f781734d 100644 --- a/lib/libc/stdlib/Symbol.map +++ b/lib/libc/stdlib/Symbol.map @@ -128,6 +128,7 @@ FBSD_1.6 { FBSD_1.7 { clearenv; qsort_r; + secure_getenv; }; FBSDprivate_1.0 { diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3 index 5566d7b01dcd..93c0d2ada6ad 100644 --- a/lib/libc/stdlib/getenv.3 +++ b/lib/libc/stdlib/getenv.3 @@ -32,13 +32,14 @@ .\" @(#)getenv.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 7, 2021 +.Dd March 13, 2023 .Dt GETENV 3 .Os .Sh NAME .Nm clearenv , .Nm getenv , .Nm putenv , +.Nm secure_getenv , .Nm setenv , .Nm unsetenv .Nd environment variable functions @@ -50,6 +51,8 @@ .Fn clearenv "void" .Ft char * .Fn getenv "const char *name" +.Ft char * +.Fn secure_getenv "const char *name" .Ft int .Fn setenv "const char *name" "const char *value" "int overwrite" .Ft int @@ -78,6 +81,20 @@ to by the .Fn getenv function. .Pp +The GNU-specific function, +.Fn secure_getenv +wraps the +.Fn getenv +function to prevent it from being run in "secure execution". +Unlike in glibc, +.Fn secure_getenv +only checks if the +.Fa setuid +and +.Fa setgid +bits have been set or changed. +These checks are subject to extension and change. +.Pp The .Fn setenv function inserts or resets the environment variable @@ -139,6 +156,13 @@ is not in the current environment, .Dv NULL is returned. .Pp +The +.Fn secure_getenv +function returns +.Dv NULL +if the process is in "secure execution," otherwise it will call +.Fn getenv . +.Pp .Rv -std clearenv setenv putenv unsetenv .Sh ERRORS .Bl -tag -width Er diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c index 7ca27ab710c4..86a846d58c69 100644 --- a/lib/libc/stdlib/getenv.c +++ b/lib/libc/stdlib/getenv.c @@ -447,6 +447,18 @@ getenv(const char *name) } +/* + * Runs getenv() unless the current process is tainted by uid or gid changes, in + * which case it will return NULL. + */ +char * +secure_getenv(const char *name) +{ + if (issetugid()) + return NULL; + return getenv(name); +} + /* * Set the value of a variable. Older settings are labeled as inactive. If an * older setting has enough room to store the new value, it will be reused. No From nobody Tue Mar 14 04:21:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbL2Q4JvCz3xfMT for ; Tue, 14 Mar 2023 04:21:50 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbL2Q17Jqz46Lh for ; Tue, 14 Mar 2023 04:21:50 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f42.google.com with SMTP id y14so455394wrq.4 for ; Mon, 13 Mar 2023 21:21:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678767708; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=va+ll/agiG9Cl4Gn5E9QW47Yy8gJ/8Hv7+HDQ+DSCy0=; b=qC5UfixSvNNtuGUGo3M0j1SuDm+kv9Zx0rqjBNHkgkXWVr8jcqZ2cWDycsBRIZMNAI bGVuUegO8WQLctg9IjYoslse+Cp7qNA/2zvkyThC+TPpObNdqbPC96y2wf8mTMlwnP7f Sp/bceZMg6xh0D4KnaMan/gYEQS7bz3uxAILV/TDiR7qWjXZqutDOXb5ActGoDsPYwam eFrSTbiUXxjfsSgNjOt9CMEKW5qTIEYnbUYl6lzl/XeGXZ0ONGBSIP1sHBl7Ey7Kjl6Y PBWkou5IwqO/A2GbbQZ4RqqbLt1njf24GpOImXP5soEhWajyUqK4jMzkto3aoMA/2p0Z blEA== X-Gm-Message-State: AO0yUKWG45VdBzUX3WzT+E3dxk4BcG7Oe9lj+3ZABCpOBD1OoG/I8+eh 2xSU51KVRgdwAh3hzVY9n9OGhQ== X-Google-Smtp-Source: AK7set+DpXgJvzcYYuGFa3X4o1vFWeqqzyTU4aT1mclBN/6fBLh7dCXxHUuerW8reSXu5aqvMZPZMA== X-Received: by 2002:adf:dccf:0:b0:2ce:adfd:9d98 with SMTP id x15-20020adfdccf000000b002ceadfd9d98mr4763733wrm.3.1678767708691; Mon, 13 Mar 2023 21:21:48 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id a9-20020adfeec9000000b002cde626cd96sm989093wrp.65.2023.03.13.21.21.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2023 21:21:48 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv From: Jessica Clarke In-Reply-To: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> Date: Tue, 14 Mar 2023 04:21:47 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PbL2Q17Jqz46Lh X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 14 Mar 2023, at 04:19, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76ab= 3c808ae4 >=20 > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 > Author: lucy > AuthorDate: 2023-03-13 22:01:12 +0000 > Commit: Warner Losh > CommitDate: 2023-03-14 04:19:24 +0000 >=20 > Add GNU glibc compatible secure_getenv >=20 > Add mostly glibc and msl compatible secure_getenv. Return NULL if > issetugid() indicates the process is tainted, otherwise getenv(x). = The > rational behind this is the fact that many Linux applications use = this > function instead of getenv() as it's widely consider a, "best > practice". >=20 > Reviewed by: imp, mjg (feedback) > Pull Request: https://github.com/freebsd/freebsd-src/pull/686 > Signed-off-by: Lucy Marsh > --- > include/stdlib.h | 1 + > lib/libc/stdlib/Makefile.inc | 4 ++-- > lib/libc/stdlib/Symbol.map | 1 + > lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- > lib/libc/stdlib/getenv.c | 12 ++++++++++++ > 5 files changed, 41 insertions(+), 3 deletions(-) >=20 > diff --git a/include/stdlib.h b/include/stdlib.h > index 01629ed84a11..c41e8704e810 100644 > --- a/include/stdlib.h > +++ b/include/stdlib.h > @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, > int (* _Nonnull)(const void *, const void *)); > int rand(void); > void *realloc(void *, size_t) __result_use_check __alloc_size(2); > +char *secure_getenv(const char *); > void srand(unsigned); > double strtod(const char * __restrict, char ** __restrict); > float strtof(const char * __restrict, char ** __restrict); > diff --git a/lib/libc/stdlib/Makefile.inc = b/lib/libc/stdlib/Makefile.inc > index 8ace2c051b82..964e7ce30594 100644 > --- a/lib/libc/stdlib/Makefile.inc > +++ b/lib/libc/stdlib/Makefile.inc > @@ -46,8 +46,8 @@ MAN+=3D a64l.3 abort.3 abs.3 alloca.3 atexit.3 = atof.3 \ > MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3 > MLINKS+=3Datol.3 atoll.3 > MLINKS+=3Dexit.3 _Exit.3 > -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \ > - getenv.3 unsetenv.3 > +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 = secure_getenv.3 \ > + getenv.3 setenv.3 getenv.3 unsetenv.3 > MLINKS+=3Dgetopt_long.3 getopt_long_only.3 > MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3 > MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 = hsearch_r.3 > diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map > index 9d2944fdb7e9..a105f781734d 100644 > --- a/lib/libc/stdlib/Symbol.map > +++ b/lib/libc/stdlib/Symbol.map > @@ -128,6 +128,7 @@ FBSD_1.6 { > FBSD_1.7 { > clearenv; > qsort_r; > + secure_getenv; > }; >=20 > FBSDprivate_1.0 { > diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3 > index 5566d7b01dcd..93c0d2ada6ad 100644 > --- a/lib/libc/stdlib/getenv.3 > +++ b/lib/libc/stdlib/getenv.3 > @@ -32,13 +32,14 @@ > .\" @(#)getenv.3 8.2 (Berkeley) 12/11/93 > .\" $FreeBSD$ > .\" > -.Dd November 7, 2021 > +.Dd March 13, 2023 > .Dt GETENV 3 > .Os > .Sh NAME > .Nm clearenv , > .Nm getenv , > .Nm putenv , > +.Nm secure_getenv , > .Nm setenv , > .Nm unsetenv > .Nd environment variable functions > @@ -50,6 +51,8 @@ > .Fn clearenv "void" > .Ft char * > .Fn getenv "const char *name" > +.Ft char * > +.Fn secure_getenv "const char *name" > .Ft int > .Fn setenv "const char *name" "const char *value" "int overwrite" > .Ft int > @@ -78,6 +81,20 @@ to by the > .Fn getenv > function. > .Pp > +The GNU-specific function, I don=E2=80=99t think it is now?.. > +.Fn secure_getenv > +wraps the > +.Fn getenv > +function to prevent it from being run in "secure execution". > +Unlike in glibc, > +.Fn secure_getenv > +only checks if the > +.Fa setuid > +and > +.Fa setgid > +bits have been set or changed. > +These checks are subject to extension and change. > +.Pp > The > .Fn setenv > function inserts or resets the environment variable > @@ -139,6 +156,13 @@ is not in the current environment, > .Dv NULL > is returned. > .Pp > +The > +.Fn secure_getenv > +function returns > +.Dv NULL > +if the process is in "secure execution," otherwise it will call > +.Fn getenv . > +.Pp > .Rv -std clearenv setenv putenv unsetenv > .Sh ERRORS > .Bl -tag -width Er > diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c > index 7ca27ab710c4..86a846d58c69 100644 > --- a/lib/libc/stdlib/getenv.c > +++ b/lib/libc/stdlib/getenv.c > @@ -447,6 +447,18 @@ getenv(const char *name) > } >=20 >=20 > +/* > + * Runs getenv() unless the current process is tainted by uid or gid = changes, in > + * which case it will return NULL. > + */ > +char * > +secure_getenv(const char *name) > +{ > + if (issetugid()) > + return NULL; > + return getenv(name); return (...); (x2) Jess > +} > + > /* > * Set the value of a variable. Older settings are labeled as = inactive. If an > * older setting has enough room to store the new value, it will be = reused. No From nobody Tue Mar 14 04:22:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbL3L2LJ4z3xfmx; Tue, 14 Mar 2023 04:22:38 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from HK2P15301CU002.outbound.protection.outlook.com (mail-eastasiaazlp170100000.outbound.protection.outlook.com [IPv6:2a01:111:f403:c400::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbL3K4nQJz46dx; Tue, 14 Mar 2023 04:22:37 +0000 (UTC) (envelope-from weh@microsoft.com) Authentication-Results: mx1.freebsd.org; none ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bf6iPqpTET2Ojlti2lR01vkUHa+BDTT30FHmS0koRab1VelXfXs+cTyQBpdr/jBrtAJxVtXX8EWAyl71rzyqnCteFl/yeEXfZp7w+HasIJajbQW5gBSSU1ejO0Gd77pksKkG4ljkXtLI6qE3kIXsZl6gme/xGjxfoargI3dE7suAqBwsPiFlM1viyYljPk7UMqWxQ77kdTOQSki35q1JBfm7pgeMxdwmzymcYu7mTMTdD0PGQfxz69s4EsJUFTaANcLsulMC6ri2wIK4bIZE99USwNimIchIY6kx5fq9PLnn7OSJorFmr7SjxYBgB9EFScaScOX/IVNRHPX2227MsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lYDrUOZzjuj39Qw/xQYLI07HkGfqV0wBu6m4OKwmOlc=; b=IOJKDI8TMXjoIKACGwRJJVoBFVupIGUTi0m3LjbdkXDYFdFAXrfJPghzYRtNtDLL9QN8dwRa4QqaxLduz9FLJ3L5bm0pwytKGHUzgS6ZfpGANcVt6Eht1B7sVLlkYYZ656D2rDtf2DrF9hPHSs5Kw/m46U2evXgebHB6HgyltQGvRci9b80XN6w5+d5ivoOp9dgNKByTjC/hldppHNWzekCnTs4ZNfmlOjjUsaG/nvG1MyRlRhTXeAxeH9tqeyfZ0wQb/0n38dH9dggvEfG727fS1Si0/Hh4RC0Hl2DyVAFMxMobHaLRxfLws0ds99Yl2MS3WSjf/tOSFixoPyH1nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lYDrUOZzjuj39Qw/xQYLI07HkGfqV0wBu6m4OKwmOlc=; b=dgFP7TpuFB0hIB89i72Fk3g3Jh11k9xyhPj6pdV3XSi7u2od5tCfaOh22WVzwK6N0/f/NAUoBg3ipHnB3YOFluV4WcivtWttgEwqkAHxvfO4ztwPUNxAtrGVVg+VfkB+KbdmB7RTWfHyLe7OJxtWD2BRLDe2UHnrNmQKtHRPmfk= Received: from SI2P153MB0441.APCP153.PROD.OUTLOOK.COM (2603:1096:4:fc::7) by PSAP153MB0391.APCP153.PROD.OUTLOOK.COM (2603:1096:301:2a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.5; Tue, 14 Mar 2023 04:22:31 +0000 Received: from SI2P153MB0441.APCP153.PROD.OUTLOOK.COM ([fe80::a485:7ae4:263d:c862]) by SI2P153MB0441.APCP153.PROD.OUTLOOK.COM ([fe80::a485:7ae4:263d:c862%6]) with mapi id 15.20.6222.005; Tue, 14 Mar 2023 04:22:31 +0000 From: Wei Hu To: Jessica Clarke , Wei Hu CC: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: RE: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build Thread-Topic: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build Thread-Index: AQHZVVf8e0xpclVc8EGc2s8MLWSZgK75p3KAgAACAACAAAF/kA== Date: Tue, 14 Mar 2023 04:22:30 +0000 Message-ID: References: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> <4F72E2FD-6E84-40F1-981D-A18C8DE22FDD@freebsd.org> In-Reply-To: <4F72E2FD-6E84-40F1-981D-A18C8DE22FDD@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=d18e3401-e597-43c3-92ed-a033a1e15a5d;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-03-14T04:09:47Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SI2P153MB0441:EE_|PSAP153MB0391:EE_ x-ms-office365-filtering-correlation-id: ad72703a-370f-46cb-8324-08db2443ba54 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ShkLwzmjGWP47pa+vjpjZKLQE9G8oHpjzTvrS+L414yPP3pWeUKeO4SKTafMW8RHEHHJ4fuA8bROvYVjvf/uWXIzvu7kbkaCJFK6Usue/slVt/cIB2mtavqWOLG0j9kve5YymWDe5ZXj2ha7Zq6RQ4EHdsaurFqje6VNjsv/ILm6C0gm1Jt6ogFPHJP7AE4/yFf3Grt9MyTuKkasnLl1+eQeCxZ3KaGuaxCnvEI0KVovkaGI2/7/mqRKgP4hdzmZbnYIXSkEd2T5YU/CAgVQDArzl5ycHzpQ2pVY9Uyb6hP0o5zS4s8SX/gJA+jj4zCKKnAq93BKrPhsfUPzOcXRT7w3s8c4JqNvMPEFUoTeZdj8foam86TQ+Eyi/ZBvooTe2H0bUhya6KYr2mRais8LiinyH+2DJZP/sF251XFBzEOoqc/MAicSahUPiCHelA3pITITuZAwFFPWACEq75e9o44u01sbVOZiSJHjA89zKayUBKL08fSzC6iQrUvcNjNBXPUlz4f8nXV78rtppj6RVtcy51EyGVgfc3kBp9KxZNhR/r0K+prtGv4caD8DHGgNIdhnJni/D2gWD/0iSgBdWUK0BkW/g643pivmqaRAqzd4uxYG5n7Loj0ES+mL848v59JU62r/m9M68lK6McUlJGdsSN+OVLnP+f4/gP91xGsOxB4NfIYbHzjzMsY7U9IcKW1UedZPWlv+t+aTLWq8BTABiBxHOLa9V8riX8iNCgq0hjsehbdrE79fymy7JM1c x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SI2P153MB0441.APCP153.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(376002)(396003)(39860400002)(136003)(346002)(451199018)(82960400001)(186003)(2906002)(38070700005)(38100700002)(8990500004)(122000001)(9686003)(6506007)(82950400001)(26005)(53546011)(5660300002)(8936002)(52536014)(41300700001)(33656002)(966005)(86362001)(450100002)(66556008)(66946007)(55016003)(64756008)(66476007)(66446008)(4326008)(8676002)(76116006)(71200400001)(478600001)(316002)(110136005)(7696005)(54906003)(83380400001)(10290500003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jXwyA5fDDThdN0SXFCQ2Jc72MADX1/foCh+7Im9/tE190VP8W6MdVw1zkIcr?= =?us-ascii?Q?xcB/G8SgsTnkI7/+FfJPo8EX/W2V2RLUUx90wiDtbxzFf576nSu2BzUu+blb?= =?us-ascii?Q?GRpKCUxyjY4aiPvmlth4I7hqJvJa2pXHZpEdWNUiINmdjo9ziCxECk55z9up?= =?us-ascii?Q?eQWWqfNO0GWih42VI/9rXRzop54OGzA75plX1HzcN2hPt8OyLQjjJcVTjGcj?= =?us-ascii?Q?7S2SxqLbkl6Ubv6nKFzd+nJviTbHnzmKG2QBbu0wYXvvBWBUhF466ExHRyh+?= =?us-ascii?Q?XuiL3BrKJKBGmZus40LQ2CgVu5dIc4uEhFVoqTmrNIKM7hG9DVqWmOLK3hRV?= =?us-ascii?Q?zGq+fLnL4myBYFDv92Ub8M/qKY5XGuCeYCG6YhADUhMWR4jcIUDsQ65n3e4i?= =?us-ascii?Q?5g7eMUmQA8j/WprgMmjgc0HCZXF6XEfozm66xKCTUdgOCK+qZL6bc1nMrMSC?= =?us-ascii?Q?A9FeF9GXFNcAAuy8x7MrDFnm+18xLSnL5Tq/ZAaHNvpm7GQYDJB2Akhjcv7W?= =?us-ascii?Q?1kX1IHZZapJL1k3XC506lUBByEetZqk3QBisF/kwkYFTbqi97fnrUN/SavRK?= =?us-ascii?Q?p3260p5n44fyFJylpjeiJRgwWvoMqLKWUo6EWDM/EIi8AmEkmUF5jV8a9bg+?= =?us-ascii?Q?ywVblqJTb7uBGjquVfxIaEvdKO0dqKIibjwsT5bx6oTqQhmWRuM1t3pb5CJZ?= =?us-ascii?Q?BdtOmh4SsNEwPunNrFib7bthtQkxiE7wSl/DKOJQ5eVG16Oc8aBWetmMk+Xa?= =?us-ascii?Q?AXIMJryrYs4wX2EtlOBBmbVNab6XrJ9Y4Q/N7+8WSdiautpMpf7StHdvRvvQ?= =?us-ascii?Q?4o21mcWXLIZTtdH5vbAODLo0c/wAfAQdvkIHT7E67fD+WOb2aDq8KaQxdnbL?= =?us-ascii?Q?Gb2YBErzCdAhXxgw1NN92LMKR8+Hv2MqnqwlfVZQMlrA0OgN7PDas9cz9CYa?= =?us-ascii?Q?d07Ogla9Ik+Y2LWIwb55DdNuq6+a9yY/5ENPJChYvpn1HR6KGjeQQg+CKjbO?= =?us-ascii?Q?tGLysFEKCoWE9mBA9RnmpfjUzAQpMVPCZ4TJJLPFUOyFmjUZyyl3HtYVqezG?= =?us-ascii?Q?xHTPTCW6CkWTktcKGc/1/S71uLWe4NqvyhRr4MOoEQyAMwVLyF5zBgfaibOF?= =?us-ascii?Q?s74FBRAZKYbPPdPfM0gT0QM2jKSDdi8GRKoftGbEylBua2KxdqB5W1sgvMVl?= =?us-ascii?Q?5JLtPWZ1QR00mQZlCrbAgsMeCgl/MdBveYzUh4tQ9e7LaKGJdrc2v9URct1c?= =?us-ascii?Q?KIZOCluFGn5+oG6W8fbKkc/ApX9RNUygM4mbQK0n3EOIWtBEx44X8I7Ph4Nd?= =?us-ascii?Q?dozHLw+RjfeVt9bBcLJTsaQ6kN4RnCD8Ka1YPzy5Lv0IrSat1opGYSr/aTIY?= =?us-ascii?Q?ZEOQGx75x5MxhB3dSz+uH5J+6GdTFSneqUXX48/yOsMK66pAUWPcluaVI70o?= =?us-ascii?Q?5dgp+2AeQ876aKuL/stcku3FjudvDzubVfOy3AGLyCCKK+mI5VeO9LF81S0D?= =?us-ascii?Q?xWihL5L/6YD7CPabJ498q40lEtEWPGS15Rd3QUaonYkBuTloLHlNHlMVZURD?= =?us-ascii?Q?IzV+x2he/ihc1rkrnjhNJiU2jvTh+QseK0lzIltV?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SI2P153MB0441.APCP153.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: ad72703a-370f-46cb-8324-08db2443ba54 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2023 04:22:30.9998 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: v1oK9HLyt6PLppevMu0St6+ALOJP9SA3zyXTvPJDlG+T1CfuGw9i1AvelHLgSu2ufwO9DteTBX1pCe+jM491Hw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAP153MB0391 X-Rspamd-Queue-Id: 4PbL3K4nQJz46dx X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > -----Original Message----- > From: Jessica Clarke > Sent: Tuesday, March 14, 2023 12:04 PM > To: Wei Hu > Cc: src-committers@freebsd.org; dev-commits-src-all@freebsd.org; dev- > commits-src-main@freebsd.org > Subject: Re: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and > Mellanox driver modules into build >=20 > On 14 Mar 2023, at 03:57, Jessica Clarke wrote: > > > > On 13 Mar 2023, at 03:00, Wei Hu wrote: > >> > >> The branch main has been updated by whu: > >> > >> URL: > >> > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fcgi > >> > t.freebsd.org%2Fsrc%2Fcommit%2F%3Fid%3D15e7fa83ef3cd909e1d1b3b2ca > da8d > >> > 9073f2e22e&data=3D05%7C01%7Cweh%40microsoft.com%7Ce49561fcb0054db > 78cfc0 > >> > 8db244136f1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6381436 > 34775 > >> > 142011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2 > luMzIiLC > >> > JBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DNe98uGxwYg > CfWaRPct > >> 8KCG%2FBEcwSf0HmjmcuW7Rx0FU%3D&reserved=3D0 > >> > >> commit 15e7fa83ef3cd909e1d1b3b2cada8d9073f2e22e > >> Author: Wei Hu > >> AuthorDate: 2023-03-13 02:55:04 +0000 > >> Commit: Wei Hu > >> CommitDate: 2023-03-13 02:55:04 +0000 > >> > >> arm64: Hyper-V: Add vPCI and Mellanox driver modules into build > > > > What does Mellanox have to do with Hyper-V? I doubt it's being emulated= . >=20 > I guess because Azure Accelerated Networking has Mellanox hardware. In > which case it doesn't belong in std.hyperv, it belongs in std.azure, as > std.hyperv is for things needed for Hyper-V, not platforms that happen to > use Hyper-V. Hyper-V supports SRIOV devices. For now Mellanox NICs is the only NIC type = supported. Mellanox drivers were not included in the ARM64 build. We have tested it on= Hyper-V=20 during the ARM64 for Hyper-V enablement effort, with Hyper-V VPCI driver. = We have not tested it on the other ARM64 platforms. It should work not only in Azur= e, but also in on-prem ARM64 Hyper-V hosts.=20 It's better to move Mellanox drivers to more general build location once th= ey are tested on more ARM64 platforms. Wei >=20 > Jess >=20 > >> These changes in conf and std.hyperv files got missed in previous co= mmit. > >> Reviewed by: whu > >> Tested by: whu > >> Obtained from: Souradeep Chakrabarti > >> Sponsored by: Microsoft > >> Differential Revision: > >> > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Frev > >> > iews.freebsd.org%2FD38529&data=3D05%7C01%7Cweh%40microsoft.com%7C > e49561 > >> > fcb0054db78cfc08db244136f1%7C72f988bf86f141af91ab2d7cd011db47%7C1% > 7C0 > >> %7C638143634775142011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4w > LjAwMDAiLCJ > >> > QIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdat > a=3DYu% > >> 2BY%2FyEVCjC6dj8UKY6pYeVy%2BAsgxar5DBC9XQlexYo%3D&reserved=3D0 > >> --- > >> sys/arm64/conf/std.hyperv | 12 +++++++++++- > >> sys/conf/files.arm64 | 1 + > >> 2 files changed, 12 insertions(+), 1 deletion(-) > >> > >> diff --git a/sys/arm64/conf/std.hyperv b/sys/arm64/conf/std.hyperv > >> index f87082f15c96..b742c75da131 100644 > >> --- a/sys/arm64/conf/std.hyperv > >> +++ b/sys/arm64/conf/std.hyperv > >> @@ -3,4 +3,14 @@ > >> # > >> > >> #hyper-v support > >> -device hyperv > >> +device hyperv > >> + > >> +options COMPAT_LINUXKPI > >> +device xz > >> + > >> +device mlx5 > >> +device mlxfw > >> +device mlx5en > >> +options RATELIMIT > >> +options KERN_TLS > >> +device firmware > >> diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index > >> 684cb8cb23ba..22dd267b2b42 100644 > >> --- a/sys/conf/files.arm64 > >> +++ b/sys/conf/files.arm64 > >> @@ -253,6 +253,7 @@ dev/hyperv/utilities/hv_kvp.c > optional hyperv acpi > >> dev/hyperv/netvsc/hn_nvs.c optional hyperv acpi > >> dev/hyperv/netvsc/hn_rndis.c optional hyperv acpi > >> dev/hyperv/netvsc/if_hn.c optional hyperv acpi > >> +dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci > acpi > >> > >> dev/ice/if_ice_iflib.c optional ice pci \ > >> compile-with "${NORMAL_C} -I$S/dev/ice" > > From nobody Tue Mar 14 04:30:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbLDG6D5Yz3xg16 for ; Tue, 14 Mar 2023 04:30:22 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbLDG5Xpmz47Hq for ; Tue, 14 Mar 2023 04:30:22 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f53.google.com with SMTP id l1so13112501wry.12 for ; Mon, 13 Mar 2023 21:30:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678768221; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y6d3RK1slGsOs+2kDHmx51mrrKXlbgB2DoAmvP8l91Y=; b=LuwKq76ssBzE7a3ozBh9eUq85/muuc+KjP9gALkO4TmO3sB5sYIdwuqK21agLvBFBC +d4LNnERAUIF7y5F2VdnUK9wOKTv9LivAzdajBhx8lV0edj586PyPNqHFFvqvzJJP60c stPCtxR65cqr9w1ve6wMYa+fXHJOBzGTs2luHgBVDJwGuRXS37x8B0EjoJN4UlSggspd nPHeylsAHt2jjyVMTSdBqU82GqDH6QZkRNCwSFMlMoCs+Nbx6+7gCBI4MuRy2UkA7fLT GeTS28aNfk9A9tAQTb+M6Wh0SplJtFIChFxT10wf08MxCHHhQHUTS9cTElc4QVBqjXsT RzQQ== X-Gm-Message-State: AO0yUKVfvJHJauO3h12C7mKYehFDIqVukHCk9TnaYRUxv5S/YNa8WcOx rzj8gRSPHhGL6f+PQaSkYJqYJHsu2ZUzQAdhvwmLKw== X-Google-Smtp-Source: AK7set/nDCD3o/muQXkrOUM97xomMxjLvxmM6kUTB8X5yJFIG3Hvd+yo+yUeW56HqhfLAHUTjVAHTA== X-Received: by 2002:a5d:4012:0:b0:2c5:532a:98c4 with SMTP id n18-20020a5d4012000000b002c5532a98c4mr9410322wrp.33.1678768221406; Mon, 13 Mar 2023 21:30:21 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id j5-20020a5d6045000000b002c55306f6edsm1006263wrt.54.2023.03.13.21.30.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2023 21:30:20 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build From: Jessica Clarke In-Reply-To: Date: Tue, 14 Mar 2023 04:30:20 +0000 Cc: Wei Hu , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <3D6476D5-807E-4D9A-87BC-F5916FBEBE5B@freebsd.org> References: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> <4F72E2FD-6E84-40F1-981D-A18C8DE22FDD@freebsd.org> To: Wei Hu X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PbLDG5Xpmz47Hq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 14 Mar 2023, at 04:22, Wei Hu wrote: >=20 >=20 >=20 >> -----Original Message----- >> From: Jessica Clarke >> Sent: Tuesday, March 14, 2023 12:04 PM >> To: Wei Hu >> Cc: src-committers@freebsd.org; dev-commits-src-all@freebsd.org; dev- >> commits-src-main@freebsd.org >> Subject: Re: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and >> Mellanox driver modules into build >>=20 >> On 14 Mar 2023, at 03:57, Jessica Clarke wrote: >>>=20 >>> On 13 Mar 2023, at 03:00, Wei Hu wrote: >>>>=20 >>>> The branch main has been updated by whu: >>>>=20 >>>> URL: >>>>=20 >> https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fcgi= >>>>=20 >> t.freebsd.org%2Fsrc%2Fcommit%2F%3Fid%3D15e7fa83ef3cd909e1d1b3b2ca >> da8d >>>>=20 >> 9073f2e22e&data=3D05%7C01%7Cweh%40microsoft.com%7Ce49561fcb0054db >> 78cfc0 >>>>=20 >> 8db244136f1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6381436 >> 34775 >>>>=20 >> 142011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2 >> luMzIiLC >>>>=20 >> JBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DNe98uGxwYg >> CfWaRPct >>>> 8KCG%2FBEcwSf0HmjmcuW7Rx0FU%3D&reserved=3D0 >>>>=20 >>>> commit 15e7fa83ef3cd909e1d1b3b2cada8d9073f2e22e >>>> Author: Wei Hu >>>> AuthorDate: 2023-03-13 02:55:04 +0000 >>>> Commit: Wei Hu >>>> CommitDate: 2023-03-13 02:55:04 +0000 >>>>=20 >>>> arm64: Hyper-V: Add vPCI and Mellanox driver modules into build >>>=20 >>> What does Mellanox have to do with Hyper-V? I doubt it's being = emulated. >>=20 >> I guess because Azure Accelerated Networking has Mellanox hardware. = In >> which case it doesn't belong in std.hyperv, it belongs in std.azure, = as >> std.hyperv is for things needed for Hyper-V, not platforms that = happen to >> use Hyper-V. >=20 > Hyper-V supports SRIOV devices. For now Mellanox NICs is the only NIC = type supported. So? Hyper-V still isn=E2=80=99t giving you a Mellanox NIC, you have to = go buy one or use a platform (Azure) that has one; Azure is the justification, not Hyper-V. > Mellanox drivers were not included in the ARM64 build. We have tested = it on Hyper-V=20 > during the ARM64 for Hyper-V enablement effort, with Hyper-V VPCI = driver. We have > not tested it on the other ARM64 platforms. It should work not only in = Azure, > but also in on-prem ARM64 Hyper-V hosts.=20 Well it=E2=80=99s in GENERIC now given that includes std.hyperv... > It's better to move Mellanox drivers to more general build location = once they are tested > on more ARM64 platforms. >=20 > Wei >=20 >>=20 >> Jess >>=20 >>>> These changes in conf and std.hyperv files got missed in previous = commit. >>>> Reviewed by: whu >>>> Tested by: whu >>>> Obtained from: Souradeep Chakrabarti >>>> Sponsored by: Microsoft >>>> Differential Revision: >>>>=20 >> https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Frev= >>>>=20 >> iews.freebsd.org%2FD38529&data=3D05%7C01%7Cweh%40microsoft.com%7C >> e49561 >>>>=20 >> fcb0054db78cfc08db244136f1%7C72f988bf86f141af91ab2d7cd011db47%7C1% >> 7C0 >>>> %7C638143634775142011%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4w >> LjAwMDAiLCJ >>>>=20 >> QIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdat >> a=3DYu% >>>> 2BY%2FyEVCjC6dj8UKY6pYeVy%2BAsgxar5DBC9XQlexYo%3D&reserved=3D0 >>>> --- >>>> sys/arm64/conf/std.hyperv | 12 +++++++++++- >>>> sys/conf/files.arm64 | 1 + >>>> 2 files changed, 12 insertions(+), 1 deletion(-) >>>>=20 >>>> diff --git a/sys/arm64/conf/std.hyperv b/sys/arm64/conf/std.hyperv >>>> index f87082f15c96..b742c75da131 100644 >>>> --- a/sys/arm64/conf/std.hyperv >>>> +++ b/sys/arm64/conf/std.hyperv >>>> @@ -3,4 +3,14 @@ >>>> # >>>>=20 >>>> #hyper-v support >>>> -device hyperv >>>> +device hyperv >>>> + >>>> +options COMPAT_LINUXKPI >>>> +device xz >>>> + >>>> +device mlx5 >>>> +device mlxfw >>>> +device mlx5en >>>> +options RATELIMIT As pointed out on IRC, no other kernel config, aside from LINT ones, enables this. Therefore this seems pretty dubious to add; why does arm64 need it whilst amd64, which does include Mellanox drivers in its GENERIC, doesn=E2=80=99t need it? Jess >>>> +options KERN_TLS >>>> +device firmware >>>> diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index >>>> 684cb8cb23ba..22dd267b2b42 100644 >>>> --- a/sys/conf/files.arm64 >>>> +++ b/sys/conf/files.arm64 >>>> @@ -253,6 +253,7 @@ dev/hyperv/utilities/hv_kvp.c >> optional hyperv acpi >>>> dev/hyperv/netvsc/hn_nvs.c optional hyperv acpi >>>> dev/hyperv/netvsc/hn_rndis.c optional hyperv = acpi >>>> dev/hyperv/netvsc/if_hn.c optional hyperv acpi >>>> +dev/hyperv/pcib/vmbus_pcib.c optional hyperv = pci >> acpi >>>>=20 >>>> dev/ice/if_ice_iflib.c optional ice pci = \ >>>> compile-with "${NORMAL_C} -I$S/dev/ice" >>>=20 >=20 From nobody Tue Mar 14 04:37:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbLNK2QF6z3xgfG for ; Tue, 14 Mar 2023 04:37:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbLNJ67lfz48Sv for ; Tue, 14 Mar 2023 04:37:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x529.google.com with SMTP id eh3so1132295edb.11 for ; Mon, 13 Mar 2023 21:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1678768639; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Mwr0+AsswWxSMiQJgYL//2oUnN543Z4lnmjmmfVcQs4=; b=mLPEBpgBLvzogrz2nMSnz2KENSgXoAv+0I2hcNjW3X2CyXXRDrNPxpImrnlvl75QqF KqmbTZ588j3JCMYOXFNVcfloElJh8xWsANKghq4ARQFFNM7flZuxKRiKdgvha+gHZugv 713pduuZCId1HokA2LET5DdSJtNrKlGO7rRlPsyELWPIJa4hcPy/wnR7Zaf45+15IuZP IlqS9gn+xv+3MVgACc1r4bFksq6/kjEk0xZhdX/5TdjJ9EbFyaEquU4Rzs7JwFepixDm FyaQ5/gV7GFJxzQV0ubbNDWIGR4B2aDZU4Uc9wt1twSOlPstSsNFbEOzp3UL8yzOfOTo zGNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678768639; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Mwr0+AsswWxSMiQJgYL//2oUnN543Z4lnmjmmfVcQs4=; b=IZ/q0ITh0TyZTKw70Zyt3M+1wXjkwSmmjJHpQsAE49Gtzx0j53dor/MLhYmj6WA4/2 BDoLUlFk1SfCj4VqarlmXunGEFkPbywqg2Cz8vE6AtpG8yA8uN+QK8S2oUqb8c8p6T19 RSXYrIJpdm1xRg9jgV/sHvsQV79muMttMI6vDNo5LEXXblqwt9LTuJYN1YgEt5WfSRI2 po3Q2K3NaUqgPuj7j6gOxQT+2RWvmOzYEY/9FBZhOnBvuZXmOaqtDNLE65Xqgbsg4azs H5GbeWZvYy4Stn+ZDmIuxZoOrFfwS11yFYdjm7wirp88fga2XpMT6vlOVWRePstXRUD/ V2Sw== X-Gm-Message-State: AO0yUKUveyUPuinBRlx/IQ42i3Kf4OnOVqrTPNOwk1g35cBooJeWY+CX luooUAWaed5+VdChe90A7DOTVKOqKcJjHrUWHqfHxQ== X-Google-Smtp-Source: AK7set+yblMnx9EZMgZZ0B5oHgG67sx4VeWYHlgFBkbz+HIuHBvDckJOv6txAKcs8kUCe3JoUYyHG5flig46tEAx/sA= X-Received: by 2002:a17:907:1b1f:b0:8b1:38d6:9853 with SMTP id mp31-20020a1709071b1f00b008b138d69853mr483418ejc.2.1678768639472; Mon, 13 Mar 2023 21:37:19 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 13 Mar 2023 22:37:07 -0600 Message-ID: Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv To: Jessica Clarke Cc: Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000006a8b8305f6d4c819" X-Rspamd-Queue-Id: 4PbLNJ67lfz48Sv X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --0000000000006a8b8305f6d4c819 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 13, 2023, 10:21 PM Jessica Clarke wrote: > On 14 Mar 2023, at 04:19, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76a= b3c808ae4 > > > > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 > > Author: lucy > > AuthorDate: 2023-03-13 22:01:12 +0000 > > Commit: Warner Losh > > CommitDate: 2023-03-14 04:19:24 +0000 > > > > Add GNU glibc compatible secure_getenv > > > > Add mostly glibc and msl compatible secure_getenv. Return NULL if > > issetugid() indicates the process is tainted, otherwise getenv(x). > The > > rational behind this is the fact that many Linux applications use th= is > > function instead of getenv() as it's widely consider a, "best > > practice". > > > > Reviewed by: imp, mjg (feedback) > > Pull Request: https://github.com/freebsd/freebsd-src/pull/686 > > Signed-off-by: Lucy Marsh > > --- > > include/stdlib.h | 1 + > > lib/libc/stdlib/Makefile.inc | 4 ++-- > > lib/libc/stdlib/Symbol.map | 1 + > > lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- > > lib/libc/stdlib/getenv.c | 12 ++++++++++++ > > 5 files changed, 41 insertions(+), 3 deletions(-) > > > > diff --git a/include/stdlib.h b/include/stdlib.h > > index 01629ed84a11..c41e8704e810 100644 > > --- a/include/stdlib.h > > +++ b/include/stdlib.h > > @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, > > int (* _Nonnull)(const void *, const void *)); > > int rand(void); > > void *realloc(void *, size_t) __result_use_check __alloc_size(2); > > +char *secure_getenv(const char *); > > void srand(unsigned); > > double strtod(const char * __restrict, char ** __restrict); > > float strtof(const char * __restrict, char ** __restrict); > > diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.in= c > > index 8ace2c051b82..964e7ce30594 100644 > > --- a/lib/libc/stdlib/Makefile.inc > > +++ b/lib/libc/stdlib/Makefile.inc > > @@ -46,8 +46,8 @@ MAN+=3D a64l.3 abort.3 abs.3 alloca.3 atexit.3 > atof.3 \ > > MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3 > > MLINKS+=3Datol.3 atoll.3 > > MLINKS+=3Dexit.3 _Exit.3 > > -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \ > > - getenv.3 unsetenv.3 > > +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 secure_getenv= .3 \ > > + getenv.3 setenv.3 getenv.3 unsetenv.3 > > MLINKS+=3Dgetopt_long.3 getopt_long_only.3 > > MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3 > > MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 > hsearch_r.3 > > diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map > > index 9d2944fdb7e9..a105f781734d 100644 > > --- a/lib/libc/stdlib/Symbol.map > > +++ b/lib/libc/stdlib/Symbol.map > > @@ -128,6 +128,7 @@ FBSD_1.6 { > > FBSD_1.7 { > > clearenv; > > qsort_r; > > + secure_getenv; > > }; > > > > FBSDprivate_1.0 { > > diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3 > > index 5566d7b01dcd..93c0d2ada6ad 100644 > > --- a/lib/libc/stdlib/getenv.3 > > +++ b/lib/libc/stdlib/getenv.3 > > @@ -32,13 +32,14 @@ > > .\" @(#)getenv.3 8.2 (Berkeley) 12/11/93 > > .\" $FreeBSD$ > > .\" > > -.Dd November 7, 2021 > > +.Dd March 13, 2023 > > .Dt GETENV 3 > > .Os > > .Sh NAME > > .Nm clearenv , > > .Nm getenv , > > .Nm putenv , > > +.Nm secure_getenv , > > .Nm setenv , > > .Nm unsetenv > > .Nd environment variable functions > > @@ -50,6 +51,8 @@ > > .Fn clearenv "void" > > .Ft char * > > .Fn getenv "const char *name" > > +.Ft char * > > +.Fn secure_getenv "const char *name" > > .Ft int > > .Fn setenv "const char *name" "const char *value" "int overwrite" > > .Ft int > > @@ -78,6 +81,20 @@ to by the > > .Fn getenv > > function. > > .Pp > > +The GNU-specific function, > > I don=E2=80=99t think it is now?.. > Yes... > +.Fn secure_getenv > > +wraps the > > +.Fn getenv > > +function to prevent it from being run in "secure execution". > > +Unlike in glibc, > > +.Fn secure_getenv > > +only checks if the > > +.Fa setuid > > +and > > +.Fa setgid > > +bits have been set or changed. > > +These checks are subject to extension and change. > > +.Pp > > The > > .Fn setenv > > function inserts or resets the environment variable > > @@ -139,6 +156,13 @@ is not in the current environment, > > .Dv NULL > > is returned. > > .Pp > > +The > > +.Fn secure_getenv > > +function returns > > +.Dv NULL > > +if the process is in "secure execution," otherwise it will call > > +.Fn getenv . > > +.Pp > > .Rv -std clearenv setenv putenv unsetenv > > .Sh ERRORS > > .Bl -tag -width Er > > diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c > > index 7ca27ab710c4..86a846d58c69 100644 > > --- a/lib/libc/stdlib/getenv.c > > +++ b/lib/libc/stdlib/getenv.c > > @@ -447,6 +447,18 @@ getenv(const char *name) > > } > > > > > > +/* > > + * Runs getenv() unless the current process is tainted by uid or gid > changes, in > > + * which case it will return NULL. > > + */ > > +char * > > +secure_getenv(const char *name) > > +{ > > + if (issetugid()) > > + return NULL; > > + return getenv(name); > > return (...); > > (x2) > style(9) says they are optional now so it's below my radar.... but honestly, it's good enough given the dozen other issues fixed in the pr. Though I'll see about adding git clang-format setup to check. I wrote a stupidly simple script to check 2 years ago and the commits coming in at the time had way more exceptions and variations than I thought I'd catch when I tested it out... but it could be turned into a gihub action easily enough I think. Warner Jess > > > +} > > + > > /* > > * Set the value of a variable. Older settings are labeled as > inactive. If an > > * older setting has enough room to store the new value, it will be > reused. No > > --0000000000006a8b8305f6d4c819 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Mar 13, 2023, 10:21 PM Jessica Clarke <jrtc27@freebsd.org> wrote:
On 14 Mar 2023, at 04:19, Warner Losh <= imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76= ab3c808ae4
>
> commit adeca21464d25bc61f98968a5c1e76ab3c808ae4
> Author:=C2=A0 =C2=A0 =C2=A0lucy <seafork@disroot.org>
> AuthorDate: 2023-03-13 22:01:12 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-03-14 04:19:24 +0000
>
>=C2=A0 =C2=A0 Add GNU glibc compatible secure_getenv
>
>=C2=A0 =C2=A0 Add mostly glibc and msl compatible secure_getenv. Return= NULL if
>=C2=A0 =C2=A0 issetugid() indicates the process is tainted, otherwise g= etenv(x).=C2=A0 The
>=C2=A0 =C2=A0 rational behind this is the fact that many Linux applicat= ions use this
>=C2=A0 =C2=A0 function instead of getenv() as it's widely consider = a, "best
>=C2=A0 =C2=A0 practice".
>
>=C2=A0 =C2=A0 Reviewed by: imp, mjg (feedback)
>=C2=A0 =C2=A0 Pull Request: https://gi= thub.com/freebsd/freebsd-src/pull/686
>=C2=A0 =C2=A0 Signed-off-by: Lucy Marsh <seafork@disroot.org>= ;
> ---
> include/stdlib.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2= =A0 1 +
> lib/libc/stdlib/Makefile.inc |=C2=A0 4 ++--
> lib/libc/stdlib/Symbol.map=C2=A0 =C2=A0|=C2=A0 1 +
> lib/libc/stdlib/getenv.3=C2=A0 =C2=A0 =C2=A0| 26 +++++++++++++++++++++= ++++-
> lib/libc/stdlib/getenv.c=C2=A0 =C2=A0 =C2=A0| 12 ++++++++++++
> 5 files changed, 41 insertions(+), 3 deletions(-)
>
> diff --git a/include/stdlib.h b/include/stdlib.h
> index 01629ed84a11..c41e8704e810 100644
> --- a/include/stdlib.h
> +++ b/include/stdlib.h
> @@ -111,6 +111,7 @@ void=C2=A0 =C2=A0 =C2=A0 =C2=A0qsort(void *, size_= t, size_t,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int (* _Nonnull)(const void *,= const void *));
> int=C2=A0 =C2=A0 rand(void);
> void=C2=A0 *realloc(void *, size_t) __result_use_check __alloc_size(2)= ;
> +char *secure_getenv(const char *);
> void=C2=A0 =C2=A0srand(unsigned);
> double=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strtod(const char * __restrict= , char ** __restrict);
> float=C2=A0 strtof(const char * __restrict, char ** __restrict);
> diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.i= nc
> index 8ace2c051b82..964e7ce30594 100644
> --- a/lib/libc/stdlib/Makefile.inc
> +++ b/lib/libc/stdlib/Makefile.inc
> @@ -46,8 +46,8 @@ MAN+=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0a64l.3 abort.3 abs= .3 alloca.3 atexit.3 atof.3 \
> MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3
> MLINKS+=3Datol.3 atoll.3
> MLINKS+=3Dexit.3 _Exit.3
> -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \ > -=C2=A0 =C2=A0 =C2=A0getenv.3 unsetenv.3
> +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 secure_geten= v.3 \
> +=C2=A0 =C2=A0 =C2=A0getenv.3 setenv.3 getenv.3 unsetenv.3
> MLINKS+=3Dgetopt_long.3 getopt_long_only.3
> MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3
> MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsear= ch_r.3
> diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map > index 9d2944fdb7e9..a105f781734d 100644
> --- a/lib/libc/stdlib/Symbol.map
> +++ b/lib/libc/stdlib/Symbol.map
> @@ -128,6 +128,7 @@ FBSD_1.6 {
> FBSD_1.7 {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0clearenv;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0qsort_r;
> +=C2=A0 =C2=A0 =C2=A0secure_getenv;
> };
>
> FBSDprivate_1.0 {
> diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3
> index 5566d7b01dcd..93c0d2ada6ad 100644
> --- a/lib/libc/stdlib/getenv.3
> +++ b/lib/libc/stdlib/getenv.3
> @@ -32,13 +32,14 @@
> .\"=C2=A0 =C2=A0 =C2=A0@(#)getenv.3=C2=A0 8.2 (Berkeley) 12/11/93=
> .\" $FreeBSD$
> .\"
> -.Dd November 7, 2021
> +.Dd March 13, 2023
> .Dt GETENV 3
> .Os
> .Sh NAME
> .Nm clearenv ,
> .Nm getenv ,
> .Nm putenv ,
> +.Nm secure_getenv ,
> .Nm setenv ,
> .Nm unsetenv
> .Nd environment variable functions
> @@ -50,6 +51,8 @@
> .Fn clearenv "void"
> .Ft char *
> .Fn getenv "const char *name"
> +.Ft char *
> +.Fn secure_getenv "const char *name"
> .Ft int
> .Fn setenv "const char *name" "const char *value" = "int overwrite"
> .Ft int
> @@ -78,6 +81,20 @@ to by the
> .Fn getenv
> function.
> .Pp
> +The GNU-specific function,

I don=E2=80=99t think it is now?..

Yes...

<= div dir=3D"auto">
> +.Fn secure_getenv
> +wraps the
> +.Fn getenv
> +function to prevent it from being run in "secure execution"= .
> +Unlike in glibc,
> +.Fn secure_getenv
> +only checks if the
> +.Fa setuid
> +and
> +.Fa setgid
> +bits have been set or changed.
> +These checks are subject to extension and change.
> +.Pp
> The
> .Fn setenv
> function inserts or resets the environment variable
> @@ -139,6 +156,13 @@ is not in the current environment,
> .Dv NULL
> is returned.
> .Pp
> +The
> +.Fn secure_getenv
> +function returns
> +.Dv NULL
> +if the process is in "secure execution," otherwise it will = call
> +.Fn getenv .
> +.Pp
> .Rv -std clearenv setenv putenv unsetenv
> .Sh ERRORS
> .Bl -tag -width Er
> diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c
> index 7ca27ab710c4..86a846d58c69 100644
> --- a/lib/libc/stdlib/getenv.c
> +++ b/lib/libc/stdlib/getenv.c
> @@ -447,6 +447,18 @@ getenv(const char *name)
> }
>
>
> +/*
> + * Runs getenv() unless the current process is tainted by uid or gid = changes, in
> + * which case it will return NULL.
> + */
> +char *
> +secure_getenv(const char *name)
> +{
> +=C2=A0 =C2=A0 =C2=A0if (issetugid())
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return NULL;
> +=C2=A0 =C2=A0 =C2=A0return getenv(name);

return (...);

(x2)

style(9) says they are optional now so it's below my radar.... but = honestly, it's good enough given the dozen other issues fixed in the pr= .

Though I'll see ab= out adding git clang-format setup to check. I wrote a stupidly simple scrip= t to check 2 years ago and the commits coming in at the time had way more e= xceptions and variations than I thought I'd catch when I tested it out.= .. but it could be turned into a gihub action easily enough I think.
<= div dir=3D"auto">
Warner=C2=A0

Jess

> +}
> +
> /*
>=C2=A0 * Set the value of a variable.=C2=A0 Older settings are labeled = as inactive.=C2=A0 If an
>=C2=A0 * older setting has enough room to store the new value, it will = be reused.=C2=A0 No

--0000000000006a8b8305f6d4c819-- From nobody Tue Mar 14 04:45:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbLYJ1VBkz3xhJD for ; Tue, 14 Mar 2023 04:45:08 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbLYH6lwyz4CQP for ; Tue, 14 Mar 2023 04:45:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f42.google.com with SMTP id m18-20020a05600c3b1200b003ed2a3d635eso1490043wms.4 for ; Mon, 13 Mar 2023 21:45:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678769106; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vgeKdlgMAEslWEtZhVzLVG7D72fW8krx49x0Ou4A+UA=; b=4PqRxAKmxYwP87wSDskSGoCA0l90blroBkplR2KNvVz1Pl0VpaBPk18b3Narp+sxUy 1cDNNt/S+2YFyFcWQSujSsjurx7gDdiS6+htxALUCjzRf1Mw107UX3GSR7onh0OpWc7g AgYq444W+sExh8Jz8RPRGOCsLSbUO0uTxH0ZW/N/b5OnxXiDagMr1zFoCVXL4c1x6RuD j8+vEWBBHDAOwh9uiaRUkZJRAbpeHKMspFTSVBbnly311MtgG7NyttWd42xpIZaNOHwc 3pExOeVVoWvdJfkU3k3NDgbrijB6f9s2j4K116yPxCD2EqWenGpVfVIukN8LL3Fop69c uQTw== X-Gm-Message-State: AO0yUKUBm5iASzfuuzgnw5W8sON084EQ4lq3uoC/6jReHfXPHYLdpDnT puaPrlwyW0rPmY2Ibf8lXIKZTg== X-Google-Smtp-Source: AK7set+q2xQ4uxY50eW1QGDuWHNdN1GypGZ9/SZAdJ9OwiamrL0dBr/m275YeDzO+iuyBdHw3B/iLw== X-Received: by 2002:a1c:f60a:0:b0:3eb:3947:41ea with SMTP id w10-20020a1cf60a000000b003eb394741eamr13543305wmc.37.1678769106161; Mon, 13 Mar 2023 21:45:06 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id c24-20020a7bc018000000b003ed2357f7f1sm1495540wmb.37.2023.03.13.21.45.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2023 21:45:05 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv From: Jessica Clarke In-Reply-To: Date: Tue, 14 Mar 2023 04:45:05 +0000 Cc: Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PbLYH6lwyz4CQP X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 14 Mar 2023, at 04:37, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Mar 13, 2023, 10:21 PM Jessica Clarke = wrote: > On 14 Mar 2023, at 04:19, Warner Losh wrote: > >=20 > > The branch main has been updated by imp: > >=20 > > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76ab= 3c808ae4 > >=20 > > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 > > Author: lucy > > AuthorDate: 2023-03-13 22:01:12 +0000 > > Commit: Warner Losh > > CommitDate: 2023-03-14 04:19:24 +0000 > >=20 > > Add GNU glibc compatible secure_getenv > >=20 > > Add mostly glibc and msl compatible secure_getenv. Return NULL if > > issetugid() indicates the process is tainted, otherwise = getenv(x). The > > rational behind this is the fact that many Linux applications use = this > > function instead of getenv() as it's widely consider a, "best > > practice". > >=20 > > Reviewed by: imp, mjg (feedback) > > Pull Request: https://github.com/freebsd/freebsd-src/pull/686 > > Signed-off-by: Lucy Marsh > > --- > > include/stdlib.h | 1 + > > lib/libc/stdlib/Makefile.inc | 4 ++-- > > lib/libc/stdlib/Symbol.map | 1 + > > lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- > > lib/libc/stdlib/getenv.c | 12 ++++++++++++ > > 5 files changed, 41 insertions(+), 3 deletions(-) > >=20 > > diff --git a/include/stdlib.h b/include/stdlib.h > > index 01629ed84a11..c41e8704e810 100644 > > --- a/include/stdlib.h > > +++ b/include/stdlib.h > > @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, > > int (* _Nonnull)(const void *, const void *)); > > int rand(void); > > void *realloc(void *, size_t) __result_use_check __alloc_size(2); > > +char *secure_getenv(const char *); > > void srand(unsigned); > > double strtod(const char * __restrict, char ** __restrict); > > float strtof(const char * __restrict, char ** __restrict); > > diff --git a/lib/libc/stdlib/Makefile.inc = b/lib/libc/stdlib/Makefile.inc > > index 8ace2c051b82..964e7ce30594 100644 > > --- a/lib/libc/stdlib/Makefile.inc > > +++ b/lib/libc/stdlib/Makefile.inc > > @@ -46,8 +46,8 @@ MAN+=3D a64l.3 abort.3 abs.3 alloca.3 = atexit.3 atof.3 \ > > MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3 > > MLINKS+=3Datol.3 atoll.3 > > MLINKS+=3Dexit.3 _Exit.3 > > -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \ > > - getenv.3 unsetenv.3 > > +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 = secure_getenv.3 \ > > + getenv.3 setenv.3 getenv.3 unsetenv.3 > > MLINKS+=3Dgetopt_long.3 getopt_long_only.3 > > MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3 > > MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 = hsearch_r.3 > > diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map > > index 9d2944fdb7e9..a105f781734d 100644 > > --- a/lib/libc/stdlib/Symbol.map > > +++ b/lib/libc/stdlib/Symbol.map > > @@ -128,6 +128,7 @@ FBSD_1.6 { > > FBSD_1.7 { > > clearenv; > > qsort_r; > > + secure_getenv; > > }; > >=20 > > FBSDprivate_1.0 { > > diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3 > > index 5566d7b01dcd..93c0d2ada6ad 100644 > > --- a/lib/libc/stdlib/getenv.3 > > +++ b/lib/libc/stdlib/getenv.3 > > @@ -32,13 +32,14 @@ > > .\" @(#)getenv.3 8.2 (Berkeley) 12/11/93 > > .\" $FreeBSD$ > > .\" > > -.Dd November 7, 2021 > > +.Dd March 13, 2023 > > .Dt GETENV 3 > > .Os > > .Sh NAME > > .Nm clearenv , > > .Nm getenv , > > .Nm putenv , > > +.Nm secure_getenv , > > .Nm setenv , > > .Nm unsetenv > > .Nd environment variable functions > > @@ -50,6 +51,8 @@ > > .Fn clearenv "void" > > .Ft char * > > .Fn getenv "const char *name" > > +.Ft char * > > +.Fn secure_getenv "const char *name" > > .Ft int > > .Fn setenv "const char *name" "const char *value" "int overwrite" > > .Ft int > > @@ -78,6 +81,20 @@ to by the > > .Fn getenv > > function. > > .Pp > > +The GNU-specific function, >=20 > I don=E2=80=99t think it is now?.. >=20 > Yes... >=20 > > +.Fn secure_getenv > > +wraps the > > +.Fn getenv > > +function to prevent it from being run in "secure execution". > > +Unlike in glibc, > > +.Fn secure_getenv > > +only checks if the > > +.Fa setuid > > +and > > +.Fa setgid > > +bits have been set or changed. > > +These checks are subject to extension and change. > > +.Pp > > The > > .Fn setenv > > function inserts or resets the environment variable > > @@ -139,6 +156,13 @@ is not in the current environment, > > .Dv NULL > > is returned. > > .Pp > > +The > > +.Fn secure_getenv > > +function returns > > +.Dv NULL > > +if the process is in "secure execution," otherwise it will call > > +.Fn getenv . > > +.Pp > > .Rv -std clearenv setenv putenv unsetenv > > .Sh ERRORS > > .Bl -tag -width Er > > diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c > > index 7ca27ab710c4..86a846d58c69 100644 > > --- a/lib/libc/stdlib/getenv.c > > +++ b/lib/libc/stdlib/getenv.c > > @@ -447,6 +447,18 @@ getenv(const char *name) > > } > >=20 > >=20 > > +/* > > + * Runs getenv() unless the current process is tainted by uid or = gid changes, in > > + * which case it will return NULL. > > + */ > > +char * > > +secure_getenv(const char *name) > > +{ > > + if (issetugid()) > > + return NULL; > > + return getenv(name); >=20 > return (...); >=20 > (x2) >=20 > style(9) says they are optional now so it's below my radar.... but = honestly, it's good enough given the dozen other issues fixed in the pr. I still see "Values in return statements should be enclosed in parentheses."? Which isn=E2=80=99t an RFC SHOULD, much of style(9) is = should rather than must. Jess > Though I'll see about adding git clang-format setup to check. I wrote = a stupidly simple script to check 2 years ago and the commits coming in = at the time had way more exceptions and variations than I thought I'd = catch when I tested it out... but it could be turned into a gihub action = easily enough I think. >=20 > Warner=20 >=20 > Jess >=20 > > +} > > + > > /* > > * Set the value of a variable. Older settings are labeled as = inactive. If an > > * older setting has enough room to store the new value, it will be = reused. No From nobody Tue Mar 14 05:03:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbLyp0dVSz3xjYN for ; Tue, 14 Mar 2023 05:03:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbLyn3kwFz4Drw for ; Tue, 14 Mar 2023 05:03:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x531.google.com with SMTP id y4so27726759edo.2 for ; Mon, 13 Mar 2023 22:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1678770224; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PfudQYaNhzLovwnem6JcPuFFdP1AAD76qF6+pJqcUbA=; b=pr03Rc7/9qGLGXfRNah8ziRRKITf1W406dJuXXz9NyAyKdcOakjHAbK1Vh209YMqmJ bjvrIXykEuhz1OV0h8FbIHSwHfuC7bME1vO3le3O4IQ2xHdaQJaibh29lk0tr1Z92/g6 e/0bCDKe5aWGzblEVQjlmjDv7jKJlVs9WNE5dc17Vsy8Pdlq0Oeu7+cUBW9hVWadsEtX 9ViMyaCsHRijcw4luDcmoGc9zspEWB8BLJazSVHFQspQ9+i/B+1bRNKvjvrDfpsqpSD2 p0TF6/9PikjCzkcd4t9pBr9uMzYqrQ1MxvmuODBhHTsvzZUniHg0p5EKUhztJOn0EltH h91A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678770224; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PfudQYaNhzLovwnem6JcPuFFdP1AAD76qF6+pJqcUbA=; b=N/yaodGj1AXK8EEI2GvxmE/MIh1ICGGjfbd99Se1RCX1dEDLREKZFVDuBIED4weTED LspyrCx92HUa9el+qsRFQJ+w8341xN+IpdHQ/Mtj7nN/NDEZ08n1lZv7Ru2vT45sg8at lCttPL3QgF02je6wo7enwdkkM9H+ouh1iMmxSwY3LB2h4YR0+6GijfdupePF4E2ZQCAA ymoLdf3mcTk3SS3srAf24BLoYKaxK3zBNEYF2pRW/+hzsiHx5/eYZMbqdpy50frwCCjZ e89U5MJFJZU/dSqnjJDvpKPnUet4+nGJCsGRWc4rWhVn6iNi3TGIoLxjnuw82R5Ngjs+ rr1Q== X-Gm-Message-State: AO0yUKWTzIjKf3De/d19+j/7mmC4pOC9gUaUkwc/rj2S9LVYtbnWnZ5/ hlGSYCqilRnTNX/cH9lfXt2y6EBcHfXgMiiwkWkZrg== X-Google-Smtp-Source: AK7set+ApGku72amcXqcExCZfybhfnnuOcuZR3X3v5jyebCvubjwoLTQnQUZ6MaQ4uhPPUFPkRfnSOQyV6qAz5Kfe+c= X-Received: by 2002:a17:906:c30e:b0:8ad:d366:54c4 with SMTP id s14-20020a170906c30e00b008add36654c4mr573700ejz.4.1678770224017; Mon, 13 Mar 2023 22:03:44 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 13 Mar 2023 23:03:33 -0600 Message-ID: Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv To: Jessica Clarke Cc: Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000dcc71305f6d52663" X-Rspamd-Queue-Id: 4PbLyn3kwFz4Drw X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000dcc71305f6d52663 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 13, 2023, 10:45 PM Jessica Clarke wrote: > On 14 Mar 2023, at 04:37, Warner Losh wrote: > > > > > > > > On Mon, Mar 13, 2023, 10:21 PM Jessica Clarke > wrote: > > On 14 Mar 2023, at 04:19, Warner Losh wrote: > > > > > > The branch main has been updated by imp: > > > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76a= b3c808ae4 > > > > > > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 > > > Author: lucy > > > AuthorDate: 2023-03-13 22:01:12 +0000 > > > Commit: Warner Losh > > > CommitDate: 2023-03-14 04:19:24 +0000 > > > > > > Add GNU glibc compatible secure_getenv > > > > > > Add mostly glibc and msl compatible secure_getenv. Return NULL if > > > issetugid() indicates the process is tainted, otherwise getenv(x). > The > > > rational behind this is the fact that many Linux applications use > this > > > function instead of getenv() as it's widely consider a, "best > > > practice". > > > > > > Reviewed by: imp, mjg (feedback) > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/686 > > > Signed-off-by: Lucy Marsh > > > --- > > > include/stdlib.h | 1 + > > > lib/libc/stdlib/Makefile.inc | 4 ++-- > > > lib/libc/stdlib/Symbol.map | 1 + > > > lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- > > > lib/libc/stdlib/getenv.c | 12 ++++++++++++ > > > 5 files changed, 41 insertions(+), 3 deletions(-) > > > > > > diff --git a/include/stdlib.h b/include/stdlib.h > > > index 01629ed84a11..c41e8704e810 100644 > > > --- a/include/stdlib.h > > > +++ b/include/stdlib.h > > > @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, > > > int (* _Nonnull)(const void *, const void *)); > > > int rand(void); > > > void *realloc(void *, size_t) __result_use_check __alloc_size(2); > > > +char *secure_getenv(const char *); > > > void srand(unsigned); > > > double strtod(const char * __restrict, char ** __restrict); > > > float strtof(const char * __restrict, char ** __restrict); > > > diff --git a/lib/libc/stdlib/Makefile.inc > b/lib/libc/stdlib/Makefile.inc > > > index 8ace2c051b82..964e7ce30594 100644 > > > --- a/lib/libc/stdlib/Makefile.inc > > > +++ b/lib/libc/stdlib/Makefile.inc > > > @@ -46,8 +46,8 @@ MAN+=3D a64l.3 abort.3 abs.3 alloca.3 atexit.= 3 > atof.3 \ > > > MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3 > > > MLINKS+=3Datol.3 atoll.3 > > > MLINKS+=3Dexit.3 _Exit.3 > > > -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \ > > > - getenv.3 unsetenv.3 > > > +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 > secure_getenv.3 \ > > > + getenv.3 setenv.3 getenv.3 unsetenv.3 > > > MLINKS+=3Dgetopt_long.3 getopt_long_only.3 > > > MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3 > > > MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 > hsearch_r.3 > > > diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map > > > index 9d2944fdb7e9..a105f781734d 100644 > > > --- a/lib/libc/stdlib/Symbol.map > > > +++ b/lib/libc/stdlib/Symbol.map > > > @@ -128,6 +128,7 @@ FBSD_1.6 { > > > FBSD_1.7 { > > > clearenv; > > > qsort_r; > > > + secure_getenv; > > > }; > > > > > > FBSDprivate_1.0 { > > > diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3 > > > index 5566d7b01dcd..93c0d2ada6ad 100644 > > > --- a/lib/libc/stdlib/getenv.3 > > > +++ b/lib/libc/stdlib/getenv.3 > > > @@ -32,13 +32,14 @@ > > > .\" @(#)getenv.3 8.2 (Berkeley) 12/11/93 > > > .\" $FreeBSD$ > > > .\" > > > -.Dd November 7, 2021 > > > +.Dd March 13, 2023 > > > .Dt GETENV 3 > > > .Os > > > .Sh NAME > > > .Nm clearenv , > > > .Nm getenv , > > > .Nm putenv , > > > +.Nm secure_getenv , > > > .Nm setenv , > > > .Nm unsetenv > > > .Nd environment variable functions > > > @@ -50,6 +51,8 @@ > > > .Fn clearenv "void" > > > .Ft char * > > > .Fn getenv "const char *name" > > > +.Ft char * > > > +.Fn secure_getenv "const char *name" > > > .Ft int > > > .Fn setenv "const char *name" "const char *value" "int overwrite" > > > .Ft int > > > @@ -78,6 +81,20 @@ to by the > > > .Fn getenv > > > function. > > > .Pp > > > +The GNU-specific function, > > > > I don=E2=80=99t think it is now?.. > > > > Yes... > > > > > +.Fn secure_getenv > > > +wraps the > > > +.Fn getenv > > > +function to prevent it from being run in "secure execution". > > > +Unlike in glibc, > > > +.Fn secure_getenv > > > +only checks if the > > > +.Fa setuid > > > +and > > > +.Fa setgid > > > +bits have been set or changed. > > > +These checks are subject to extension and change. > > > +.Pp > > > The > > > .Fn setenv > > > function inserts or resets the environment variable > > > @@ -139,6 +156,13 @@ is not in the current environment, > > > .Dv NULL > > > is returned. > > > .Pp > > > +The > > > +.Fn secure_getenv > > > +function returns > > > +.Dv NULL > > > +if the process is in "secure execution," otherwise it will call > > > +.Fn getenv . > > > +.Pp > > > .Rv -std clearenv setenv putenv unsetenv > > > .Sh ERRORS > > > .Bl -tag -width Er > > > diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c > > > index 7ca27ab710c4..86a846d58c69 100644 > > > --- a/lib/libc/stdlib/getenv.c > > > +++ b/lib/libc/stdlib/getenv.c > > > @@ -447,6 +447,18 @@ getenv(const char *name) > > > } > > > > > > > > > +/* > > > + * Runs getenv() unless the current process is tainted by uid or gid > changes, in > > > + * which case it will return NULL. > > > + */ > > > +char * > > > +secure_getenv(const char *name) > > > +{ > > > + if (issetugid()) > > > + return NULL; > > > + return getenv(name); > > > > return (...); > > > > (x2) > > > > style(9) says they are optional now so it's below my radar.... but > honestly, it's good enough given the dozen other issues fixed in the pr. > > I still see "Values in return statements should be enclosed in > parentheses."? Which isn=E2=80=99t an RFC SHOULD, much of style(9) is sho= uld > rather than must. > We need to do a pass to use rfc language. In this case, thought it's been encouraged but not required for a long time. I added the explicit language years ago since it was only by example prior to that. I thought this was one of the many lossenings we've had over the years, but if so there's been no update since I added the should language... I know I've committed a lot of new code without it over the years... It may just have been a combo of many other projects forbidding the practice and it was one of the variations my script found... I'll have to go find the script to see. But like I said before... git clang-format... Warner Jess > > > Though I'll see about adding git clang-format setup to check. I wrote a > stupidly simple script to check 2 years ago and the commits coming in at > the time had way more exceptions and variations than I thought I'd catch > when I tested it out... but it could be turned into a gihub action easily > enough I think. > > > > Warner > > > > Jess > > > > > +} > > > + > > > /* > > > * Set the value of a variable. Older settings are labeled as > inactive. If an > > > * older setting has enough room to store the new value, it will be > reused. No > > --000000000000dcc71305f6d52663 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Mar 13, 2023, 10:45 PM Jessica Clarke <jrtc= 27@freebsd.org> wrote:
On 14= Mar 2023, at 04:37, Warner Losh <imp@bsdimp.com> wrote:<= br> >
>
>
> On Mon, Mar 13, 2023, 10:21 PM Jessica Clarke <jrtc27@fr= eebsd.org> wrote:
> On 14 Mar 2023, at 04:19, Warner Losh <imp@FreeBSD.org> wrote: > >
> > The branch main has been updated by imp:
> >
> > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25b= c61f98968a5c1e76ab3c808ae4
> >
> > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4
> > Author:=C2=A0 =C2=A0 =C2=A0lucy <seafork@disroot.o= rg>
> > AuthorDate: 2023-03-13 22:01:12 +0000
> > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org> > > CommitDate: 2023-03-14 04:19:24 +0000
> >
> >=C2=A0 =C2=A0 Add GNU glibc compatible secure_getenv
> >
> >=C2=A0 =C2=A0 Add mostly glibc and msl compatible secure_getenv. R= eturn NULL if
> >=C2=A0 =C2=A0 issetugid() indicates the process is tainted, otherw= ise getenv(x).=C2=A0 The
> >=C2=A0 =C2=A0 rational behind this is the fact that many Linux app= lications use this
> >=C2=A0 =C2=A0 function instead of getenv() as it's widely cons= ider a, "best
> >=C2=A0 =C2=A0 practice".
> >
> >=C2=A0 =C2=A0 Reviewed by: imp, mjg (feedback)
> >=C2=A0 =C2=A0 Pull Request: https://github.com/freebsd/freebsd-src/pull/686
> >=C2=A0 =C2=A0 Signed-off-by: Lucy Marsh <seafork@di= sroot.org>
> > ---
> > include/stdlib.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|= =C2=A0 1 +
> > lib/libc/stdlib/Makefile.inc |=C2=A0 4 ++--
> > lib/libc/stdlib/Symbol.map=C2=A0 =C2=A0|=C2=A0 1 +
> > lib/libc/stdlib/getenv.3=C2=A0 =C2=A0 =C2=A0| 26 ++++++++++++++++= +++++++++-
> > lib/libc/stdlib/getenv.c=C2=A0 =C2=A0 =C2=A0| 12 ++++++++++++
> > 5 files changed, 41 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/stdlib.h b/include/stdlib.h
> > index 01629ed84a11..c41e8704e810 100644
> > --- a/include/stdlib.h
> > +++ b/include/stdlib.h
> > @@ -111,6 +111,7 @@ void=C2=A0 =C2=A0 =C2=A0 =C2=A0qsort(void *, = size_t, size_t,
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int (* _Nonnull)(const vo= id *, const void *));
> > int=C2=A0 =C2=A0 rand(void);
> > void=C2=A0 *realloc(void *, size_t) __result_use_check __alloc_si= ze(2);
> > +char *secure_getenv(const char *);
> > void=C2=A0 =C2=A0srand(unsigned);
> > double=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strtod(const char * __res= trict, char ** __restrict);
> > float=C2=A0 strtof(const char * __restrict, char ** __restrict);<= br> > > diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makef= ile.inc
> > index 8ace2c051b82..964e7ce30594 100644
> > --- a/lib/libc/stdlib/Makefile.inc
> > +++ b/lib/libc/stdlib/Makefile.inc
> > @@ -46,8 +46,8 @@ MAN+=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0a64l.3 abort.= 3 abs.3 alloca.3 atexit.3 atof.3 \
> > MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3
> > MLINKS+=3Datol.3 atoll.3
> > MLINKS+=3Dexit.3 _Exit.3
> > -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.= 3 \
> > -=C2=A0 =C2=A0 =C2=A0getenv.3 unsetenv.3
> > +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 secure_= getenv.3 \
> > +=C2=A0 =C2=A0 =C2=A0getenv.3 setenv.3 getenv.3 unsetenv.3
> > MLINKS+=3Dgetopt_long.3 getopt_long_only.3
> > MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3
> > MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 = hsearch_r.3
> > diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.= map
> > index 9d2944fdb7e9..a105f781734d 100644
> > --- a/lib/libc/stdlib/Symbol.map
> > +++ b/lib/libc/stdlib/Symbol.map
> > @@ -128,6 +128,7 @@ FBSD_1.6 {
> > FBSD_1.7 {
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0clearenv;
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0qsort_r;
> > +=C2=A0 =C2=A0 =C2=A0secure_getenv;
> > };
> >
> > FBSDprivate_1.0 {
> > diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3<= br> > > index 5566d7b01dcd..93c0d2ada6ad 100644
> > --- a/lib/libc/stdlib/getenv.3
> > +++ b/lib/libc/stdlib/getenv.3
> > @@ -32,13 +32,14 @@
> > .\"=C2=A0 =C2=A0 =C2=A0@(#)getenv.3=C2=A0 8.2 (Berkeley) 12/= 11/93
> > .\" $FreeBSD$
> > .\"
> > -.Dd November 7, 2021
> > +.Dd March 13, 2023
> > .Dt GETENV 3
> > .Os
> > .Sh NAME
> > .Nm clearenv ,
> > .Nm getenv ,
> > .Nm putenv ,
> > +.Nm secure_getenv ,
> > .Nm setenv ,
> > .Nm unsetenv
> > .Nd environment variable functions
> > @@ -50,6 +51,8 @@
> > .Fn clearenv "void"
> > .Ft char *
> > .Fn getenv "const char *name"
> > +.Ft char *
> > +.Fn secure_getenv "const char *name"
> > .Ft int
> > .Fn setenv "const char *name" "const char *value&q= uot; "int overwrite"
> > .Ft int
> > @@ -78,6 +81,20 @@ to by the
> > .Fn getenv
> > function.
> > .Pp
> > +The GNU-specific function,
>
> I don=E2=80=99t think it is now?..
>
> Yes...
>
> > +.Fn secure_getenv
> > +wraps the
> > +.Fn getenv
> > +function to prevent it from being run in "secure execution&= quot;.
> > +Unlike in glibc,
> > +.Fn secure_getenv
> > +only checks if the
> > +.Fa setuid
> > +and
> > +.Fa setgid
> > +bits have been set or changed.
> > +These checks are subject to extension and change.
> > +.Pp
> > The
> > .Fn setenv
> > function inserts or resets the environment variable
> > @@ -139,6 +156,13 @@ is not in the current environment,
> > .Dv NULL
> > is returned.
> > .Pp
> > +The
> > +.Fn secure_getenv
> > +function returns
> > +.Dv NULL
> > +if the process is in "secure execution," otherwise it = will call
> > +.Fn getenv .
> > +.Pp
> > .Rv -std clearenv setenv putenv unsetenv
> > .Sh ERRORS
> > .Bl -tag -width Er
> > diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c<= br> > > index 7ca27ab710c4..86a846d58c69 100644
> > --- a/lib/libc/stdlib/getenv.c
> > +++ b/lib/libc/stdlib/getenv.c
> > @@ -447,6 +447,18 @@ getenv(const char *name)
> > }
> >
> >
> > +/*
> > + * Runs getenv() unless the current process is tainted by uid or= gid changes, in
> > + * which case it will return NULL.
> > + */
> > +char *
> > +secure_getenv(const char *name)
> > +{
> > +=C2=A0 =C2=A0 =C2=A0if (issetugid())
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return NULL;
> > +=C2=A0 =C2=A0 =C2=A0return getenv(name);
>
> return (...);
>
> (x2)
>
> style(9) says they are optional now so it's below my radar.... but= honestly, it's good enough given the dozen other issues fixed in the p= r.

I still see "Values in return statements should be enclosed in
parentheses."? Which isn=E2=80=99t an RFC SHOULD, much of style(9) is = should
rather than must.

<= div dir=3D"auto">We need to do a pass to use rfc language. In this case,=C2= =A0 thought it's been encouraged but not required for a long time. I ad= ded the explicit language years ago since it was only by example prior to t= hat. I thought this was one of the many lossenings we've had over the y= ears, but if so there's been no update since I added the should languag= e... I know I've committed a lot of new code without it over the years.= ..

It may just have been= a combo of many other projects forbidding the practice and it was one of t= he variations my script found... I'll have to go find the script to see= .

But like I said before= ... git clang-format...

= Warner

Jess

> Though I'll see about adding git clang-format setup to check. I wr= ote a stupidly simple script to check 2 years ago and the commits coming in= at the time had way more exceptions and variations than I thought I'd = catch when I tested it out... but it could be turned into a gihub action ea= sily enough I think.
>
> Warner
>
> Jess
>
> > +}
> > +
> > /*
> >=C2=A0 * Set the value of a variable.=C2=A0 Older settings are lab= eled as inactive.=C2=A0 If an
> >=C2=A0 * older setting has enough room to store the new value, it = will be reused.=C2=A0 No

--000000000000dcc71305f6d52663-- From nobody Tue Mar 14 06:56:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbPSQ5Gzbz3xqGw for ; Tue, 14 Mar 2023 06:56:06 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2072a.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::72a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbPSQ1yDzz4MFG; Tue, 14 Mar 2023 06:56:06 +0000 (UTC) (envelope-from weh@microsoft.com) Authentication-Results: mx1.freebsd.org; none ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M0WSM/Fa1tZaXO3I4TSlOkXaeHPsrl3tr2n7xJ+Ermsq9PGsesxxkWT3ls5J9YXxv1vyYXoD3ItBIDoPU30uIBh0EGQMjgFrtFZooJ5Fg/Pvhp9VVQB/zWQ/Bq+R6YXyXHakIlKF65h8zB0ziG29vVuunKnjp/0MGNynuQBa99+3M0BQVbMUYPkutq847Ov9nVNENoULlSNeU1RL2nkPJr2o7M3FbFn1q52IkEJxkcBQgr6dt9Dt7lCJNn1esYuARSX1/ppQmUPe5Vb0IVwOVLFUDYU/5QcmpNmVvjvOD001K4m6NG6ijHWqnvzd9FgfUBvKKReDVRafRgWCFjiDpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2WJWJUbNyxAAABd0jShsbeddtzKY8R3yESlrdqVkwPk=; b=L8luOTUeurd28uYZ73HeymDMysHHFd/LYbgjh++MRx3tSvquf1guJPGCyivprnuxI6FSP6CIl6E5E9F17SeoaXeZGzXik8flBFU6hjMNfOACKxdHJlYYJPoWrVQoRj5dDyAY23ldbc9gmQntDvaxdLH8txEmetIxsgxXly3elPbmi7i+qtNdN5O6nQHJhfxdXmYCrsOgWqV0gWMZD6osrxNI9fBPr+tkUIZ9raZgesmsoYPgMPQInypi4SFF/diudijul68VCn8Atg58+vAuAuErAQ+nbgZlacMYRKMKOdOhlsrDlNYjlQlaBzakTnioao3Mjh/+outEQK8wxBV/JQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2WJWJUbNyxAAABd0jShsbeddtzKY8R3yESlrdqVkwPk=; b=WmNTjhTT6LRKeuKE02FAJZNQWIZsv7jwdHljDsPToXOlIHZKUjgDXx5ep5uY18cpwWJRDSDp5cfTzj5ll8PWBOPOs5PvuGCvQDdcAJ8r5G3Dx26nij8blerT7n60U6ulYZTgY28Zsr+0LZCoSdO9bN4wReux+cgiljp+tK02DUw= Received: from SI2P153MB0441.APCP153.PROD.OUTLOOK.COM (2603:1096:4:fc::7) by TY0P153MB0783.APCP153.PROD.OUTLOOK.COM (2603:1096:400:27b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.3; Tue, 14 Mar 2023 06:56:00 +0000 Received: from SI2P153MB0441.APCP153.PROD.OUTLOOK.COM ([fe80::a485:7ae4:263d:c862]) by SI2P153MB0441.APCP153.PROD.OUTLOOK.COM ([fe80::a485:7ae4:263d:c862%6]) with mapi id 15.20.6222.005; Tue, 14 Mar 2023 06:56:00 +0000 From: Wei Hu To: Jessica Clarke CC: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" Subject: RE: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build Thread-Topic: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build Thread-Index: AQHZVVf8e0xpclVc8EGc2s8MLWSZgK75p3KAgAACAACAAAF/kIAABb0AgAAmYeA= Date: Tue, 14 Mar 2023 06:56:00 +0000 Message-ID: References: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> <4F72E2FD-6E84-40F1-981D-A18C8DE22FDD@freebsd.org> <3D6476D5-807E-4D9A-87BC-F5916FBEBE5B@freebsd.org> In-Reply-To: <3D6476D5-807E-4D9A-87BC-F5916FBEBE5B@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=350372fb-74b4-4f87-a362-6d618738203f;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-03-14T06:47:41Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SI2P153MB0441:EE_|TY0P153MB0783:EE_ x-ms-office365-filtering-correlation-id: 6eb53a13-550b-41d0-e633-08db24592b9f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: X0lNKO+P8YcK4iT7hym3zoox/gbNqfe2NCruLviWD/0FkJalkyyp5hsWry9qanauKUMlOdWkJCDzB/BzeIY0NKW4oKHfV5KEchHYKtnP/VHUY+rx7WGjsZ7cXiCPLshB1rXmGvw4r/GMkliEMx0UkZtqPdRsVdl7bgs1oIhqKPvVJqgxsmJYcVX7xDT7wix1pc6CoZkvC3CaPguCBrzYBhf0P1sRW8ZcKPzEKPIbPyLfPpQgrqhiMeYokyDWHmPFunClOT4QgYgLZcpoPL84WbZFDAChRpUmoFjNNhg/Le+eoTY1H4zkidHFTGZifrcXBN4NCnG3kJ+CU4AbfrapvTcaBj3Mev+Z2mjQXE4Ze1yq/WFiBKx3OL6ukCubi9vOZSorUZ1NvEzBqDFJFHWJTZsajbThceCLTQHSYdtZIfVxW3r1joIBdZvETMIX3WErEJLiBM1UqpnqnuN2NOpopmJpsSgIZzFEZafvI0iKBmHEg72cSEUXEXjUzC77XHgUZNBa45K8BE7bSRXTw81600hn161Z0iEYDR5Z/eGrxkP68blM51AwgwM7hK+uwH91CKoCgIPYCzqEPQLRjuo6XcJH1WPoo2O34Jjq5YhSMoBeSoBgY+bsvORmCFqyQomp432w6P2EhGQggnJwvGKLHkvnCCorstz5bTqWftXiLA0tFbk6Gpiry8NG/5fkU/5CqHlNj7ah3oz4wozaWbOlXPv0uPuRkKYvC53Uem7yRg5rPWinNALASL/9RRPubO1F x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SI2P153MB0441.APCP153.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(366004)(346002)(39860400002)(376002)(396003)(451199018)(8990500004)(83380400001)(33656002)(82950400001)(55016003)(82960400001)(38070700005)(122000001)(86362001)(38100700002)(66556008)(66476007)(66446008)(4326008)(8676002)(66946007)(64756008)(6916009)(41300700001)(76116006)(5660300002)(2906002)(4744005)(52536014)(450100002)(186003)(9686003)(71200400001)(478600001)(6506007)(10290500003)(316002)(54906003)(8936002)(7696005)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BueFsjOD9TPi5Y9lIYIknHSpQ0SENKmW4zGC1Fqo6IvnXKoFTZvKlZgDRcQT?= =?us-ascii?Q?YzEYMGx/JT7IsQ2cV5UJIgBztQARVfl0YnoTwsgMiJ/zf3dP1H7ONA12YgzO?= =?us-ascii?Q?+lNo/SexUpFPoIVGRn5j2OlibOdLbUMZajW0RdHEzp5vkGVm4S3AOvRrbX17?= =?us-ascii?Q?hVOeSur8f2ZsX02EjfUQ7fALaffD+E13PrEknGIOa7fdRaEfTLTKeuyQ3QSn?= =?us-ascii?Q?WDYU9syVlhH/hkAcZmwFv560fu5E32xLfh11L9hdQAwlYHuncO0sgcsQZbn5?= =?us-ascii?Q?ossEAx8XOrjc5JcR5ppDhyR8vzkl03nt0qQfrCrQiNsu1hDrPUMaEpnqzyN4?= =?us-ascii?Q?WI9Iu84HLTN8V4onDNQIhzwRwpiCr/dtBQ3uPlNejQ1gAVhA/JCWiZTXL+j3?= =?us-ascii?Q?DyeifAEA0CNI93E8yVQFnr74hXlkaa73bZPXg58rVg1Kuc40X7ThU3TZo+na?= =?us-ascii?Q?lsUst7AkbteH4v1ISoK6XRBw39b+/cd5RkXr/eiYhFXoYQCqQRknNry+W9Mv?= =?us-ascii?Q?yyelgIuYK4IlcidVTE/oUUpXD1wzOPQ5FfcKmiWJV0oe/YZIOOu0QEIja+t7?= =?us-ascii?Q?9ZvznXZfgMIFAdHAKee+IXWFN0NuRru1yJgB5Qu4zcPNSqWVpct5tFeHXqwl?= =?us-ascii?Q?wFoS4MBeqXiuSpq4YgaLrLNWRsgrOn1pzK9ezJZqWq587H1IbMHeqMb2+pkr?= =?us-ascii?Q?xqeZ4alNW0me1HTZM29QTJJaxI32xf7yr16ksJEBU8uzwaPv8slPH6BG/9Dy?= =?us-ascii?Q?ZFSTvNZDd1V03/bJNVr2+uX7rQMOxvPZ822NoALH/Yhh0DgjlxPqA+HJb27A?= =?us-ascii?Q?mQ+eorGeAKMm5ILlx/WJ29CtFaZWnB+Ggijt8/nY5fK8c9iMJyCy2fT5q39w?= =?us-ascii?Q?qrY1NMcT31eSvNN9o9I8KTveKPr6ra9PmMSIzLdalxUHfkHsAJMBs8zOeY0U?= =?us-ascii?Q?uTj707URvUkq+p84NGHOVQpSTPmFyRyGBUu2U8pTFpQHDC8B7gOIM+GqWCWj?= =?us-ascii?Q?8OhvDQBttuWnx7vvBC9RPGBZmho12R3tN9v1Wj2HWUNY2MkqHQ6orMt/rKIg?= =?us-ascii?Q?GRBfu8mqyfpJctygisX2M3jWjxcKO5ogRMsdj0qwQYEVrG6LznBSBvlVMcu0?= =?us-ascii?Q?PZG5YPR1nNk93BYdm+2fTpCoBbTcmq1QWjK03Cgrnp2XCKydY0NANHN2I/rE?= =?us-ascii?Q?2asqLQl9zU/OVCE/9wEI5a10ol+xdpa6RvgHBVSL7F6soY8lT8Acm2CfT+j7?= =?us-ascii?Q?f6BZFw4tA3oU7mzATDa/AWFtHv+k3Onveqv8fTvNwaX9ixuSo70LYCqYcRxm?= =?us-ascii?Q?xd+Cc1MjfrVG9YsoQqVtE7DkIqGG+diOxxpHImWhrLwBGsFvRFDWckHsgLAv?= =?us-ascii?Q?HkJ9vstxE29RqCbhnmmbzar6kK8K6mYw2CmjVAbbzCiR68mMT50NO0cTyceO?= =?us-ascii?Q?w8GA5OjJZKpPMGDZUf2V8MacKMs/Cts9orr1zBE9PDsQs0Ek4h/d+GmdCYCZ?= =?us-ascii?Q?j1DwH6yScD3OUjTolV3yFy46MlvTIBzlbxj/sE0ugvBW5OF1NEkWY6JdGPr9?= =?us-ascii?Q?orrHv7NSfOgrkupXhIuGuFaNNw3AJ4VxjteV2Y7O?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SI2P153MB0441.APCP153.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 6eb53a13-550b-41d0-e633-08db24592b9f X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2023 06:56:00.5637 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: riz6K+RBqrh876OReawfhmYfz9J0yXYdkGwZh0PINkkcndD+IxLa3MxJzT0KfIwJDTtFUtTR3q6c3qz42NiaCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0P153MB0783 X-Rspamd-Queue-Id: 4PbPSQ1yDzz4MFG X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > >>>> + > >>>> +options COMPAT_LINUXKPI > >>>> +device xz > >>>> + > >>>> +device mlx5 > >>>> +device mlxfw > >>>> +device mlx5en > >>>> +options RATELIMIT >=20 > As pointed out on IRC, no other kernel config, aside from LINT ones, enab= les > this. Therefore this seems pretty dubious to add; why does > arm64 need it whilst amd64, which does include Mellanox drivers in its > GENERIC, doesn't need it? >=20 How about moving these to std.nvidia? Does it look better to you? From nobody Tue Mar 14 06:59:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbPWq1d5Nz3xqQf for ; Tue, 14 Mar 2023 06:59:03 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbPWp6mxYz4MXZ for ; Tue, 14 Mar 2023 06:59:02 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f48.google.com with SMTP id m2so532970wrh.6 for ; Mon, 13 Mar 2023 23:59:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678777141; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZMQG7sS6ezrWtl3rSM4ZmdM0FqU9QaS6dIJu05NRe60=; b=0CRaABYVmBSveGjIsrRlj5Qdt9s4NsqgN+1wxs+BbCg+Hme/eQYSu0IoyCc9WwLc/S nGL3hTBqD/ex9GlCg0m8Yp/vamRrTTwlfxCLGLPpuQWZyW1bbMThZKAOkmsMy8RZ+PLJ j6eDISPBR71XMQSMPD/jPN9XCyy9V4sRWV0aRAjo5I8AMt9JyC1/qK9+dFOYechveP9m CO/vE/cKGU2OxlJk+Rh/2G1bniHc/+8L3/SrsqmUTzmmSPj9v86sYlvKBFm8DaoxCZUL fmDLfXIn+JxMZ/OYdef+0G/eywDAZOwPQ62UF5U6kCeWub1YPUKvPbbA7GXYxJpP4B1Z 8Mog== X-Gm-Message-State: AO0yUKW/5jsyrZ6WnX+VoP5vIRQQavfaMDRXmg1qdO50OpcZ6WbcmiSR GRdf+o+kgpgcOWXjDGbPq3DcnQ== X-Google-Smtp-Source: AK7set8EFH8E56angY+PL+oUw7DposXhGe5cqMCGXdZUeZiVRxRMgmVuj22PLfEJBTy5BlXjGHQRQA== X-Received: by 2002:a05:6000:1149:b0:2ce:ae57:71da with SMTP id d9-20020a056000114900b002ceae5771damr4164132wrx.68.1678777141646; Mon, 13 Mar 2023 23:59:01 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id d9-20020a5d4f89000000b002c707b336c9sm1240837wru.36.2023.03.13.23.59.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2023 23:59:01 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build From: Jessica Clarke In-Reply-To: Date: Tue, 14 Mar 2023 06:59:00 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> <4F72E2FD-6E84-40F1-981D-A18C8DE22FDD@freebsd.org> <3D6476D5-807E-4D9A-87BC-F5916FBEBE5B@freebsd.org> To: Wei Hu X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PbPWp6mxYz4MXZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 14 Mar 2023, at 06:56, Wei Hu wrote: >=20 >>>>>> + >>>>>> +options COMPAT_LINUXKPI >>>>>> +device xz >>>>>> + >>>>>> +device mlx5 >>>>>> +device mlxfw >>>>>> +device mlx5en >>>>>> +options RATELIMIT >>=20 >> As pointed out on IRC, no other kernel config, aside from LINT ones, = enables >> this. Therefore this seems pretty dubious to add; why does >> arm64 need it whilst amd64, which does include Mellanox drivers in = its >> GENERIC, doesn't need it? >>=20 >=20 > How about moving these to std.nvidia? Does it look better to you? They=E2=80=99re not part of an Nvidia SoC. Anyway, I already moved them to a new std.azure. Jess From nobody Tue Mar 14 07:46:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbQZL2J6Fz3xsvx for ; Tue, 14 Mar 2023 07:46:18 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbQZK2lzGz4Qj7; Tue, 14 Mar 2023 07:46:17 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1678779969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8AhJl0NQXwETiC0eBd/hBNCdfmqbKOiHnE3HyaoI6Rs=; b=ixn2N1ewfqc33m8+UljM+G/7tZ4Z8fCVZWQD1UUsLvWmfiUjdwApW0BRcEgy9bQ5a4TU0i t5VpKtDK2NLzXWSz1t+YPZmpkkP1A0lemLoyZDZZWgSHU3BWrJgTNgieP0HfbUnievouxS mAzQeTPsyvzAzkxmaUZ6JeckF0IRZoo= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 59800dea (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Mar 2023 07:46:08 +0000 (UTC) Date: Tue, 14 Mar 2023 08:46:03 +0100 From: Emmanuel Vadot To: Jessica Clarke Cc: Wei Hu , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" Subject: Re: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build Message-Id: <20230314084603.de49c42bc92ad1b20d38b372@bidouilliste.com> In-Reply-To: References: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> <4F72E2FD-6E84-40F1-981D-A18C8DE22FDD@freebsd.org> <3D6476D5-807E-4D9A-87BC-F5916FBEBE5B@freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PbQZK2lzGz4Qj7 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, 14 Mar 2023 06:59:00 +0000 Jessica Clarke wrote: > On 14 Mar 2023, at 06:56, Wei Hu wrote: > >=20 > >>>>>> + > >>>>>> +options COMPAT_LINUXKPI > >>>>>> +device xz > >>>>>> + > >>>>>> +device mlx5 > >>>>>> +device mlxfw > >>>>>> +device mlx5en > >>>>>> +options RATELIMIT > >>=20 > >> As pointed out on IRC, no other kernel config, aside from LINT ones, e= nables > >> this. Therefore this seems pretty dubious to add; why does > >> arm64 need it whilst amd64, which does include Mellanox drivers in its > >> GENERIC, doesn't need it? > >>=20 > >=20 > > How about moving these to std.nvidia? Does it look better to you? >=20 > They?re not part of an Nvidia SoC. >=20 > Anyway, I already moved them to a new std.azure. >=20 > Jess >=20 Why do we need them in GENERIC anyway ? We have modules already built, we have devmatch, if mlx driver don't autoload we should just fix that. --=20 Emmanuel Vadot From nobody Tue Mar 14 07:54:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbQmC1JJQz3xtnJ for ; Tue, 14 Mar 2023 07:54:51 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbQmB6RlPz3CMq for ; Tue, 14 Mar 2023 07:54:50 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f46.google.com with SMTP id i9so4401613wrp.3 for ; Tue, 14 Mar 2023 00:54:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678780489; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=trXyPLKkcdskPO6ULia4VHu3YwCqKBW0knzULv+SmYo=; b=Ibi6OQZZhTH5BcwRK8wuPrjdiwQS7xdF5aqr/3L0gRO4tPUtbfyaF8MISQP09fu6kl +AVdTqZll9dBjhs/+/LWQwkj7uynlbaJavSLpTXdikI9HlZvKH9VibWFi9Fht8D3mIbH H4N6KlVbzPABam1fPZq5OSpe+xEkhLpngqZT4+rvyzp9Xqv4NjE7FMYc0VmIu7eC0Igf Det3YDp0ss77NVjVzrzLXpIxqvh4vV8x4i/OFmMcol8jcfQTEP0ISUL/iTNjY/OaUe9q KQgDWGn/ZBSg9A1LtpEaSDx+dlTjDAt6OrQXKHZllxgXv2XcfR/LtdGEqPmLgDyThK+2 qvKw== X-Gm-Message-State: AO0yUKUu6qpCfJ2YPcsf3yadkKvgtRMSuSv2uVS1Hl3ASqg9LES8T2dy MS+6HvUM9hd/hEFkpi3bTqypHw== X-Google-Smtp-Source: AK7set8Cg0aA+eHbhULQRBFUjuXo/Q6ox6fe8LInGJqBC67s1eH8IrUkAYxy/4IKB4EhX5hHvi9eXw== X-Received: by 2002:a5d:604a:0:b0:2c9:e996:8275 with SMTP id j10-20020a5d604a000000b002c9e9968275mr22913169wrt.13.1678780489469; Tue, 14 Mar 2023 00:54:49 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id j15-20020adff00f000000b002cea9d931e6sm1368912wro.78.2023.03.14.00.54.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2023 00:54:49 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 15e7fa83ef3c - main - arm64: Hyper-V: Add vPCI and Mellanox driver modules into build From: Jessica Clarke In-Reply-To: <20230314084603.de49c42bc92ad1b20d38b372@bidouilliste.com> Date: Tue, 14 Mar 2023 07:54:48 +0000 Cc: Wei Hu , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <49D67579-28BC-4734-BDF7-BC8669FFF20C@freebsd.org> References: <202303130300.32D30Q0K068420@gitrepo.freebsd.org> <4F72E2FD-6E84-40F1-981D-A18C8DE22FDD@freebsd.org> <3D6476D5-807E-4D9A-87BC-F5916FBEBE5B@freebsd.org> <20230314084603.de49c42bc92ad1b20d38b372@bidouilliste.com> To: Emmanuel Vadot X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PbQmB6RlPz3CMq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 14 Mar 2023, at 07:46, Emmanuel Vadot wrote: >=20 > On Tue, 14 Mar 2023 06:59:00 +0000 > Jessica Clarke wrote: >=20 >> On 14 Mar 2023, at 06:56, Wei Hu wrote: >>>=20 >>>>>>>> + >>>>>>>> +options COMPAT_LINUXKPI >>>>>>>> +device xz >>>>>>>> + >>>>>>>> +device mlx5 >>>>>>>> +device mlxfw >>>>>>>> +device mlx5en >>>>>>>> +options RATELIMIT >>>>=20 >>>> As pointed out on IRC, no other kernel config, aside from LINT = ones, enables >>>> this. Therefore this seems pretty dubious to add; why does >>>> arm64 need it whilst amd64, which does include Mellanox drivers in = its >>>> GENERIC, doesn't need it? >>>>=20 >>>=20 >>> How about moving these to std.nvidia? Does it look better to you? >>=20 >> They?re not part of an Nvidia SoC. >>=20 >> Anyway, I already moved them to a new std.azure. >>=20 >> Jess >>=20 >=20 > Why do we need them in GENERIC anyway ? > We have modules already built, we have devmatch, if mlx driver don't > autoload we should just fix that. I guess for the same reasons as https://reviews.freebsd.org/D28469? Jess > --=20 > Emmanuel Vadot From nobody Tue Mar 14 09:01:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbSF94mvhz3xyXF; Tue, 14 Mar 2023 09:01: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 4PbSF93nPvz3GvN; Tue, 14 Mar 2023 09:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678784493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XVnjGlzzKX7uRnnhFhsdtc6/2rDm/khP8/0c7RrMuDI=; b=E4UvP8Tn8D0vr259deEcprwwfVPS2qV9B1A2X1HTT5aCBKie8lN/OzrfmXt1CpeWigNw5Q T/gMxIfLmhBKB6tWx1mUNPpy4tBhLvKTpen27sVks/wwvD8j2OdvFnSTGiZqPbp2sTpZPH SG8JS3Sa9Usb3hIdZ+oAQnOe/p3qhWUViR19CB/D9BppchqqnATFXpKMrEnxC3kp7Qjmmd MLD/0vTBqFIbcWTc1YCepR8quDWUy/7FDKXZ9/P9KYxKYIqGsNc8OPeq2W9MgNYjSAQOIl 2yjZkfcXbTqlSQheOtWxPsZbLbdu5B82RbhBGk+3Kbrknycsn5BZpYsJ2XwzTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678784493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XVnjGlzzKX7uRnnhFhsdtc6/2rDm/khP8/0c7RrMuDI=; b=TAXlF9Q58s5kBi5ouvwattqCZFbvH4tyyh1hXRzlrlBDkTnZSjQeJIsR6vyjuL5Bnd/vrI Nu231clbRXvNnwM0zGASBse8gux9hdb5JkBCuoL0rReuOgaX+X+rGRY95u5fnLStneQxDv GEGK6PCYNHY7gopmRySWOq+RO/83uV14FPrRvjXsgtzg/mtwa5+slbX10EZ/PwcAsuLZD9 zarAukKY6AYvac4AT0Hm7ao/JtGFTmEJ6GM6zbEI/PnjifJkbVMCZ645UaYND+laeiVbvZ JkacN40noKKKqf11nHc9/zozUbQSfqkWYj53vfKdYG0etvaU+0YMWxp5/zO9qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678784493; a=rsa-sha256; cv=none; b=P7Vn0nqMwtneugoBO+mOBNls8K2cLVK3lx4fOB1nsMR9lsSSXM0+15lS0yfgRrENra/Tme 1J/VuoUSmG/RWDPmDVD84wn8Hotr843w9V1NjnQ96X6AV2EXu3d+gcNkuzw+26oNXQMbCm 7OJX+MuvGvBS0OHPmSAKwOjM6H2Saz/OxG37p+Gu+Z1ujnmHkl6IgVq0zV+uxGePRgp1zM LdJci69RELIkpt2M+bLRD7R/GaUR8gITAMzH6CkgrXcfE94HawDT3FTVg8jLt7IgBwKIFH LsznjbyF07vSx/ekYS96cxvD09BnCUPMqa+X8a0TUHVelKBu1reeFMH2KegdbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbSF92r2YzVGG; Tue, 14 Mar 2023 09:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32E91XZM033923; Tue, 14 Mar 2023 09:01:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E91XqX033922; Tue, 14 Mar 2023 09:01:33 GMT (envelope-from git) Date: Tue, 14 Mar 2023 09:01:33 GMT Message-Id: <202303140901.32E91XqX033922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Roger=20Pau=20Monn=C3=A9?= Subject: git: a78e46a7dbb3 - main - xen: take struct size into account for video information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a78e46a7dbb37dcb537fbc3b17f3980458978bc9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=a78e46a7dbb37dcb537fbc3b17f3980458978bc9 commit a78e46a7dbb37dcb537fbc3b17f3980458978bc9 Author: Roger Pau Monné AuthorDate: 2023-03-13 14:17:21 +0000 Commit: Roger Pau Monné CommitDate: 2023-03-14 08:59:08 +0000 xen: take struct size into account for video information The xenpf_dom0_console_t structure can grow as more data is added, and hence we need to check that the fields we accesses have been filled by Xen. The only extra field FreeBSD currently uses is the top 32 bits for the frame buffer physical address. Note that this field is present in all the versions that make the information available from the platform hypercall interface, so the check here is mostly cosmetic, and to remember us that newly added fields require checking the size of the returned data. Fixes: 6f80738b228c ('xen: fetch dom0 video console information from Xen') Sponsored by: Citrix Systems R&D --- sys/x86/xen/pv.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index d721e9bb530e..3411f4b6b030 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -347,11 +347,11 @@ fixup_console(caddr_t kmdp) struct efi_fb efi; struct vbe_fb vbe; } *fb = NULL; - int ret; + int size; - ret = HYPERVISOR_platform_op(&op); - if (ret != 0) { - xc_printf("Failed to get dom0 video console info\n"); + size = HYPERVISOR_platform_op(&op); + if (size < 0) { + xc_printf("Failed to get dom0 video console info: %d\n", size); return; } @@ -381,8 +381,11 @@ fixup_console(caddr_t kmdp) } } - fb->efi.fb_addr = console->u.vesa_lfb.lfb_base | - ((uint64_t)console->u.vesa_lfb.ext_lfb_base << 32); + fb->efi.fb_addr = console->u.vesa_lfb.lfb_base; + if (size > + offsetof(xenpf_dom0_console_t, u.vesa_lfb.ext_lfb_base)) + fb->efi.fb_addr |= + (uint64_t)console->u.vesa_lfb.ext_lfb_base << 32; fb->efi.fb_size = console->u.vesa_lfb.lfb_size << 16; fb->efi.fb_height = console->u.vesa_lfb.height; fb->efi.fb_width = console->u.vesa_lfb.width; From nobody Tue Mar 14 09:11:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbSSJ04y3z3y00s; Tue, 14 Mar 2023 09:11:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbSSH4tWjz3HqH; Tue, 14 Mar 2023 09:11:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 32E9B12d045967 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 14 Mar 2023 11:11:04 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 32E9B12d045967 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 32E9B1P1045966; Tue, 14 Mar 2023 11:11:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 14 Mar 2023 11:11:01 +0200 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv Message-ID: References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4PbSSH4tWjz3HqH X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, Mar 14, 2023 at 04:19:55AM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=adeca21464d25bc61f98968a5c1e76ab3c808ae4 > > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 > Author: lucy > AuthorDate: 2023-03-13 22:01:12 +0000 > Commit: Warner Losh > CommitDate: 2023-03-14 04:19:24 +0000 > > Add GNU glibc compatible secure_getenv > > Add mostly glibc and msl compatible secure_getenv. Return NULL if > issetugid() indicates the process is tainted, otherwise getenv(x). The > rational behind this is the fact that many Linux applications use this > function instead of getenv() as it's widely consider a, "best > practice". > > Reviewed by: imp, mjg (feedback) > Pull Request: https://github.com/freebsd/freebsd-src/pull/686 > Signed-off-by: Lucy Marsh > --- > include/stdlib.h | 1 + > lib/libc/stdlib/Makefile.inc | 4 ++-- > lib/libc/stdlib/Symbol.map | 1 + > lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- > lib/libc/stdlib/getenv.c | 12 ++++++++++++ > 5 files changed, 41 insertions(+), 3 deletions(-) > > diff --git a/include/stdlib.h b/include/stdlib.h > index 01629ed84a11..c41e8704e810 100644 > --- a/include/stdlib.h > +++ b/include/stdlib.h > @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, > int (* _Nonnull)(const void *, const void *)); > int rand(void); > void *realloc(void *, size_t) __result_use_check __alloc_size(2); > +char *secure_getenv(const char *); The declaration must be put under BSD_VISIBLE. > void srand(unsigned); > double strtod(const char * __restrict, char ** __restrict); > float strtof(const char * __restrict, char ** __restrict); From nobody Tue Mar 14 10:54:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbVkx2t3rz3y6nd; Tue, 14 Mar 2023 10:54: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 4PbVkx2NMWz3jwc; Tue, 14 Mar 2023 10:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678791241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=myaGJtMGhLr5XwZbe9YNRzgJv2WytMWhjE4wNRC6EcM=; b=DZJlNcRolryzlaoKpWe9PUJRLgE0m6MyJB0HliibvH27mYFXUJI41IRy6MJlBTRHZFFXjk Sjx0/HxfWJafozMp3F1QJ+2+C2ogo9abUvrHB14KERaV1FZl+DN42KsIC3EvGdrZ9ZTLYc GMqbkc6Xp/NpANi04iCIVuPP6x1BF4zoWgNoDAendwqANrF5ZBt/HBtGGX34pIJeuDCqSz z0cKXdL4uHQZ4aJS8Z1jsaKapAnafkSFgTmSUWXA3BBo6RKK1TT6ETrWZL3Nj/FEoA9lOW EtdeA+c89aU+lzLhF+1ZLz37AtZ0MfNVaHaKJ/xBGKKl53NjHz75uvuDipvoug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678791241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=myaGJtMGhLr5XwZbe9YNRzgJv2WytMWhjE4wNRC6EcM=; b=FhuMFFb18M8hoW7ySzyAatvQMKRxq522UwhcVy9L14xUOAKumn0nFjdcE+6uTOnDZZzUpq JIS7JnPTWyocwl5NMFovC9986Zb19xNuHvSu2/r+CQRCoGqKFNJQRWzh4bRq8lG2vKylXb tK4zbxOLk6c9DqQllFpESlLbiHYrTv8PkMCWLrvJk5PaddXWtNiq3A7zkbA6Sq1FUjjeSB POTsX27us1K7rwP9tgmjT9S14WE8Jfhm/cX1bqOAEKFYEZ9v201oZ/hY4EvUu7rJ/OvWV6 2NAyLtlozPCkyUebJhlyptltk2P7SWxzDRmu3bhd+k240EhZBc6ppTnyoslAig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678791241; a=rsa-sha256; cv=none; b=PJ/6gz+y9MFLjuADKF6x3+beFgUx+iXzfd6cQazIz2hZLi680uN/bKg/HAEx62xvfp3TNO jDPWfyR4diSXAgzS+Ae7I+onS5O/1R5w32CwnT1isc3Ovw8a7Z5m8MK/jPDW42kZODCWjG ivTFBU+b8kPuT7n4HJY0LArScRaiodOqTCrPoVx75Z+/BkGtqzJ4CB5s8xGHKkJdrMY8li JRJ75JJiOMnokmxo2O1gOGbENo5+zpn2h0wVXD3jAE1MyHnCar5yrq/I9HAS6JM9t6kBiu hxuLPl2mCuvfviT247R/d2mbDccec9GK6R2SJ2kYH1GNE5rds1rgaBNg5+ECug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbVkx1QNxzXWK; Tue, 14 Mar 2023 10:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EAs1ZF015128; Tue, 14 Mar 2023 10:54:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EAs14I015127; Tue, 14 Mar 2023 10:54:01 GMT (envelope-from git) Date: Tue, 14 Mar 2023 10:54:01 GMT Message-Id: <202303141054.32EAs14I015127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 5b99fbfb7289 - releng/13.2 - route(8): Add an example how to print the routing tables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 5b99fbfb72891a058838bf1485f88d8c5bb3e1e0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=5b99fbfb72891a058838bf1485f88d8c5bb3e1e0 commit 5b99fbfb72891a058838bf1485f88d8c5bb3e1e0 Author: Gordon Bergling AuthorDate: 2021-04-13 04:44:04 +0000 Commit: Gordon Bergling CommitDate: 2023-03-14 10:49:16 +0000 route(8): Add an example how to print the routing tables The manual page currently doesn't show an example how to print the routing table, so add one and .Xr netstat while here. PR: 231579 Reported by: Pekka Järvinen Reviewed by: debdrup Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D29702 (cherry picked from commit bc54f5f1cd5c01aa5f941234034839fb0b8f54ed) --- sbin/route/route.8 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index 6f34795ce883..c353bfb73d62 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd January 9, 2019 +.Dd April 11, 2021 .Dt ROUTE 8 .Os .Sh NAME @@ -453,6 +453,10 @@ Delete a static route from the routing table: Remove all routes from the routing table: .Pp .Dl route flush +.Pp +List all routing tables: +.Pp +.Dl netstat -r .Sh DIAGNOSTICS .Bl -diag .It "add [host \&| network ] %s: gateway %s flags %x" @@ -493,6 +497,7 @@ The next-hop gateway should be reachable through a different route. .El .Sh SEE ALSO .\".Xr esis 4 , +.Xr netstat 1 , .Xr netintro 4 , .Xr route 4 , .Xr arp 8 , From nobody Tue Mar 14 10:54:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbVky43ZXz3y7Cf; Tue, 14 Mar 2023 10:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbVky3CzRz3k9p; Tue, 14 Mar 2023 10:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678791242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/8ssaEMmXgnFIr3FVkzqMCO91g/QmTX98lYNv564YEI=; b=l/J9XOr74kTZ/rAAY2MYGs1vf0wPjvRKK0Zihpog9CdJkYZAxIH4oedMjcWxWILMiUEch/ /Ypk0YDjkkUB1LtGCq32xeBzP2sDZ/72C1jYXKSiKTe2uItypvWCowrM+C3jEbbqsSQz2J YMs39fVrfdvEF7c8BehpeLtGXIKsmM5Qd529XC9issHtKbNusyso65bF4RmzVqtzWfJkHj JL11qAztYGWwSTHa0j2QQyR/DOb13woM2PITL9QnQXVAhMJpHRksI7D8QbThz1jbrmyKPf iy3SOcOUnbMdkhgoKWGmMqJlvSoWvWast/fqP0etEKGl++qPyNqL8ZKFfIS3ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678791242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/8ssaEMmXgnFIr3FVkzqMCO91g/QmTX98lYNv564YEI=; b=beOp+knXF0Anpnv2POwM0KMDOOJ90cqa4Zs0o9K+ai8DV6J89jpLSrJ8W+UHTrqxXdWKcO Yp0zoUNIxx0rnpfmnjJCkID7S+u4wXc8k9zZNdRSQxr2B4BEPh6qtSfh2Vcvp2sqtEbClo vaKykY6s3W+4+O6kbr19W+Vs2hAtsPNHHmvDsTijm4AtOBnrym3vTcKqQAZK0wIQfoahTt 4/cUGe4T1FxdtEkDBrZrLNt2Ag2rhdFawNB8GtkLVttiyBLOTAo/Uk3iB2frIo+UFS4g3C cRdLR9JFdUiSsvyhKUxebUsWqBnrrtR5cGtnG7SKqtF5V7ZIsyIargn1H1NOfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678791242; a=rsa-sha256; cv=none; b=Dh4O0mTkEmhA26FMBC+G3ymKBD3R1plnQK9CuKINwrOvvVG98DSD+xlVqFQNIYOmC806IA OYa72rQ8GzOiVn5VOxauGmq8NRh/1uNB5g5w3/mS6WaB0vidz8/cVOgo8qOKpdSk03/bFe CYt3OEHPITJR7VuL+3oplOF1b5/KIScb2ca50GojIPzlzhjwuDOdEoz2K2khAw4UyQ8jsp 9B8xROldcxNiXt8jGr8byrdAfVH2YFJ92j22ECxTJY7jBhzZeVUSPc815v9rTU9RfpwJUh U/otHG8pjszUckA+Ji/uDUKZJCi1Np065a6ppWx+E0nj7S9Gs8zTm9vgWeU+3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbVky2B2gzXyq; Tue, 14 Mar 2023 10:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EAs2Rg015147; Tue, 14 Mar 2023 10:54:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EAs2Rs015146; Tue, 14 Mar 2023 10:54:02 GMT (envelope-from git) Date: Tue, 14 Mar 2023 10:54:02 GMT Message-Id: <202303141054.32EAs2Rs015146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 92d6645fd4c2 - releng/13.2 - route(8): Remove obsolete information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 92d6645fd4c2fa99035a35cb81a4805b81f3fa1d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=92d6645fd4c2fa99035a35cb81a4805b81f3fa1d commit 92d6645fd4c2fa99035a35cb81a4805b81f3fa1d Author: Warner Losh AuthorDate: 2021-12-15 23:06:19 +0000 Commit: Gordon Bergling CommitDate: 2023-03-14 10:52:08 +0000 route(8): Remove obsolete information xns and osi are no longer relevant (or supported) so remove their vestiges. Noticed by: phk Sponsored by: Netflix Approved by: re (cperciva) (cherry picked from commit c6b2efb64e279b4d543aaa10073c63765bf6e790) --- sbin/route/route.8 | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index c353bfb73d62..161189e7a9d8 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd April 11, 2021 +.Dd December 15, 2021 .Dt ROUTE 8 .Os .Sh NAME @@ -143,8 +143,6 @@ command is specified, .Nm will ``flush'' the routing tables of all gateway entries. When the address family may is specified by any of the -.Fl osi , -.Fl xns , .Fl inet6 , or .Fl inet @@ -264,20 +262,6 @@ Alternately, if the interface is point to point the name of the interface itself may be given, in which case the route remains valid even if the local or remote addresses change. .Pp -The optional modifiers -.Fl xns , -.Fl osi , -and -.Fl link -specify that all subsequent addresses are in the -.Tn XNS -or -.Tn OSI -address families, -or are specified as link-level addresses, -and the names must be numeric specifications rather than -symbolic names. -.Pp The optional .Fl netmask modifier is intended @@ -502,7 +486,6 @@ The next-hop gateway should be reachable through a different route. .Xr route 4 , .Xr arp 8 , .Xr routed 8 -.\".Xr XNSrouted 8 .Sh HISTORY The .Nm From nobody Tue Mar 14 10:54:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbVkz4bHwz3y77l; Tue, 14 Mar 2023 10:54: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 4PbVkz3m56z3kKG; Tue, 14 Mar 2023 10:54:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678791243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yAMaz9WsmLXG0YVOIz7niaOsTl/nibXbw9bsiEtSP6k=; b=CuFaKVOqXOxFfr7L54fioxlXLeXCOnMB7949K7YHbb8Dgazk63Rub6XBgBA5tF1EPnQcyn G1IDLNnQNfMildIl56eB1Vwg5zbtQLlhFqL1q1FmhSzL1SnLSpG1ZNn2TuXY+yv4jvn4X5 2aPg9+ifucGh/vT05AT1HbAnzjQKRUVUUslVAn3ZmH7Hy6q1Nc5yauSjDTn33oM2xQrd4w xweLgVyxzKYNh7N+McIjONmsa/MFG7odMLfhpMiIkSkrFsySwQpJazji275Bc/FZ6Ywt46 tZBuCaqVx6LNdun7Zdj1Fp9g4Gj9CT6GCJ7Iye1NHW+RakYYW4HrElcF6sYpOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678791243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yAMaz9WsmLXG0YVOIz7niaOsTl/nibXbw9bsiEtSP6k=; b=atddmCK1xoPDMZ2gqDyYvfFn89pqR/tvF3HJARcO/RZuBcU0CbhHIwPnRn+d8MVT7KyqUg C/PfxuIRWeyxQ1FlE7skZSaAytdXnX2TPVm+4MBBH7ITdTxC80Y1Uy0zIbfSUQ0nM0uwpa CWDpRaUev5NZnZC/eHjhA18aryW3FVWFzyWKDh+xpjcFSYSvdJDvabX3+Cya26vDyG8aSD s0E6aNdKT/DGipjJ5aXuQUF5H3dmG27SPe57T0dn5mc82XWyPaLOH2Ich9DmEAUzWKkAYU oItOLAwxYRowP5F39iDBZuo5Rgfus3QgH/gVZHIPSZTwewYd8hWG9o/2T5nBSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678791243; a=rsa-sha256; cv=none; b=nz7Mv4UxuQQ0pDQTL0seIWXH6dNrr+EvZwPtJCYxQo02t9cKlPNWqhhyB5GcgSxrOAl2w8 8hvms3O/idrA7wbqyNskjRweO08dI9PsVEN07Xe3Fl+j3zfFTALDai1I9j9BtA523uKeZ7 4xIDM0bk8xy2fmzAmraMJ2gDa1fsuIpllbGDSzq3JEDCNPztsughNugAysn+eqn7DS6M5C ee46+mJUdl91IHe5HAjbPK7wqmZlcDUsBg2nHWZoFTCVgzD9i4KNBLMt7+cb4swHbMJf8p SJ0N+w6ClecC9khjsJaEwVQuU4fobuairnrlF5Rip6BmmBi/7AX+1WEwSbMQRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbVkz2pKkzXYM; Tue, 14 Mar 2023 10:54:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EAs37O015167; Tue, 14 Mar 2023 10:54:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EAs3DU015166; Tue, 14 Mar 2023 10:54:03 GMT (envelope-from git) Date: Tue, 14 Mar 2023 10:54:03 GMT Message-Id: <202303141054.32EAs3DU015166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 49a096e889c4 - releng/13.2 - route.8: Add information about ROUTE_MPATH and FIB_ALGO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 49a096e889c4cfca6606ef273e4f4c331b0ce3cb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=49a096e889c4cfca6606ef273e4f4c331b0ce3cb commit 49a096e889c4cfca6606ef273e4f4c331b0ce3cb Author: Gordon Bergling AuthorDate: 2023-02-26 13:15:34 +0000 Commit: Gordon Bergling CommitDate: 2023-03-14 10:52:45 +0000 route.8: Add information about ROUTE_MPATH and FIB_ALGO Since the kernel options ROUTE_MPATH and FIB_ALGO are enabled per default for a while, it's good to have some user facing documetation about the general functionality of multipath routing and fib lookup algorithms. Reviewed by: pauamma, Jose Luis Duran Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38783 (cherry picked from commit b06338167d64507e79e003500002e22fbe583832) --- sbin/route/route.8 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index 161189e7a9d8..c893ae5ab4b3 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd December 15, 2021 +.Dd February 26, 2023 .Dt ROUTE 8 .Os .Sh NAME @@ -405,6 +405,60 @@ and .Dv RTM_CHANGE . As such, only the super-user may modify the routing tables. +.Pp +.Fx provides support for scalable multipath routing. +It is activated by default, but can be turned off by setting the +.Va net.route.multipath +.Xr sysctl 8 +MIB to 0. +.Pp +There are multiple route lookup algorithms available. +They can be configured by setting +.Va net.route.algo.inet.algo +for IPv4 and +.Va net.route.algo.inet6.algo +for IPv6 +.Xr sysctl 8 +MIBs. +.Pp +A list of available algorithms can be obtained by accessing the +following +.Xr sysctl 8 +MIBs +.Va net.route.algo.inet.algo_list +for IPv4 and +.Va net.route.algo.inet6.algo_list +for IPv6. +.Pp +The following algorithms are available: +.Bl -tag -width radix_lockless +.It radix +Base system radix backend. +.It bsearch +Lockless binary search in a special IP array, tailored for a small FIB +with <16 routes. +This algorithm is only available for IPv4. +.It radix_lockless +Lockless immutable radix, re-created on every rtable change, +tailored for a small FIB with <1000 routes. +.It dpdk_lpm +DPDK DIR24-8-based lookups, lockless datastructure, optimized +for a large FIB. +In order to use the dpdk_lpm algorithm one or both of the +following kernel modules must be loaded via +.Xr loader.conf 5 : +.Bl -tag -width dpdk_lpm6.ko -compact +.It dpdk_lpm4.ko +DPDK implementation for IPv4. +.It dpdk_lpm6.ko +DPDK implementation for IPv6. +.El +.El +.Pp +The algorithms are selected automatically based on the size of the routing +table of the system. +They can be changed, but not every algorithm performs best for every +FIB size. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -484,6 +538,7 @@ The next-hop gateway should be reachable through a different route. .Xr netstat 1 , .Xr netintro 4 , .Xr route 4 , +.Xr loader.conf 5 , .Xr arp 8 , .Xr routed 8 .Sh HISTORY From nobody Tue Mar 14 10:54:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbVl101Bvz3y6nh; Tue, 14 Mar 2023 10:54: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 4PbVl04d3tz3jxt; Tue, 14 Mar 2023 10:54:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678791244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EzM9igxvYmwODt3zZz001JX7eWe2AIOP25CqOZv61dk=; b=iyGki80Gt6PYMbfjVlWWwds5r3LFqbIA60vVX4U3DAce/Nu4l77oWCWEs6S8isRqDE3d5y 9LUPoXTT1Jl0o/9wIs04b0lENJR0KpXn4NLZG/kPu/A8S1KfgkuFlD8K1J7DDOiXiY2ikr wdVDgXrU7VceNWFqcT5nE1YV9h1Hft1NnP+8Gfs7IPUkS8GXjiQPB/LHXGjhnd4X8pn9EJ oPo316dKCrOXk4y9hHtdlXYXF1qUmRI27W70roV9Po1/QIi0PCob/BmLm/zqjhp8pjFdCO Auwj2vAZSfo39D+IobzjMyaOQoaAbg/hUYWEpoOLn+Yr/lJfl8NDmGtj3scDIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678791244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EzM9igxvYmwODt3zZz001JX7eWe2AIOP25CqOZv61dk=; b=h7ZCoLAjpGPYf5f/dM85g9azpptkMW+vH72O3TBDWa0/47vrjZOhrT9OiN/wcN+EPEJxkA 9KOSkTEVAZ4a1SQ6ePmvlUZrcAgRDyGPj1DZrRNvwdl4y4hotwjUtva5g/OCtuW/Oew8Or 1WO3UeDVxAFCSYz1BRh+oCnc9OZwBUJoCi2joayo7TWFr9CniE+xSeWatIv6NiRSdGwmZc vNW/fzwBpobjJtT33XNPu6jtbQKKqVEyIj17LqHaBl/ZrjU9jr/MJiqfjdWglbiu1SW6aJ Za/KhDbQzlbCjlQnmxa4ewBshq7ewj10OAP982UcOczjKbtptHld2+/NXyKV3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678791244; a=rsa-sha256; cv=none; b=gLX+Dsd2Fe4AriXAKDK8Foyh841r6euNXKafIJBSwSjx6xwT+B0wbJlBOPyELlDGomG8aC Fd4/ZlqFRP9ATV7BE+wpFXoBYfbJXpPDPw01+7ECmkd9ceevjuxysEcUsq1c8eoz7HMKIC ZXhqEk9E/dQextl1V51FD5mxjrWwUdaNP/Y2GjFoIvxxq4nQsjCkxnWKIqTXkCL0EAUwVF E4h2fV3ygEmxM4Sy6oO1VDUDLaPdorutTI2rff3aBSj0sKY/8CLKIqIOv1V7mvE2tjR16u M8GeAPL3Q5Q4M+CxhjaPa4fx2jrAHVWJK1zVfHs0nQhZp3zQO3yLBnImnOARfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbVl03kcDzY1v; Tue, 14 Mar 2023 10:54:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EAs4LQ015186; Tue, 14 Mar 2023 10:54:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EAs46f015185; Tue, 14 Mar 2023 10:54:04 GMT (envelope-from git) Date: Tue, 14 Mar 2023 10:54:04 GMT Message-Id: <202303141054.32EAs46f015185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 2ebf1ef8825f - releng/13.2 - route.8: Fix mandoc warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 2ebf1ef8825f44ef575545b51c6667fb12ea6b74 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=2ebf1ef8825f44ef575545b51c6667fb12ea6b74 commit 2ebf1ef8825f44ef575545b51c6667fb12ea6b74 Author: Gordon Bergling AuthorDate: 2023-02-26 13:33:58 +0000 Commit: Gordon Bergling CommitDate: 2023-03-14 10:53:25 +0000 route.8: Fix mandoc warnings - skipping end of block that is not open: Oc - no blank before trailing delimiter - remove useless TN macros - remove commented out reference for esis(4) Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38783 (cherry picked from commit 6dbfbe6e11a04f6e2ae893dbf46b059ab49eb517) --- sbin/route/route.8 | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index c893ae5ab4b3..5b6e13281447 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -134,7 +134,7 @@ The flush command has the syntax: .Bd -ragged -offset indent -compact .Nm .Op Fl n -.Cm flush Oc Oo Ar family Oc Op Fl fib Ar number +.Cm flush Oo Ar family Oc Op Fl fib Ar number .Ed .Pp If the @@ -228,10 +228,10 @@ is interpreted as .Fl host Li 128.32.0.130 ; .Fl net Li 128.32 is interpreted as -.Li 128.32.0.0; +.Li 128.32.0.0 ; .Fl net Li 128.32.130 is interpreted as -.Li 128.32.130.0; +.Li 128.32.130.0 ; and .Li 192.168.64/20 is interpreted as @@ -265,9 +265,7 @@ if the local or remote addresses change. The optional .Fl netmask modifier is intended -to achieve the effect of an -.Tn OSI -.Tn ESIS +to achieve the effect of an OSI ESIS redirect with the netmask option, or to manually add subnet routes with netmasks different from that of the implied network interface @@ -378,9 +376,7 @@ In a or .Cm add command where the destination and gateway are not sufficient to specify -the route (as in the -.Tn ISO -case where several interfaces may have the +the route (as in the ISO case where several interfaces may have the same address), the .Fl ifp or @@ -534,7 +530,6 @@ same route as the one being changed. The next-hop gateway should be reachable through a different route. .El .Sh SEE ALSO -.\".Xr esis 4 , .Xr netstat 1 , .Xr netintro 4 , .Xr route 4 , From nobody Tue Mar 14 11:09:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbW4x3LKRz3y7s1; Tue, 14 Mar 2023 11:09: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 4PbW4x0kk2z3mnb; Tue, 14 Mar 2023 11:09:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678792177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hmGKEzEz6Azb45XYccroKrIbm1JI/R1avaEuHpgKAVA=; b=fJa471KS0rso+1xlvp95n3b4nskG2du4n1l7Q4bGlzpeo5AyIgtg4pmzD28JcT3zILJGNW Ghb2ySk76/+n6H41IuYH3inMTWiy6/Nf9hC2KBOcDaSxMRh16yemdSSbemaqImt8rq1JHJ 1XGnlAI+PBBxfS2ZTrZBrs3aH+wGPjtm4KPbUnnL6/BHP5duGq1jYd1gNMNxXm8yd2azbP tO885+mG/49BiVhdkNxNfJjUvUfjnrXqDrTYTeuzNOzVkNe5JHrQpgfR4vg43YhEBUSc1V qLdasQO88GX7U4RQ0tmdYz9PORPnlIix/FT7A5QH2GjtvTp9sZnQknnKsR4IGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678792177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hmGKEzEz6Azb45XYccroKrIbm1JI/R1avaEuHpgKAVA=; b=pei1oyVTBKDii0t/TuYddRYEmyR2w+DldNdrjRwm5BLBorebFuzqMYgbnPT+KDy1aV0tQq c21o6HjpOIjmnqzKhI70yyKDI2H/kJbJaDn1PddTKPMJ0erSjWujVmQDgeH3cjv3FkQpvR HMvmpPLbJbpRfDRtqx0ZzOMw5gRBvDdoglkyWqYoPC8vAYGzy6RqsdLdJd4qo/CA3KpH9Y UoDXyO5i6aaIsxRPl5mqvDNBX2ByL5//ZCyOxfh9J+xSbVIgYKCd2CFCCA+U26tP3LSZJW badDqKip0gliJe3q9O5BCOoqTJb8rmO8lQsYWs5HsK8JKg/1jP9+NWmqyOOMrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678792177; a=rsa-sha256; cv=none; b=jffiGnLQJxnt+LX9A9vIkQGpBuSvFnhrc3Wy1jXtt+cIWUiEOX9/G4XCM6mmR13yt6jtzQ F+xJj+hi+6zWChgFdrtSPhNSd7u0D4mRkhKe4zp1swXbALdXHuSXXCgXlhJBY70YX5Dwcd xf9kKgiBlEVo8mBA9vFHZdxRl9QzJUxBYIRS+jFcXzg6k7qvRbKRrG+sRvIjLmBnf2oMpa Zzo8C5BZPATdP1eLY+Pw6MsbKckgh4xny/hQfmJlYBLLOnep3IF5QUZG80DeGqbRprFKP/ i9yeJfLk68FwZisKWSa/FyTR1DcCUe45kxZRzszN9OSX+bkumhk9HNs1noItFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbW4w6vfPzY7T; Tue, 14 Mar 2023 11:09:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EB9aJ4032746; Tue, 14 Mar 2023 11:09:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EB9acC032745; Tue, 14 Mar 2023 11:09:36 GMT (envelope-from git) Date: Tue, 14 Mar 2023 11:09:36 GMT Message-Id: <202303141109.32EB9acC032745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: ae60314c9467 - main - Fix the ofw parent check in arm64 nexus List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae60314c9467012abb23cf22249c6522d2ca1d91 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ae60314c9467012abb23cf22249c6522d2ca1d91 commit ae60314c9467012abb23cf22249c6522d2ca1d91 Author: Andrew Turner AuthorDate: 2023-03-06 09:54:57 +0000 Commit: Andrew Turner CommitDate: 2023-03-14 10:37:00 +0000 Fix the ofw parent check in arm64 nexus OF_parent returns 0 for no parent. Fix the check in teh arm64 nexus_fdt_activate_resource. Sponsored by: Arm Ltd --- sys/arm64/arm64/nexus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index d07965433919..3d6519f5fedd 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -565,7 +565,7 @@ nexus_fdt_activate_resource(device_t bus, device_t child, int type, int rid, node = ofw_bus_get_node(child); if (node != -1) { parent = OF_parent(node); - if (parent != -1 && + if (parent != 0 && OF_hasprop(parent, "nonposted-mmio")) { flags |= BUS_SPACE_MAP_NONPOSTED; } From nobody Tue Mar 14 11:09:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbW4y2HVnz3y7Nw; Tue, 14 Mar 2023 11:09: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 4PbW4y1TzRz3mm0; Tue, 14 Mar 2023 11:09:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678792178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hBeiiDNeJ54zW1F7zIqpy3KJ6ZouEzNl+EF8RrVji0g=; b=WRheklgPQcmo0/X+PYmFGhCLQPwQICBo4XuDO8CtXMtIxFN6yzvnOolrqg0ln06/KPvB02 XI10VGxlETJxndfFchskd1gObTb7/eo0v7LZgRikNWhdau/0od6nYmg6eMnQcY41xo3r/v eP8ZW2J9iI1IdfBiHdCABMHSE1JmBAaaZET7IlNVuJSe6oySdSKdE5Omhd2pEGmKBa1Kr9 pwJ+z8kDfAaH2dmtcv25UpJSXEoFA+g8nNK27dDXg2dlD6J8rM0U1v1Fu/ztdf+EUeObY3 gX2CddiBn3N5B0RU/mgs0dHOOebRtM0ZxC3I8RzTJdi+5uNPZWHt89M7zAHSwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678792178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hBeiiDNeJ54zW1F7zIqpy3KJ6ZouEzNl+EF8RrVji0g=; b=EdfzIszDCL2nlbvRhJCYXZM6JzWvIDSmsDREHK7Cwcj6R6EGUNI49lzzxH07DNkHpxlD1V I4L1UVJ3Aiq/TLReyT3YDmHEtbjjcvH+moI6uMeHUqKrB1/evIkVbWCoo6YeO4z5IfZT+1 o9QBrezU9B+H9O7CHIDcoDzXzMGhi3CybYJDWNuDyKRfSnVKMvfW5zSnIa6vQFAKAPQ+WP FZK4Va5nURZUC+WPYfg8Dr8KKK5kY27PZiFGUGA6+eWPlYjL6gWXABRIgWl8xgfa81qPU0 zenhmQ/2l0AsuZjV5vJlb3uRuZUNgp7rslMep7UKviqYjNPEUobtH3aUSAUDGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678792178; a=rsa-sha256; cv=none; b=d6zQ6YGwaq4+45vaMSjRPCNxMedYjkgfE+Q++fjNi4ipfC3Ar2vn0D/O6XtRHh3AZEPp/R dvfjAql4plH63CP06czrt7sqG9wygbVh7+sgLUsSGADJa1uAGGKxREkyOuWg8SZwtBOaPr mN4l/6D5Q6C8jiC7TngD/1qAXCNdL2ZjoqtLHIgkZYTtH6CfUXZMrmo4utgUMFXqTPq9t3 jNgoBzKRG/aYaz4MlY7E8Uv9twTjqAmFuJbr+mXOzVinIAY0L/3W6jrh/Uk4q87Ba4Holc kcGJWsD/S5LODbBry+sWeUPfvgxn0nyaH4DVWjxwhGI8djufHLnyL3J5oZDVTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbW4y0b6nzY19; Tue, 14 Mar 2023 11:09:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EB9baA032765; Tue, 14 Mar 2023 11:09:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EB9blR032764; Tue, 14 Mar 2023 11:09:37 GMT (envelope-from git) Date: Tue, 14 Mar 2023 11:09:37 GMT Message-Id: <202303141109.32EB9blR032764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 93d574ea957d - main - Always enable the virtual timer for userspace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93d574ea957decec1c95dea9bfa8bc72457cc60d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=93d574ea957decec1c95dea9bfa8bc72457cc60d commit 93d574ea957decec1c95dea9bfa8bc72457cc60d Author: Andrew Turner AuthorDate: 2023-03-10 12:43:59 +0000 Commit: Andrew Turner CommitDate: 2023-03-14 10:37:36 +0000 Always enable the virtual timer for userspace We always have it, some languages assume it's present, e.g. go before 1.20. Enable it by default on arm and arm64. PR: 269070 Reviewed by: kevans Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D39059 --- sys/arm/arm/generic_timer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index 5d694e8e9660..0b48841c9960 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -270,13 +270,12 @@ setup_user_access(void *arg __unused) cntkctl = get_el1(cntkctl); cntkctl &= ~(GT_CNTKCTL_PL0PTEN | GT_CNTKCTL_PL0VTEN | - GT_CNTKCTL_EVNTEN); + GT_CNTKCTL_EVNTEN | GT_CNTKCTL_PL0PCTEN); + /* Always enable the virtual timer */ + cntkctl |= GT_CNTKCTL_PL0VCTEN; + /* Enable the physical timer if supported */ if (arm_tmr_sc->physical) { cntkctl |= GT_CNTKCTL_PL0PCTEN; - cntkctl &= ~GT_CNTKCTL_PL0VCTEN; - } else { - cntkctl |= GT_CNTKCTL_PL0VCTEN; - cntkctl &= ~GT_CNTKCTL_PL0PCTEN; } set_el1(cntkctl, cntkctl); isb(); From nobody Tue Mar 14 12:48:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbYGz3tVVz3yF0t; Tue, 14 Mar 2023 12:48: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 4PbYGz34V1z3xYb; Tue, 14 Mar 2023 12:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678798107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AZgXHT/ozcEUqpspLgFL/0i1uymtQgYPImql2R9PF8g=; b=slJnUAVZdOAyhhW+vrAWrDKtyn5zuasPaWJqnt6maXjJE0p7CzVgD2NWPgAYttUgEVXCDu QVREmfHCqHGmECQo9BHzpnEynCc/Ad6rB2BVWyxJzzMliSVzn2OkdaQOIyJcZyVECYtGqt f6f4MxI4ov96wQ2It4mFRB7xcIZiy0iATZwp6fRW7f+mEAsPbxZKbQFWwGcI2ROKhWpW97 Uh35rtAqHtZU4N+7868lP1t96NodSeyunifZZaIrbiRRpZ4STMlJk0XrTztAzRdbFQS9iP 56uqkXRJHTmIM1KSsOQx/huCFLixyGIXnxrFqm9HUbyqTjkLKvZvwrWT/ktNFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678798107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AZgXHT/ozcEUqpspLgFL/0i1uymtQgYPImql2R9PF8g=; b=YoSUGHVLQXPw+9ccEqfbKMnvk1oczq+BBThVTKh1HnQoVbvNTpj/BB3hwGBklIqyvI/ode nGw1EtMkqk85ZP2Vh6g/LrgnTBJlW2DBAoS3IENLP3XzXR08ag30znLKJBAFkshCjb0RDj mpDFbn6LZFK1lQEFxs3nBEvqgA2x+esNQnI3mKli77QKIPl8v2B6TAzuGq4n9XhwLgLDuU jsN9oOnuHBS9E4ROLY+Xp9QHYJ1435wAdNxzJGSUE3GjdriuiEta2bitMKrmD21NUMtX6J ch108BJJDz92+CT54VIOYibhbCVttzlc5VsqUoYQGZ6unxyIBy67Bm90wZbLnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678798107; a=rsa-sha256; cv=none; b=eq51j3ocrBIUpYpefiBQVLQE58BQ8vlrVyhFJZb6AhLPdNvHBJdrZqB5sbLJmMI3TB1Z8+ geWWE2fjN2lgzRyyUoFC9o3H3yLfdUykaXS07IrnKAUFv2fY3URzCvFkrIEsFH6xQSb0P9 Qz2PFCXWKjQUwaw1kZv4QiN92PasKgzd9SOu0ve9tIZ9Lf/BW1Xo2opfsnlg3akgCVW0Cf ZtDg2J4+FHMG3ugDTRUTw1Imr0mW2Q6QcR7ncZOK5BqXEUJRHasdC+CWGEAfObMEqWSN9T tWCdUoTLP32oGNwI47NQhFZOP2/P5fD8So+wHzgxd2BStjtGKyoNxYubmPNTKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbYGz26J1zbx2; Tue, 14 Mar 2023 12:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32ECmRdR096332; Tue, 14 Mar 2023 12:48:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32ECmRPP096331; Tue, 14 Mar 2023 12:48:27 GMT (envelope-from git) Date: Tue, 14 Mar 2023 12:48:27 GMT Message-Id: <202303141248.32ECmRPP096331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a2de35e1a460 - main - CI: update QEMU command line to avoid deprecated option format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2de35e1a460126b99f63b6cdc3759157cc15860 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a2de35e1a460126b99f63b6cdc3759157cc15860 commit a2de35e1a460126b99f63b6cdc3759157cc15860 Author: Ed Maste AuthorDate: 2023-03-07 16:38:01 +0000 Commit: Ed Maste CommitDate: 2023-03-14 12:44:50 +0000 CI: update QEMU command line to avoid deprecated option format > warning: short-form boolean option 'readonly' deprecated > Please use readonly=on instead Sponsored by: The FreeBSD Foundation --- tools/boot/ci-qemu-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/boot/ci-qemu-test.sh b/tools/boot/ci-qemu-test.sh index b730e9725014..9548c6a1289e 100755 --- a/tools/boot/ci-qemu-test.sh +++ b/tools/boot/ci-qemu-test.sh @@ -85,7 +85,7 @@ amd64) if [ ! -r "${OVMF}" ]; then die "Cannot read UEFI firmware file ${OVMF}" fi - QEMU="qemu-system-x86_64 -drive if=pflash,format=raw,readonly,file=${OVMF}" + QEMU="qemu-system-x86_64 -drive if=pflash,format=raw,readonly=on,file=${OVMF}" EFIBOOT=BOOTx64.EFI ROOTDEV=ada0s1 ;; From nobody Tue Mar 14 13:56:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbZnk1dGVz3yJm7; Tue, 14 Mar 2023 13:56: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 4PbZnk1749z43VS; Tue, 14 Mar 2023 13:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678802202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sQyYjBXwuAVzTVdFruTzEB54Zg4eu3kJyZ1j0jF0D1o=; b=L2aheJ+ZTXNEpC3FL0jqjHi+Fx86BuHSJIs3UxxSVYHcnEp+E0wq+vzfsnz4v2RgcZg9Kd qab1ZqUkplCMArhkJlToGAkViyL+n8E5WGpggrCMjw9B9I0gqplyV46u28EquJ4kxPFIvf HL//EIM5YIHVpSelgqzJaapJKaWU7VqfHwqJAxFqbKqaGB/etu2cJHl2XESjPjD/jGdVq3 0zSxJOsbig+hf8TUdEgeaZt/YOwpljYEXBVbLeLYM3EbvTdKhvBgXpyAI7RNN2WGKNm3u9 twjZOG0Q2UZcnpegooYUsfCCxVGjusYUr8xYOlBimD/XrJXIz73KGSvHHt9VLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678802202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sQyYjBXwuAVzTVdFruTzEB54Zg4eu3kJyZ1j0jF0D1o=; b=o3a8c8Krx4nEoVj5EGuluEwcZ+2OoscLsayB7/E+NsNTP4Q710qveHhFbAuWT8hI5scjZK 6i5X3F4xyfztRhS1kmE3/gyktYIRtnKleznzMrvDlMRi2MCTiOplBslDK4umLM6aYkdj8Q Slkn595ZiKOuokpJXpZJL51DyPYBuY6XzFCr1/aK1/qYTLlDZsdP58SM/+u709+/J11Cty 2GvxHMGZByslhz8fvyG2m/qKqDBLPxKRiatAWzI1QUxCEUXxTYUKV9WOXrDwASC4eqoSMX FOtTX+UwnDHqLgyzLsNxGpaNhS0ko4flwWlbrrSlm0PWACPKRWRET0BS4c5SrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678802202; a=rsa-sha256; cv=none; b=fr/BFirVxA72MVzUMSJtLB7z3cep97oRuyWXk/mTKKYrXg530F9CweeJ77FcEiV9O5Fyya hAwvIpoMowushKX+UPu7WhgR4mr31EiLgwwj+FGz/mCGxdLVPpb3LbeLEPpWzCEMOtaNnO 5laA7ex1TEpFuyBn5IDYKF+cmYRG8HZzUNrP9DVgIz6yypLR6QG7LLqj+q7EFAUlWUBCcf jiD9DJgh4m69JWNbtmnJ+Fxqupqe0ViVvOR6sAuVQcm61lSXfV8RJE9/s0UZtcek8zoav3 zBNk3ZGfqvnW49klHRFQOGTwRlu0DbtDyfyk5GE28Jjl9YdDuiBlJ6Ryk8SZBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbZnk0B4DzdPT; Tue, 14 Mar 2023 13:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EDuf07010659; Tue, 14 Mar 2023 13:56:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EDufdm010658; Tue, 14 Mar 2023 13:56:41 GMT (envelope-from git) Date: Tue, 14 Mar 2023 13:56:41 GMT Message-Id: <202303141356.32EDufdm010658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 21f268182838 - main - route.8: Don't reference an external command in EXAMPLES List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21f268182838f072f96234c727778d5603a580e3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=21f268182838f072f96234c727778d5603a580e3 commit 21f268182838f072f96234c727778d5603a580e3 Author: Gordon Bergling AuthorDate: 2023-03-14 13:55:28 +0000 Commit: Gordon Bergling CommitDate: 2023-03-14 13:55:28 +0000 route.8: Don't reference an external command in EXAMPLES It is better to mention the externel command for showing the routing table as using an explicit command. PR: 231579 Suggested by: karels Reviewed by: karles, gbe MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D39075 --- sbin/route/route.8 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index 5b6e13281447..afcf55ab44c7 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd February 26, 2023 +.Dd March 14, 2023 .Dt ROUTE 8 .Os .Sh NAME @@ -488,9 +488,8 @@ Remove all routes from the routing table: .Pp .Dl route flush .Pp -List all routing tables: -.Pp -.Dl netstat -r +The routing table can be listed with +.Xr netstat 1 . .Sh DIAGNOSTICS .Bl -diag .It "add [host \&| network ] %s: gateway %s flags %x" From nobody Tue Mar 14 13:58:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbZrH2gM5z3yJpM; Tue, 14 Mar 2023 13:58: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 4PbZrH2872z44Pj; Tue, 14 Mar 2023 13:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678802335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mm7vUlYAvfHWzIncQyk+AlJJV4+1ctfRRjhLO4AbjCs=; b=jxlRXXAoq/xK6hRwOWQZvVCIHgeWw+xDazDABNsSfYvHEtBxnyWIWxD6/sGR3Z5iDuu3y3 OpbYjgwPJX/CAsI02dlRyFLW4vWWzSts/ud5kIWFDbgwNrUqcXrYwgzGB9YNthR6RBGnkg G+HSZ/uiWfZRqybyA9m4hl6UR5WTT0NBiyT33/2nLFK6vhVmekRJ1PLcVhkMV4w8Ob1xe/ bC6HqAXaEt4/42GDl6N+xhIyO8S0rhQmAsktBMF/EwikUaepHw16PW9FMiOFA6tA8lQN+d AZDyxXi6/KqV5X0jLA0s9jZJOLghapZ1ZfdsO1upCUnkL5SLCIyeGvd/VNvcKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678802335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mm7vUlYAvfHWzIncQyk+AlJJV4+1ctfRRjhLO4AbjCs=; b=ty+pgC0rvvfvmBhwvhu/k4gTNDN1fMatFtOBS89+OneP5pZlo9VC8YRyNWgy5dbQs+0eCt 6p58EdwPR95N7CApyZc9upyid1kLjk6MUzKTMOgY713VyYYdePLie9sj2w1UQfpnNsktSX 7gS9NvOydm0/syBaXDNJ+R/XAwXaWl3SO8RB69YyOUQrh6M1a/LKPmDw8aACjQBZBRjvaU x1X49moK1gyI2i+jrT7T6SDGHKnMe/QWlL2ekBUfJr8Y2JJfILIqOnU4SDRKGOyg6mrPPB UbWukgfH+gPxy89FQrRARBT8sAMjb881U5dm7TSHQ9x5rabwRXG0mOebkNsnmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678802335; a=rsa-sha256; cv=none; b=uSp7pgHNeYRJ6s75kK0DSzRsmCvqFCHDMLn06ipchSAfB4v75g09Elx1Z6MARr9gQ+ECN0 QhRq5jXzWTWOtuxGhG0xJmNkSN1RJWvrbanRh0HYTM9rtaZxvWy/Ut6Ip2bfs7ENR/SXHH zQKXfyKIha8wLX1lM0922v9yRTNe1Ka/Ujo6cRPmEj00FzHAz8eQuxEkINEiksUMEAGLK+ vEeR2QpKdlnEl8+VbADXmimItFhlKUkqHif5jF7lwicNt4OnTY0pq3boVut9fIUYyHFcEl emvmV0d4J9Za5/cEiOG24fycWsDSu3ojK6O+tfsL/GVoOiZ7mobeLWtRGyw0RA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbZrH1BtdzdVc; Tue, 14 Mar 2023 13:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EDwtof011073; Tue, 14 Mar 2023 13:58:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EDwtEK011072; Tue, 14 Mar 2023 13:58:55 GMT (envelope-from git) Date: Tue, 14 Mar 2023 13:58:55 GMT Message-Id: <202303141358.32EDwtEK011072@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: 069fb41af5bc - releng/13.2 - nvmecontrol: Fix default ns create parameters. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/13.2 X-Git-Reftype: branch X-Git-Commit: 069fb41af5bca224caf6f96b50fed55fa7755c5b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=069fb41af5bca224caf6f96b50fed55fa7755c5b commit 069fb41af5bca224caf6f96b50fed55fa7755c5b Author: Alexander Motin AuthorDate: 2023-03-09 15:19:00 +0000 Commit: Alexander Motin CommitDate: 2023-03-14 13:58:02 +0000 nvmecontrol: Fix default ns create parameters. Instead of passing 0xff's for all unset parameters, prefer reasonable defaults. It is much easier to use it this was without specs in hand. PR: 269912 Approved by: re (cperciva) (cherry picked from commit 20dc2c4d11ddaa980c491116b65c51ab522028e9) (cherry picked from commit de0b02cb7b112947191af96dd34e7a95b760019c) --- sbin/nvmecontrol/ns.c | 56 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index 763c12aa11af..040918caf9c5 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -577,30 +577,48 @@ nscreate(const struct cmd *f, int argc, char *argv[]) NVME_CTRLR_DATA_OACS_NSMGMT_MASK) == 0) errx(EX_UNAVAILABLE, "controller does not support namespace management"); - /* Allow namespaces sharing if Multi-Path I/O is supported. */ - if (create_opt.nmic == NONE) { - create_opt.nmic = cd.mic ? (NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK << - NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) : 0; - } - memset(&nsdata, 0, sizeof(nsdata)); nsdata.nsze = create_opt.nsze; nsdata.ncap = create_opt.cap; - if (create_opt.flbas == NONE) - nsdata.flbas = ((create_opt.lbaf & NVME_NS_DATA_FLBAS_FORMAT_MASK) - << NVME_NS_DATA_FLBAS_FORMAT_SHIFT) | - ((create_opt.mset & NVME_NS_DATA_FLBAS_EXTENDED_MASK) - << NVME_NS_DATA_FLBAS_EXTENDED_SHIFT); - else + if (create_opt.flbas != NONE) { nsdata.flbas = create_opt.flbas; - if (create_opt.dps == NONE) - nsdata.dps = ((create_opt.pi & NVME_NS_DATA_DPS_MD_START_MASK) - << NVME_NS_DATA_DPS_MD_START_SHIFT) | - ((create_opt.pil & NVME_NS_DATA_DPS_PIT_MASK) - << NVME_NS_DATA_DPS_PIT_SHIFT); - else + } else { + /* Default to the first format, whatever it is. */ + nsdata.flbas = 0; + if (create_opt.lbaf != NONE) { + nsdata.flbas |= (create_opt.lbaf & + NVME_NS_DATA_FLBAS_FORMAT_MASK) + << NVME_NS_DATA_FLBAS_FORMAT_SHIFT; + } + if (create_opt.mset != NONE) { + nsdata.flbas |= (create_opt.mset & + NVME_NS_DATA_FLBAS_EXTENDED_MASK) + << NVME_NS_DATA_FLBAS_EXTENDED_SHIFT; + } + } + if (create_opt.dps != NONE) { nsdata.dps = create_opt.dps; - nsdata.nmic = create_opt.nmic; + } else { + /* Default to protection disabled. */ + nsdata.dps = 0; + if (create_opt.pi != NONE) { + nsdata.dps |= (create_opt.pi & + NVME_NS_DATA_DPS_MD_START_MASK) + << NVME_NS_DATA_DPS_MD_START_SHIFT; + } + if (create_opt.pil != NONE) { + nsdata.dps |= (create_opt.pil & + NVME_NS_DATA_DPS_PIT_MASK) + << NVME_NS_DATA_DPS_PIT_SHIFT; + } + } + if (create_opt.nmic != NONE) { + nsdata.nmic = create_opt.nmic; + } else { + /* Allow namespaces sharing if Multi-Path I/O is supported. */ + nsdata.nmic = cd.mic ? (NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK << + NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) : 0; + } nvme_namespace_data_swapbytes(&nsdata); memset(&pt, 0, sizeof(pt)); From nobody Tue Mar 14 14:19:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbbJB2rMkz3yKZ9; Tue, 14 Mar 2023 14:19: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 4PbbJB24zZz45mT; Tue, 14 Mar 2023 14:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678803578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LPILlxu61jliviLEQ0Cq/AKdEEi1hKJme7kK06oBM6g=; b=oZCZViX9yKzXh6DvM/hDs85HEvvlABZzjFPjor3yDKIVRHocQtmQB3RbXn2WC1M3KvKxGv vCC49p3D8WB3YRX37cGllFDdKa8sx+vS5bv5j6YCgLHadC6UORce8RREObBOJeWiqyur60 jht9bdZZL5Su9EUbdSzBA2ywRwjRCxmzcbJpqXZaK4PnVOql2hH7D3iuNTMs40wIPFBz76 Ny/ZsrTrQZP1/p1kJamD+vycAv8D4lrK0dR3eUNS9fniSL1keHErJgwRhprnYAuFpO7Je3 T70sqzV94qJMTpYZX/fdeh5iVxz5SgpCXw0OE3+y3CrgsN649CNJcDMM1c2eLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678803578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LPILlxu61jliviLEQ0Cq/AKdEEi1hKJme7kK06oBM6g=; b=bh+Yrx6T9hlwdnyEUtqdfI/FYspLsZ18TDcgEAb8+swmEH6iOXUgw7Uo45sHwpbadWJAzX PXNHfZL98jzw1CUAl077ZOIrMCqNUtZPpxU7xVHNBEs7iv2oJNUEX5Y73YXDJJZdiBVjO/ GaNxQfkPUk1I4kdeH7W1fmCpLuIn8VvAqIKO+akn02SLm63ZaERXuOwV4YhGhCzlhsGn7f Y/vLT3HuBiBdBNfAwuhA43L+tdelpPDXuxWxZIcNr0Te8l5aENh7mYEeJclQQRMB1FKSgV utWd/fZPPe8MMMezgxE8+jE8FD/xqTLcGdTeJaVTcLU7CdE9CGG0PXuKN7Op8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678803578; a=rsa-sha256; cv=none; b=TEmRYjo3GFqAEn01clDEPMJeKlSbCfi9YNKIfSRrv/HvCDWiE0CPwhu9LEMhoEjXawdSxh F4n59OovUCWEes6yp56uwNcSQcWsh4awOLh/JJ0nsFXbB26ccIVRdiEVLN4iLSiEkgwPtJ krqE425ncNnfj4kOk/yQ98AmluJpVcsKpzPs/yXNqHubqNZTLEzunJOGFHZDYdmZxwgEqv qQI9TmcUn4MAUugffuydGrupUN1QPULCqp7nkSsRDaTHa8LpbY7qLB5t621A2Xq+HawrYP Rgt+T1DVV5ycPa1yua0Qe6AHYHAFgTrLWcEoMFP2HwmG2h98d9H5X1zahkILMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbbJB0wTfzds2; Tue, 14 Mar 2023 14:19:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EEJb7p044490; Tue, 14 Mar 2023 14:19:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EEJbtH044489; Tue, 14 Mar 2023 14:19:37 GMT (envelope-from git) Date: Tue, 14 Mar 2023 14:19:37 GMT Message-Id: <202303141419.32EEJbtH044489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: a849842f510a - main - loader: Add support for booting from a ZFS snapshot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a849842f510af48717e35ff709623e0dd1b80b20 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=a849842f510af48717e35ff709623e0dd1b80b20 commit a849842f510af48717e35ff709623e0dd1b80b20 Author: Allan Jude AuthorDate: 2022-11-26 18:11:13 +0000 Commit: Allan Jude CommitDate: 2023-03-14 14:18:29 +0000 loader: Add support for booting from a ZFS snapshot When booting from a snapshot we need to follow a different code path to turn the objset ID into the name, and for forward lookups we need to walk the parent's snapnames_zap. With this, it is possible to set the pools BOOTFS property to a snapshot and boot with a read-only filesystem of that snapshot. Reviewed by: tsoome, rew, imp Sponsored By: Beckhoff Automation GmbH & Co. KG Sponsored By: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38600 --- stand/libsa/zfs/zfsimpl.c | 56 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index 36c90613e827..76063e76225f 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -3068,11 +3068,12 @@ zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result) char name[256]; char component[256]; uint64_t dir_obj, parent_obj, child_dir_zapobj; - dnode_phys_t child_dir_zap, dataset, dir, parent; + dnode_phys_t child_dir_zap, snapnames_zap, dataset, dir, parent; dsl_dir_phys_t *dd; dsl_dataset_phys_t *ds; char *p; int len; + boolean_t issnap = B_FALSE; p = &name[sizeof(name) - 1]; *p = '\0'; @@ -3083,6 +3084,8 @@ zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result) } ds = (dsl_dataset_phys_t *)&dataset.dn_bonus; dir_obj = ds->ds_dir_obj; + if (ds->ds_snapnames_zapobj == 0) + issnap = B_TRUE; for (;;) { if (objset_get_dnode(spa, spa->spa_mos, dir_obj, &dir) != 0) @@ -3098,6 +3101,34 @@ zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result) &parent) != 0) return (EIO); dd = (dsl_dir_phys_t *)&parent.dn_bonus; + if (issnap == B_TRUE) { + /* + * The dataset we are looking up is a snapshot + * the dir_obj is the parent already, we don't want + * the grandparent just yet. Reset to the parent. + */ + dd = (dsl_dir_phys_t *)&dir.dn_bonus; + /* Lookup the dataset to get the snapname ZAP */ + if (objset_get_dnode(spa, spa->spa_mos, + dd->dd_head_dataset_obj, &dataset)) + return (EIO); + ds = (dsl_dataset_phys_t *)&dataset.dn_bonus; + if (objset_get_dnode(spa, spa->spa_mos, + ds->ds_snapnames_zapobj, &snapnames_zap) != 0) + return (EIO); + /* Get the name of the snapshot */ + if (zap_rlookup(spa, &snapnames_zap, component, + objnum) != 0) + return (EIO); + len = strlen(component); + p -= len; + memcpy(p, component, len); + --p; + *p = '@'; + issnap = B_FALSE; + continue; + } + child_dir_zapobj = dd->dd_child_dir_zapobj; if (objset_get_dnode(spa, spa->spa_mos, child_dir_zapobj, &child_dir_zap) != 0) @@ -3127,9 +3158,11 @@ zfs_lookup_dataset(const spa_t *spa, const char *name, uint64_t *objnum) { char element[256]; uint64_t dir_obj, child_dir_zapobj; - dnode_phys_t child_dir_zap, dir; + dnode_phys_t child_dir_zap, snapnames_zap, dir, dataset; dsl_dir_phys_t *dd; + dsl_dataset_phys_t *ds; const char *p, *q; + boolean_t issnap = B_FALSE; if (objset_get_dnode(spa, spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, &dir)) @@ -3160,6 +3193,25 @@ zfs_lookup_dataset(const spa_t *spa, const char *name, uint64_t *objnum) p += strlen(p); } + if (issnap == B_TRUE) { + if (objset_get_dnode(spa, spa->spa_mos, + dd->dd_head_dataset_obj, &dataset)) + return (EIO); + ds = (dsl_dataset_phys_t *)&dataset.dn_bonus; + if (objset_get_dnode(spa, spa->spa_mos, + ds->ds_snapnames_zapobj, &snapnames_zap) != 0) + return (EIO); + /* Actual loop condition #2. */ + if (zap_lookup(spa, &snapnames_zap, element, + sizeof (dir_obj), 1, &dir_obj) != 0) + return (ENOENT); + *objnum = dir_obj; + return (0); + } else if ((q = strchr(element, '@')) != NULL) { + issnap = B_TRUE; + element[q - element] = '\0'; + p = q + 1; + } child_dir_zapobj = dd->dd_child_dir_zapobj; if (objset_get_dnode(spa, spa->spa_mos, child_dir_zapobj, &child_dir_zap) != 0) From nobody Tue Mar 14 15:04:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbcJ41mh3z3yMrC; Tue, 14 Mar 2023 15:04: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 4PbcJ415NNz48Sv; Tue, 14 Mar 2023 15:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678806276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hJvTHCMH215yIZLXXFY7DkZ3NGisrHDgH6TJ1vvlBN4=; b=jTCBmF+sjBR2+1DFCc57jRKFtOdp36C7Zd7I4P5NXouW3WE8Um6XB4L2DmLXo0H1T9seU1 a1e2uSkZ76n2RXAa1H5zWFzW+zUr/UPG+W4l+t0s92EASwMJTWh0eSWg+EY7iJgxBXVLHV IYE+LWgiJrXy9oeTBJif3cLAKr6hbnvJvZp17gfCScScs68S6vGv+yEamTAaLunyyw589k 2qv2GfJR0EkLO5PUAop9JY/a9DTRrZLbA+odQuQWmSyRvZtOQAJCuULugApqnLUs+rrXlM 8Dj2Hv4sEsUUxv73nKERu245uxPIN4kINCLFURXlVGL1HykcrwqkQc+LQfIt/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678806276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hJvTHCMH215yIZLXXFY7DkZ3NGisrHDgH6TJ1vvlBN4=; b=oOS90whaNEGoenO3ug7Yf4Tx4NxoP13I0B0ZStxFxquduzE0Q+m3Wlvln9gbHq/YcyFdUL 8cIDk/48hsHRWfvhDPb0DwujdSJHLaBxSTDFjepFgiKbSLrDzfYYynODvo39qmb/a4LWeN avOk7OQx15DWM4iCy75bQL5tav1D6rdI9sjs7Dw6agYv9Ih3Pji/+bzW8O53H/6oADhvVq i8YchomljWUc/vvzUMH18s+6WlhoD8NDrazSC5UgH5eaaFNg2OQo2L6YdzBOOKpNT8taU+ KPxrrLlVQctJTqic6scUJahhw4LZN1WaELNaB6ur/iztxua6o/ndZczIUNi8/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678806276; a=rsa-sha256; cv=none; b=Y+xwMbF0wjO/qe8TkCbtYsFAPP83h1DDmHn0Y4jtO607Bgw+XuHfjluJVCYUhHXYqLKK49 NjTIc8tV9mPpPuvNuA5TcOlJL7UsX/z4S90rwNT9L1YDNbhKjrFyns9zR5RmsxMdc3nuf/ TCNiM0BkJNeHwOEzet9Dszj1R+5B0rPmLo4t+hWRZXnI0vR0YwMaej5uQWPY4JA7WMv23z iWz/5AfsPqruRN2QrYAhJZldltk3Mu8aqDc4aeX+jaY/tNOVuD5Gj902stT02z6Xnuzavq pPqk/HZz1T3aI8B2gJMyqYGryqtTT9cSeWHcBnUC960KvYVMG0kUzmjKyp2WSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbcJ36y09zgFr; Tue, 14 Mar 2023 15:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EF4Z3M026039; Tue, 14 Mar 2023 15:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EF4Ztx026038; Tue, 14 Mar 2023 15:04:35 GMT (envelope-from git) Date: Tue, 14 Mar 2023 15:04:35 GMT Message-Id: <202303141504.32EF4Ztx026038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2ef8baba4c0c - main - Increase protection provided by veriexec with new unlink/rename hooks. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ef8baba4c0c75f39e6e67b264ae71507bbb4782 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2ef8baba4c0c75f39e6e67b264ae71507bbb4782 commit 2ef8baba4c0c75f39e6e67b264ae71507bbb4782 Author: dl AuthorDate: 2023-03-14 04:26:41 +0000 Commit: Warner Losh CommitDate: 2023-03-14 15:04:31 +0000 Increase protection provided by veriexec with new unlink/rename hooks. Functions implemented : - mac_veriexec_vnode_check_unlink: Unlink on a file has been requested and requires validation. This function prohibits the deleting a protected file (or deleting one of these hard links, if any). - mac_veriexec_vnode_check_rename_from: Rename the file has been requested and must be validated. This function controls the renaming of protected file - mac_veriexec_vnode_check_rename_to: File overwrite rename has been requested and must be validated. This function prevent overwriting of a file protected (overwriting by mv command). The 3 fonctions together aim to control the 'removal' (via unlink) and the 'mv' on files protected by veriexec. The intention is to reach the functional level of NetBSD veriexec. Add sysctl node security.mac.veriexec.unlink to toggle control on syscall unlink. Add tunable kernel variable security.mac.veriexec.block_unlink to toggle unlink protection. Add the corresponding read-only sysctl. [ tidied up commit message, trailing whitespace, long lines, { placement ] Reviewed by: sjg, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/613 --- sys/security/mac_veriexec/mac_veriexec.c | 163 +++++++++++++++++++++++++++++-- 1 file changed, 155 insertions(+), 8 deletions(-) diff --git a/sys/security/mac_veriexec/mac_veriexec.c b/sys/security/mac_veriexec/mac_veriexec.c index 99a76abd4afb..6f06a8577212 100644 --- a/sys/security/mac_veriexec/mac_veriexec.c +++ b/sys/security/mac_veriexec/mac_veriexec.c @@ -73,6 +73,7 @@ static int sysctl_mac_veriexec_state(SYSCTL_HANDLER_ARGS); static int sysctl_mac_veriexec_db(SYSCTL_HANDLER_ARGS); +static struct mac_policy_ops mac_veriexec_ops; SYSCTL_DECL(_security_mac); @@ -94,8 +95,11 @@ SYSCTL_PROC(_security_mac_veriexec, OID_AUTO, db, 0, 0, sysctl_mac_veriexec_db, "A", "Verified execution fingerprint database"); + static int mac_veriexec_slot; +static int mac_veriexec_block_unlink; + MALLOC_DEFINE(M_VERIEXEC, "veriexec", "Verified execution data"); /** @@ -235,8 +239,8 @@ mac_veriexec_vfs_unmounted(void *arg __unused, struct mount *mp, * * @param label the label that is being initialized */ -static void -mac_veriexec_mount_init_label(struct label *label) +static void +mac_veriexec_mount_init_label(struct label *label) { SLOT_SET(label, 0); @@ -252,8 +256,8 @@ mac_veriexec_mount_init_label(struct label *label) * * @param label the label that is being destroyed */ -static void -mac_veriexec_mount_destroy_label(struct label *label) +static void +mac_veriexec_mount_destroy_label(struct label *label) { SLOT_SET(label, 0); @@ -296,7 +300,7 @@ mac_veriexec_vnode_destroy_label(struct label *label) * @brief Copy the value in the MAC per-policy slot assigned to veriexec from * the @p src label to the @p dest label */ -static void +static void mac_veriexec_copy_label(struct label *src, struct label *dest) { @@ -505,7 +509,7 @@ mac_veriexec_check_vp(struct ucred *cred, struct vnode *vp, accmode_t accmode) /* * If file has a fingerprint then deny the write request, * otherwise invalidate the status so we don't keep checking - * for the file having a fingerprint. + * for the file having a fingerprint. */ switch (status) { case FINGERPRINT_FILE: @@ -531,7 +535,7 @@ mac_veriexec_check_vp(struct ucred *cred, struct vnode *vp, accmode_t accmode) default: /* * Caller wants open to fail unless there is a valid - * fingerprint registered. + * fingerprint registered. */ MAC_VERIEXEC_DBG(2, "fingerprint status is %d for dev " "%ju, file %ju.%ju\n", status, @@ -571,6 +575,136 @@ mac_veriexec_vnode_check_open(struct ucred *cred, struct vnode *vp, return (error); } +/** + * @brief Unlink on a file has been requested and may need to be validated. + * + * @param cred credentials to use + * @param dvp parent directory for file vnode vp + * @param dlabel vnode label assigned to the directory vnode + * @param vp vnode of the file to unlink + * @param label vnode label assigned to the vnode + * @param cnp component name for vp + * + * + * @return 0 if opening the file should be allowed, otherwise an error code. + */ +static int +mac_veriexec_vnode_check_unlink(struct ucred *cred, struct vnode *dvp __unused, + struct label *dvplabel __unused, struct vnode *vp, + struct label *label __unused, struct componentname *cnp __unused) +{ + int error; + + /* + * Look for the file on the fingerprint lists iff it has not been seen + * before. + */ + if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) + return (0); + + /* + * Check if it's a verified file + */ + error = mac_veriexec_check_vp(cred, vp, VVERIFY); + if (error == 0) { /* file is verified */ + MAC_VERIEXEC_DBG(2, + "(UNLINK) attempted to unlink a protected file (euid: %u)", cred->cr_uid); + + return (EAUTH); + } + return (0); +} + +/** + * @brief Rename the file has been requested and may need to be validated. + * + * @param cred credentials to use + * @param dvp parent directory for file vnode vp + * @param dlabel vnode label assigned to the directory vnode + * @param vp vnode of the file to rename + * @param label vnode label assigned to the vnode + * @param cnp component name for vp + * + * + * @return 0 if opening the file should be allowed, otherwise an error code. + */ +static int +mac_veriexec_vnode_check_rename_from(struct ucred *cred, + struct vnode *dvp __unused, struct label *dvplabel __unused, + struct vnode *vp, struct label *label __unused, + struct componentname *cnp __unused) +{ + int error; + + /* + * Look for the file on the fingerprint lists iff it has not been seen + * before. + */ + if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) + return (0); + + /* + * Check if it's a verified file + */ + error = mac_veriexec_check_vp(cred, vp, VVERIFY); + if (error == 0) { /* file is verified */ + MAC_VERIEXEC_DBG(2, + "(RENAME_FROM) attempted to rename a protected file (euid: %u)", cred->cr_uid); + return (EAUTH); + } + return (0); +} + + +/** + * @brief Rename to file into the directory (overwrite the file name) has been + * requested and may need to be validated. + * + * @param cred credentials to use + * @param dvp parent directory for file vnode vp + * @param dlabel vnode label assigned to the directory vnode + * @param vp vnode of the overwritten file + * @param label vnode label assigned to the vnode + * @param samedir 1 if the source and destination directories are the same + * @param cnp component name for vp + * + * + * @return 0 if opening the file should be allowed, otherwise an error code. + */ + static int +mac_veriexec_vnode_check_rename_to(struct ucred *cred, struct vnode *dvp __unused, + struct label *dvplabel __unused, struct vnode *vp, + struct label *label __unused, int samedir __unused, + struct componentname *cnp __unused) +{ + int error; + /* + * If there is no existing file to overwrite, vp and label will be + * NULL. + */ + if (vp == NULL) + return (0); + + /* + * Look for the file on the fingerprint lists iff it has not been seen + * before. + */ + if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) + return (0); + + /* + * Check if it's a verified file + */ + error = mac_veriexec_check_vp(cred, vp, VVERIFY); + if (error == 0) { /* file is verified */ + MAC_VERIEXEC_DBG(2, + "(RENAME_TO) attempted to overwrite a protected file (euid: %u)", cred->cr_uid); + return (EAUTH); + } + return (0); +} + + /** * @brief Check mode changes on file to ensure they should be allowed. * @@ -626,6 +760,16 @@ mac_veriexec_init(struct mac_policy_conf *mpc __unused) EVENTHANDLER_PRI_FIRST); EVENTHANDLER_REGISTER(vfs_unmounted, mac_veriexec_vfs_unmounted, NULL, EVENTHANDLER_PRI_LAST); + + /* Fetch tunable value in kernel env and define a corresponding read-only sysctl */ + mac_veriexec_block_unlink = 0; + TUNABLE_INT_FETCH("security.mac.veriexec.block_unlink", &mac_veriexec_block_unlink); + SYSCTL_INT(_security_mac_veriexec, OID_AUTO, block_unlink, + CTLFLAG_RDTUN, &mac_veriexec_block_unlink, 0, "Veriexec unlink protection"); + + /* Check if unlink control is activated via tunable value */ + if (!mac_veriexec_block_unlink) + mac_veriexec_ops.mpo_vnode_check_unlink = NULL; } /** @@ -685,7 +829,7 @@ mac_veriexec_syscall(struct thread *td, int call, void *arg) error = VOP_GETATTR(fp->f_vnode, &va, td->td_ucred); if (error) goto check_done; - + MAC_VERIEXEC_DBG(2, "mac_veriexec_fingerprint_check_image: " "va_mode=%o, check_files=%d\n", va.va_mode, ((va.va_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0)); @@ -729,6 +873,9 @@ static struct mac_policy_ops mac_veriexec_ops = .mpo_system_check_sysctl = mac_veriexec_sysctl_check, .mpo_vnode_check_exec = mac_veriexec_vnode_check_exec, .mpo_vnode_check_open = mac_veriexec_vnode_check_open, + .mpo_vnode_check_unlink = mac_veriexec_vnode_check_unlink, + .mpo_vnode_check_rename_to = mac_veriexec_vnode_check_rename_to, + .mpo_vnode_check_rename_from = mac_veriexec_vnode_check_rename_from, .mpo_vnode_check_setmode = mac_veriexec_vnode_check_setmode, .mpo_vnode_copy_label = mac_veriexec_copy_label, .mpo_vnode_destroy_label = mac_veriexec_vnode_destroy_label, From nobody Tue Mar 14 15:16:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbcZC2dwXz3yNnd; Tue, 14 Mar 2023 15:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbcZC1j91z4Bnm; Tue, 14 Mar 2023 15:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678807011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61r9vQ2RrD4MbTX7JT+rr9vwYTQkzi9+HeeAM3kN/1w=; b=eFw67Yn2jnsvo4mZuTQBF9Ovba9q4ClD8Yr/WKZks1Hf3d8YzCaMNfUI0a7+bw11/soHq1 33e2WX4tMkgjEdq1gfNI8NOR4kuqmTuJlQED+JeP5/5+NEHNRAfmzMxOPNfz4pBMGd5bLw nI3YNxtSzuZIlTsgpTiLwZsxgb4MiEEyGZ/Ng6CJRbzKaO5a5Uqj55CvMZ+n85COxB2uwl UBxCjxNqLOHHe3I5iHpeyD59a3RXsohRHJvU4AJIS7AeZBtqLAcqNuDaj4PTcwQrpgaNVU 2RKAZfUduAgWJWfrCmwlgRU7lpr3v44YHJXiSgS9GkiTEBSt2aV+9qmMq3LZZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678807011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61r9vQ2RrD4MbTX7JT+rr9vwYTQkzi9+HeeAM3kN/1w=; b=ZMp4hdPlGgQzdgiGHOoUOt61B8zSCpmY47GqtHPU80Z3MnNjZln2M0ir+C5Bf8ApRecFW6 UEyQZUMCDwI6YuIoy+MHUpUWpM16TVydwgd9WvvcYVvgXQjkBlS5jb01tlu6pYNgt9Bzkk cy6pfR459PpS24o4r2yFYVCT1OFHIsagTyGts2DqK5nhE6r3DSz8bydRr+SjnuNnIpFOEE Reor/EPpuA6F/U2NBA/yDCVfLhWPtWdRlTMOpyygyYR6YOO3bRfDmR7OcRwJuzFkIoqVdV heoQbkaFwKt+QX69eFt/qpwdw9zD6A8sZHaJ6oxCWkVqSg5fNPDnNPXxAJMq5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678807011; a=rsa-sha256; cv=none; b=FQlihYHNG2ZoXoZGZHkyI3iP71syIbH1thc4OoylfIXwR7hy+pJudxTQbSokdFYan5V00D K+PNOH35YpcAzAoh4ndQ1UShr+n+zC8NmANAaCSG8qyAndGY6ZgUdx9gZ0RAHF5QptwBvW BubqcWvqqMLuEVdOmWcOPHkt5R91P8Dh3NBeHbLTP4hSW99X0ahnVJ64DuY21dXu2qxVih CsAvzQ5mn4BhZmkXC9QdeVkpJMn7hsds3hoQakJigZgiVF+dzOXIwoVLx/M+Gw+er0QTWL 0BXdQB3YAXYfuaMau5MFQ+uWoNAyXpUzI0111Jm8GWkA5CeAY6LLOJZsywfhlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbcZC0dlqzgKC; Tue, 14 Mar 2023 15:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EFGocq042338; Tue, 14 Mar 2023 15:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EFGoYK042337; Tue, 14 Mar 2023 15:16:50 GMT (envelope-from git) Date: Tue, 14 Mar 2023 15:16:50 GMT Message-Id: <202303141516.32EFGoYK042337@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: a14756f5c351 - stable/13 - epair: Fix the RSS build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a14756f5c35114911ad3de1b750c6705bb14b0ac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a14756f5c35114911ad3de1b750c6705bb14b0ac commit a14756f5c35114911ad3de1b750c6705bb14b0ac Author: Mark Johnston AuthorDate: 2023-03-14 14:57:33 +0000 Commit: Mark Johnston CommitDate: 2023-03-14 14:57:33 +0000 epair: Fix the RSS build This is a direct commit to stable/13. Reported by: Marek Zarychta Fixes: c3bd32f225ec ("epair: Avoid loading m_flags into a short") --- sys/net/if_epair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 68b68c11af06..aebcaca0cd2f 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -223,7 +223,7 @@ epair_select_queue(struct epair_softc *sc, struct mbuf *m) break; } } - bucket %= osc->num_queues; + bucket %= sc->num_queues; #else bucket = 0; #endif From nobody Tue Mar 14 15:58:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbdV10FGZz3yQY0; Tue, 14 Mar 2023 15:58: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 4PbdV06bBJz4FMZ; Tue, 14 Mar 2023 15:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Adrhyei+W7KSXZ0BuXqjtFLunA23DiOO8c3VGYjZhSM=; b=hwHd6b/2MgFzxHhCVUmcSE84SeORHyh9H/h3te53Q3SBTTxowa3OibSzkUMpK5B2q9q7os HMKnGLVsp+rJ6B0PseiSuFSWjlewIC27xO5Tu0+rHzcy70XL15th5AVrqlErcI6HYevA1V SXM9kjU0EALpiuzdSM/3faj6AdrKTR14PLbptedWBTQ91CNQHwrxVBOta1+BBOE7JeFd20 jrVB197mYBet+jiO4WBwo+AzojlZq8+/Dmo5Ql8AeOrdFo41b1PdJuP5oX2AQtB87atLnb c9kAHzdJQUoKNBsw/X4vNLGProT55uRSvM9Trwg6+GIVktqIJ7zDJKdu9KC1Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Adrhyei+W7KSXZ0BuXqjtFLunA23DiOO8c3VGYjZhSM=; b=M2ptYvrUjg0U9LreyHMevZ8WOhy8EfxUvzx9F/ttsUm4XgPsKpR2rV+B0QivvW1ZEpZSRR mvFNgDztNzKQPn/L2WrBDlBGjgZ5iBr/6uaZ+EWOVkPqkd9yklwG8pwHdk4S2+4CQ9TKwN afxfTiWHE9/eqJtmtU3wratibPx71PUVPyNeM/3AUq03tNddxJh90/YQQ2Eto27JXJ7c+M XN51kOKjyB29P4AjB9yq87mnUbRmb/E87IYzt7lFEnSTgudpQc5Xm2TqZXb7wTgQJKGJIN En/Sz8tbl6NR3RQFzlMhSLgXpoGHVG8eUfg4aEIVcU9rqbb4MBACfZtcB09S1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678809496; a=rsa-sha256; cv=none; b=jCXkJ6tSv6dMWxyCuuXkYiTefWS6QtZJq/98Ur3LhKbrG9e3DIywmWERsqaj+D8C5HdpNH JPi9LxsveNvakddL6CQCrbCRe4LoVD3Fr9GXAwg7wAf3WcFAkCvyJ4bEXiv8KZ2AT2ArCX LKNoN+YjmMPZToN3+qyhSCTJUZGm/yLfJvaicbVVQyBelhB8I7WKf/AHBRUWEqJrfsJ04c /txolv8heNzbBt+FNN5y7k1lJs1xcbMKRpVCNNF0nbtQ/b1ysG6WKvrgCZ6WeFlm9hT5CZ bnk/kfDV8szae8qxtaJ6lJFq1WV+ERFl4bUTiI+TiLAUEAChCKmnUED9g0ZA6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbdV05SlJzhT6; Tue, 14 Mar 2023 15:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EFwGNv007878; Tue, 14 Mar 2023 15:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EFwG7h007877; Tue, 14 Mar 2023 15:58:16 GMT (envelope-from git) Date: Tue, 14 Mar 2023 15:58:16 GMT Message-Id: <202303141558.32EFwG7h007877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e9ea690ae848 - main - udp: Fix a memory leak in udp6_send() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9ea690ae8486b74d6eeca62e316bf591d8aea4e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e9ea690ae8486b74d6eeca62e316bf591d8aea4e commit e9ea690ae8486b74d6eeca62e316bf591d8aea4e Author: Mark Johnston AuthorDate: 2023-03-14 14:26:29 +0000 Commit: Mark Johnston CommitDate: 2023-03-14 15:58:02 +0000 udp: Fix a memory leak in udp6_send() Reviewed by: glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38993 --- sys/netinet6/udp6_usrreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 8a95e1623f9c..c5f2cc452dfb 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -766,10 +766,10 @@ udp6_send(struct socket *so, int flags_arg, struct mbuf *m, * Given this is either an IPv6-only socket or no INET is * supported we will fail the send if the given destination * address is a v4mapped address. - * - * XXXGL: do we leak m and control? */ INP_UNLOCK(inp); + m_freem(m); + m_freem(control); return (EINVAL); } From nobody Tue Mar 14 15:58:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbdV20V9Lz3yQM1; Tue, 14 Mar 2023 15:58: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 4PbdV16s4sz4F8C; Tue, 14 Mar 2023 15:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=thnFvPD7/bYesASiNrh331F8YE3jwH0l4MkOVOL5afo=; b=BKOIv/MbRLt4Vn+KP4wcKG5jOawbJt7K6dUndFMiJWI6WIfIr2RqTEcV2YbqKU7g5QyYA5 H1+wcfXPfUblTR6rw+8K7MgGHH2WbnbO9fbwc5vmh0vzwAnjW4WKAEtq4un73vX83zPbor d2gXTfgO6mW4091OIk610BVli+xn7Ykjb1aOa4kCzoeNIfobWyL1aBp+QoJ5J1tJUDy4LB Kk6spLIGviu/z9CoimVKElPFo36HNSxtNuNgVoyMZrt53Gh022LempWj25k05FNBxfZ26Y TrAc8kICsHbtgKCtJ3DviWTM+HA6+ENe/Ffxsu2w6x77ZpgiX6Fynf4p7aGUcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=thnFvPD7/bYesASiNrh331F8YE3jwH0l4MkOVOL5afo=; b=yHUgKYYxGKGhxq1xktS3zE5PEjixHGxhFUawMaUDDBO8LGT3FOW3bhGG6vm2NRplsigMv3 /OHkmCok0p5vEvDJrVsjcAoJ7vq6eLP7AkNZZoOlifw/oJB98H0+rGDycHoO7VcaOeTvNq 951mxFXa7FT4uRi5x8UaCOI2dS6Zw9qZpPiA3tFWsjkzxQIu0OcrWNCvl5fwRenl7biC8x TK7bokxkBwKXGNC/AgGo1SQiiFeV9s93QlhgiRubzgzkTEFTKz0fXd0jI9Aalj7EozoDIJ KCEKdoIGOFdr3n6aTt/cWtJjxO4SXn5otx0V1m+nAhM4p2sN8hnaL2sBD59dQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678809498; a=rsa-sha256; cv=none; b=NvBrK/CHzDQiDKVXisi02go8qwC8P0w7ndfsG1nodzJ3j9VtNWOPDZ+AHzXaI4+QC4Ep0D BtEfrPUeo6BeaN3n1afdvSL+3ATItUMAARFQIZ8qQ0OjDRqD7lnnSUNB0yrUqpfb5NFmuZ P8dUXrsZXNRfvy0UfLvbPGam4tXb6gMNC6MirT4LT4eKRoiKWSxjH78l+c4aFl4L8BjDQY O2tMxxEZDgtADj2RqaeTF+8HYMTQToMy+ItPk+eVmizFLQaSuhdzkWDq0YJk6zqCzedNoe tOh64KvHijPtVkLR2A4PFetCh59810gitFMAqatjsgiPwbYObxHF7UvI6QyVhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbdV15xngzhT7; Tue, 14 Mar 2023 15:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EFwHib007905; Tue, 14 Mar 2023 15:58:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EFwHpq007904; Tue, 14 Mar 2023 15:58:17 GMT (envelope-from git) Date: Tue, 14 Mar 2023 15:58:17 GMT Message-Id: <202303141558.32EFwHpq007904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f32d6f745d0e - main - ping6: Use errx to avoid appending a specious error message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f32d6f745d0ef7ca045fc5946fa8d02e86afcf47 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f32d6f745d0ef7ca045fc5946fa8d02e86afcf47 commit f32d6f745d0ef7ca045fc5946fa8d02e86afcf47 Author: Jose Luis Duran AuthorDate: 2023-03-14 15:08:54 +0000 Commit: Mark Johnston CommitDate: 2023-03-14 15:58:02 +0000 ping6: Use errx to avoid appending a specious error message Reviewed by: asomers, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38418 --- sbin/ping/ping6.c | 2 +- sbin/ping/tests/test_ping.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/ping/ping6.c b/sbin/ping/ping6.c index 74d36f0357f8..5449d02a5d56 100644 --- a/sbin/ping/ping6.c +++ b/sbin/ping/ping6.c @@ -580,7 +580,7 @@ ping6(int argc, char *argv[]) case 'W': t = strtod(optarg, &e); if (*e || e == optarg || t > (double)INT_MAX) - err(EX_USAGE, "invalid timing interval: `%s'", + errx(EX_USAGE, "invalid timing interval: `%s'", optarg); options |= F_WAITTIME; waittime = (int)t; diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 913948d18b3e..186790853314 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -736,7 +736,6 @@ PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 "stdout": "", "stderr": "ping: invalid timing interval: `x'\n", }, - marks=pytest.mark.skip("XXX currently failing"), id="_Wx_localhost", ), ] From nobody Tue Mar 14 15:58:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbdV30bgWz3yQPN; Tue, 14 Mar 2023 15:58: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 4PbdV308gBz4FHm; Tue, 14 Mar 2023 15:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AwabSpvGsoIXhcfkWdRoUmqO+rIPZ6D43lbRZ2IfcZg=; b=jU8RqEzGMs19kVJw7E/yfEtlhhjDQep5YmpjmXhCmIxjuj81RBMJ1HzxCIX5fNUZN7P5Wb IgxR4AJSxnekyH6BGAtB2Lw9TmPc2jXQBdTN+nElTfwLAU7XI6/KtdtOBtJ++jAaWVPpj2 sHM/H3hZ+i0gA+jY86YKyX7EeohXQCjJ3tLLRnI1TKGC3UE9hQoavAjFe7GT8XbRBYBR6J jjwCAfarC7QVxek+CePzNsLuJK2MpvYyDepdpGvCMJGGqfvkq93x5JVcR6hUX4KxJqmi2V lqAB2TzlcFIJ09qx5YhuuRngpgwrrynQT+LCUuqvIvKKfF4xtS5Y9/eyqCOHgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AwabSpvGsoIXhcfkWdRoUmqO+rIPZ6D43lbRZ2IfcZg=; b=gKwhchuP7xgqUY8gp/PhlJvcB2J7FMLMCBzrWVxrPTvwgkbq1sif31UtWYfRUHjpLBKzZQ oCx/zRgP+bor71JKkpVhzIeaiftuyDtEXoBdrqQTn+Vfwjx6gjv+01REukAR4MPgfxwhze T43oLvyQ2qS+WOwaawpZFsdmweY0tA201lB2V23CMdMyPZJdkuuXXLBvpyfdj9/BOFw6qr poTPbh529oGVweC1/hMavgaC0kGEdlD+CjYZRA2jRVEDx8xQYUB3Ej/2pDFpJXrvvhDa1O 6+7nGAq6cAcF/YBMGWx0XTNj7HxB4hxvmP2+Yl3nVBV9ogtbnmX/N7+QL9wbeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678809499; a=rsa-sha256; cv=none; b=QIr8l/tcgUNyuZ+BMT+fMqwoyLVInKJa2AZFtOJiKCQkBXClvrmkwU2QAqW4F+eliVEWpd eO/zvzmeBRgXuM48XR1IPai+3WXzO8HYj4GD5xfLE9GJTD4UcfBKoCPiyawNjMPyTMJTzR 5sn977LdlSAt2GzKYyPmlntOWs956ArlGa5g9a8fLPwT4mBHEA67B7itiY4v8V/9/veIi5 yakP8w3QcoQ9+NQgINv0XxlvIsw9FET4Gw53IPzi0k/ZNO9Nphes4mhdTyHJVqgZLxefBR 6urm7f9SYJUz0E1fpOkd4N3oyG35Bu4+VAF3RAYfFREyiM2+15C8YX8k26Eoaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbdV26N5nzh17; Tue, 14 Mar 2023 15:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EFwIhI007931; Tue, 14 Mar 2023 15:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EFwIre007930; Tue, 14 Mar 2023 15:58:18 GMT (envelope-from git) Date: Tue, 14 Mar 2023 15:58:18 GMT Message-Id: <202303141558.32EFwIre007930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9185854d1965 - main - ping: Fix the display of Flags/Fragment Offset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9185854d19658289d0da93bb3af8e49cba184b7e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9185854d19658289d0da93bb3af8e49cba184b7e commit 9185854d19658289d0da93bb3af8e49cba184b7e Author: Jose Luis Duran AuthorDate: 2023-03-14 15:09:27 +0000 Commit: Mark Johnston CommitDate: 2023-03-14 15:58:02 +0000 ping: Fix the display of Flags/Fragment Offset In the IP header, Flags + Fragment Offset is a 16-bit field. Use ntohs() instead of ntohl(), otherwise the Flags/Fragment Offset values may not display correctly. Before (DF set) Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 0054 0001 0 0000 40 01 b6a4 192.0.2.1 192.0.2.2 After (DF set) Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 0054 0001 2 0000 40 01 b6a4 192.0.2.1 192.0.2.2 Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38479 --- sbin/ping/ping.c | 6 +++--- sbin/ping/tests/test_ping.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 2fc876e50776..00026c33a479 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1680,9 +1680,9 @@ pr_iph(struct ip *ip) (void)printf(" %1x %1x %02x %04x %04x", ip->ip_v, ip->ip_hl, ip->ip_tos, ntohs(ip->ip_len), ntohs(ip->ip_id)); - (void)printf(" %1lx %04lx", - (u_long) (ntohl(ip->ip_off) & 0xe000) >> 13, - (u_long) ntohl(ip->ip_off) & 0x1fff); + (void)printf(" %1x %04x", + (ntohs(ip->ip_off) & 0xe000) >> 13, + ntohs(ip->ip_off) & 0x1fff); (void)printf(" %02x %02x %04x", ip->ip_ttl, ip->ip_p, ntohs(ip->ip_sum)); memcpy(&ina, &ip->ip_src.s_addr, sizeof ina); diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 186790853314..a9b760ff7aca 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -919,7 +919,6 @@ Vr HL TOS Len ID Flg off TTL Pro cks Src Dst "stderr": "", "redacted": False, }, - marks=pytest.mark.skip("XXX currently failing"), id="_3_1_flags_DF", ), ] From nobody Tue Mar 14 15:58:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbdV41lSYz3yQPT; Tue, 14 Mar 2023 15:58: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 4PbdV41KQXz4FRM; Tue, 14 Mar 2023 15:58:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5IIDDDsW8cKP4ZyGjNSAf6FDsJuAK/ncZtuvKTWFP8Q=; b=dBXFDAU6NCYXjyA8fbe24WSaVZvvNxzmUclA+wgXVyb3FFDUUFDxmBCkrt+KsuIaA2MwM5 +FXzvf07FU/2Lr/L5/VFSRCS+k3TlHtOLUBN43hjJ4zm+ty8LuyHiV1wP49nbWpQW7qV/8 kLWXsNSV1/ejCCsNRvNEWVacAf0a1FW982zvvfm3vLg7i77mYlJGaQXpJRFtuFzWnj+/9O g6Bb3/L0P+GFsIy5YJOMhUWFUOl8stbpvV+cEZ6EVPgmho1iIz7sm5WHxAfmNtwy/WpJZT sEOyDkQllHSZmiUvupr2yhayU5SW9ArOXL/EyW+NPd/KjA0xqPVobTDRHfOSOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5IIDDDsW8cKP4ZyGjNSAf6FDsJuAK/ncZtuvKTWFP8Q=; b=epT8mLt0+Yni6x3FTejIOIQuBPux4Vv4clEzaXXSve3cy+XMewcMsyQwCiz9TmLlnXLIWz SlOeI5uEq28a5a+Hi6MvKxQouvCZK9WWxqVwEuCVbPh6ahr2nJ9H1UZYArxztMSR0iogw9 QyzFhq7+fAYlxIeO6bDeZTIFMmGqK+o7pmndUYXFkSD6oSKN6QFs/RSVkqZCmDlFG233lQ Pew/jImTf9UEErF58sFxqhdp4D7blNaT5ZgAJ49d6QtwL2gA0sxCc656fGjxM6yaFKsWpH PBsEuyl8CfV6j9I0/cEfhhUQ9fuUkEknLwEoUjSYeVGH69WLmwzg3qAAvHybFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678809500; a=rsa-sha256; cv=none; b=Gi8bjG9uFJIYJWTqDZFXWvhlNjgK2aY9/fmYWiqWDRtpVr4taOvHfjaSNNOvjgvszbauGQ OS00wefEINydBbp7rZNshUTOFGmCZssm8D8mf9pWMSS+OtZKkYMO39fQuVEsCaVNnEOzCH dANJV/Z3wsNYTZuJ287CDDZasjBEGOtF8tgDWRkK8AqV9PxHPOD0zu+nq0kMekU4RfbV3G mpae+C/nwDYdibxAL6Z5jqYHTW+DmyWMOJvKQz5TZ8QiBImqeaEBJIuOzypmbLqQthUmvq HUGe+w+G0gVeP/v4hZH8unu/dmru2aGxdNVYwbqrNRczjkOqs2RiOKnN5/avWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbdV40R9lzh18; Tue, 14 Mar 2023 15:58:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EFwJR8007950; Tue, 14 Mar 2023 15:58:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EFwJOB007949; Tue, 14 Mar 2023 15:58:19 GMT (envelope-from git) Date: Tue, 14 Mar 2023 15:58:19 GMT Message-Id: <202303141558.32EFwJOB007949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6d33121337af - main - ping: Remove ifndef icmp_data guards List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d33121337af8b8ddfe3c44c8a3dba4db1529787 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6d33121337af8b8ddfe3c44c8a3dba4db1529787 commit 6d33121337af8b8ddfe3c44c8a3dba4db1529787 Author: Jose Luis Duran AuthorDate: 2023-03-14 15:22:33 +0000 Commit: Mark Johnston CommitDate: 2023-03-14 15:58:03 +0000 ping: Remove ifndef icmp_data guards Early versions of [1] did not have icmp_data defined, but FreeBSD has always had. Remove these guards. NetBSD [2] and OpenBSD [3] have already removed them. [1]: https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/netinet/ip_icmp.h [2]: https://github.com/NetBSD/src/commit/203dfd34867991fd002f747d74a96f26ae80d41c [3]: https://github.com/openbsd/src/commit/d83449c83c03b86e72d642dc92bcea434310435a Reviewed by: markj MFC after: 1 week --- sbin/ping/ping.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 00026c33a479..6e069adfecfa 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1189,12 +1189,8 @@ pr_pack(char *buf, ssize_t cc, struct sockaddr_in *from, struct timespec *tv) return; } -#ifndef icmp_data - icmp_data_raw = buf + hlen + offsetof(struct icmp, icmp_ip); -#else icmp_data_raw_len = cc - (hlen + offsetof(struct icmp, icmp_data)); icmp_data_raw = buf + hlen + offsetof(struct icmp, icmp_data); -#endif /* Now the ICMP part */ cc -= hlen; From nobody Tue Mar 14 16:16:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbdtZ3lC2z3yRVN; Tue, 14 Mar 2023 16:16: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 4PbdtZ394Hz4HTZ; Tue, 14 Mar 2023 16:16:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678810566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmmzsjHw0u+sqSBttloTH+dHjcMoObKbi55LTsK3CsQ=; b=m6r27sAq0lMfOdap7zJYq7gfbTeZT6FzrezE+pwZGie5LVEVm1njOYng/+Iv4fqQVcDBDb tYXOjxFShVp2hsRuQRDA8Cyqgy243j8ZJiWWmMy382nW9VD0d+dOlu0qadAM/rzlljAbAm yitMYstd+S3beQon9ZCS8JNJ+4FsGopVqWhIaTOjCo9UaZUkrLz0F7dIToGics/5JHRVIl twkl8Okz+AFY2O55t31Cd2NO5ipWonj++MmknUPUe6p5JwoiKJmmW756ZqA7q8yRytRRh3 n10upafh1wecPqDAX0VtEkrrOEA/50K6OCTKHJVFWfP9qIAkXO2Zow8k8m34GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678810566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmmzsjHw0u+sqSBttloTH+dHjcMoObKbi55LTsK3CsQ=; b=iCiT9I1FCUys31bU1ZehhtYwlkuMxLvDQxfJFMsmdl9x4iml6luMKx/fiTrNcSZLSoI0SP 2ATuKMIIa3vf/MuA/9Z0qfWj+iGS5D88jnTkGYJR8Pv4/+jse8Vn8UQJYNR6t/eZvf1Jwk 30AZIMgBqKsHZ4yvEw4PtPgDHw1CwzOap/xEEPJ9WJjJDaPWSIhkuKwyiEOv62eurLe5s5 WEwUvheyTpamA1eia54pR7NJ+4BCv6sLmtnH9ZKuXIkDfqQbqDQg9+sxdh3oxvKFYPVj2W pts4N9F85qvSu6U7KGcQxJNLGCGMcRobU4zihr8/m19LpYPFv/K6Hv+8sjCbvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678810566; a=rsa-sha256; cv=none; b=pMDp3bEV2rZlLXoOosv2/iI8t8WjmcDwsGMkZ/wPWrbwc+GJ78iKnrYrwY+5Yx6AZ+R+Cw QYpS7uij44i5mcbvSsCn0DFlTh9O1bDQssrE3IXDpAzyZUnNKkdwzxqaPu52iquhirY8Cv BsLR7fi0s2dVCof3kwhkUeyqSFU8bGTnWkvvJH0LL8uOKHZSDVdctY9casZ7pupwMjD42W T1Wt49yYYum38t+XMsmTV8GN73AjK7D5bng5gzmoQA7pGatx9UZVlG+hrX+1+BEA1kiA2E /mGlr88Wx3UaXpRWOJiMCbKHMFEkFQbHMrzD+XFH7rbFGShS7wjqeP8KFj6tkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbdtZ26bqzj0j; Tue, 14 Mar 2023 16:16:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EGG6pR040275; Tue, 14 Mar 2023 16:16:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EGG6MQ040274; Tue, 14 Mar 2023 16:16:06 GMT (envelope-from git) Date: Tue, 14 Mar 2023 16:16:06 GMT Message-Id: <202303141616.32EGG6MQ040274@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: aa1e6a4f4c28 - stable/13 - makefs: make msdos creation go fast List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/13 X-Git-Reftype: branch X-Git-Commit: aa1e6a4f4c28c7051ee9431ecb7802309cc1bf96 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=aa1e6a4f4c28c7051ee9431ecb7802309cc1bf96 commit aa1e6a4f4c28c7051ee9431ecb7802309cc1bf96 Author: Warner Losh AuthorDate: 2023-03-13 20:28:51 +0000 Commit: Warner Losh CommitDate: 2023-03-14 15:47:46 +0000 makefs: make msdos creation go fast Add missing brelse(bp). Without it the cache grows and we have a n^2 lookup. I'm not entirely sure why we read the block before we write it back out, since the only side effect of that is to allocate memory, clear the memory, read it in from disk, throw it away with the contents of the file being written out. We likely should just do a getblk() here instead, but even with all that, this takes the time it takes to create a 150MB msdos fs image down from 5 minutes to 30 seconds. Old: 317.663u 0.685s 5:18.34 100.0% 198+360k 0+19io 1009pf+0w New: 7.330u 23.841s 0:31.17 100.0% 198+360k 0+250522io 4pf+0w See code review for how we got this. tl;dr: netbsd move brelse into bwrite and we picked up msdos code after that, but not the move. That change should be picked up later. Sponsored by: Netflix Reviewed by: emaste MFC After: 1 day (13.2 is coming fast) Differential Revision: https://reviews.freebsd.org/D39025 (cherry picked from commit 370e009188ba90c3290b1479aa06ec98b66e140a) --- usr.sbin/makefs/msdos/msdosfs_vnops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/makefs/msdos/msdosfs_vnops.c b/usr.sbin/makefs/msdos/msdosfs_vnops.c index ff470576ee79..198efae31a0e 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vnops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c @@ -501,6 +501,7 @@ msdosfs_wfile(const char *path, struct denode *dep, fsnode *node) cpsize = MIN((nsize - offs), blsize - on); memcpy(bp->b_data + on, dat + offs, cpsize); bwrite(bp); + brelse(bp); offs += cpsize; } From nobody Tue Mar 14 16:30:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbfD068D1z3ySTt for ; Tue, 14 Mar 2023 16:31:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbfD04Qwnz4KRK for ; Tue, 14 Mar 2023 16:31:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52a.google.com with SMTP id eh3so8493427edb.11 for ; Tue, 14 Mar 2023 09:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1678811470; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EZT1RgtA57NlM36rt1x1wg/Ls9ASMeaCS6YIA3jHQME=; b=qK6sIs5gJpId2xctgucltFXpnGumGouMu8QuOyx8uQK1U0auRqPs298BZdqLCj/Cbr IrG9/ouVjzue/6gdjU94FZCkCwqGyR874x6z0OqSHwgrgmSnN8Oh80unl3+Pa8cYfP/g 5EtcdN9k266cYmhb7OWTVwgWW5HXwi6dyoFOb4CqUvZYzqNcYpGM1pWH0YPJXnSn568Q 6A/AeXNUAk1GVAF1sads87r8q4op6Pjun94mzqlco0SZjRlCGCvzDsrD11ml1T4LnNkd AxxwuOg8jXBfGpMWpbZQynifEoqLY7jZ6tiD2sShXC2XdOMUt9v7NE+OHKlTJ+Bq+W9F E6zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678811470; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EZT1RgtA57NlM36rt1x1wg/Ls9ASMeaCS6YIA3jHQME=; b=YTPchtg7fGZNzLtz9FY52077dNE8DQQPtU2zce1GIFLTY8ragnjs63f6WXBv1rVzdz xmp8jA9WstdZaRO7CgLZSFPehk/jaOFFKGXIGFNjLzEGx8OnVxQpzmHwVBq+pG/t/xJ2 hr05cOUzFi5QGTmtP99wT9SDxW0U7/OqEjx4p4GuU9Hvfx3VOvWlpBdxM5Ryc3HA9cKP BrLdYBg7mqmoSm5DNBCxCf39dhBfmSl0pNRjS7BCegrFesDDTiiW4Bh1+dG0nOw+uuzA Bss3zTR5jwac3SST22NaPRKJdYCKjJjBwkMUPh23bzAu0Pvuw/uzaTs+FcmmNz03Xt/L fpYA== X-Gm-Message-State: AO0yUKUnGTSCoA4jyBbMtFw6jYqxu5U+uMvJaTt2vydzOu0cXL8pJyZk gjIexClQ9NP+I/qfDus5y5VHf2um3dn3iJHfYrOSQw== X-Google-Smtp-Source: AK7set8w1Ec4o6gmF0RA/R37VS57DQLIXyqLEocHEeRPdRCyr10mgTj2BKMqSJC1e7wrQk3RpDT82uWxrDi8IwW85k0= X-Received: by 2002:a17:907:72c1:b0:8e5:1a7b:8ab2 with SMTP id du1-20020a17090772c100b008e51a7b8ab2mr1820250ejc.4.1678811470422; Tue, 14 Mar 2023 09:31:10 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 14 Mar 2023 10:30:59 -0600 Message-ID: Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv To: Konstantin Belousov Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000056f71d05f6dec12e" X-Rspamd-Queue-Id: 4PbfD04Qwnz4KRK X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000056f71d05f6dec12e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 14, 2023 at 3:11=E2=80=AFAM Konstantin Belousov wrote: > On Tue, Mar 14, 2023 at 04:19:55AM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76a= b3c808ae4 > > > > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 > > Author: lucy > > AuthorDate: 2023-03-13 22:01:12 +0000 > > Commit: Warner Losh > > CommitDate: 2023-03-14 04:19:24 +0000 > > > > Add GNU glibc compatible secure_getenv > > > > Add mostly glibc and msl compatible secure_getenv. Return NULL if > > issetugid() indicates the process is tainted, otherwise getenv(x). > The > > rational behind this is the fact that many Linux applications use > this > > function instead of getenv() as it's widely consider a, "best > > practice". > > > > Reviewed by: imp, mjg (feedback) > > Pull Request: https://github.com/freebsd/freebsd-src/pull/686 > > Signed-off-by: Lucy Marsh > > --- > > include/stdlib.h | 1 + > > lib/libc/stdlib/Makefile.inc | 4 ++-- > > lib/libc/stdlib/Symbol.map | 1 + > > lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- > > lib/libc/stdlib/getenv.c | 12 ++++++++++++ > > 5 files changed, 41 insertions(+), 3 deletions(-) > > > > diff --git a/include/stdlib.h b/include/stdlib.h > > index 01629ed84a11..c41e8704e810 100644 > > --- a/include/stdlib.h > > +++ b/include/stdlib.h > > @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, > > int (* _Nonnull)(const void *, const void *)); > > int rand(void); > > void *realloc(void *, size_t) __result_use_check __alloc_size(2); > > +char *secure_getenv(const char *); > The declaration must be put under BSD_VISIBLE. > Thanks. https://reviews.freebsd.org/D39076 > > void srand(unsigned); > > double strtod(const char * __restrict, char ** __restrict); > > float strtof(const char * __restrict, char ** __restrict); > --00000000000056f71d05f6dec12e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Mar 14, 2023 at 3:11=E2=80=AF= AM Konstantin Belousov <kostikbel= @gmail.com> wrote:
On Tue, Mar 14, 2023 at 04:19:55AM +0000, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76ab3c808ae4<= /a>
>
> commit adeca21464d25bc61f98968a5c1e76ab3c808ae4
> Author:=C2=A0 =C2=A0 =C2=A0lucy <
seafork@disroot.org>
> AuthorDate: 2023-03-13 22:01:12 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-03-14 04:19:24 +0000
>
>=C2=A0 =C2=A0 =C2=A0Add GNU glibc compatible secure_getenv
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Add mostly glibc and msl compatible secure_getenv. = Return NULL if
>=C2=A0 =C2=A0 =C2=A0issetugid() indicates the process is tainted, other= wise getenv(x).=C2=A0 The
>=C2=A0 =C2=A0 =C2=A0rational behind this is the fact that many Linux ap= plications use this
>=C2=A0 =C2=A0 =C2=A0function instead of getenv() as it's widely con= sider a, "best
>=C2=A0 =C2=A0 =C2=A0practice".
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Reviewed by: imp, mjg (feedback)
>=C2=A0 =C2=A0 =C2=A0Pull Request: https://github.= com/freebsd/freebsd-src/pull/686
>=C2=A0 =C2=A0 =C2=A0Signed-off-by: Lucy Marsh <seafork@disroot.org>
> ---
>=C2=A0 include/stdlib.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 1 +
>=C2=A0 lib/libc/stdlib/Makefile.inc |=C2=A0 4 ++--
>=C2=A0 lib/libc/stdlib/Symbol.map=C2=A0 =C2=A0|=C2=A0 1 +
>=C2=A0 lib/libc/stdlib/getenv.3=C2=A0 =C2=A0 =C2=A0| 26 +++++++++++++++= ++++++++++-
>=C2=A0 lib/libc/stdlib/getenv.c=C2=A0 =C2=A0 =C2=A0| 12 ++++++++++++ >=C2=A0 5 files changed, 41 insertions(+), 3 deletions(-)
>
> diff --git a/include/stdlib.h b/include/stdlib.h
> index 01629ed84a11..c41e8704e810 100644
> --- a/include/stdlib.h
> +++ b/include/stdlib.h
> @@ -111,6 +111,7 @@ void=C2=A0 =C2=A0 =C2=A0 =C2=A0qsort(void *, size_= t, size_t,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int (* _Nonnull)(const void *,= const void *));
>=C2=A0 int=C2=A0 =C2=A0rand(void);
>=C2=A0 void *realloc(void *, size_t) __result_use_check __alloc_size(2)= ;
> +char *secure_getenv(const char *);
The declaration must be put under BSD_VISIBLE.

=C2=A0
>=C2=A0 void=C2=A0 srand(unsigned);
>=C2=A0 double=C2=A0 =C2=A0 =C2=A0 =C2=A0 strtod(const char * __restrict= , char ** __restrict);
>=C2=A0 float=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strtof(const char * __res= trict, char ** __restrict);
--00000000000056f71d05f6dec12e-- From nobody Tue Mar 14 16:49:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbfcz35xPz3ySsC; Tue, 14 Mar 2023 16:49:23 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pbfcz1Bnmz4MMj; Tue, 14 Mar 2023 16:49:23 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x235.google.com with SMTP id bh20so12245783oib.9; Tue, 14 Mar 2023 09:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678812562; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Xm/Pvo/SQLcdj1KmNyCfkGNndOh5DuCaRsC/l0PksZA=; b=Pz6AhId3Kx1hoF84+uDZKmB8EZw0ywKZPriPU1e0KWyhPcvzaS54lIeelbk9gdx38J lR38g955JIqjJgBSlRWUqu9syQ6WHufCwNH2Vv40PPHRZu8mGkX2FDXImRhyzupGYaWe bj77uKy/kxwCcuFPSDOcKjPsTgW7m6z5FCopmvt42FMQQJrQOjhV7cp1JT850lvw4hRV c9d6pcZW/b6/JbAL3/tXkzjmgh0Zhm3G5VxBslNzkRAMqYy0xZ5FX/MP2PcCA14w97RT 7mT9rAIiSc37kFqyFYH85iNa+mwftbHXQb6nL6k8JMUqdgPnCTDXd/DEsFKr71Aj/yYg eTIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678812562; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xm/Pvo/SQLcdj1KmNyCfkGNndOh5DuCaRsC/l0PksZA=; b=BxLZyuWpBSb16WoQVyHheUVZ6roe+AglRWscNH4pYUMq/RavqVXUkr7PcZMg1pzk+j FDZ1o5VclW72nf6VJ0MHVQk4zIL0HQFhMnz9vFXVVXXFKo2Alc/iMjlIkN23h01Yt9eg itFhAFsJxp7krARkzexYDWxd1yD78ql5n+GRDF9juodxXHuBwPsKk6dhXt8izQmuy7d/ 5qjZHNL3KBaTpMKuHDUbWhlLIKGHXG0prFGRDJzdDXkk/qS5t4U7uo6E9zGJJcEj8SHn mZ6SY25tsQblF8McZ4F+eBA2Jh2fGCpe4EAncQJhx2xiy/gAK7lM/sTvfTvDTJXmxoS6 fBAg== X-Gm-Message-State: AO0yUKWyGSAw4PkunXAQrTVrZIGL+jYpDoXMtOSFymAnDNHmkB7bLyzV njTHgsZLY52VGqt1pQ8yq3s6X/zkQUI3QIVUWe5xpi+b X-Google-Smtp-Source: AK7set8foDpQM+3z2BmG2VHsMPBJ2++eZ2s3AZqkso9dG/VAIAJ9gMURHJv+TJix0UpjyGbPetu7whWMwePhOtRZeN8= X-Received: by 2002:a54:4602:0:b0:384:3518:df33 with SMTP id p2-20020a544602000000b003843518df33mr13100347oip.4.1678812561996; Tue, 14 Mar 2023 09:49:21 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:7087:0:b0:49c:b071:b1e3 with HTTP; Tue, 14 Mar 2023 09:49:21 -0700 (PDT) In-Reply-To: References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> From: Mateusz Guzik Date: Tue, 14 Mar 2023 17:49:21 +0100 Message-ID: Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv To: Jessica Clarke Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Pbfcz1Bnmz4MMj X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 3/14/23, Jessica Clarke wrote: > On 14 Mar 2023, at 04:19, Warner Losh wrote: >> >> The branch main has been updated by imp: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76= ab3c808ae4 >> >> commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 >> Author: lucy >> AuthorDate: 2023-03-13 22:01:12 +0000 >> Commit: Warner Losh >> CommitDate: 2023-03-14 04:19:24 +0000 >> >> Add GNU glibc compatible secure_getenv >> >> Add mostly glibc and msl compatible secure_getenv. Return NULL if >> issetugid() indicates the process is tainted, otherwise getenv(x). >> The >> rational behind this is the fact that many Linux applications use thi= s >> function instead of getenv() as it's widely consider a, "best >> practice". >> >> Reviewed by: imp, mjg (feedback) >> Pull Request: https://github.com/freebsd/freebsd-src/pull/686 >> Signed-off-by: Lucy Marsh >> --- >> include/stdlib.h | 1 + >> lib/libc/stdlib/Makefile.inc | 4 ++-- >> lib/libc/stdlib/Symbol.map | 1 + >> lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- >> lib/libc/stdlib/getenv.c | 12 ++++++++++++ >> 5 files changed, 41 insertions(+), 3 deletions(-) >> >> diff --git a/include/stdlib.h b/include/stdlib.h >> index 01629ed84a11..c41e8704e810 100644 >> --- a/include/stdlib.h >> +++ b/include/stdlib.h >> @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, >> int (* _Nonnull)(const void *, const void *)); >> int rand(void); >> void *realloc(void *, size_t) __result_use_check __alloc_size(2); >> +char *secure_getenv(const char *); >> void srand(unsigned); >> double strtod(const char * __restrict, char ** __restrict); >> float strtof(const char * __restrict, char ** __restrict); >> diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc >> index 8ace2c051b82..964e7ce30594 100644 >> --- a/lib/libc/stdlib/Makefile.inc >> +++ b/lib/libc/stdlib/Makefile.inc >> @@ -46,8 +46,8 @@ MAN+=3D a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 = \ >> MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3 >> MLINKS+=3Datol.3 atoll.3 >> MLINKS+=3Dexit.3 _Exit.3 >> -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \ >> - getenv.3 unsetenv.3 >> +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 secure_getenv.= 3 \ >> + getenv.3 setenv.3 getenv.3 unsetenv.3 >> MLINKS+=3Dgetopt_long.3 getopt_long_only.3 >> MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3 >> MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 >> hsearch_r.3 >> diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map >> index 9d2944fdb7e9..a105f781734d 100644 >> --- a/lib/libc/stdlib/Symbol.map >> +++ b/lib/libc/stdlib/Symbol.map >> @@ -128,6 +128,7 @@ FBSD_1.6 { >> FBSD_1.7 { >> clearenv; >> qsort_r; >> + secure_getenv; >> }; >> >> FBSDprivate_1.0 { >> diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3 >> index 5566d7b01dcd..93c0d2ada6ad 100644 >> --- a/lib/libc/stdlib/getenv.3 >> +++ b/lib/libc/stdlib/getenv.3 >> @@ -32,13 +32,14 @@ >> .\" @(#)getenv.3 8.2 (Berkeley) 12/11/93 >> .\" $FreeBSD$ >> .\" >> -.Dd November 7, 2021 >> +.Dd March 13, 2023 >> .Dt GETENV 3 >> .Os >> .Sh NAME >> .Nm clearenv , >> .Nm getenv , >> .Nm putenv , >> +.Nm secure_getenv , >> .Nm setenv , >> .Nm unsetenv >> .Nd environment variable functions >> @@ -50,6 +51,8 @@ >> .Fn clearenv "void" >> .Ft char * >> .Fn getenv "const char *name" >> +.Ft char * >> +.Fn secure_getenv "const char *name" >> .Ft int >> .Fn setenv "const char *name" "const char *value" "int overwrite" >> .Ft int >> @@ -78,6 +81,20 @@ to by the >> .Fn getenv >> function. >> .Pp >> +The GNU-specific function, > > I don=E2=80=99t think it is now?.. > It is not and this is not the place to point out any GNU-related information either. Also wrapping getenv is an implementation detail which should not be mentioned. Instead, modulo bad english, content-wise it should be +/-: The secure_getenv function acts like getenv, except intentionally returns NULL when the environment is considered untrusted. Currently this means executing in a setuid or setgid context, but the list of limitations of subject to change. then in STANDARDS: The secure_getenv function was added for compatiblity with GNU libc. >> +.Fn secure_getenv >> +wraps the >> +.Fn getenv >> +function to prevent it from being run in "secure execution". >> +Unlike in glibc, >> +.Fn secure_getenv >> +only checks if the >> +.Fa setuid >> +and >> +.Fa setgid >> +bits have been set or changed. >> +These checks are subject to extension and change. >> +.Pp >> The >> .Fn setenv >> function inserts or resets the environment variable >> @@ -139,6 +156,13 @@ is not in the current environment, >> .Dv NULL >> is returned. >> .Pp >> +The >> +.Fn secure_getenv >> +function returns >> +.Dv NULL >> +if the process is in "secure execution," otherwise it will call >> +.Fn getenv . >> +.Pp >> .Rv -std clearenv setenv putenv unsetenv >> .Sh ERRORS >> .Bl -tag -width Er >> diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c >> index 7ca27ab710c4..86a846d58c69 100644 >> --- a/lib/libc/stdlib/getenv.c >> +++ b/lib/libc/stdlib/getenv.c >> @@ -447,6 +447,18 @@ getenv(const char *name) >> } >> >> >> +/* >> + * Runs getenv() unless the current process is tainted by uid or gid >> changes, in >> + * which case it will return NULL. >> + */ >> +char * >> +secure_getenv(const char *name) >> +{ >> + if (issetugid()) >> + return NULL; >> + return getenv(name); > > return (...); > > (x2) > > Jess > >> +} >> + >> /* >> * Set the value of a variable. Older settings are labeled as inactive. >> If an >> * older setting has enough room to store the new value, it will be >> reused. No > > --=20 Mateusz Guzik From nobody Tue Mar 14 17:03:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbfxS3NQnz3yTqt for ; Tue, 14 Mar 2023 17:03:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbfxS2V1pz4NB6 for ; Tue, 14 Mar 2023 17:03:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52e.google.com with SMTP id x13so17477985edd.1 for ; Tue, 14 Mar 2023 10:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1678813418; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=T5wLKQc33HlwcbZlJ2+NSNPgaMXFkxTp/k7UBMRR+Ck=; b=NOpc8kHiNwy96g9v/0Tv1N9GxuN3FYRJ3ZbAXT3HUYfzjMAgKmMwE+4wkURhSXAUjD XiTilg8LDsGZfHIKpmpLQfDo18fW7jimQW97l9e5kakDzTzpdUeumk3ObGHYSXwCgrM/ d8ueb0c5CxFQrETyabodrmTrdXVUqo4rlJBHSpaz3W3UoI+shecqNog4lFWg7gyMlfsh /MzPUhgtcNxh9K6TFTPRAM0Htm4Y6qZjrBaCu9r/JhVJ1ZVA05rRZUZ7bUTRV3AlEwYX T+AiMc8s8GyrdaezKt/QVY5KaqjWLCR2n8LwpluFc+sdH+/ppHiFMtb3hLkiXU91W3RI v4xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678813418; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T5wLKQc33HlwcbZlJ2+NSNPgaMXFkxTp/k7UBMRR+Ck=; b=NXys2U63xjR/6gKYlX9e8HAcLUCtJypUddG9/bgun7o73sWn/eEWOPRNogfdYrotcG m50LY0isx+2cPm/PMQOwyu2Wzz1+WYC+0MO3IA9Iv+4ZwUuQKekehztRz+jjMxGFNX45 /ESnDzy7hGM9pFc+QjI+MfScY7zGTsM+jhk9JeVFuvICc6/EPeVgXy2giDFubPxYt8nB wPAZGN+kaSOCVk4EU6AK5zG0gaUyAWUQZs8VnUqWPKYBXOJCnTvbMu6wcCVdG02TQ79s U29UkXGYI9dqxJ9AAHosrawcTHlXqDP5jBJMGnor/7g4+bAkD4DeWXfv87PDtgRFrdkQ jzKg== X-Gm-Message-State: AO0yUKULxN2KyOWGTbbFXpRMf7jj7bkQZsTdWWf/F9YwVbiVt6SSVlHb ndhjdc420AJ1xTiMHo57qZpDKgF92nyW1FKX4f4idJYEsN7k/ez0ob4= X-Google-Smtp-Source: AK7set/YJ6vtqfoPYeXMw1sVvhGjFWZhsQ42LD9ObJkNcjoTpOFj/gViPmDCApFQ0c5PFyWGg2uy6j1LQc5Vgw4ANM4= X-Received: by 2002:a17:907:72c1:b0:8e5:1a7b:8ab2 with SMTP id du1-20020a17090772c100b008e51a7b8ab2mr1887680ejc.4.1678813418145; Tue, 14 Mar 2023 10:03:38 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 14 Mar 2023 11:03:27 -0600 Message-ID: Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv To: Mateusz Guzik Cc: Jessica Clarke , Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000006edcdc05f6df3524" X-Rspamd-Queue-Id: 4PbfxS2V1pz4NB6 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --0000000000006edcdc05f6df3524 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 14, 2023 at 10:49=E2=80=AFAM Mateusz Guzik = wrote: > On 3/14/23, Jessica Clarke wrote: > > On 14 Mar 2023, at 04:19, Warner Losh wrote: > >> > >> The branch main has been updated by imp: > >> > >> URL: > >> > https://cgit.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76a= b3c808ae4 > >> > >> commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 > >> Author: lucy > >> AuthorDate: 2023-03-13 22:01:12 +0000 > >> Commit: Warner Losh > >> CommitDate: 2023-03-14 04:19:24 +0000 > >> > >> Add GNU glibc compatible secure_getenv > >> > >> Add mostly glibc and msl compatible secure_getenv. Return NULL if > >> issetugid() indicates the process is tainted, otherwise getenv(x). > >> The > >> rational behind this is the fact that many Linux applications use > this > >> function instead of getenv() as it's widely consider a, "best > >> practice". > >> > >> Reviewed by: imp, mjg (feedback) > >> Pull Request: https://github.com/freebsd/freebsd-src/pull/686 > >> Signed-off-by: Lucy Marsh > >> --- > >> include/stdlib.h | 1 + > >> lib/libc/stdlib/Makefile.inc | 4 ++-- > >> lib/libc/stdlib/Symbol.map | 1 + > >> lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- > >> lib/libc/stdlib/getenv.c | 12 ++++++++++++ > >> 5 files changed, 41 insertions(+), 3 deletions(-) > >> > >> diff --git a/include/stdlib.h b/include/stdlib.h > >> index 01629ed84a11..c41e8704e810 100644 > >> --- a/include/stdlib.h > >> +++ b/include/stdlib.h > >> @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, > >> int (* _Nonnull)(const void *, const void *)); > >> int rand(void); > >> void *realloc(void *, size_t) __result_use_check __alloc_size(2); > >> +char *secure_getenv(const char *); > >> void srand(unsigned); > >> double strtod(const char * __restrict, char ** __restrict); > >> float strtof(const char * __restrict, char ** __restrict); > >> diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.i= nc > >> index 8ace2c051b82..964e7ce30594 100644 > >> --- a/lib/libc/stdlib/Makefile.inc > >> +++ b/lib/libc/stdlib/Makefile.inc > >> @@ -46,8 +46,8 @@ MAN+=3D a64l.3 abort.3 abs.3 alloca.3 atexit.3 > atof.3 \ > >> MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3 > >> MLINKS+=3Datol.3 atoll.3 > >> MLINKS+=3Dexit.3 _Exit.3 > >> -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \ > >> - getenv.3 unsetenv.3 > >> +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 secure_geten= v.3 > \ > >> + getenv.3 setenv.3 getenv.3 unsetenv.3 > >> MLINKS+=3Dgetopt_long.3 getopt_long_only.3 > >> MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3 > >> MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 > >> hsearch_r.3 > >> diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map > >> index 9d2944fdb7e9..a105f781734d 100644 > >> --- a/lib/libc/stdlib/Symbol.map > >> +++ b/lib/libc/stdlib/Symbol.map > >> @@ -128,6 +128,7 @@ FBSD_1.6 { > >> FBSD_1.7 { > >> clearenv; > >> qsort_r; > >> + secure_getenv; > >> }; > >> > >> FBSDprivate_1.0 { > >> diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3 > >> index 5566d7b01dcd..93c0d2ada6ad 100644 > >> --- a/lib/libc/stdlib/getenv.3 > >> +++ b/lib/libc/stdlib/getenv.3 > >> @@ -32,13 +32,14 @@ > >> .\" @(#)getenv.3 8.2 (Berkeley) 12/11/93 > >> .\" $FreeBSD$ > >> .\" > >> -.Dd November 7, 2021 > >> +.Dd March 13, 2023 > >> .Dt GETENV 3 > >> .Os > >> .Sh NAME > >> .Nm clearenv , > >> .Nm getenv , > >> .Nm putenv , > >> +.Nm secure_getenv , > >> .Nm setenv , > >> .Nm unsetenv > >> .Nd environment variable functions > >> @@ -50,6 +51,8 @@ > >> .Fn clearenv "void" > >> .Ft char * > >> .Fn getenv "const char *name" > >> +.Ft char * > >> +.Fn secure_getenv "const char *name" > >> .Ft int > >> .Fn setenv "const char *name" "const char *value" "int overwrite" > >> .Ft int > >> @@ -78,6 +81,20 @@ to by the > >> .Fn getenv > >> function. > >> .Pp > >> +The GNU-specific function, > > > > I don=E2=80=99t think it is now?.. > > > > It is not and this is not the place to point out any GNU-related > information either. Also wrapping getenv is an implementation detail > which should not be mentioned. > > Instead, modulo bad english, content-wise it should be +/-: > > The secure_getenv function acts like getenv, except intentionally > returns NULL when the environment is considered untrusted. Currently > this means executing in a setuid or setgid context, but the list of > limitations of subject to change. > > then in STANDARDS: > > The secure_getenv function was added for compatiblity with GNU libc. > https://reviews.freebsd.org/D39078 might address this. Warner > >> +.Fn secure_getenv > >> +wraps the > >> +.Fn getenv > >> +function to prevent it from being run in "secure execution". > >> +Unlike in glibc, > >> +.Fn secure_getenv > >> +only checks if the > >> +.Fa setuid > >> +and > >> +.Fa setgid > >> +bits have been set or changed. > >> +These checks are subject to extension and change. > >> +.Pp > >> The > >> .Fn setenv > >> function inserts or resets the environment variable > >> @@ -139,6 +156,13 @@ is not in the current environment, > >> .Dv NULL > >> is returned. > >> .Pp > >> +The > >> +.Fn secure_getenv > >> +function returns > >> +.Dv NULL > >> +if the process is in "secure execution," otherwise it will call > >> +.Fn getenv . > >> +.Pp > >> .Rv -std clearenv setenv putenv unsetenv > >> .Sh ERRORS > >> .Bl -tag -width Er > >> diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c > >> index 7ca27ab710c4..86a846d58c69 100644 > >> --- a/lib/libc/stdlib/getenv.c > >> +++ b/lib/libc/stdlib/getenv.c > >> @@ -447,6 +447,18 @@ getenv(const char *name) > >> } > >> > >> > >> +/* > >> + * Runs getenv() unless the current process is tainted by uid or gid > >> changes, in > >> + * which case it will return NULL. > >> + */ > >> +char * > >> +secure_getenv(const char *name) > >> +{ > >> + if (issetugid()) > >> + return NULL; > >> + return getenv(name); > > > > return (...); > > > > (x2) > > > > Jess > > > >> +} > >> + > >> /* > >> * Set the value of a variable. Older settings are labeled as inactiv= e. > >> If an > >> * older setting has enough room to store the new value, it will be > >> reused. No > > > > > > > -- > Mateusz Guzik > --0000000000006edcdc05f6df3524 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Mar 14, 2023 at 10:49=E2=80= =AFAM Mateusz Guzik <mjguzik@gmail.= com> wrote:
On 3/14/23, Jessica Clarke <jrtc27@freebsd.org> wrote:
> On 14 Mar 2023, at 04:19, Warner Losh <imp@FreeBSD.org> wrote: >>
>> The branch main has been updated by imp:
>>
>> URL:
>> https://c= git.FreeBSD.org/src/commit/?id=3Dadeca21464d25bc61f98968a5c1e76ab3c808ae4
>>
>> commit adeca21464d25bc61f98968a5c1e76ab3c808ae4
>> Author:=C2=A0 =C2=A0 =C2=A0lucy <
seafork@disroot.org>
>> AuthorDate: 2023-03-13 22:01:12 +0000
>> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
>> CommitDate: 2023-03-14 04:19:24 +0000
>>
>>=C2=A0 =C2=A0 Add GNU glibc compatible secure_getenv
>>
>>=C2=A0 =C2=A0 Add mostly glibc and msl compatible secure_getenv. Re= turn NULL if
>>=C2=A0 =C2=A0 issetugid() indicates the process is tainted, otherwi= se getenv(x).
>> The
>>=C2=A0 =C2=A0 rational behind this is the fact that many Linux appl= ications use this
>>=C2=A0 =C2=A0 function instead of getenv() as it's widely consi= der a, "best
>>=C2=A0 =C2=A0 practice".
>>
>>=C2=A0 =C2=A0 Reviewed by: imp, mjg (feedback)
>>=C2=A0 =C2=A0 Pull Request: https://github.co= m/freebsd/freebsd-src/pull/686
>>=C2=A0 =C2=A0 Signed-off-by: Lucy Marsh <seafork@disroot.org>
>> ---
>> include/stdlib.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|= =C2=A0 1 +
>> lib/libc/stdlib/Makefile.inc |=C2=A0 4 ++--
>> lib/libc/stdlib/Symbol.map=C2=A0 =C2=A0|=C2=A0 1 +
>> lib/libc/stdlib/getenv.3=C2=A0 =C2=A0 =C2=A0| 26 +++++++++++++++++= ++++++++-
>> lib/libc/stdlib/getenv.c=C2=A0 =C2=A0 =C2=A0| 12 ++++++++++++
>> 5 files changed, 41 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/stdlib.h b/include/stdlib.h
>> index 01629ed84a11..c41e8704e810 100644
>> --- a/include/stdlib.h
>> +++ b/include/stdlib.h
>> @@ -111,6 +111,7 @@ void=C2=A0 =C2=A0 =C2=A0 qsort(void *, size_t,= size_t,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int (* _Nonnull)(const void *, c= onst void *));
>> int=C2=A0 =C2=A0rand(void);
>> void *realloc(void *, size_t) __result_use_check __alloc_size(2);<= br> >> +char=C2=A0 =C2=A0 =C2=A0 =C2=A0 *secure_getenv(const char *);
>> void=C2=A0 srand(unsigned);
>> double=C2=A0 =C2=A0 =C2=A0 =C2=A0 strtod(const char * __restrict, = char ** __restrict);
>> float=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strtof(const char * __restr= ict, char ** __restrict);
>> diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefi= le.inc
>> index 8ace2c051b82..964e7ce30594 100644
>> --- a/lib/libc/stdlib/Makefile.inc
>> +++ b/lib/libc/stdlib/Makefile.inc
>> @@ -46,8 +46,8 @@ MAN+=3D=C2=A0 =C2=A0 =C2=A0 a64l.3 abort.3 abs.3= alloca.3 atexit.3 atof.3 \
>> MLINKS+=3Da64l.3 l64a.3 a64l.3 l64a_r.3
>> MLINKS+=3Datol.3 atoll.3
>> MLINKS+=3Dexit.3 _Exit.3
>> -MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3= \
>> -=C2=A0 =C2=A0 getenv.3 unsetenv.3
>> +MLINKS+=3Dgetenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 secure_g= etenv.3 \
>> +=C2=A0 =C2=A0 getenv.3 setenv.3 getenv.3 unsetenv.3
>> MLINKS+=3Dgetopt_long.3 getopt_long_only.3
>> MLINKS+=3Dhcreate.3 hdestroy.3 hcreate.3 hsearch.3
>> MLINKS+=3Dhcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 >> hsearch_r.3
>> diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.m= ap
>> index 9d2944fdb7e9..a105f781734d 100644
>> --- a/lib/libc/stdlib/Symbol.map
>> +++ b/lib/libc/stdlib/Symbol.map
>> @@ -128,6 +128,7 @@ FBSD_1.6 {
>> FBSD_1.7 {
>>=C2=A0 =C2=A0 =C2=A0 clearenv;
>>=C2=A0 =C2=A0 =C2=A0 qsort_r;
>> +=C2=A0 =C2=A0 secure_getenv;
>> };
>>
>> FBSDprivate_1.0 {
>> diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3 >> index 5566d7b01dcd..93c0d2ada6ad 100644
>> --- a/lib/libc/stdlib/getenv.3
>> +++ b/lib/libc/stdlib/getenv.3
>> @@ -32,13 +32,14 @@
>> .\"=C2=A0 =C2=A0 =C2=A0@(#)getenv.3 8.2 (Berkeley) 12/11/93 >> .\" $FreeBSD$
>> .\"
>> -.Dd November 7, 2021
>> +.Dd March 13, 2023
>> .Dt GETENV 3
>> .Os
>> .Sh NAME
>> .Nm clearenv ,
>> .Nm getenv ,
>> .Nm putenv ,
>> +.Nm secure_getenv ,
>> .Nm setenv ,
>> .Nm unsetenv
>> .Nd environment variable functions
>> @@ -50,6 +51,8 @@
>> .Fn clearenv "void"
>> .Ft char *
>> .Fn getenv "const char *name"
>> +.Ft char *
>> +.Fn secure_getenv "const char *name"
>> .Ft int
>> .Fn setenv "const char *name" "const char *value&qu= ot; "int overwrite"
>> .Ft int
>> @@ -78,6 +81,20 @@ to by the
>> .Fn getenv
>> function.
>> .Pp
>> +The GNU-specific function,
>
> I don=E2=80=99t think it is now?..
>

It is not and this is not the place to point out any GNU-related
information either. Also wrapping getenv is an implementation detail
which should not be mentioned.

Instead, modulo bad english, content-wise it should be +/-:

The secure_getenv function acts like getenv, except intentionally
returns NULL when the environment is considered untrusted. Currently
this means executing in a setuid or setgid context, but the list of
limitations of subject to change.

then in STANDARDS:

The secure_getenv function was added for compatiblity with GNU libc.

=C2=A0https://reviews.freebsd.org/D39078 might address this.

Warner
=C2=A0
>> +.Fn secure_getenv
>> +wraps the
>> +.Fn getenv
>> +function to prevent it from being run in "secure execution&q= uot;.
>> +Unlike in glibc,
>> +.Fn secure_getenv
>> +only checks if the
>> +.Fa setuid
>> +and
>> +.Fa setgid
>> +bits have been set or changed.
>> +These checks are subject to extension and change.
>> +.Pp
>> The
>> .Fn setenv
>> function inserts or resets the environment variable
>> @@ -139,6 +156,13 @@ is not in the current environment,
>> .Dv NULL
>> is returned.
>> .Pp
>> +The
>> +.Fn secure_getenv
>> +function returns
>> +.Dv NULL
>> +if the process is in "secure execution," otherwise it w= ill call
>> +.Fn getenv .
>> +.Pp
>> .Rv -std clearenv setenv putenv unsetenv
>> .Sh ERRORS
>> .Bl -tag -width Er
>> diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c >> index 7ca27ab710c4..86a846d58c69 100644
>> --- a/lib/libc/stdlib/getenv.c
>> +++ b/lib/libc/stdlib/getenv.c
>> @@ -447,6 +447,18 @@ getenv(const char *name)
>> }
>>
>>
>> +/*
>> + * Runs getenv() unless the current process is tainted by uid or = gid
>> changes, in
>> + * which case it will return NULL.
>> + */
>> +char *
>> +secure_getenv(const char *name)
>> +{
>> +=C2=A0 =C2=A0 if (issetugid())
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return NULL;
>> +=C2=A0 =C2=A0 return getenv(name);
>
> return (...);
>
> (x2)
>
> Jess
>
>> +}
>> +
>> /*
>>=C2=A0 * Set the value of a variable.=C2=A0 Older settings are labe= led as inactive.
>> If an
>>=C2=A0 * older setting has enough room to store the new value, it w= ill be
>> reused.=C2=A0 No
>
>


--
Mateusz Guzik <mjguzik gmail.com>
--0000000000006edcdc05f6df3524-- From nobody Tue Mar 14 17:12:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbg782l9vz3yVNT; Tue, 14 Mar 2023 17:12: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 4Pbg782Csxz4PK5; Tue, 14 Mar 2023 17:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678813924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pTp9BkbfqEzVAIFbMmujkMSnlSgJwNgyrXT9IHk3vuA=; b=k8mLMT0/4kM8E05Y7OQLR8qErkUCazV6gBCG0aU3/jZTaLIxoHjmUHnvdkvNplZVva6tLj XmUOq1x0yvMGHcDB5wlBsYg9frG+wK17wR9kgb+u7I5xculU/qBp288uzOqf3iTiWeVdNO gsnwIuWbrsWtkEt36mE9WU2k28lFM/LsnHMXZo2ZoCk1HjxHkKc28JzTUy8leM6ojvPzja +C5nGBxGi1/ZLRxsDWSdyHD4mSrde9Y1nMzjuHiGxpPEOqt+sxXXj8Nly9DVSoLRb5xgmx 7JCYjy9SaLjfNZ6vWiZaJ6PlUFXzBMiX2Z/Vtie6dzPgN381D+b3WQ8XtT6VMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678813924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pTp9BkbfqEzVAIFbMmujkMSnlSgJwNgyrXT9IHk3vuA=; b=RWy7ss2jx/m4wuGVF1RvP4WDnGVhpbH9K48dOKFj6S65B4ULJyva3Lz3ZhizXofIX/8kU1 L2rfyTWpmkciNf8OZp7wvCmNs/bTnWmO5mUw0Btpv9xFp4uPEGln23c5Xy0gBIW3R3QrkY U9IwBCBh+kwmJnG6vr8EX9XBwg0dTNZonPKtbT1vlVZlQTTCOe3Zydg7WIKiZnmuKvZkRI kuvUW56hyUW6JmQnkN2iObOyeOmCXLj4zxUgJW6bo/QZbIUJ427LKdoNS2EkoFdJg/q/8w SGptsE7MOru1TWevwXYjZn+P+drhCBVxyay28RjdBZHpBGcf+NKEnsHKsNJ7mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678813924; a=rsa-sha256; cv=none; b=P2iyAJRqAbL03ZJ2xuAUTTSm+EPBA3vceDZnDlumW9INm3SZajPTCv74wV4iJkFAvkCohR yQZmF0hDVwEj+7dYOJrZDLBbZFnq4/SUVMa8G0GY0LuEbta6YBv0YCDx82MYbn6sLkJWMU NUSjcIPDxN5LVkgg0IIzNlFUCEV82lDGtGMzfdOcABuXKpBEQrSep+gmtstbe1GrJDTj00 Up/WB2BogiN3ZfcNzUdIYko7R2cMLuasH76XFI3/7P7gTFJQedUWTebVSrM0DNyJtOYttD n5DCEY97TbGBVn68551m5jYxrIgu79IPwqZ1fTw68QxPv4UM6veic90rpoE7LQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbg781KnHzjld; Tue, 14 Mar 2023 17:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EHC4kV039634; Tue, 14 Mar 2023 17:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EHC4Am039633; Tue, 14 Mar 2023 17:12:04 GMT (envelope-from git) Date: Tue, 14 Mar 2023 17:12:04 GMT Message-Id: <202303141712.32EHC4Am039633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d0f1f38202c4 - main - Reserve u2f group for FIDO/U2F key support (SSH, etc.) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0f1f38202c4176af277185a3b973098bb03fe6d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d0f1f38202c4176af277185a3b973098bb03fe6d commit d0f1f38202c4176af277185a3b973098bb03fe6d Author: Ed Maste AuthorDate: 2022-02-18 18:13:20 +0000 Commit: Ed Maste CommitDate: 2023-03-14 17:09:40 +0000 Reserve u2f group for FIDO/U2F key support (SSH, etc.) We have FIDO/U2F support in the base system now, so reserve a group ID for it (maching the security/u2f-devd port). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34341 --- etc/group | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/group b/etc/group index 2a24f55303ca..4a8bc078e9b6 100644 --- a/etc/group +++ b/etc/group @@ -31,6 +31,7 @@ dialer:*:68: network:*:69: audit:*:77: www:*:80: +u2f:*:116: ntpd:*:123: _ypldap:*:160: hast:*:845: From nobody Tue Mar 14 17:29:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbgWP6qHHz3yWLZ; Tue, 14 Mar 2023 17:29: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 4PbgWP5v8Bz3Bxl; Tue, 14 Mar 2023 17:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678814977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3cESPxaiLD1wTApFjM3WR7NCRY17n8mIJ1605eazK6g=; b=BxuBr6+36sdK/e+3GcNBQXgKgkfmG96ErrkJn6GGTueXQQiWX/lJj3ixlU7YnWb3SonrQw pZuB0tKwrCUySL/FlyQ5Himy3umkOBFKC9y8pH6r4B+x5emqBK/f2a3qbl/rzgCbaG7hwz rq39elZg5KbpCpoN1MJpXATggnlqL3fW8cjMyXwAo/k0frtiPFmZdOavs40H/Wb238UQrN yFFUzydfPkhEpL04Ip4A39xtOeDF+SVH7kHBg3XIy+howaHqGTWowMLgAWNB+KUUjti4sX Ul1mu+YVR702utLriC9Xbv4UIeBpFE70NMnHaSrVVlLR2+uIV3qMPtfVQErW/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678814977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3cESPxaiLD1wTApFjM3WR7NCRY17n8mIJ1605eazK6g=; b=jCp+zQJA7LABOgHxg6u8Lhvp517qRa9zud0wEfADQuTZ1HWJxQBaG0Rf2L1DE8ekTSOwHS dgezvTiFwG8kyFkTcmpA3NL3dDOh9J+ehwn8oSVhBh9dVU9fDYk7J/Y6BUgorASWl1muKy zo5jhDEurHHRdOoRqsM1e2x+azb6a/1Hv1Pn2Dl+Bg35GbPgRBNUa7lcA/CltEZTZa6ccz YthkgyA7dhNPL2K47ahArooG4yeqpsyGrapLkVFKZw4jpIwM4OD/OQJYLGfS2S3AS0kUNZ AF14x5kLKxvV1zt/m7nxyTTcCRpzVyuS3eJkiJxzMJUk8HXLsuWgcnjq68z6lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678814977; a=rsa-sha256; cv=none; b=KkVudWnK4+TNQlma/EAS5ORG8Sc/l4LyGjaa0wiCLRgqi1wZ9dpWdu489I5Qh7qCkUIcp8 Q7dpEz4r94+Ih5VlvkfVZK+p2tODSret7J5yYrRoCmzh/BsXU4Q0Dpi4gsg0ka4wGP3ued sEkRYLbgJpyZXuEsE0d2gHy4QpiiVMIrhU9i1iOT6MhXa9bbLc5ZsIN+Kp4DnzcdhzvWSf OHze61OVmSV0GyeD2RAziaY/bG7KNJjvd5BP3zKXahgaQU80pcXe+xxivLU0STLrVbp8jG e/FbFF0t7GC3sOlf3+4Gkp8H5IVaIAvgHr1PQd0es7L1Wrsn2XNML88P95Ukhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbgWP4ykjzkGC; Tue, 14 Mar 2023 17:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EHTbV9056458; Tue, 14 Mar 2023 17:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EHTbqH056457; Tue, 14 Mar 2023 17:29:37 GMT (envelope-from git) Date: Tue, 14 Mar 2023 17:29:37 GMT Message-Id: <202303141729.32EHTbqH056457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 96ab5023fd4b - main - compiler-rt: remove eprintf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96ab5023fd4b7de7df2627ce7c495292c468ba72 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=96ab5023fd4b7de7df2627ce7c495292c468ba72 commit 96ab5023fd4b7de7df2627ce7c495292c468ba72 Author: Ed Maste AuthorDate: 2023-03-14 17:01:20 +0000 Commit: Ed Maste CommitDate: 2023-03-14 17:13:51 +0000 compiler-rt: remove eprintf It was used by ancient GCC assert.h. Prior to 2001 GCC used to provide its own assert.h The GCC assert.h required __eprintf to emit the error message. FreeBSD's own assert.h never used this. Reviewed by: ed (previously), imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2597 --- lib/libcompiler_rt/Makefile.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libcompiler_rt/Makefile.inc b/lib/libcompiler_rt/Makefile.inc index a1cc3d4cac07..4657ffe64abe 100644 --- a/lib/libcompiler_rt/Makefile.inc +++ b/lib/libcompiler_rt/Makefile.inc @@ -40,7 +40,6 @@ SRCF+= divtc3 SRCF+= divti3 SRCF+= divxc3 SRCF+= enable_execute_stack -SRCF+= eprintf SRCF+= extendhfsf2 SRCF+= ffsdi2 SRCF+= ffssi2 From nobody Tue Mar 14 17:29:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbgWQ71RNz3yWLc; Tue, 14 Mar 2023 17:29: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 4PbgWQ6bHVz3ByM; Tue, 14 Mar 2023 17:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678814978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p3ech/v7br24gl+pK701JkgnM4oroCb9SmZL1fmvr6s=; b=BncZi3nEOnVX0b9ut0ngtValjrBOowNZ50jkDOZlXvbTcKTv/641yHouOL/HFlO/H84kEp iNy/K+J5Fn/+qZ2ZNyEOCJALCk8CPpX4PC/qX/lQEXWv1A9T9CFwam3brg/P4CX4Pgy8cr JB5HD/8PqIiEdQYqEGSeAyMTgKjYX2CHxOb3dSDIz/WfNaXs9Mk8VkVazhrCEwVAHKOXYy GxlilQ40lvIjMiMCcI7YiVSNFD3QUBT8gjC+mWtS/sorg98j8d/ymf/qKQUZ0OdyzdR08j k/gS9n9WEPbMDCKPwCkxLTJzYbFKIN09WO3a+ANhmEoQQcgKyJGuQkrY9KN37Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678814978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p3ech/v7br24gl+pK701JkgnM4oroCb9SmZL1fmvr6s=; b=YMhzL69WBZU1Ts+4dsoUKxyYSrh+oqsXZf7OC+lXgMGI33e9AZcvee0jMiAdG4/Gt+5FYI CJ2UEUIEQpYDTF44jHowSMvpBS9sukTg0ddeSqDQC5awDAB5jGb6q7qWqYQcpVal9kl+jt BAnmySoz7SZBp0GyinwX8C+b0wmTQwCGPmfEsqSLrdA0zkNbk/8z4eeonp5zm669BDu52N mwRTGrQZYuTQkBFs9s0XM+7mIr2ubmdDrtoZxdMqt9WCT+WxvwSPw+3inXSQ4zl06++5Ys oQvAst1OyKdmQHS5hU2DJ2v2iw0JM13w9JFbyfqyjdZIg3JKZIgmh4z/zPyPpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678814978; a=rsa-sha256; cv=none; b=Sb3VSLxHiSiEFFIjA1Mw7ZgjCKefwrR9WOSZwTLyPUyHrDdETHC844wXQv7KeJZl0v8CYL IcEdcUUnZXmdYT1yfKl3xEfFdgmk9TrBDX7xy4KeqzARI83N5sAYQeLrLLPwRVSxDJkTjF MCuHQQ/C2oSspIhHP8f9DHbzHYrUDSfH1KinotB5m76po7yjHGPJuDHzyxuVGy9+iEmzpS +cIsoYz+smsTgBn0WB4fqHMdcIYu76n7GmEuINWujyI3JGQ2ZJo4yocpbBGlW1KlmOqyUr pWgz0HEqFQKt8U0oukbx/pUArPiUllxv0na1vRCEe0aZILruAOfUFzQ16Pi2QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbgWQ5hwVzkV3; Tue, 14 Mar 2023 17:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EHTcWZ056481; Tue, 14 Mar 2023 17:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EHTcDk056480; Tue, 14 Mar 2023 17:29:38 GMT (envelope-from git) Date: Tue, 14 Mar 2023 17:29:38 GMT Message-Id: <202303141729.32EHTcDk056480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 19aba210e1a1 - main - ssh: fix leak and apply style(9) to hostname canonicalization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19aba210e1a1b5999bff10cccab5a277060c4d46 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=19aba210e1a1b5999bff10cccab5a277060c4d46 commit 19aba210e1a1b5999bff10cccab5a277060c4d46 Author: Ed Maste AuthorDate: 2023-02-08 13:16:53 +0000 Commit: Ed Maste CommitDate: 2023-03-14 17:16:57 +0000 ssh: fix leak and apply style(9) to hostname canonicalization Fixes: bf2e2524a2ce ("ssh: canonicize the host name before...") Fixes: 3e74849a1ee2 ("ssh: canonicize the host name before...") Reviewed by: rew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38441 --- crypto/openssh/ssh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c index 21050ec342e0..7a44744e0029 100644 --- a/crypto/openssh/ssh.c +++ b/crypto/openssh/ssh.c @@ -1388,18 +1388,21 @@ main(int ac, char **av) cinfo->locuser = xstrdup(pw->pw_name); /* Find canonic host name. */ - if (strchr(host, '.') == 0) { + if (strchr(host, '.') == NULL) { struct addrinfo hints; struct addrinfo *ai = NULL; int errgai; + memset(&hints, 0, sizeof(hints)); hints.ai_family = options.address_family; hints.ai_flags = AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; errgai = getaddrinfo(host, NULL, &hints, &ai); if (errgai == 0) { - if (ai->ai_canonname != NULL) + if (ai->ai_canonname != NULL) { + free(host); host = xstrdup(ai->ai_canonname); + } freeaddrinfo(ai); } } From nobody Tue Mar 14 20:01:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbktp5YNtz3yfp6; Tue, 14 Mar 2023 20:01: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 4Pbktp4y5Dz3jNL; Tue, 14 Mar 2023 20:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678824098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rnujZZ1Oy0eblXTJ8+2q0q1+jGb/cSIst4gEdWYMA2U=; b=LRbh2cllvLzWODyDMArk9HLX54Am2y6tp9Ritg6jpAvGjw+Iw4+PhrfyEiz0QK9RcRZEwY jS5X+z1EdOP/38MmJK+nVHdyYLAabMpR4/1pwzTw3el6PdnynHHRjk7J584kAbZF8ZwHc0 KXMHA3BmMMKEWKSwIYd9fWyGo1F85xtK1quj95TE7xjOElWgOkxoskTwoRCVwjASFxNaKb CXFofDtGz/RvfWFBcIX+9raqvOU7JnCedOtO9s8YmVWTPWzfdFCceVnH1+aF63JOB0ALh5 2YVQ08SWNRcfgrtzL2dC9EvsIVvHaobZZoJ6LmE5/9FIW6z1V8zMQbPWeqiOnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678824098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rnujZZ1Oy0eblXTJ8+2q0q1+jGb/cSIst4gEdWYMA2U=; b=nqMjSzqd1NNXYu0pzZKVVk4ayhGg6PblfXlWOo/WLilvX7dL9b9YTP54BmScPu3mkkm21q NQ2WR6CIYlUBgZtEYeyKnwcT/WbuUs7akwT/qVxt23POfPgkit16lpbkyBcDKdw27YVSzI BURYgFd/j6AWkPvyMF3ftNa16K+Lx2gfZAFgpab2YuQYIs0mggO41QQ2xAqAAjhHlbNLpB FfvDYvTjNA4+rIL2BNP6eLMzL6ZleVzL34t7eOaMdhtwnuUnWXOyvodA2EOcUc1cVEs7hy u3Yruoud5FVraNe/8I9+G0dVVY7erYW99qYKihX5Ick4IQ+JbtK/+KoQy8Z6og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678824098; a=rsa-sha256; cv=none; b=Zz47KLXpwRvCCcA6pHX9hyYT+3fNPw1giJMbz3/ZDg4gw6AivGmSX0eq7iHmFRI3Xitx58 rCA51Yr78pft0sYFa4ZD0sYxmO98JPsGzVksodZjRc2+w44yiudKaD3pKrpYOTm8mYg3Li dpM4LmkKI9+92HuQG8KvpaPcAf8DCnLggnvuzCOeda63gmNIwh6LBYHRvHK4MLokqZO0Iw nTQbzpWE37K8umf1sEXgbg4SWnVhiU1VBhJZp8V1wyYJsjWKEpTQdN15PYLjR6J6y+KQa1 QWGPjTPfdIGabl+FFqq3pH8IgUuD7p8cMQvjD5ao9ATIt8RlIZZyCQCEyOQ9uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbktp41n3zpK0; Tue, 14 Mar 2023 20:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EK1cSN019016; Tue, 14 Mar 2023 20:01:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EK1cel019015; Tue, 14 Mar 2023 20:01:38 GMT (envelope-from git) Date: Tue, 14 Mar 2023 20:01:38 GMT Message-Id: <202303142001.32EK1cel019015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: adf62e836315 - main - infiniband: Convert BPF handling for IfAPI List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adf62e83631571e74caf3d78ddb091870b9d6ecf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=adf62e83631571e74caf3d78ddb091870b9d6ecf commit adf62e83631571e74caf3d78ddb091870b9d6ecf Author: Justin Hibbits AuthorDate: 2023-02-09 02:32:47 +0000 Commit: Justin Hibbits CommitDate: 2023-03-14 19:51:32 +0000 infiniband: Convert BPF handling for IfAPI Summary: All callers of infiniband_bpf_mtap() call it through the wrapper macro, which checks the if_bpf member explicitly. Since this is getting hidden, move this check into the internal function and remove the wrapper macro. Reviewed by: hselasky Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D39024 --- sys/net/if_infiniband.c | 5 ++++- sys/net/if_lagg.c | 4 ++-- sys/net/infiniband.h | 8 -------- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/sys/net/if_infiniband.c b/sys/net/if_infiniband.c index e5830d977e80..6764373b3d1a 100644 --- a/sys/net/if_infiniband.c +++ b/sys/net/if_infiniband.c @@ -128,6 +128,9 @@ infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb) struct infiniband_header *ibh; struct ether_header eh; + if (!bpf_peers_present(ifp->if_bpf)) + return; + if (mb->m_len < sizeof(*ibh)) return; @@ -439,7 +442,7 @@ infiniband_input(struct ifnet *ifp, struct mbuf *m) } /* Let BPF have it before we strip the header. */ - INFINIBAND_BPF_MTAP(ifp, m); + infiniband_bpf_mtap(ifp, m); /* Allow monitor mode to claim this frame, after stats are updated. */ if (ifp->if_flags & IFF_MONITOR) { diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 1ac8492834fc..a50cd995c6eb 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -2154,7 +2154,7 @@ lagg_transmit_infiniband(struct ifnet *ifp, struct mbuf *m) return (ENXIO); } - INFINIBAND_BPF_MTAP(ifp, m); + infiniband_bpf_mtap(ifp, m); error = lagg_proto_start(sc, m); NET_EPOCH_EXIT(et); @@ -2222,7 +2222,7 @@ lagg_input_infiniband(struct ifnet *ifp, struct mbuf *m) return (NULL); } - INFINIBAND_BPF_MTAP(scifp, m); + infiniband_bpf_mtap(scifp, m); m = lagg_proto_input(sc, lp, m); if (m != NULL && (scifp->if_flags & IFF_MONITOR) != 0) { diff --git a/sys/net/infiniband.h b/sys/net/infiniband.h index b9fead61c220..6d41f0fe8816 100644 --- a/sys/net/infiniband.h +++ b/sys/net/infiniband.h @@ -41,14 +41,6 @@ #define INFINIBAND_IS_MULTICAST(addr) \ ((addr)[4] == 0xff) -#define INFINIBAND_BPF_MTAP(_ifp, _m) \ -do { \ - if (bpf_peers_present((_ifp)->if_bpf)) { \ - M_ASSERTVALID(_m); \ - infiniband_bpf_mtap(_ifp, _m); \ - } \ -} while (0) - struct infiniband_header { uint8_t ib_hwaddr[INFINIBAND_ADDR_LEN]; uint16_t ib_protocol; /* big endian */ diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c index f7b257c92784..3f01d8b0218e 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -747,7 +747,7 @@ ipoib_start_locked(struct ifnet *dev, struct ipoib_dev_priv *priv) IFQ_DRV_DEQUEUE(&dev->if_snd, mb); if (mb == NULL) break; - INFINIBAND_BPF_MTAP(dev, mb); + infiniband_bpf_mtap(dev, mb); ipoib_send_one(priv, mb); } } From nobody Tue Mar 14 20:52:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbm1k3WsVz3yjfH; Tue, 14 Mar 2023 20:52: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 4Pbm1k35VQz3nl3; Tue, 14 Mar 2023 20:52:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678827162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nHWQ0tXH8t0CyQkEAAwl4bWWRbgKg2PAvFS65EgwiMY=; b=IfDlkLd7dtMzjFYMEriWZT8Dg+xWOtgVBgzPLl7HQzqCQc2uLmS8gGH6AEmprj1uOhtJ6e jhQ+B0Q0+EJW/DRroqHJs5L+WldydqknEUvoTxfsRduvp2sg0/0W2fwG/fn93E9fFrQP5l 0l6QDVmgqAImaTN2L61nnuEwTCsxYiDbqyae49cn+h0DF/VK/J2YVyLZKo+TpUE8h5maU4 HzkbbVY3zkI+VTq54WsfcJfFqV7dezW8KTMX1BcIJHCzVrym4Iy6gBiWBjXZGwLyFbBTds NefkI+4Z1YHJ7WHgZey1YmF6AQUEuTLFek42ZcH2TkQ0sKySKB5yNCkAEXVpww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678827162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nHWQ0tXH8t0CyQkEAAwl4bWWRbgKg2PAvFS65EgwiMY=; b=rMF4N8lbmSjWSUHrbUoXE54oxQC0sO8ncdrVP7kxkRLO3mtoCicCeSQpW2UD7krrtS0MAq bqzkfoRf1mrHmJWEPXTitASYapK2+r36P2DvEmv+m4ufR4QMkXKu5eOj4wza/obWgYfdSg +CNNu7x/Q2M51xtVICQP8JvXrUAVrQYuktUwzb8ecIAbXXJYWgARvqRyqweTsSpktTgsMR 0L6fAJ6RO7R0ODSgzmYzGEhqUbUJxl5uzv1q0jtwV0NW7I+2PWrqwHishJOtsOzUdeYeOe 5cBFytWA1ZRDAlM4SZ/iwHEw9PFePwZXW0dSYEQqdsLMIrh78RxpQpCCkIzOIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678827162; a=rsa-sha256; cv=none; b=hMe6DQzGFiqhQorO/tCYzFRQ8Vezn9sbBk45EXxEuBreKSljlFB+ga2nrTT4PXs9UhV6DC kGhaFRT5ZcM6vJewKVM3Mt2AzgcZ3Fb34s5bGsO5JJ5hn02vygO1SCu4Ew9tnPtNYybBD1 NvTE9rZ5RqRhf4FzuhoZwbvkV1ITWqd3Eh7fWxejKWzaYFrfQP5ink0uSELH6i+i7f8JFf 5msbEaVa1ZWbQaGBLtmTAIdm0qYFr5TDTkV52Tyg+nB0AwpB1cFoyoO0uI+CJlxTwsm8T0 VMgtF4Wl8Wo6a6MegAkVcMW00wnh4TnI/NxFk0DrjHbHZWBBbFYX3799kKtoZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbm1k28TRzqM3; Tue, 14 Mar 2023 20:52:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EKqgn6001978; Tue, 14 Mar 2023 20:52:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EKqgiM001977; Tue, 14 Mar 2023 20:52:42 GMT (envelope-from git) Date: Tue, 14 Mar 2023 20:52:42 GMT Message-Id: <202303142052.32EKqgiM001977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 4e31d33bfe67 - stable/13 - netmap: pkt-gen: init all slots of every tx ring List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4e31d33bfe67343d7647242db672ad2d16c7a5f5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=4e31d33bfe67343d7647242db672ad2d16c7a5f5 commit 4e31d33bfe67343d7647242db672ad2d16c7a5f5 Author: Vincenzo Maffione AuthorDate: 2023-03-06 17:22:09 +0000 Commit: Vincenzo Maffione CommitDate: 2023-03-14 20:48:42 +0000 netmap: pkt-gen: init all slots of every tx ring sender_body() uses OPT_COPY to copy the frame into the destination slot for the first 100,000 packets. Then it removes OPT_COPY to improve performance. The function always starts with the first tx ring. If multiple tx rings are in use, it is possible that the initial 100k packets will only use the first ring. After OPT_COPY is removed, there may come a time when the first ring is full and sender_body() will move to the next ring which was never initialized. As a result it will send all zero packets. (This was discovered when the receiving NIC reported rx errors.) Before any transmissions, step through every tx ring and set NS_BUF_CHANGED on every slot. That will force send_packets() to initialize the slot when first used. Since it only copies when necessary, it performs better than always setting OPT_COPY. With this change, there is no reason for the "drop copy" code. Submitted by: Brian Poole MFC after: 7 days (cherry picked from commit 506336f2cd1fa0a3ba94bc247d7fad1a71d43ac2) --- tools/tools/netmap/pkt-gen.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/tools/netmap/pkt-gen.c b/tools/tools/netmap/pkt-gen.c index b06fef05579d..296208018fd4 100644 --- a/tools/tools/netmap/pkt-gen.c +++ b/tools/tools/netmap/pkt-gen.c @@ -1604,7 +1604,7 @@ sender_body(void *data) uint64_t n = targ->g->npackets / targ->g->nthreads; uint64_t sent = 0; uint64_t event = 0; - int options = targ->g->options | OPT_COPY; + int options = targ->g->options; struct timespec nexttime = { 0, 0}; // XXX silence compiler int rate_limit = targ->g->tx_rate; struct pkt *pkt = &targ->pkt; @@ -1678,6 +1678,19 @@ sender_body(void *data) targ->frags++; } D("frags %u frag_size %u", targ->frags, targ->frag_size); + + /* mark all slots of all rings as changed so initial copy will be done */ + for (i = targ->nmd->first_tx_ring; i <= targ->nmd->last_tx_ring; i++) { + uint32_t j; + struct netmap_slot *slot; + + txring = NETMAP_TXRING(nifp, i); + for (j = 0; j < txring->num_slots; j++) { + slot = &txring->slot[j]; + slot->flags = NS_BUF_CHANGED; + } + } + while (!targ->cancel && (n == 0 || sent < n)) { int rv; @@ -1714,10 +1727,6 @@ sender_body(void *data) /* * scan our queues and send on those with room */ - if (options & OPT_COPY && sent > 100000 && !(targ->g->options & OPT_COPY) ) { - D("drop copy"); - options &= ~OPT_COPY; - } for (i = targ->nmd->first_tx_ring; i <= targ->nmd->last_tx_ring; i++) { int m; uint64_t limit = rate_limit ? tosend : targ->g->burst; From nobody Tue Mar 14 22:04:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbncr5r6kz3xY6L; Tue, 14 Mar 2023 22:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pbncr5JKmz3v6m; Tue, 14 Mar 2023 22:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678831484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SvRA5im1ralkeLjaWqMiGB6Oe2+y1WYKhio3dYC/LMk=; b=nRLbPwAbwEEr0v+poZzcdXt6CjL2Zfj6REIQz32fNanLitND+f4QvG4FUoBRtqcLP9T4Tq YGVahZRvkWE56jlZWlDsHJ56tRROGt9+Vma6DghFnRwhPiqnWvjCJ2dv2Pav6u/LzpZ3m4 O0sflx1+fqrmigsU4znMOJkFFu2ZobRqqocBBmPib72Vg0bAsizfZh0MlNTtCN4vM1ogzZ AbFaPLWBw1fxqmhETm6x1BQtWbMfbWB20LAejSJSUEdREDKygC2KJktQkS5BPjuGbbVX13 LevADUfv8CD5SWP1gG5eZpsWh+kyna6jQNRJBiGBZ33UJQcQEWfdTzYC12PV+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678831484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SvRA5im1ralkeLjaWqMiGB6Oe2+y1WYKhio3dYC/LMk=; b=ohBzJS6sBORR33GuZoFV2CJvDyP5r1MUKzQp+jGsgG5hF7dtgxnNnbCvwS1L0zmVZ2qtMZ y5zkObW28eIiosfBpu+8o8hEGL5qiOP66lyAjvdQAlSSGXCvUYVZlM1U1YoD2UdDljlbvr rDVjwb8qlr/vzZswnBjp5k4KG8yGhNnU0aAaXSl+3vnl68CHVjlJicPC8gZB1p5YSbmjeh uC9pHF5afeBFSUOYp402utnmrn2s8n5CvhQukp22k7IaM94ApoSWvRUwB5XurDqaboE/s3 0TlpgeJoHtMx8uXJ1+g/ypbqttCig58XCSJXt8XR06sE1oLo0aodIOeQxlMtgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678831484; a=rsa-sha256; cv=none; b=qlTdRgv8QCRMhmU8EtBi0OnlLj06lwKXx2iHzo6TrT/P9QoLkYO9nNlF6k6r/FveeXUe8p E//B8LJXLWOKliG/5JdThT2U6KH3oV/nvkV04Zgc4nze3Fv22xdVMS1NzgHTKMR24Blo8t W4GIFc8QlitTg8Js5u1Ev7nuecQG8CEl4mBqbTqOo7sII+k76uA1Zir1Z3kcwluGutgNnM wRDK5AZmS9jVxmSh60AG9XOAXpG+O2Z10sTJ1lXybz5tyl573LsHT7atEZlFvk3c8w/0QW KNnq44RMLOvMG97SLrgHfhpNpPFsLOQInJJ/BtU6kwkQd2ejcvMlNknYNEKm1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbncr4KxJzsJm; Tue, 14 Mar 2023 22:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EM4ii0016831; Tue, 14 Mar 2023 22:04:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EM4iCH016830; Tue, 14 Mar 2023 22:04:44 GMT (envelope-from git) Date: Tue, 14 Mar 2023 22:04:44 GMT Message-Id: <202303142204.32EM4iCH016830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vincenzo Maffione Subject: git: 6c9fe357435d - main - netmap: get rid of save_if_input for emulated adapters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c9fe357435db6408ec6b01221b9ff9e7e9b0ff1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=6c9fe357435db6408ec6b01221b9ff9e7e9b0ff1 commit 6c9fe357435db6408ec6b01221b9ff9e7e9b0ff1 Author: Vincenzo Maffione AuthorDate: 2023-03-14 21:59:23 +0000 Commit: Vincenzo Maffione CommitDate: 2023-03-14 22:04:23 +0000 netmap: get rid of save_if_input for emulated adapters The save_if_input function pointer was meant to save the previous value of ifp->if_input before replacing it with the emulated adapter hook. However, the same pointer value is already stored in the if_input field of the netmap_adapter struct, to be used for host TX ring processing. Reuse the netmap_adapter if_input field to simplify the code and save some space. MFC after: 14 days --- sys/dev/netmap/netmap_freebsd.c | 20 ++------------------ sys/dev/netmap/netmap_kern.h | 3 --- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c index 296c37576407..4b3b1a6edacd 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -327,9 +327,7 @@ freebsd_generic_rx_handler(if_t ifp, struct mbuf *m) stolen = generic_rx_handler(ifp, m); if (!stolen) { - struct netmap_generic_adapter *gna = - (struct netmap_generic_adapter *)NA(ifp); - gna->save_if_input(ifp, m); + NA(ifp)->if_input(ifp, m); } } @@ -346,26 +344,12 @@ nm_os_catch_rx(struct netmap_generic_adapter *gna, int intercept) nm_os_ifnet_lock(); if (intercept) { - if (gna->save_if_input) { - nm_prerr("RX on %s already intercepted", na->name); - ret = EBUSY; /* already set */ - goto out; - } if_setcapenablebit(ifp, IFCAP_NETMAP, 0); - gna->save_if_input = if_getinputfn(ifp); if_setinputfn(ifp, freebsd_generic_rx_handler); } else { - if (!gna->save_if_input) { - nm_prerr("Failed to undo RX intercept on %s", - na->name); - ret = EINVAL; /* not saved */ - goto out; - } if_setcapenablebit(ifp, 0, IFCAP_NETMAP); - if_setinputfn(ifp, gna->save_if_input); - gna->save_if_input = NULL; + if_setinputfn(ifp, na->if_input); } -out: nm_os_ifnet_unlock(); return ret; diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index c34733f912fd..7c68c79c61ef 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -1042,11 +1042,8 @@ struct netmap_generic_adapter { /* emulated device */ struct netmap_adapter *prev; /* Emulated netmap adapters support: - * - save_if_input saves the if_input hook (FreeBSD); * - mit implements rx interrupt mitigation; */ - void (*save_if_input)(if_t, struct mbuf *); - struct nm_generic_mit *mit; #ifdef linux netdev_tx_t (*save_start_xmit)(struct mbuf *, if_t); From nobody Tue Mar 14 22:19:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbnyM1YpJz3xZD5; Tue, 14 Mar 2023 22:19: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 4PbnyM14JHz3wMQ; Tue, 14 Mar 2023 22:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678832395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXCm5VapkNANgdZ0B145Hbp39UAlg0c6vF84smWi4iM=; b=FznRZoMvWDN82/u/NLiAI+hm1BQGdNUI7MffUwRTzLvSFAoLNOUQ+jNvekJ3PvbS7yUsrM etq1BAmc8XPuth9KlKOvfLSI5F2SV/56lNIMu1800QlS1915vYId5fvhmqQShwikmd/5Rt FHzQ/2MX+o73YglsvB1CvS716KP3Al8joGnlhaDEBw9UQeoVQq2+oDnB4GaHtqsRVKJZG9 gDfdd4nKSMKNNhz4IRGTzfF5lWZUCBqzgJhGXM7ZmUTfkRSz6pEfMLzzQwvXV1V89r4JVm tpP+utI6NT4AZex6bovObqD1cpcyUSUdun9/ymmzv9gR1tD79+GIkJzyUcDs/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678832395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXCm5VapkNANgdZ0B145Hbp39UAlg0c6vF84smWi4iM=; b=UX5fTNIk88oEszRj2q/PHagWbfhwG1+JmpATy7Q0JoBgz2bpeQiEKIYsPxL8dgNTgrWCvR Pefy2N+0l6jdmCamvdiTPtLY4EoYlU1e+gZqe/EoMAHcg/9SLFV7VPEew2BIg1qTrWKrnD Ql7H03a0ll+HmLoQkjOoGrJE0Gh7iWIJLYO8SF18ZbHuuxNmhdUt2/eLQhx01oeR9lM0Ip UGwfeK2D9YYgqBGJHQy8m6WYiv4R3cfUpz6Vpfhay6CQXtqn8XSwqzwTzQtpII0pivU9Gm WdIN9JYl9ds/1xnOum5ok17cGQKo6KfOX1nDknhwnNXmbhR5FhJXeos5VlLC6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678832395; a=rsa-sha256; cv=none; b=hKgzTk9+pE87k0NoLlrIOnsyfO0lDkLy7gUitN7WCzun9iX9FNCgSzZxfkWK1djjBmJdRv 3xYi/3wi32vwkuVWsRgPF9ykY3GaBelY9cWMNg6h5Kj4heVo0aSEf51QaCUsqaIOZPouIZ 9Te7y+rvCDIqmfVsqg9iyAW+RCzL7nfN5s0NOPYCJb46brvAHXg5SUhVvOa2JEFT38iUKl XFjvc0ephL6/2azF70L3xnNFh7/eocZK19ukY69YSIEpetPZGXvs56xq3EeqL0rp/E8rWQ cI9sKf1lUTkJcygAsTH9nGVLlG4GQqtV3fUEVrYfcmsyaNsHVG9bGZeFgyKwhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbnyM07c2zsNG; Tue, 14 Mar 2023 22:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EMJs8v034373; Tue, 14 Mar 2023 22:19:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EMJsbM034372; Tue, 14 Mar 2023 22:19:54 GMT (envelope-from git) Date: Tue, 14 Mar 2023 22:19:54 GMT Message-Id: <202303142219.32EMJsbM034372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3346164ce844 - main - net80211: define mask for ss_flags rather than using hardcoded 0xfff List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3346164ce844f8995311c3988ab193bd6ddda0c9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3346164ce844f8995311c3988ab193bd6ddda0c9 commit 3346164ce844f8995311c3988ab193bd6ddda0c9 Author: Bjoern A. Zeeb AuthorDate: 2023-03-14 21:00:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-03-14 22:16:41 +0000 net80211: define mask for ss_flags rather than using hardcoded 0xfff scan state ss_flags in two places cut off the "internal" GOTPICK options. Replace the hardcoded 0xfff with a defined mask. Note that "internal" flags is confusing as we also supplement the the 16bit by another 16bit of "internal flags" passed around but comaparing to GOTPICK never stored to my understanding. No functional change. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D38832 --- sys/net80211/ieee80211_scan.h | 1 + sys/net80211/ieee80211_scan_sw.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_scan.h b/sys/net80211/ieee80211_scan.h index e1f7b786be19..8db7bd03e2d7 100644 --- a/sys/net80211/ieee80211_scan.h +++ b/sys/net80211/ieee80211_scan.h @@ -136,6 +136,7 @@ struct ieee80211_scan_state { #define IEEE80211_SCAN_ONCE 0x0010 /* do one complete pass */ #define IEEE80211_SCAN_NOBCAST 0x0020 /* no broadcast probe req */ #define IEEE80211_SCAN_NOJOIN 0x0040 /* no auto-sequencing */ +#define IEEE80211_SCAN_PUBLIC_MASK 0x0fff /* top 4 bits for internal use */ #define IEEE80211_SCAN_GOTPICK 0x1000 /* got candidate, can stop */ uint8_t ss_nssid; /* # ssid's to probe/match */ struct ieee80211_scan_ssid ss_ssid[IEEE80211_SCAN_MAX_SSID]; diff --git a/sys/net80211/ieee80211_scan_sw.c b/sys/net80211/ieee80211_scan_sw.c index 51e1189824e3..6442ed42112c 100644 --- a/sys/net80211/ieee80211_scan_sw.c +++ b/sys/net80211/ieee80211_scan_sw.c @@ -196,8 +196,7 @@ ieee80211_swscan_start_scan_locked(const struct ieee80211_scanner *scan, if ((flags & IEEE80211_SCAN_NOSSID) == 0) ieee80211_scan_copy_ssid(vap, ss, nssid, ssids); - /* NB: top 4 bits for internal use */ - ss->ss_flags = flags & 0xfff; + ss->ss_flags = flags & IEEE80211_SCAN_PUBLIC_MASK; if (ss->ss_flags & IEEE80211_SCAN_ACTIVE) vap->iv_stats.is_scan_active++; else @@ -307,7 +306,7 @@ ieee80211_swscan_check_scan(const struct ieee80211_scanner *scan, ic->ic_flags |= IEEE80211_F_SCAN; /* NB: need to use supplied flags in check */ - ss->ss_flags = flags & 0xff; + ss->ss_flags = flags & IEEE80211_SCAN_PUBLIC_MASK; result = ss->ss_ops->scan_end(ss, vap); ic->ic_flags &= ~IEEE80211_F_SCAN; From nobody Tue Mar 14 22:19:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbnyN2bs9z3xYfh; Tue, 14 Mar 2023 22:19: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 4PbnyN1zpCz3wLC; Tue, 14 Mar 2023 22:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678832396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T0+CCm35EFtFrMN+8T63nqhL8d2vTlIMiez557gSKi4=; b=SLTapF69Ksj3osXJS8YU+pxIwa3jZQ3wGKrP4POzodsbJzRT9j8unS+MxOmGtkKcVPbFLc UocVjK82hhAfqsZ5G5rk9+D5J70mNpAF2fS+W6Ww1rtwShbBf3Cpl1Gj9ewOq3Ai07rFF/ Jf1OCYMk1H933zwJSjtrFUIVNKCwzO7LqhvkDZ5qvWtSWVLhTPZc0DYZr0j4keT/UgRE3Z 8THHLQKx5QPTNOGBYaYzCwRl2DD+slntTw3BqegMQ9E/2qThss9SFVksQ5wzw0+NF+R27E y3AADPEO44/fcXLBOxf5OTRzRj1yeyKdCFhgR3YBE+1dzOLMc/i/kuCxOt/JBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678832396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T0+CCm35EFtFrMN+8T63nqhL8d2vTlIMiez557gSKi4=; b=HS+i3dZh65Urj6E+QB24xgzQEfd7ipOBqfjp+uTBgUn4rEMmZ6GB7kqorCyOi9W37Q3PVa KUcapP148ARtTCKv6GmHRa+CxyHV77BTz0UFdF1YEmDekwSsI0oX2AiihJWeXHhxix2iuH PA59+fMFz14QXLd2KRR5a6zz0dUo6VECru+erjFcJXldfhtc+wELOub60oCcRfQrGJqoyc GjfTMNqJHcMA3tp/vIRAdtLZ8M8ZR7nbjzW1ShzPbPPnOIRNndiQ/lO7qR9NgIvJjcWnlx evuZvZH5FGUSgKViCvOrG3OfaybMw6fpaquO5lmQIdKNHTQkKPzFAtcgo+5VUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678832396; a=rsa-sha256; cv=none; b=S5+VN926Y92UH1Y7lU98hQS8aacIin7ef1Mb06MZPB0M0qbai59pb88r8xKs4tQBTq8rS6 SKjJyv9krzdagE5RaWMUyvaDvMcCj3Z0S7ggnyGlGFfdGeC4+Y/3EqI7JiYpzCAUI6u33n S4Dhbd+ZMHIbFepnf1AeZ+PpAPS25BEHCAmc+v+vjlMWFg/I+R9P7glmQ8gaE0c66XeouI lTO1L01o5OuKk5YCz1j+cQDS8v/sQ09FGrB4HYcgKcyeFzNP8QqQUQ/3n9JXdEMcV3Toar NXngISuSP//V/exg69SnNS8oYy4PMcwH7QdtdwnAkswflidkljw5AZKEFuIxkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbnyN0qQvzsHY; Tue, 14 Mar 2023 22:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EMJuR2034392; Tue, 14 Mar 2023 22:19:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EMJuEn034391; Tue, 14 Mar 2023 22:19:56 GMT (envelope-from git) Date: Tue, 14 Mar 2023 22:19:56 GMT Message-Id: <202303142219.32EMJuEn034391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d7fb679dc96b - main - net80211: make ieee80211_scan_dump_channels private List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7fb679dc96b07c38eedfa8c91817b44b214c799 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d7fb679dc96b07c38eedfa8c91817b44b214c799 commit d7fb679dc96b07c38eedfa8c91817b44b214c799 Author: Bjoern A. Zeeb AuthorDate: 2023-03-14 21:01:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-03-14 22:17:03 +0000 net80211: make ieee80211_scan_dump_channels private ieee80211_scan_dump_channels() is only used locally and only when IEEE80211_DEBUG is compiled. Stop exporting it, make it file local and hide under the #ifdef to reduce the footprint for production kernels a tiny bit. Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38833 --- sys/net80211/ieee80211_scan.c | 4 ++-- sys/net80211/ieee80211_scan.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c index fd387e68e39f..e1cced8a4b06 100644 --- a/sys/net80211/ieee80211_scan.c +++ b/sys/net80211/ieee80211_scan.c @@ -278,7 +278,8 @@ ieee80211_scan_update_locked(struct ieee80211vap *vap, } } -void +#ifdef IEEE80211_DEBUG +static void ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss) { struct ieee80211com *ic = ss->ss_ic; @@ -295,7 +296,6 @@ ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss) } } -#ifdef IEEE80211_DEBUG void ieee80211_scan_dump(struct ieee80211_scan_state *ss) { diff --git a/sys/net80211/ieee80211_scan.h b/sys/net80211/ieee80211_scan.h index 8db7bd03e2d7..a214dc435813 100644 --- a/sys/net80211/ieee80211_scan.h +++ b/sys/net80211/ieee80211_scan.h @@ -164,8 +164,6 @@ void ieee80211_scan_detach(struct ieee80211com *); void ieee80211_scan_vattach(struct ieee80211vap *); void ieee80211_scan_vdetach(struct ieee80211vap *); -void ieee80211_scan_dump_channels(const struct ieee80211_scan_state *); - #define IEEE80211_SCAN_FOREVER 0x7fffffff int ieee80211_start_scan(struct ieee80211vap *, int flags, u_int duration, u_int mindwell, u_int maxdwell, From nobody Tue Mar 14 22:29:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbp8w4pGQz3xZmX; Tue, 14 Mar 2023 22:29: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 4Pbp8w3rwyz3xlb; Tue, 14 Mar 2023 22:29:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678832944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hHJKhSLKEIB+7M5m82QNXz8qJArc96KpRzXgX2bEsrg=; b=FZAUNxhjpW4HIybB5R+LuceXMlv38ZgLae5eBCrrMKcu9sJRloDptjM4Yr1NclLohIpX7J +PMHMFYgDqAkaqqDfm2fuVZUybMBi6Ivmgq6Aipt9vu7Mvciy8jHEljQsqo/QsH+dZvAm3 AFmW/Onp7eUXwqbWTgu7CFwe4NNAV3y/YeNWidj1oiKZmet7ivJvsKhIqVmDM+NDpDsf3j bruEEO+rgr91uQeqcGOoUldDQqPjUwNRn959BPnmq8XDsvBCwNuhBl7wUs+wqn9YQAkMJc SYqeO5bmztQ9VmwzrwMqwWiIX045s0SNADGxeODEnr41if6iZqP+/4q7vyqFSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678832944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hHJKhSLKEIB+7M5m82QNXz8qJArc96KpRzXgX2bEsrg=; b=UXTGIrJazKUQpfSwlKZORSMDLlB/OYy5Nc2ObiBesUjluWBHsQwEJsV1kxUDUiaVUqe7K4 rPrcb5lYITeVm4dtNUHKKbQIZ61C369Okr0a7rkNqL+7ntFnIPQnxLD37yslh22cyup73j OedAcODT64aOOkA+/XCC0BDue3+ugG5+V5FJInGTsctHoMa/SeyybzxV6sq9tWWnXYaTf8 iTNJ0r9RsHQgwxEPrvpeeKtoB8RuDKWaJrOJyUZM8EidgtEZUm5G7BnKcTQMSTjhWMW5Tx 31tHTrD+MnRqsgtE70m5yxlcvqau2Ok18DwMI4E9TVtdxSCXHQx008pAGyTBBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678832944; a=rsa-sha256; cv=none; b=Lj03J4IA+N2UmE7z2wVrkGP+zB3kz9NEuaZTnOw/uKlFRlaX5MzM3qV/iFTQ/zHAc7EtB0 2W9etAldVsoVRR2VxmLj/FQnAZxFbR+ol2fO9Rwpa6ONmOZfPRUaDsd16nE2E5yoirlW3B eWnXvkqrr6s76794LKmDfFG1oLC7/1lYenxhrGaWsiXuGVdzR0pdyq8PXxbewtP3D9CScB 6QVYXtZjLtsJEpu29jgDSi6uvO8l6mDUuZmznpBI+voYiPFS4XWoH1YicqfwI4y4YXmaI1 tfYUdweKrnVeFVEwtenLYppIqM3acRF+hand+5H4tDIaaTn+mCsQTRAwP/h0jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbp8w2cVRzsnd; Tue, 14 Mar 2023 22:29:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EMT466050099; Tue, 14 Mar 2023 22:29:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EMT4A0050098; Tue, 14 Mar 2023 22:29:04 GMT (envelope-from git) Date: Tue, 14 Mar 2023 22:29:04 GMT Message-Id: <202303142229.32EMT4A0050098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: c0f94fee0bdd - main - jail.8: Update the allow.nfsd section List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0f94fee0bdddcc07f216f9723544f78ace5155a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c0f94fee0bdddcc07f216f9723544f78ace5155a commit c0f94fee0bdddcc07f216f9723544f78ace5155a Author: Rick Macklem AuthorDate: 2023-03-14 22:28:02 +0000 Commit: Rick Macklem CommitDate: 2023-03-14 22:28:02 +0000 jail.8: Update the allow.nfsd section This patch updates the information for "allow.nfsd" and adds configuration information. This is a content change. Reviewed by: karels, markj, pauamma (manpages) MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D39033 --- usr.sbin/jail/jail.8 | 54 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index e40e455f61a6..a69702900d8e 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2022 +.Dd March 12, 2023 .Dt JAIL 8 .Os .Sh NAME @@ -586,17 +586,49 @@ memory subject to and resource limits. .It Va allow.nfsd The -.Xr mountd 8 +.Xr mountd 8 , +.Xr nfsd 8 , +.Xr nfsuserd 8 , +.Xr gssd 8 and -.Xr nfsd 8 -daemons are permitted to run inside a vnet-enabled jail. -The kernel must have been compiled with the -.Sy VNET_NFSD option +.Xr rpc.tlsservd 8 +daemons are permitted to run inside a properly configured vnet-enabled jail. +The jail's root must be a file system mount point and +.Va enforce_statfs +must not be set to 0, so that +.Xr mountd 8 +can export file systems visible within the jail. +.Va enforce_statfs +must be set to 1 if file systems mounted under the +jail's file system need to be exported by +.Xr mount 8 . +For exporting only the jail's file system, a setting of 2 +is sufficient. +If the kernel configuration does not include the +.Sy NFSD +option, +.Pa nfsd.ko +must be loaded outside of the jails. +This is normally done by adding +.Dq nfsd +to +.Va kld_list +in the +.Xr rc.conf 5 +file outside of the jails. +Similarily, if the +.Xr gssd 8 +is to be run in a jail, either the kernel +.Sy KGSSAPI +option needs to be specified or +.Dq kgssapi and -.Sy NFSD option -as well as the -.Sy VIMAGE option -for this to be available. +.Dq kgssapi_krb5 +need to be in +.Va kld_list +in the +.Xr rc.conf 5 +file outside of the jails. .It Va allow.reserved_ports The jail root may bind to ports lower than 1024. .It Va allow.unprivileged_proc_debug @@ -1372,6 +1404,8 @@ environment of the first jail. .Xr jexec 8 , .Xr jls 8 , .Xr mount 8 , +.Xr mountd 8 , +.Xr nfsd 8 , .Xr reboot 8 , .Xr rpcbind 8 , .Xr sendmail 8 , From nobody Tue Mar 14 22:43:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbpTp1QNwz3xbQY; Tue, 14 Mar 2023 22:43:42 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE Root Certificate Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbpTn0mXCz40Qd; Tue, 14 Mar 2023 22:43:40 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 195.201.62.131 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net; dmarc=none Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 5055F8D4A179; Tue, 14 Mar 2023 22:43:34 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 3C9AC5C3A831; Tue, 14 Mar 2023 22:43:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id avIfyFt1f081; Tue, 14 Mar 2023 22:43:31 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 602735C3A82F; Tue, 14 Mar 2023 22:43:31 +0000 (UTC) Date: Tue, 14 Mar 2023 22:43:30 +0000 (UTC) From: "Bjoern A. Zeeb" To: Pawel Biernacki cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 3eaffc626589 - main - netinet6: allow disabling excess log messages In-Reply-To: <202303131649.32DGnNxn023755@gitrepo.freebsd.org> Message-ID: <95n6o6q4-s916-nq21-op3o-2q925r91r13n@mnoonqbm.arg> References: <202303131649.32DGnNxn023755@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spamd-Result: default: False [-3.29 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.994]; R_SPF_ALLOW(-0.20)[+ip4:195.201.62.131]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; DMARC_NA(0.00)[zabbadoz.net]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_NA(0.00)[]; ASN(0.00)[asn:24940, ipnet:195.201.0.0/16, country:DE]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4PbpTn0mXCz40Qd X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On Mon, 13 Mar 2023, Pawel Biernacki wrote: > The branch main has been updated by kaktus: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3eaffc626589eb2fc20a3c9c87eb8ab0ee89e783 > > commit 3eaffc626589eb2fc20a3c9c87eb8ab0ee89e783 > Author: Pawel Biernacki > AuthorDate: 2023-03-13 16:36:11 +0000 > Commit: Pawel Biernacki > CommitDate: 2023-03-13 16:46:21 +0000 > > netinet6: allow disabling excess log messages > > RFC 4443 specifies cases where certain packets, like those originating from > local-scope addresses destined outside of the scope shouldn't be forwarded. > The current practice is to drop them, send ICMPv6 message where appropriate, > and log the message: > > cannot forward src fe80:10::426:82ff:fe36:1d8, dst 2001:db8:db8::10, nxt > 58, rcvif vlan5, outif vlan2 > > At times the volume of such messages cat get very high. Let's allow local > admins to disable such messages on per vnet basis, keeping the current > default (log). Thanks for the change. I find the commit message a "bit misleading" ;-) If that log amount gets high, the local admin should take care of some other hosts ... really ... to reduce the logging and not disable the messages. > Reported by: zarychtam@plan-b.pwste.edu.pl > Reviewed by: zlei (previous version), pauamma (docs) > Differential Revision: https://reviews.freebsd.org/D38644 -- Bjoern A. Zeeb r15:7 From nobody Tue Mar 14 23:43:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbqpX41yNz3xg0M; Tue, 14 Mar 2023 23:43: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 4PbqpX3bJDz44fq; Tue, 14 Mar 2023 23:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678837396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZcFKeB83y6N09JpafxFH89AUl9wrOQgN/IiTFCFQHOQ=; b=wBi6Qxde06x79KSd7fVh96TI58xAB0SHNNTkJ+yzckO3OU/rveVmE09I7pUM7YcFpXzSxG U19zft4LWc6v9r3hR5hheQQQUqe/2M2Hupwd3UZRevMG1yP08dC2Ll5y9SX/BSgo9wLSW2 xWdSYR6TyP7AboRQEwgbq6luJ/KQ3nyR0bFeXLcTi1okA4q/PBavh5gxM0UudIvtk3qgN6 cE/QxQXzWRj5FItAH41MQ9xIU3A3RzaCwgl2+lV0pLRCAcAlT5bT45TSm7qG9gnp9W/VXE lUtRz2zdOIQYUqnb31tjZMEAVHyO32a55p8cl4GVjkEQx615lsPhRrCGIHp03Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678837396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZcFKeB83y6N09JpafxFH89AUl9wrOQgN/IiTFCFQHOQ=; b=k5bHt0q9Q0RnSJmqBGzY9IfkBotyJsOAyc/a8z1uDpATSXRTurVga6aVM9B51RZ5XBonkN Q/xQhp1e+9W93bGE29el4Yd50FFgKOH9xm4YBn7SYVaGmnGyeYMu8aD70RLq/Ja92EKv0r wpdgqj3xrRn09AxnDX8w+ybQ0m5dyqBnwyEjI7R9iJ+2/y1MkOSoNSU/t4UoZRCSvlseSr RKhVBuiqXua2d+5X8iJJX1dTI1UJnyspabfMaH3Pk/kOK33RvFfNQjYxe0k+ANJwYbaP1m 1+ThZOrbHWMn9+NJriDBqoC5A1xwHE851VC++YDNnx2FCNfDV+fNNiqixqnrjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678837396; a=rsa-sha256; cv=none; b=VOgui9UZ/1hzBcocAK44uqLcyhs9X5Q/HWaojQXJOt72jpezNezYoJm3pbMGeRDRgDmR9S +04N3V+fpbm0WD2pK6a/lc8SERoFxuYhxvGGJdKIoxBDo3u2JnaOc7tWRvSWUrVy+z/60H QoR3nPyoQ3akQtApa6m9cfdeyBYG5DeluOSTL2Kpymj24pkDhGxZ98ahAK7Zo24gCU2VLy QkRnswL71ovr6AIZ0S1ZDaPeGpBpdnqT0Njezah42xHKmS73yGEM8iIHe2AhRtmxiYqr9z UgYMvr8s6bzMYVzwIsALycgEMuNn/fhe0pu+7pebdWGKhTzNVgnJmdWoELU2Fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbqpX2gfzzvX2; Tue, 14 Mar 2023 23:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32ENhGLt079752; Tue, 14 Mar 2023 23:43:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32ENhGe1079751; Tue, 14 Mar 2023 23:43:16 GMT (envelope-from git) Date: Tue, 14 Mar 2023 23:43:16 GMT Message-Id: <202303142343.32ENhGe1079751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a06761e3f473 - main - secure_getenv: Put under __BSD_VISIBLE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a06761e3f4738de3a33696fd71cce571c489eec4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a06761e3f4738de3a33696fd71cce571c489eec4 commit a06761e3f4738de3a33696fd71cce571c489eec4 Author: Warner Losh AuthorDate: 2023-03-14 23:42:18 +0000 Commit: Warner Losh CommitDate: 2023-03-14 23:43:13 +0000 secure_getenv: Put under __BSD_VISIBLE Sponsored by: Netflix Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D39076 --- include/stdlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/stdlib.h b/include/stdlib.h index c41e8704e810..730223e7fd77 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -111,7 +111,6 @@ void qsort(void *, size_t, size_t, int (* _Nonnull)(const void *, const void *)); int rand(void); void *realloc(void *, size_t) __result_use_check __alloc_size(2); -char *secure_getenv(const char *); void srand(unsigned); double strtod(const char * __restrict, char ** __restrict); float strtof(const char * __restrict, char ** __restrict); @@ -320,6 +319,7 @@ void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size2(2, 3); void *reallocf(void *, size_t) __result_use_check __alloc_size(2); int rpmatch(const char *); +char *secure_getenv(const char *); void setprogname(const char *); int sradixsort(const unsigned char **, int, const unsigned char *, unsigned); From nobody Wed Mar 15 00:07:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbrLC19vVz3xhRd; Wed, 15 Mar 2023 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 4PbrLC0CDxz49h6; Wed, 15 Mar 2023 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=1678838835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EfDeuynb3kbGKNXgfoGAUSqMFV7seFa7GFHkbIsjxxQ=; b=uAXH2/qHAvB00mOkKPBbkFPS1H0i2Rph8lu/JSfu08pW8yPGyfqaI6E+q2t7gKJljO6pMh rxPNJOLb36EAJI0De3FU1dbg9nMnRfesJDjvbyJCLMtAbxcBWI7Lv/4t/gvbj3c/+TvtB/ Tsnd2OFPve+WQ0wj2cctGXyQXvTF+71bTIha4zk2QUERD0F2QpLPvQzbtkEbAi0sMhi/D6 gjUV9ts5ZX84sVtjbAwf9q/Y3GYcrhDeZN5KozOI1oEf5dYtpSTYxBvODPJFaoM1yFOFXX BpSMJcF/KEuTWRY3J5cuRSHlzv5Q7w3x658TunwsLaLtvQE67heW4Npszg5y5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678838835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EfDeuynb3kbGKNXgfoGAUSqMFV7seFa7GFHkbIsjxxQ=; b=as5Zbg4yGIJ6vxMEjlXSU47SjTJMgwVdaePkh/7V8ap86IV8+3qbRwCkXR9CYkmNSTdulX wY7dDamDT8oOrrFPr79NLnedP0fUlSK9Uy4bg0I2UkfAbSOuUK78QaZNeQDn18e3JzVTNW DJ3XbTo7Gh79SaGXstg/psihkOwfvg40d6Ck92jIsmR7at7OgCmx5XThnf7rrWOo/jO9Sx C/SvTNl41G717ixC/PFpKKbdsKb9th5KZky2imWV2A/so2zWDk3tLL/GIbw6ZMUZiFwDCg BqMCPh8Otpq/pvFKtRgn/JovEVQa6QrFlcV1Mvf/rzOxLNlD8Ckxf/U29JazoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678838835; a=rsa-sha256; cv=none; b=GOluGehc7m6TCKgqVoZKbdcjrtpVyYFeKNL1YBPbgr8Ra87GV70BvWsmxezp7pLmJvRS8K di2mPVF7c3qw9rVyTfrfgMNEnFu7kv9jxEkyxqrCnAHOgsds6hYP+VNi9I6LjJrL2p5Fsp 1scvzfzumupL4ETPu+1oC/5pkU1e6nrarrIyoX39UMNR/DpSXcA+kAl5LOv+23G7R2UkLT v3kp9wiNJE7hXCWwb+DlWLvHzBk6BPVPO49Glwj5U4Vua/VmeksLW9CWcliZlSYwsnx86B yfDhuNbpZvdP0qngpYpi+K2neRpcyO5kfwVModQzQ0Gvu4nRMohXevj004dlDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbrLB6L4RzvSW; Wed, 15 Mar 2023 00:07:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F07EgZ014551; Wed, 15 Mar 2023 00:07:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F07Emn014550; Wed, 15 Mar 2023 00:07:14 GMT (envelope-from git) Date: Wed, 15 Mar 2023 00:07:14 GMT Message-Id: <202303150007.32F07Emn014550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 379954d06c1d - main - src.conf.5: Regen after ZFS-related options changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 379954d06c1d55276acb606a04f804924b94494a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=379954d06c1d55276acb606a04f804924b94494a commit 379954d06c1d55276acb606a04f804924b94494a Author: Jessica Clarke AuthorDate: 2023-03-15 00:06:52 +0000 Commit: Jessica Clarke CommitDate: 2023-03-15 00:06:52 +0000 src.conf.5: Regen after ZFS-related options changes Since 9503d2704ca6 LOADER_ZFS gets turned off when ZFS is, and since 63715498ac6b ZFS is no longer disabled on powerpc and powerpcspe. Reviewed by: emaste Fixes: 9503d2704ca6 ("opts: Minor cleanup of ZFS options") Fixes: 63715498ac6b ("powerpc: enable ZFS on 32 bit powerpc/powerpcspe") Differential Revision: https://reviews.freebsd.org/D39071 --- share/man/man5/src.conf.5 | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index a3f997e66e2c..04af879dbd02 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd March 9, 2023 +.Dd March 15, 2023 .Dt SRC.CONF 5 .Os .Sh NAME @@ -426,6 +426,8 @@ When set, it enforces these options: .It .Va WITHOUT_LDNS_UTILS .It +.Va WITHOUT_LOADER_ZFS +.It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL @@ -1318,6 +1320,8 @@ When set, it enforces these options: .It .Va WITHOUT_LDNS_UTILS .It +.Va WITHOUT_LOADER_ZFS +.It .Va WITHOUT_OPENSSH .It .Va WITHOUT_OPENSSL_KTLS @@ -1763,16 +1767,6 @@ or .Xr zfs 8 . Also disable ZFS support in utilities and libraries which implement ZFS-specific functionality. -.Pp -This is a default setting on -powerpc/powerpc. -.It Va WITH_ZFS -Build the ZFS file system kernel module, libraries, and user commands. -Also enable ZFS support in utilities and libraries which implement -ZFS-specific functionality. -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_ZONEINFO Do not build the timezone database. When set, it enforces these options: From nobody Wed Mar 15 00:07:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbrLD2JMwz3xgPf; Wed, 15 Mar 2023 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 4PbrLD1VrJz49hH; Wed, 15 Mar 2023 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=1678838836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g7UyiTJvoYCZ9fYLHodG6+wS/6I6bU5gLwRc21yOnPw=; b=vXmLq/Qv+gJ/Q1XXTxKW1umQ3Iyhta9lzqeuIjahoXyhJHe+hn1s2f1PA3KJqPqsyOspuX chHyfPq8H3O0qvxV3uSlKXEI0MuYHki+hPLVfTvWbgyYQ6p7vxcK45D1JLuOPEu++fh7fm jsJ5qyXpIQf9Ts5X7zHc8uEZQtPTT2Cvwu+1tDQl3LHnDwtJBDI9o0WkVyXqgCAKHPVZNh xluynbzIxmYqZbdV0LrAS/SbLGWVfUh8YvpLj8Rcv5LwenZJY1fPdQptB9Vm4QneYnpysh Pgmgxc9ZXIPGi+iqSLbAIQmckOJmohG+BzVvcZQ4LcfLV7ks/i3SsdkGAAGF4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678838836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g7UyiTJvoYCZ9fYLHodG6+wS/6I6bU5gLwRc21yOnPw=; b=isgVDm3A5EZz6nG9ZHpUouBQqzE2d4dZoPqc0Ub5DzMzLiu5AB1y0um1YtYBWpLd0GQiOq ww2fvY1S7jUHEs0g2kNzp53lgXsGbgtMdAxOamDYv22NqH60XSY4607vshkeTOxwSyt8Yz ZSgxD4pBMinei0eYVqUnawUhSZ2faAQHT+79mByvOtaat3c/ddS8IFtxrXS7YmFenk06bt acAx8kuT39awgVH8Fh1G4hgMAf8qRTn0AsbVIH0i+fcutbiz8KtPV0a2FyhM+GTj6Rwg3r wedR0Dj+lKbk98r7Mls5fc3ywnJjjR8Bo0yavSEYVPOswMClufG0J8/S5VROsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678838836; a=rsa-sha256; cv=none; b=qCSwVSQmS89mnbEDg36C9A3pjw96XceY7FfmbtvM7TC1WHUeOkppayPtEYOO0KRHju4toh a0+7/Tbpdyx292CfwpZMBoLCgCwpfF1zBNwYqFa3iejMfUUwSuptyPqel8dRlHzmuJl5db 7AjqzYYRMllweoFnQRfwP3LfanVhALde4ODDdzXv9+H+bXSvFokQvFp3dlgLzfTyi405yP kvr76xWPZ0nANezurT5zsGTANi3Kmx9c2MGLn3OhB+Qo2dfg4OY8KuSllBpNz82XYcymQg ow9UOiVSRqIpwt5bFLJlMTZWeZWH1X1/tGCg6/Yh+vGbhX0JsXaHLdGYeOuARQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbrLD0LRQzvbK; Wed, 15 Mar 2023 00:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F07Fse014570; Wed, 15 Mar 2023 00:07:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F07Fbt014569; Wed, 15 Mar 2023 00:07:15 GMT (envelope-from git) Date: Wed, 15 Mar 2023 00:07:15 GMT Message-Id: <202303150007.32F07Fbt014569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 9e914c7af1f3 - main - Add new DISK_IMAGE_TOOLS_BOOTSTRAP option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e914c7af1f3d176acf2712e5a86a9a6a7b779c6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9e914c7af1f3d176acf2712e5a86a9a6a7b779c6 commit 9e914c7af1f3d176acf2712e5a86a9a6a7b779c6 Author: Jessica Clarke AuthorDate: 2023-03-15 00:06:53 +0000 Commit: Jessica Clarke CommitDate: 2023-03-15 00:06:53 +0000 Add new DISK_IMAGE_TOOLS_BOOTSTRAP option This will build etdump, makefs and mkimg as bootstrap tools to allow easily creating disk images. Note that etdump is bootstrapped due to its use in the release scripts for building ISO images. Reviewed by: emaste, arichardson Differential Revision: https://reviews.freebsd.org/D39072 --- Makefile.inc1 | 22 ++++++++++++++++++++-- share/man/man5/src.conf.5 | 7 +++++++ share/mk/src.opts.mk | 1 + .../build/options/WITH_DISK_IMAGE_TOOLS_BOOTSTRAP | 6 ++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 2767a6038354..63c3ce80f54d 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2301,8 +2301,8 @@ _flua= lib/liblua lib/libucl libexec/flua # r245440 mtree -N support added # r313404 requires sha384.h for libnetbsd, added to libmd in r292782 .if ${BOOTSTRAPPING} < 1100093 +_libnetbsd= lib/libnetbsd _nmtree= lib/libmd \ - lib/libnetbsd \ usr.sbin/nmtree ${_bt}-lib/libnetbsd: ${_bt}-lib/libmd @@ -2335,9 +2335,23 @@ _crunchgen= usr.sbin/crunch/crunchgen _bootstrap_tools_links+=crunchgen .endif +.if ${MK_DISK_IMAGE_TOOLS_BOOTSTRAP} != "no" +_etdump= usr.bin/etdump +_makefs= usr.sbin/makefs + +_libnetbsd= lib/libnetbsd +${_bt}-usr.sbin/makefs: ${_bt}-lib/libnetbsd + +.if defined(BOOTSTRAP_ALL_TOOLS) +_libsbuf= lib/libsbuf +${_bt}-usr.sbin/makefs: ${_bt}-lib/libsbuf +.endif +.endif + # 1300102: VHDX support .if ${BOOTSTRAPPING} < 1201520 || \ - (${BOOTSTRAPPING} > 1300000 && ${BOOTSTRAPPING} < 1300102) + (${BOOTSTRAPPING} > 1300000 && ${BOOTSTRAPPING} < 1300102) || \ + ${MK_DISK_IMAGE_TOOLS_BOOTSTRAP} != "no" _mkimg= usr.bin/mkimg .else _bootstrap_tools_links+=mkimg @@ -2538,6 +2552,10 @@ bootstrap-tools: ${_bt}-links .PHONY ${_flua} \ ${_crunchide} \ ${_crunchgen} \ + ${_etdump} \ + ${_libnetbsd} \ + ${_libsbuf} \ + ${_makefs} \ ${_mkimg} \ ${_nmtree} \ ${_vtfontcvt} \ diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 04af879dbd02..7ef13efbb4d0 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -569,6 +569,13 @@ This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not .Pa /etc/src.conf . +.It Va WITH_DISK_IMAGE_TOOLS_BOOTSTRAP +Build +.Xr etdump 1 , +.Xr makefs 8 +and +.Xr mkimg 1 +as bootstrap tools. .It Va WITHOUT_DMAGENT Do not build dma Mail Transport Agent. .It Va WITHOUT_DOCCOMPRESS diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 7e865b31db25..880f1139843c 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -197,6 +197,7 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CLANG_FORMAT \ DETECT_TZ_CHANGES \ + DISK_IMAGE_TOOLS_BOOTSTRAP \ DTRACE_TESTS \ EXPERIMENTAL \ HESIOD \ diff --git a/tools/build/options/WITH_DISK_IMAGE_TOOLS_BOOTSTRAP b/tools/build/options/WITH_DISK_IMAGE_TOOLS_BOOTSTRAP new file mode 100644 index 000000000000..5f5fba2ea0a2 --- /dev/null +++ b/tools/build/options/WITH_DISK_IMAGE_TOOLS_BOOTSTRAP @@ -0,0 +1,6 @@ +Build +.Xr etdump 1 , +.Xr makefs 8 +and +.Xr mkimg 1 +as bootstrap tools. From nobody Wed Mar 15 00:07:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbrLF2cK2z3xhCV; Wed, 15 Mar 2023 00:07: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 4PbrLF2BRbz49ht; Wed, 15 Mar 2023 00:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678838837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VZhK8SHoqrv046oidNbxngfrobG1IyDdRcnm+LVqYDI=; b=Y3q69IqG43n8f730RYmSCP6YBfoo5KVzLlV4EOvTby3UaoQpI2F0Z0UmSwBYOM18a76/0G 9bj8Ouw1uHo321gJXNiYvPf1bPsHuXqmgnKs98ExhZpEdhIQXsdsXaPTNtyUxqOFARi5bE e4KwXGkenpaO8BqTFwdgtRd2AzSymci6hLm4+h9eFJd9+n5gwJQo93N5dYOfqFoY/hGo8j Ju9zT+Pwex5QVrzdEa7DZRILkKj9PIfv/J24cCtrHWQyAVq4ivEDA3uD87dQBkhOIxZjRU rtvgiI/A29kgB12UzuAS6edto4cXKzG3UHTkMLI8buLwbRzwTdzNjpaQy7rb2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678838837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VZhK8SHoqrv046oidNbxngfrobG1IyDdRcnm+LVqYDI=; b=GJATzDpeyqVFK+EKa0BeMZMcrnDhysdJ6BtXa7FUWfISss89axy18RNS5KMvp2h3rOuXtL SBxNPNDB+OM8ommMUGeMzFF0X3SHuIA5C5dastuiv3zdxpsZ8Fvs+wcgdLg3cH7SNjiq6Q fe93gkGvQCQRdgvambYScAJm2xly5Lapo7RoxYCL5UOfiv3lHGhs9Sr5f0xV+9WmtwgSwz PeEASsvK1DCVobyf5j4BKnlQlddHEq0an3gQzsNcErm0v/bJU0y08ohBWQGsbEUyXdAtSn peb35OPkfV60pEVeOhEGO68Ta7kdoG2jN2wJmRDkOgKym24MBpnFrefNX72QYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678838837; a=rsa-sha256; cv=none; b=ZMUj5v+EHEebJQRMZJKGxCr2ktBjAlvtOyMWQwqnJ0ihIpPqpVZesHsECpCI0xhEjoDJMd wVV9eJMDp5wpGN58gdOxGIzGu2uz6F8s+0SMhJ3WoAKGysWTjxVPhdm3VoaF82b8UY+9d5 cpcywiTsXykDtBI+HOUt33NHSiY8FQYEdRCxwS3jVCpVJJhBpngkqjM6q0N/sIiWu0g3Yb NydKSLIJ5FRVakxDoJkYygHObrecFvJ39m5Iq3Mw/jJK49OBb8HJ4agr2sUHn6ctvlCjWB mgApfTar/HTMOVf7VYQkiUpDlxzU25Ytes29FipJUAD6v21TdLdFaWThtj8TLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbrLF1HbGzw8x; Wed, 15 Mar 2023 00:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F07HIm014594; Wed, 15 Mar 2023 00:07:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F07HCo014593; Wed, 15 Mar 2023 00:07:17 GMT (envelope-from git) Date: Wed, 15 Mar 2023 00:07:17 GMT Message-Id: <202303150007.32F07HCo014593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: f13b4e460ccb - main - .github: Test DISK_IMAGE_TOOLS_BOOTSTRAP in CI List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f13b4e460ccb2a11250a0ecc86b6cf329601cdce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f13b4e460ccb2a11250a0ecc86b6cf329601cdce commit f13b4e460ccb2a11250a0ecc86b6cf329601cdce Author: Jessica Clarke AuthorDate: 2023-03-15 00:06:53 +0000 Commit: Jessica Clarke CommitDate: 2023-03-15 00:06:53 +0000 .github: Test DISK_IMAGE_TOOLS_BOOTSTRAP in CI Building the tools is quick so we should provide coverage of this to ensure it keeps working, especially on non-FreeBSD. Reviewed by: emaste, arichardson Differential Revision: https://reviews.freebsd.org/D39073 --- .github/workflows/cross-bootstrap-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 9630470d0420..ddfcb467126e 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -61,6 +61,6 @@ jobs: - name: bootstrap bmake run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} -n - name: make kernel-toolchain - run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} kernel-toolchain -s -j$NPROC + run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} kernel-toolchain -s -j$NPROC -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP - name: make buildkernel run: ./tools/build/make.py --debug $EXTRA_BUILD_ARGS TARGET=${{ matrix.target }} TARGET_ARCH=${{ matrix.target_arch }} KERNCONF=GENERIC NO_MODULES=yes buildkernel -s -j$NPROC $EXTRA_MAKE_ARGS From nobody Wed Mar 15 00:15:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbrW95Cn0z3xhq6; Wed, 15 Mar 2023 00:15: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 4PbrW94yngz4DRC; Wed, 15 Mar 2023 00:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678839301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zPQL6butjDrUebKVdjReoZ/2PJ6Wq+MEF2nvuVXqu3s=; b=AtWEl5IxNRptqig6qJGN8gmdAg5iKsJ8ykfTBHJ52WeT+jU4vuYbUpjBH7mg19u9aCVQWH rbI7+rl6ZiUGImvvxfQsPNelaUOcziPk9Vh+uAf7I//BzKAKgk71DbIKUIAelSgSv5iL/i S7Ll7nHAR4lBhgk6jeXmRZpQnLHO6KnJ3E96drdcq1SJceMkQeAyZmhn7T4NWUraN3RLVE 4zmjbffCABh8Ttu8uZXhnP/HbE/OP/uoiNLW4FsuIfg5ROIB+H4EIYTQhG9BXZtPMeSR7S BMVPXlHIZc+YInvSmpZ4l0vg78sh1fL1KOcenaeAzKttP85i02U4k89Zfd73SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678839301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zPQL6butjDrUebKVdjReoZ/2PJ6Wq+MEF2nvuVXqu3s=; b=Opl7eQunmatdGMGuOCOW3R9nYk4usjyrUtppPb2otFfIySW5ZY1KaXYxXirYXOVSH3AwWa mWjSR/3RAYczPmb7FlPCt6SZTyh8cHslC0RqI7w2UF8oRu9noNQcOfu1T150rtczbDZ+ji D0YdHxJfgp2sWNdXHtu/WIHUZLls+H0Kwy5CUUNRl0f64YjeAFT8lfTjFVNR3GLytHiLWB qPw88b88ucvrrkaiOHoWZUFjJgkQmSa7+TzAmWxv9LARLnlxZqxdeGS2ydFLmEQWfhaTRG azTfwWa6uSsgqIaf7kmnVMaapHZcShy89Z4qjbr0v0VEBbFF+msBGj80jEVw3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678839301; a=rsa-sha256; cv=none; b=p/g2jZJn7h8x8JvIuNbozELyprJRrhD3NnHJ454BzOJ+uzXnyUWXn3JTbufoJcfse1xNHu HZCj+/lEw9vsbfPGthgKLr1tq4ENgOaA35COVmG45piGtISwGzCpZCjxtYXtb3B630gytG yx9y0Q35duCwJgWlPysXAkmdtBBF59KgtYMQs23LREfAdXO5Jfe2b+ybzbzKhMPEcnqPfp M9pxkcDglq9u1gNDTiX6/nonH9O3dkEiwXm9X3u9/u5FhCU7/Vf2zpEqDDldvc0wiO3H+4 4PcoljEuZ/8cuP0IFmcaaAVF0+6Tc0D0cmi2yl50SmxVmZV20hpAUM4aquP4kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbrW9439czwGg; Wed, 15 Mar 2023 00:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F0F1C0030236; Wed, 15 Mar 2023 00:15:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F0F1Is030232; Wed, 15 Mar 2023 00:15:01 GMT (envelope-from git) Date: Wed, 15 Mar 2023 00:15:01 GMT Message-Id: <202303150015.32F0F1Is030232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: aa728e209458 - stable/13 - sqlite3: Vendor import of sqlite3 3.41.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa728e209458a41955e64b6b4d4181c6db26bc74 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=aa728e209458a41955e64b6b4d4181c6db26bc74 commit aa728e209458a41955e64b6b4d4181c6db26bc74 Author: Cy Schubert AuthorDate: 2023-02-28 13:28:07 +0000 Commit: Cy Schubert CommitDate: 2023-03-15 00:14:48 +0000 sqlite3: Vendor import of sqlite3 3.41.0 Release notes at https://www.sqlite.org/releaselog/3_41_0.html. Obtained from: https://www.sqlite.org/2023/sqlite-autoconf-3410000.tar.gz MFC after: 2 weeks Merge commit '615bd3eb2a2225e83e14d5b2a82649430889483c' into temp_merge (cherry picked from commit 7bba9d9473c00cec825495543198768fe387ebf4) --- contrib/sqlite3/Makefile.msc | 1 + contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 2188 ++++++++++++---- contrib/sqlite3/sqlite3.c | 4091 ++++++++++++++++++++---------- contrib/sqlite3/sqlite3.h | 238 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- contrib/sqlite3/tea/generic/tclsqlite3.c | 3 + 11 files changed, 4643 insertions(+), 1926 deletions(-) diff --git a/contrib/sqlite3/Makefile.msc b/contrib/sqlite3/Makefile.msc index e36eb21ea004..09daa867eced 100644 --- a/contrib/sqlite3/Makefile.msc +++ b/contrib/sqlite3/Makefile.msc @@ -955,6 +955,7 @@ LIBRESOBJS = # when the shell is not being dynamically linked. # !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_DQS=0 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1 diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 13ff272ad2e6..e5cbf778e689 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.40.1. +# Generated by GNU Autoconf 2.71 for sqlite 3.41.0. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.40.1' -PACKAGE_STRING='sqlite 3.40.1' +PACKAGE_VERSION='3.41.0' +PACKAGE_STRING='sqlite 3.41.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.40.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.41.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.40.1:";; + short | recursive ) echo "Configuration of sqlite 3.41.0:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.40.1 +sqlite configure 3.41.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.40.1, which was +It was created by sqlite $as_me 3.41.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.40.1' + VERSION='3.41.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.40.1, which was +This file was extended by sqlite $as_me 3.41.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.40.1 +sqlite config.status 3.41.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index bb8a90ebafc3..f7f6558c2db5 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.40.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.41.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 63f708c0bf74..d6a673fe2cfe 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -39,7 +39,7 @@ typedef unsigned short int u16; /* ** Optionally #include a user-defined header, whereby compilation options -** may be set prior to where they take effect, but after platform setup. +** may be set prior to where they take effect, but after platform setup. ** If SQLITE_CUSTOM_INCLUDE=? is defined, its value names the #include ** file. Note that this macro has a like effect on sqlite3.c compilation. */ @@ -129,7 +129,7 @@ typedef unsigned char u8; #if !defined(_WIN32) && !defined(WIN32) # include -# if !defined(__RTP__) && !defined(_WRS_KERNEL) +# if !defined(__RTP__) && !defined(_WRS_KERNEL) && !defined(SQLITE_WASI) # include # endif #endif @@ -184,6 +184,14 @@ typedef unsigned char u8; # define SHELL_USE_LOCAL_GETLINE 1 #endif +#ifndef deliberate_fall_through +/* Quiet some compilers about some of our intentional code. */ +# if defined(GCC_VERSION) && GCC_VERSION>=7000000 +# define deliberate_fall_through __attribute__((fallthrough)); +# else +# define deliberate_fall_through +# endif +#endif #if defined(_WIN32) || defined(WIN32) # if SQLITE_OS_WINRT @@ -210,7 +218,7 @@ typedef unsigned char u8; /* Make sure isatty() has a prototype. */ extern int isatty(int); -# if !defined(__RTP__) && !defined(_WRS_KERNEL) +# if !defined(__RTP__) && !defined(_WRS_KERNEL) && !defined(SQLITE_WASI) /* popen and pclose are not C89 functions and so are ** sometimes omitted from the header */ extern FILE *popen(const char*,const char*); @@ -485,8 +493,108 @@ static char *Argv0; ** Prompt strings. Initialized in main. Settable with ** .prompt main continue */ -static char mainPrompt[20]; /* First line prompt. default: "sqlite> "*/ -static char continuePrompt[20]; /* Continuation prompt. default: " ...> " */ +#define PROMPT_LEN_MAX 20 +/* First line prompt. default: "sqlite> " */ +static char mainPrompt[PROMPT_LEN_MAX]; +/* Continuation prompt. default: " ...> " */ +static char continuePrompt[PROMPT_LEN_MAX]; + +/* This is variant of the standard-library strncpy() routine with the +** one change that the destination string is always zero-terminated, even +** if there is no zero-terminator in the first n-1 characters of the source +** string. +*/ +static char *shell_strncpy(char *dest, const char *src, size_t n){ + size_t i; + for(i=0; iinParenLevel += ni; + if( ni==0 ) p->inParenLevel = 0; + p->zScannerAwaits = 0; +} + +/* Record that a lexeme is opened, or closed with args==0. */ +static void setLexemeOpen(struct DynaPrompt *p, char *s, char c){ + if( s!=0 || c==0 ){ + p->zScannerAwaits = s; + p->acAwait[0] = 0; + }else{ + p->acAwait[0] = c; + p->zScannerAwaits = p->acAwait; + } +} + +/* Upon demand, derive the continuation prompt to display. */ +static char *dynamicContinuePrompt(void){ + if( continuePrompt[0]==0 + || (dynPrompt.zScannerAwaits==0 && dynPrompt.inParenLevel == 0) ){ + return continuePrompt; + }else{ + if( dynPrompt.zScannerAwaits ){ + size_t ncp = strlen(continuePrompt); + size_t ndp = strlen(dynPrompt.zScannerAwaits); + if( ndp > ncp-3 ) return continuePrompt; + strcpy(dynPrompt.dynamicPrompt, dynPrompt.zScannerAwaits); + while( ndp<3 ) dynPrompt.dynamicPrompt[ndp++] = ' '; + shell_strncpy(dynPrompt.dynamicPrompt+3, continuePrompt+3, + PROMPT_LEN_MAX-4); + }else{ + if( dynPrompt.inParenLevel>9 ){ + shell_strncpy(dynPrompt.dynamicPrompt, "(..", 4); + }else if( dynPrompt.inParenLevel<0 ){ + shell_strncpy(dynPrompt.dynamicPrompt, ")x!", 4); + }else{ + shell_strncpy(dynPrompt.dynamicPrompt, "(x.", 4); + dynPrompt.dynamicPrompt[2] = (char)('0'+dynPrompt.inParenLevel); + } + shell_strncpy(dynPrompt.dynamicPrompt+3, continuePrompt+3, PROMPT_LEN_MAX-4); + } + } + return dynPrompt.dynamicPrompt; +} +#endif /* !defined(SQLITE_OMIT_DYNAPROMPT) */ /* ** Render output like fprintf(). Except, if the output is going to the @@ -747,7 +855,7 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){ if( in!=0 ){ zResult = local_getline(zPrior, in); }else{ - zPrompt = isContinuation ? continuePrompt : mainPrompt; + zPrompt = isContinuation ? CONTINUATION_PROMPT : mainPrompt; #if SHELL_USE_LOCAL_GETLINE printf("%s", zPrompt); fflush(stdout); @@ -964,7 +1072,7 @@ static void shellModuleSchema( char *zFake; UNUSED_PARAMETER(nVal); zName = (const char*)sqlite3_value_text(apVal[0]); - zFake = zName ? shellFakeSchema(sqlite3_context_db_handle(pCtx), 0, zName) : 0; + zFake = zName? shellFakeSchema(sqlite3_context_db_handle(pCtx), 0, zName) : 0; if( zFake ){ sqlite3_result_text(pCtx, sqlite3_mprintf("/* %s */", zFake), -1, sqlite3_free); @@ -2058,7 +2166,7 @@ static void sha3Func( /* Compute a string using sqlite3_vsnprintf() with a maximum length ** of 50 bytes and add it to the hash. */ -static void hash_step_vformat( +static void sha3_step_vformat( SHA3Context *p, /* Add content to this context */ const char *zFormat, ... @@ -2154,7 +2262,7 @@ static void sha3QueryFunc( z = sqlite3_sql(pStmt); if( z ){ n = (int)strlen(z); - hash_step_vformat(&cx,"S%d:",n); + sha3_step_vformat(&cx,"S%d:",n); SHA3Update(&cx,(unsigned char*)z,n); } @@ -2198,14 +2306,14 @@ static void sha3QueryFunc( case SQLITE_TEXT: { int n2 = sqlite3_column_bytes(pStmt, i); const unsigned char *z2 = sqlite3_column_text(pStmt, i); - hash_step_vformat(&cx,"T%d:",n2); + sha3_step_vformat(&cx,"T%d:",n2); SHA3Update(&cx, z2, n2); break; } case SQLITE_BLOB: { int n2 = sqlite3_column_bytes(pStmt, i); const unsigned char *z2 = sqlite3_column_blob(pStmt, i); - hash_step_vformat(&cx,"B%d:",n2); + sha3_step_vformat(&cx,"B%d:",n2); SHA3Update(&cx, z2, n2); break; } @@ -2965,7 +3073,7 @@ int sqlite3_decimal_init( SQLITE_EXTENSION_INIT2(pApi); - for(i=0; i +** *Nix: gcc -O2 -shared -I$SQDIR -fPIC -o base64.so base64.c +** OSX: gcc -O2 -dynamiclib -fPIC -I$SQDIR -o base64.dylib base64.c +** Win32: gcc -O2 -shared -I%SQDIR% -o base64.dll base64.c +** Win32: cl /Os -I%SQDIR% base64.c -link -dll -out:base64.dll +*/ + +#include + +/* #include "sqlite3ext.h" */ + +#ifndef deliberate_fall_through +/* Quiet some compilers about some of our intentional code. */ +# if GCC_VERSION>=7000000 +# define deliberate_fall_through __attribute__((fallthrough)); +# else +# define deliberate_fall_through +# endif +#endif + +SQLITE_EXTENSION_INIT1; + +#define PC 0x80 /* pad character */ +#define WS 0x81 /* whitespace */ +#define ND 0x82 /* Not above or digit-value */ +#define PAD_CHAR '=' + +#ifndef U8_TYPEDEF +/* typedef unsigned char u8; */ +#define U8_TYPEDEF +#endif + +static const u8 b64DigitValues[128] = { + /* HT LF VT FF CR */ + ND,ND,ND,ND, ND,ND,ND,ND, ND,WS,WS,WS, WS,WS,ND,ND, + /* US */ + ND,ND,ND,ND, ND,ND,ND,ND, ND,ND,ND,ND, ND,ND,ND,ND, + /*sp + / */ + WS,ND,ND,ND, ND,ND,ND,ND, ND,ND,ND,62, ND,ND,ND,63, + /* 0 1 5 9 = */ + 52,53,54,55, 56,57,58,59, 60,61,ND,ND, ND,PC,ND,ND, + /* A O */ + ND, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, + /* P Z */ + 15,16,17,18, 19,20,21,22, 23,24,25,ND, ND,ND,ND,ND, + /* a o */ + ND,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, + /* p z */ + 41,42,43,44, 45,46,47,48, 49,50,51,ND, ND,ND,ND,ND +}; + +static const char b64Numerals[64+1] += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +#define BX_DV_PROTO(c) \ + ((((u8)(c))<0x80)? (u8)(b64DigitValues[(u8)(c)]) : 0x80) +#define IS_BX_DIGIT(bdp) (((u8)(bdp))<0x80) +#define IS_BX_WS(bdp) ((bdp)==WS) +#define IS_BX_PAD(bdp) ((bdp)==PC) +#define BX_NUMERAL(dv) (b64Numerals[(u8)(dv)]) +/* Width of base64 lines. Should be an integer multiple of 4. */ +#define B64_DARK_MAX 72 + +/* Encode a byte buffer into base64 text with linefeeds appended to limit +** encoded group lengths to B64_DARK_MAX or to terminate the last group. +*/ +static char* toBase64( u8 *pIn, int nbIn, char *pOut ){ + int nCol = 0; + while( nbIn >= 3 ){ + /* Do the bit-shuffle, exploiting unsigned input to avoid masking. */ + pOut[0] = BX_NUMERAL(pIn[0]>>2); + pOut[1] = BX_NUMERAL(((pIn[0]<<4)|(pIn[1]>>4))&0x3f); + pOut[2] = BX_NUMERAL(((pIn[1]&0xf)<<2)|(pIn[2]>>6)); + pOut[3] = BX_NUMERAL(pIn[2]&0x3f); + pOut += 4; + nbIn -= 3; + pIn += 3; + if( (nCol += 4)>=B64_DARK_MAX || nbIn<=0 ){ + *pOut++ = '\n'; + nCol = 0; + } + } + if( nbIn > 0 ){ + signed char nco = nbIn+1; + int nbe; + unsigned long qv = *pIn++; + for( nbe=1; nbe<3; ++nbe ){ + qv <<= 8; + if( nbe=0; --nbe ){ + char ce = (nbe>= 6; + pOut[nbe] = ce; + } + pOut += 4; + *pOut++ = '\n'; + } + *pOut = 0; + return pOut; +} + +/* Skip over text which is not base64 numeral(s). */ +static char * skipNonB64( char *s ){ + char c; + while( (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; + return s; +} + +/* Decode base64 text into a byte buffer. */ +static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){ + if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; + while( ncIn>0 && *pIn!=PAD_CHAR ){ + static signed char nboi[] = { 0, 0, 1, 2, 3 }; + char *pUse = skipNonB64(pIn); + unsigned long qv = 0L; + int nti, nbo, nac; + ncIn -= (pUse - pIn); + pIn = pUse; + nti = (ncIn>4)? 4 : ncIn; + ncIn -= nti; + nbo = nboi[nti]; + if( nbo==0 ) break; + for( nac=0; nac<4; ++nac ){ + char c = (nac>8) & 0xff; + case 1: + pOut[0] = (qv>>16) & 0xff; + } + pOut += nbo; + } + return pOut; +} + +/* This function does the work for the SQLite base64(x) UDF. */ +static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ + int nb, nc, nv = sqlite3_value_bytes(av[0]); + int nvMax = sqlite3_limit(sqlite3_context_db_handle(context), + SQLITE_LIMIT_LENGTH, -1); + char *cBuf; + u8 *bBuf; + assert(na==1); + switch( sqlite3_value_type(av[0]) ){ + case SQLITE_BLOB: + nb = nv; + nc = 4*(nv+2/3); /* quads needed */ + nc += (nc+(B64_DARK_MAX-1))/B64_DARK_MAX + 1; /* LFs and a 0-terminator */ + if( nvMax < nc ){ + sqlite3_result_error(context, "blob expanded to base64 too big", -1); + return; + } + cBuf = sqlite3_malloc(nc); + if( !cBuf ) goto memFail; + bBuf = (u8*)sqlite3_value_blob(av[0]); + nc = (int)(toBase64(bBuf, nb, cBuf) - cBuf); + sqlite3_result_text(context, cBuf, nc, sqlite3_free); + break; + case SQLITE_TEXT: + nc = nv; + nb = 3*((nv+3)/4); /* may overestimate due to LF and padding */ + if( nvMax < nb ){ + sqlite3_result_error(context, "blob from base64 may be too big", -1); + return; + }else if( nb<1 ){ + nb = 1; + } + bBuf = sqlite3_malloc(nb); + if( !bBuf ) goto memFail; + cBuf = (char *)sqlite3_value_text(av[0]); + nb = (int)(fromBase64(cBuf, nc, bBuf) - bBuf); + sqlite3_result_blob(context, bBuf, nb, sqlite3_free); + break; + default: + sqlite3_result_error(context, "base64 accepts only blob or text", -1); + return; + } + return; + memFail: + sqlite3_result_error(context, "base64 OOM", -1); +} + +/* +** Establish linkage to running SQLite library. +*/ +#ifndef SQLITE_SHELL_EXTFUNCS +#ifdef _WIN32 + +#endif +int sqlite3_base_init +#else +static int sqlite3_base64_init +#endif +(sqlite3 *db, char **pzErr, const sqlite3_api_routines *pApi){ + SQLITE_EXTENSION_INIT2(pApi); + (void)pzErr; + return sqlite3_create_function + (db, "base64", 1, + SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS|SQLITE_DIRECTONLY|SQLITE_UTF8, + 0, base64, 0, 0); +} + +/* +** Define some macros to allow this extension to be built into the shell +** conveniently, in conjunction with use of SQLITE_SHELL_EXTFUNCS. This +** allows shell.c, as distributed, to have this extension built in. +*/ +#define BASE64_INIT(db) sqlite3_base64_init(db, 0, 0) +#define BASE64_EXPOSE(db, pzErr) /* Not needed, ..._init() does this. */ + +/************************* End ../ext/misc/base64.c ********************/ +#undef sqlite3_base_init +#define sqlite3_base_init sqlite3_base85_init +#define OMIT_BASE85_CHECKER +/************************* Begin ../ext/misc/base85.c ******************/ +/* +** 2022-11-16 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This is a utility for converting binary to base85 or vice-versa. +** It can be built as a standalone program or an SQLite3 extension. +** +** Much like base64 representations, base85 can be sent through a +** sane USASCII channel unmolested. It also plays nicely in CSV or +** written as TCL brace-enclosed literals or SQL string literals. +** It is not suited for unmodified use in XML-like documents. +** +** The encoding used resembles Ascii85, but was devised by the author +** (Larry Brasfield) before Mozilla, Adobe, ZMODEM or other Ascii85 +** variant sources existed, in the 1984 timeframe on a VAX mainframe. +** Further, this is an independent implementation of a base85 system. +** Hence, the author has rightfully put this into the public domain. +** +** Base85 numerals are taken from the set of 7-bit USASCII codes, +** excluding control characters and Space ! " ' ( ) { | } ~ Del +** in code order representing digit values 0 to 84 (base 10.) +** +** Groups of 4 bytes, interpreted as big-endian 32-bit values, +** are represented as 5-digit base85 numbers with MS to LS digit +** order. Groups of 1-3 bytes are represented with 2-4 digits, +** still big-endian but 8-24 bit values. (Using big-endian yields +** the simplest transition to byte groups smaller than 4 bytes. +** These byte groups can also be considered base-256 numbers.) +** Groups of 0 bytes are represented with 0 digits and vice-versa. +** No pad characters are used; Encoded base85 numeral sequence +** (aka "group") length maps 1-to-1 to the decoded binary length. +** +** Any character not in the base85 numeral set delimits groups. +** When base85 is streamed or stored in containers of indefinite +** size, newline is used to separate it into sub-sequences of no +** more than 80 digits so that fgets() can be used to read it. +** +** Length limitations are not imposed except that the runtime +** SQLite string or blob length limits are respected. Otherwise, +** any length binary sequence can be represented and recovered. +** Base85 sequences can be concatenated by separating them with +** a non-base85 character; the conversion to binary will then +** be the concatenation of the represented binary sequences. + +** The standalone program either converts base85 on stdin to create +** a binary file or converts a binary file to base85 on stdout. +** Read or make it blurt its help for invocation details. +** +** The SQLite3 extension creates a function, base85(x), which will +** either convert text base85 to a blob or a blob to text base85 +** and return the result (or throw an error for other types.) +** Unless built with OMIT_BASE85_CHECKER defined, it also creates a +** function, is_base85(t), which returns 1 iff the text t contains +** nothing other than base85 numerals and whitespace, or 0 otherwise. +** +** To build the extension: +** Set shell variable SQDIR= +** and variable OPTS to -DOMIT_BASE85_CHECKER if is_base85() unwanted. +** *Nix: gcc -O2 -shared -I$SQDIR $OPTS -fPIC -o base85.so base85.c +** OSX: gcc -O2 -dynamiclib -fPIC -I$SQDIR $OPTS -o base85.dylib base85.c +** Win32: gcc -O2 -shared -I%SQDIR% %OPTS% -o base85.dll base85.c +** Win32: cl /Os -I%SQDIR% %OPTS% base85.c -link -dll -out:base85.dll +** +** To build the standalone program, define PP symbol BASE85_STANDALONE. Eg. +** *Nix or OSX: gcc -O2 -DBASE85_STANDALONE base85.c -o base85 +** Win32: gcc -O2 -DBASE85_STANDALONE -o base85.exe base85.c +** Win32: cl /Os /MD -DBASE85_STANDALONE base85.c +*/ + +#include +#include +#include +#include +#ifndef OMIT_BASE85_CHECKER +# include +#endif + +#ifndef BASE85_STANDALONE + +/* # include "sqlite3ext.h" */ + +SQLITE_EXTENSION_INIT1; + +#else + +# ifdef _WIN32 +# include +# include +# else +# define setmode(fd,m) +# endif + +static char *zHelp = + "Usage: base85 \n" + " is either -r to read or -w to write ,\n" + " content to be converted to/from base85 on stdout/stdin.\n" + " names a binary file to be rendered or created.\n" + " Or, the name '-' refers to the stdin or stdout stream.\n" + ; + +static void sayHelp(){ + printf("%s", zHelp); +} +#endif + +#ifndef U8_TYPEDEF +/* typedef unsigned char u8; */ +#define U8_TYPEDEF +#endif + +/* Classify c according to interval within USASCII set w.r.t. base85 + * Values of 1 and 3 are base85 numerals. Values of 0, 2, or 4 are not. + */ +#define B85_CLASS( c ) (((c)>='#')+((c)>'&')+((c)>='*')+((c)>'z')) + +/* Provide digitValue to b85Numeral offset as a function of above class. */ +static u8 b85_cOffset[] = { 0, '#', 0, '*'-4, 0 }; +#define B85_DNOS( c ) b85_cOffset[B85_CLASS(c)] + +/* Say whether c is a base85 numeral. */ +#define IS_B85( c ) (B85_CLASS(c) & 1) + +#if 0 /* Not used, */ +static u8 base85DigitValue( char c ){ + u8 dv = (u8)(c - '#'); + if( dv>87 ) return 0xff; + return (dv > 3)? dv-3 : dv; +} +#endif + +/* Width of base64 lines. Should be an integer multiple of 5. */ +#define B85_DARK_MAX 80 + + +static char * skipNonB85( char *s ){ + char c; + while( (c = *s) && !IS_B85(c) ) ++s; + return s; +} + +/* Convert small integer, known to be in 0..84 inclusive, to base85 numeral. + * Do not use the macro form with argument expression having a side-effect.*/ +#if 0 +static char base85Numeral( u8 b ){ + return (b < 4)? (char)(b + '#') : (char)(b - 4 + '*'); +} +#else +# define base85Numeral( dn )\ + ((char)(((dn) < 4)? (char)((dn) + '#') : (char)((dn) - 4 + '*'))) +#endif + +static char *putcs(char *pc, char *s){ + char c; + while( (c = *s++)!=0 ) *pc++ = c; + return pc; +} + +/* Encode a byte buffer into base85 text. If pSep!=0, it's a C string +** to be appended to encoded groups to limit their length to B85_DARK_MAX +** or to terminate the last group (to aid concatenation.) +*/ +static char* toBase85( u8 *pIn, int nbIn, char *pOut, char *pSep ){ + int nCol = 0; + while( nbIn >= 4 ){ + int nco = 5; + unsigned long qbv = (((unsigned long)pIn[0])<<24) | + (pIn[1]<<16) | (pIn[2]<<8) | pIn[3]; + while( nco > 0 ){ + unsigned nqv = (unsigned)(qbv/85UL); + unsigned char dv = qbv - 85UL*nqv; + qbv = nqv; + pOut[--nco] = base85Numeral(dv); + } + nbIn -= 4; + pIn += 4; + pOut += 5; + if( pSep && (nCol += 5)>=B85_DARK_MAX ){ + pOut = putcs(pOut, pSep); + nCol = 0; + } + } + if( nbIn > 0 ){ + int nco = nbIn + 1; + unsigned long qv = *pIn++; + int nbe = 1; + while( nbe++ < nbIn ){ + qv = (qv<<8) | *pIn++; + } + nCol += nco; + while( nco > 0 ){ + u8 dv = (u8)(qv % 85); + qv /= 85; + pOut[--nco] = base85Numeral(dv); + } + pOut += (nbIn+1); + } + if( pSep && nCol>0 ) pOut = putcs(pOut, pSep); + *pOut = 0; + return pOut; +} + +/* Decode base85 text into a byte buffer. */ +static u8* fromBase85( char *pIn, int ncIn, u8 *pOut ){ + if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; + while( ncIn>0 ){ + static signed char nboi[] = { 0, 0, 1, 2, 3, 4 }; + char *pUse = skipNonB85(pIn); + unsigned long qv = 0L; + int nti, nbo; + ncIn -= (pUse - pIn); + pIn = pUse; + nti = (ncIn>5)? 5 : ncIn; + nbo = nboi[nti]; + if( nbo==0 ) break; + while( nti>0 ){ + char c = *pIn++; + u8 cdo = B85_DNOS(c); + --ncIn; + if( cdo==0 ) break; + qv = 85 * qv + (c - cdo); + --nti; + } + nbo -= nti; /* Adjust for early (non-digit) end of group. */ + switch( nbo ){ + case 4: + *pOut++ = (qv >> 24)&0xff; + case 3: + *pOut++ = (qv >> 16)&0xff; + case 2: + *pOut++ = (qv >> 8)&0xff; + case 1: + *pOut++ = qv&0xff; + case 0: + break; + } + } + return pOut; +} + +#ifndef OMIT_BASE85_CHECKER +/* Say whether input char sequence is all (base85 and/or whitespace).*/ +static int allBase85( char *p, int len ){ + char c; + while( len-- > 0 && (c = *p++) != 0 ){ + if( !IS_B85(c) && !isspace(c) ) return 0; + } + return 1; +} +#endif + +#ifndef BASE85_STANDALONE + +# ifndef OMIT_BASE85_CHECKER +/* This function does the work for the SQLite is_base85(t) UDF. */ +static void is_base85(sqlite3_context *context, int na, sqlite3_value *av[]){ + assert(na==1); + switch( sqlite3_value_type(av[0]) ){ + case SQLITE_TEXT: + { + int rv = allBase85( (char *)sqlite3_value_text(av[0]), + sqlite3_value_bytes(av[0]) ); + sqlite3_result_int(context, rv); + } + break; + case SQLITE_NULL: + sqlite3_result_null(context); + break; + default: + sqlite3_result_error(context, "is_base85 accepts only text or NULL", -1); + return; + } +} +# endif + +/* This function does the work for the SQLite base85(x) UDF. */ +static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ + int nb, nc, nv = sqlite3_value_bytes(av[0]); + int nvMax = sqlite3_limit(sqlite3_context_db_handle(context), + SQLITE_LIMIT_LENGTH, -1); + char *cBuf; + u8 *bBuf; + assert(na==1); + switch( sqlite3_value_type(av[0]) ){ + case SQLITE_BLOB: + nb = nv; + /* ulongs tail newlines tailenc+nul*/ + nc = 5*(nv/4) + nv%4 + nv/64+1 + 2; + if( nvMax < nc ){ + sqlite3_result_error(context, "blob expanded to base85 too big", -1); + return; + } + cBuf = sqlite3_malloc(nc); + if( !cBuf ) goto memFail; + bBuf = (u8*)sqlite3_value_blob(av[0]); + nc = (int)(toBase85(bBuf, nb, cBuf, "\n") - cBuf); + sqlite3_result_text(context, cBuf, nc, sqlite3_free); + break; + case SQLITE_TEXT: + nc = nv; + nb = 4*(nv/5) + nv%5; /* may overestimate */ + if( nvMax < nb ){ + sqlite3_result_error(context, "blob from base85 may be too big", -1); + return; + }else if( nb<1 ){ + nb = 1; + } + bBuf = sqlite3_malloc(nb); + if( !bBuf ) goto memFail; + cBuf = (char *)sqlite3_value_text(av[0]); + nb = (int)(fromBase85(cBuf, nc, bBuf) - bBuf); + sqlite3_result_blob(context, bBuf, nb, sqlite3_free); + break; + default: + sqlite3_result_error(context, "base85 accepts only blob or text.", -1); + return; + } + return; + memFail: + sqlite3_result_error(context, "base85 OOM", -1); +} + +/* +** Establish linkage to running SQLite library. +*/ +#ifndef SQLITE_SHELL_EXTFUNCS *** 11431 LINES SKIPPED *** From nobody Wed Mar 15 00:15:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbrWV6XLPz3xhqL; Wed, 15 Mar 2023 00:15: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 4PbrWV6Gflz4DbM; Wed, 15 Mar 2023 00:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678839318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yGlYCmNVxWlgVe8lHy7BZcfUzlteEiru0xtgUkIJAu8=; b=DX9+ank44RZnxdhvFQ/jcDN8MztvlIR5LGuZxDSDLgEoVzjXgzSnJe98f+WxhH0OxBHjtz +SPGI3fo/DNj1/UF0fZU598We9PrkBkGnR95dzKY+JDDUan/twczTLDrkWZKvfEgXSQDLx iNqqlAKEVLme9Z+8yp2Pqoyb9CDNngda9zpnbUnWhO1cA1sD1e9soiuxMUFFtHOU8uBsu/ D3zGo9Fmq7Y3kki4NoFaJchVcvafCx2OSRUeyp48b2i2Ei/BRw+y93Xwbnaw0WJsMxLbFL 3B+zawHaDh6WBM6IPGVuhrnjPJeZqgP4fAv+g6kuc1HlTfb2ZjBxoaFuemTM1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678839318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yGlYCmNVxWlgVe8lHy7BZcfUzlteEiru0xtgUkIJAu8=; b=xSHKeoBJanHPDALr4piJsVnwMYjiz3xWxFH84YiPGI62iiW6xTVnfB/z6B/VxCJXQ0rGrL 8Q/M2brTYXmWDwEVbhH6yFPq+MJVhl0oRDCDOEA604vQbnIf2Y6EJqfOIWhfBjPgD61WBQ eiV0s1imhGOvQ0BUW2msgkUGnB5c3vNZ18erzdKVZAEMKl8Mjnrxbdh87NStfpYXrh373P ROdAJFFRyDKVtl1SLFHHkfz3iFuo0zL9a4Zw6u3TGtHR7dVxLFLRLkj3sMIeQJRRNpfokp UFibtR66OahRq09ujdYrfruopbaFePgEqmlc9MutOK7UI5afRfnXmMqDFYQ+uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678839318; a=rsa-sha256; cv=none; b=ofAQcXqCG2UcypXLZKJv7jr3/sPAP8j2dcVWLroi0QEaclt2ZvbxZuiMxdp5Kn5WBCuRW9 fqtXv/pMcFUbecipA117ZX5CAYi6oGLZlGfhhkZGAOGDSm2gkHQEOAqllrPu93CSoHu6Ig EGeysu0RuJKLS8OoEvDsW31CB73v/QfScAcx+OoefYNTLScw+T93e96QRSV/NeTyVwmH2b 2CXo9j4IwrdZMzTaiXw3oImf0NTG0TJNlAypjmUDHEDj5FB/lyR+a16Khw7hon+xGiKUJg czElmZGGseYYgGI6ualTMiCfzcD5OM9w5/ylWj5i7yungPTCyGfX8t8c++0LMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbrWV5Lmczw2L; Wed, 15 Mar 2023 00:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F0FIGO030376; Wed, 15 Mar 2023 00:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F0FIWm030370; Wed, 15 Mar 2023 00:15:18 GMT (envelope-from git) Date: Wed, 15 Mar 2023 00:15:18 GMT Message-Id: <202303150015.32F0FIWm030370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 7cca504c7a69 - stable/12 - sqlite3: Vendor import of sqlite3 3.41.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7cca504c7a692afe7259b6f3fa7d698f67f0f1ce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7cca504c7a692afe7259b6f3fa7d698f67f0f1ce commit 7cca504c7a692afe7259b6f3fa7d698f67f0f1ce Author: Cy Schubert AuthorDate: 2023-02-28 13:28:07 +0000 Commit: Cy Schubert CommitDate: 2023-03-14 02:59:34 +0000 sqlite3: Vendor import of sqlite3 3.41.0 Release notes at https://www.sqlite.org/releaselog/3_41_0.html. Obtained from: https://www.sqlite.org/2023/sqlite-autoconf-3410000.tar.gz MFC after: 2 weeks Merge commit '615bd3eb2a2225e83e14d5b2a82649430889483c' into temp_merge (cherry picked from commit 7bba9d9473c00cec825495543198768fe387ebf4) --- contrib/sqlite3/Makefile.msc | 1 + contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 2188 ++++++++++++---- contrib/sqlite3/sqlite3.c | 4091 ++++++++++++++++++++---------- contrib/sqlite3/sqlite3.h | 238 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- contrib/sqlite3/tea/generic/tclsqlite3.c | 3 + 11 files changed, 4643 insertions(+), 1926 deletions(-) diff --git a/contrib/sqlite3/Makefile.msc b/contrib/sqlite3/Makefile.msc index e36eb21ea004..09daa867eced 100644 --- a/contrib/sqlite3/Makefile.msc +++ b/contrib/sqlite3/Makefile.msc @@ -955,6 +955,7 @@ LIBRESOBJS = # when the shell is not being dynamically linked. # !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_DQS=0 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1 SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1 diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 13ff272ad2e6..e5cbf778e689 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.40.1. +# Generated by GNU Autoconf 2.71 for sqlite 3.41.0. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.40.1' -PACKAGE_STRING='sqlite 3.40.1' +PACKAGE_VERSION='3.41.0' +PACKAGE_STRING='sqlite 3.41.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.40.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.41.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.40.1:";; + short | recursive ) echo "Configuration of sqlite 3.41.0:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.40.1 +sqlite configure 3.41.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.40.1, which was +It was created by sqlite $as_me 3.41.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.40.1' + VERSION='3.41.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.40.1, which was +This file was extended by sqlite $as_me 3.41.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.40.1 +sqlite config.status 3.41.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index bb8a90ebafc3..f7f6558c2db5 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.40.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.41.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 63f708c0bf74..d6a673fe2cfe 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -39,7 +39,7 @@ typedef unsigned short int u16; /* ** Optionally #include a user-defined header, whereby compilation options -** may be set prior to where they take effect, but after platform setup. +** may be set prior to where they take effect, but after platform setup. ** If SQLITE_CUSTOM_INCLUDE=? is defined, its value names the #include ** file. Note that this macro has a like effect on sqlite3.c compilation. */ @@ -129,7 +129,7 @@ typedef unsigned char u8; #if !defined(_WIN32) && !defined(WIN32) # include -# if !defined(__RTP__) && !defined(_WRS_KERNEL) +# if !defined(__RTP__) && !defined(_WRS_KERNEL) && !defined(SQLITE_WASI) # include # endif #endif @@ -184,6 +184,14 @@ typedef unsigned char u8; # define SHELL_USE_LOCAL_GETLINE 1 #endif +#ifndef deliberate_fall_through +/* Quiet some compilers about some of our intentional code. */ +# if defined(GCC_VERSION) && GCC_VERSION>=7000000 +# define deliberate_fall_through __attribute__((fallthrough)); +# else +# define deliberate_fall_through +# endif +#endif #if defined(_WIN32) || defined(WIN32) # if SQLITE_OS_WINRT @@ -210,7 +218,7 @@ typedef unsigned char u8; /* Make sure isatty() has a prototype. */ extern int isatty(int); -# if !defined(__RTP__) && !defined(_WRS_KERNEL) +# if !defined(__RTP__) && !defined(_WRS_KERNEL) && !defined(SQLITE_WASI) /* popen and pclose are not C89 functions and so are ** sometimes omitted from the header */ extern FILE *popen(const char*,const char*); @@ -485,8 +493,108 @@ static char *Argv0; ** Prompt strings. Initialized in main. Settable with ** .prompt main continue */ -static char mainPrompt[20]; /* First line prompt. default: "sqlite> "*/ -static char continuePrompt[20]; /* Continuation prompt. default: " ...> " */ +#define PROMPT_LEN_MAX 20 +/* First line prompt. default: "sqlite> " */ +static char mainPrompt[PROMPT_LEN_MAX]; +/* Continuation prompt. default: " ...> " */ +static char continuePrompt[PROMPT_LEN_MAX]; + +/* This is variant of the standard-library strncpy() routine with the +** one change that the destination string is always zero-terminated, even +** if there is no zero-terminator in the first n-1 characters of the source +** string. +*/ +static char *shell_strncpy(char *dest, const char *src, size_t n){ + size_t i; + for(i=0; iinParenLevel += ni; + if( ni==0 ) p->inParenLevel = 0; + p->zScannerAwaits = 0; +} + +/* Record that a lexeme is opened, or closed with args==0. */ +static void setLexemeOpen(struct DynaPrompt *p, char *s, char c){ + if( s!=0 || c==0 ){ + p->zScannerAwaits = s; + p->acAwait[0] = 0; + }else{ + p->acAwait[0] = c; + p->zScannerAwaits = p->acAwait; + } +} + +/* Upon demand, derive the continuation prompt to display. */ +static char *dynamicContinuePrompt(void){ + if( continuePrompt[0]==0 + || (dynPrompt.zScannerAwaits==0 && dynPrompt.inParenLevel == 0) ){ + return continuePrompt; + }else{ + if( dynPrompt.zScannerAwaits ){ + size_t ncp = strlen(continuePrompt); + size_t ndp = strlen(dynPrompt.zScannerAwaits); + if( ndp > ncp-3 ) return continuePrompt; + strcpy(dynPrompt.dynamicPrompt, dynPrompt.zScannerAwaits); + while( ndp<3 ) dynPrompt.dynamicPrompt[ndp++] = ' '; + shell_strncpy(dynPrompt.dynamicPrompt+3, continuePrompt+3, + PROMPT_LEN_MAX-4); + }else{ + if( dynPrompt.inParenLevel>9 ){ + shell_strncpy(dynPrompt.dynamicPrompt, "(..", 4); + }else if( dynPrompt.inParenLevel<0 ){ + shell_strncpy(dynPrompt.dynamicPrompt, ")x!", 4); + }else{ + shell_strncpy(dynPrompt.dynamicPrompt, "(x.", 4); + dynPrompt.dynamicPrompt[2] = (char)('0'+dynPrompt.inParenLevel); + } + shell_strncpy(dynPrompt.dynamicPrompt+3, continuePrompt+3, PROMPT_LEN_MAX-4); + } + } + return dynPrompt.dynamicPrompt; +} +#endif /* !defined(SQLITE_OMIT_DYNAPROMPT) */ /* ** Render output like fprintf(). Except, if the output is going to the @@ -747,7 +855,7 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){ if( in!=0 ){ zResult = local_getline(zPrior, in); }else{ - zPrompt = isContinuation ? continuePrompt : mainPrompt; + zPrompt = isContinuation ? CONTINUATION_PROMPT : mainPrompt; #if SHELL_USE_LOCAL_GETLINE printf("%s", zPrompt); fflush(stdout); @@ -964,7 +1072,7 @@ static void shellModuleSchema( char *zFake; UNUSED_PARAMETER(nVal); zName = (const char*)sqlite3_value_text(apVal[0]); - zFake = zName ? shellFakeSchema(sqlite3_context_db_handle(pCtx), 0, zName) : 0; + zFake = zName? shellFakeSchema(sqlite3_context_db_handle(pCtx), 0, zName) : 0; if( zFake ){ sqlite3_result_text(pCtx, sqlite3_mprintf("/* %s */", zFake), -1, sqlite3_free); @@ -2058,7 +2166,7 @@ static void sha3Func( /* Compute a string using sqlite3_vsnprintf() with a maximum length ** of 50 bytes and add it to the hash. */ -static void hash_step_vformat( +static void sha3_step_vformat( SHA3Context *p, /* Add content to this context */ const char *zFormat, ... @@ -2154,7 +2262,7 @@ static void sha3QueryFunc( z = sqlite3_sql(pStmt); if( z ){ n = (int)strlen(z); - hash_step_vformat(&cx,"S%d:",n); + sha3_step_vformat(&cx,"S%d:",n); SHA3Update(&cx,(unsigned char*)z,n); } @@ -2198,14 +2306,14 @@ static void sha3QueryFunc( case SQLITE_TEXT: { int n2 = sqlite3_column_bytes(pStmt, i); const unsigned char *z2 = sqlite3_column_text(pStmt, i); - hash_step_vformat(&cx,"T%d:",n2); + sha3_step_vformat(&cx,"T%d:",n2); SHA3Update(&cx, z2, n2); break; } case SQLITE_BLOB: { int n2 = sqlite3_column_bytes(pStmt, i); const unsigned char *z2 = sqlite3_column_blob(pStmt, i); - hash_step_vformat(&cx,"B%d:",n2); + sha3_step_vformat(&cx,"B%d:",n2); SHA3Update(&cx, z2, n2); break; } @@ -2965,7 +3073,7 @@ int sqlite3_decimal_init( SQLITE_EXTENSION_INIT2(pApi); - for(i=0; i +** *Nix: gcc -O2 -shared -I$SQDIR -fPIC -o base64.so base64.c +** OSX: gcc -O2 -dynamiclib -fPIC -I$SQDIR -o base64.dylib base64.c +** Win32: gcc -O2 -shared -I%SQDIR% -o base64.dll base64.c +** Win32: cl /Os -I%SQDIR% base64.c -link -dll -out:base64.dll +*/ + +#include + +/* #include "sqlite3ext.h" */ + +#ifndef deliberate_fall_through +/* Quiet some compilers about some of our intentional code. */ +# if GCC_VERSION>=7000000 +# define deliberate_fall_through __attribute__((fallthrough)); +# else +# define deliberate_fall_through +# endif +#endif + +SQLITE_EXTENSION_INIT1; + +#define PC 0x80 /* pad character */ +#define WS 0x81 /* whitespace */ +#define ND 0x82 /* Not above or digit-value */ +#define PAD_CHAR '=' + +#ifndef U8_TYPEDEF +/* typedef unsigned char u8; */ +#define U8_TYPEDEF +#endif + +static const u8 b64DigitValues[128] = { + /* HT LF VT FF CR */ + ND,ND,ND,ND, ND,ND,ND,ND, ND,WS,WS,WS, WS,WS,ND,ND, + /* US */ + ND,ND,ND,ND, ND,ND,ND,ND, ND,ND,ND,ND, ND,ND,ND,ND, + /*sp + / */ + WS,ND,ND,ND, ND,ND,ND,ND, ND,ND,ND,62, ND,ND,ND,63, + /* 0 1 5 9 = */ + 52,53,54,55, 56,57,58,59, 60,61,ND,ND, ND,PC,ND,ND, + /* A O */ + ND, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, + /* P Z */ + 15,16,17,18, 19,20,21,22, 23,24,25,ND, ND,ND,ND,ND, + /* a o */ + ND,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, + /* p z */ + 41,42,43,44, 45,46,47,48, 49,50,51,ND, ND,ND,ND,ND +}; + +static const char b64Numerals[64+1] += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +#define BX_DV_PROTO(c) \ + ((((u8)(c))<0x80)? (u8)(b64DigitValues[(u8)(c)]) : 0x80) +#define IS_BX_DIGIT(bdp) (((u8)(bdp))<0x80) +#define IS_BX_WS(bdp) ((bdp)==WS) +#define IS_BX_PAD(bdp) ((bdp)==PC) +#define BX_NUMERAL(dv) (b64Numerals[(u8)(dv)]) +/* Width of base64 lines. Should be an integer multiple of 4. */ +#define B64_DARK_MAX 72 + +/* Encode a byte buffer into base64 text with linefeeds appended to limit +** encoded group lengths to B64_DARK_MAX or to terminate the last group. +*/ +static char* toBase64( u8 *pIn, int nbIn, char *pOut ){ + int nCol = 0; + while( nbIn >= 3 ){ + /* Do the bit-shuffle, exploiting unsigned input to avoid masking. */ + pOut[0] = BX_NUMERAL(pIn[0]>>2); + pOut[1] = BX_NUMERAL(((pIn[0]<<4)|(pIn[1]>>4))&0x3f); + pOut[2] = BX_NUMERAL(((pIn[1]&0xf)<<2)|(pIn[2]>>6)); + pOut[3] = BX_NUMERAL(pIn[2]&0x3f); + pOut += 4; + nbIn -= 3; + pIn += 3; + if( (nCol += 4)>=B64_DARK_MAX || nbIn<=0 ){ + *pOut++ = '\n'; + nCol = 0; + } + } + if( nbIn > 0 ){ + signed char nco = nbIn+1; + int nbe; + unsigned long qv = *pIn++; + for( nbe=1; nbe<3; ++nbe ){ + qv <<= 8; + if( nbe=0; --nbe ){ + char ce = (nbe>= 6; + pOut[nbe] = ce; + } + pOut += 4; + *pOut++ = '\n'; + } + *pOut = 0; + return pOut; +} + +/* Skip over text which is not base64 numeral(s). */ +static char * skipNonB64( char *s ){ + char c; + while( (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; + return s; +} + +/* Decode base64 text into a byte buffer. */ +static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){ + if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; + while( ncIn>0 && *pIn!=PAD_CHAR ){ + static signed char nboi[] = { 0, 0, 1, 2, 3 }; + char *pUse = skipNonB64(pIn); + unsigned long qv = 0L; + int nti, nbo, nac; + ncIn -= (pUse - pIn); + pIn = pUse; + nti = (ncIn>4)? 4 : ncIn; + ncIn -= nti; + nbo = nboi[nti]; + if( nbo==0 ) break; + for( nac=0; nac<4; ++nac ){ + char c = (nac>8) & 0xff; + case 1: + pOut[0] = (qv>>16) & 0xff; + } + pOut += nbo; + } + return pOut; +} + +/* This function does the work for the SQLite base64(x) UDF. */ +static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ + int nb, nc, nv = sqlite3_value_bytes(av[0]); + int nvMax = sqlite3_limit(sqlite3_context_db_handle(context), + SQLITE_LIMIT_LENGTH, -1); + char *cBuf; + u8 *bBuf; + assert(na==1); + switch( sqlite3_value_type(av[0]) ){ + case SQLITE_BLOB: + nb = nv; + nc = 4*(nv+2/3); /* quads needed */ + nc += (nc+(B64_DARK_MAX-1))/B64_DARK_MAX + 1; /* LFs and a 0-terminator */ + if( nvMax < nc ){ + sqlite3_result_error(context, "blob expanded to base64 too big", -1); + return; + } + cBuf = sqlite3_malloc(nc); + if( !cBuf ) goto memFail; + bBuf = (u8*)sqlite3_value_blob(av[0]); + nc = (int)(toBase64(bBuf, nb, cBuf) - cBuf); + sqlite3_result_text(context, cBuf, nc, sqlite3_free); + break; + case SQLITE_TEXT: + nc = nv; + nb = 3*((nv+3)/4); /* may overestimate due to LF and padding */ + if( nvMax < nb ){ + sqlite3_result_error(context, "blob from base64 may be too big", -1); + return; + }else if( nb<1 ){ + nb = 1; + } + bBuf = sqlite3_malloc(nb); + if( !bBuf ) goto memFail; + cBuf = (char *)sqlite3_value_text(av[0]); + nb = (int)(fromBase64(cBuf, nc, bBuf) - bBuf); + sqlite3_result_blob(context, bBuf, nb, sqlite3_free); + break; + default: + sqlite3_result_error(context, "base64 accepts only blob or text", -1); + return; + } + return; + memFail: + sqlite3_result_error(context, "base64 OOM", -1); +} + +/* +** Establish linkage to running SQLite library. +*/ +#ifndef SQLITE_SHELL_EXTFUNCS +#ifdef _WIN32 + +#endif +int sqlite3_base_init +#else +static int sqlite3_base64_init +#endif +(sqlite3 *db, char **pzErr, const sqlite3_api_routines *pApi){ + SQLITE_EXTENSION_INIT2(pApi); + (void)pzErr; + return sqlite3_create_function + (db, "base64", 1, + SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS|SQLITE_DIRECTONLY|SQLITE_UTF8, + 0, base64, 0, 0); +} + +/* +** Define some macros to allow this extension to be built into the shell +** conveniently, in conjunction with use of SQLITE_SHELL_EXTFUNCS. This +** allows shell.c, as distributed, to have this extension built in. +*/ +#define BASE64_INIT(db) sqlite3_base64_init(db, 0, 0) +#define BASE64_EXPOSE(db, pzErr) /* Not needed, ..._init() does this. */ + +/************************* End ../ext/misc/base64.c ********************/ +#undef sqlite3_base_init +#define sqlite3_base_init sqlite3_base85_init +#define OMIT_BASE85_CHECKER +/************************* Begin ../ext/misc/base85.c ******************/ +/* +** 2022-11-16 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This is a utility for converting binary to base85 or vice-versa. +** It can be built as a standalone program or an SQLite3 extension. +** +** Much like base64 representations, base85 can be sent through a +** sane USASCII channel unmolested. It also plays nicely in CSV or +** written as TCL brace-enclosed literals or SQL string literals. +** It is not suited for unmodified use in XML-like documents. +** +** The encoding used resembles Ascii85, but was devised by the author +** (Larry Brasfield) before Mozilla, Adobe, ZMODEM or other Ascii85 +** variant sources existed, in the 1984 timeframe on a VAX mainframe. +** Further, this is an independent implementation of a base85 system. +** Hence, the author has rightfully put this into the public domain. +** +** Base85 numerals are taken from the set of 7-bit USASCII codes, +** excluding control characters and Space ! " ' ( ) { | } ~ Del +** in code order representing digit values 0 to 84 (base 10.) +** +** Groups of 4 bytes, interpreted as big-endian 32-bit values, +** are represented as 5-digit base85 numbers with MS to LS digit +** order. Groups of 1-3 bytes are represented with 2-4 digits, +** still big-endian but 8-24 bit values. (Using big-endian yields +** the simplest transition to byte groups smaller than 4 bytes. +** These byte groups can also be considered base-256 numbers.) +** Groups of 0 bytes are represented with 0 digits and vice-versa. +** No pad characters are used; Encoded base85 numeral sequence +** (aka "group") length maps 1-to-1 to the decoded binary length. +** +** Any character not in the base85 numeral set delimits groups. +** When base85 is streamed or stored in containers of indefinite +** size, newline is used to separate it into sub-sequences of no +** more than 80 digits so that fgets() can be used to read it. +** +** Length limitations are not imposed except that the runtime +** SQLite string or blob length limits are respected. Otherwise, +** any length binary sequence can be represented and recovered. +** Base85 sequences can be concatenated by separating them with +** a non-base85 character; the conversion to binary will then +** be the concatenation of the represented binary sequences. + +** The standalone program either converts base85 on stdin to create +** a binary file or converts a binary file to base85 on stdout. +** Read or make it blurt its help for invocation details. +** +** The SQLite3 extension creates a function, base85(x), which will +** either convert text base85 to a blob or a blob to text base85 +** and return the result (or throw an error for other types.) +** Unless built with OMIT_BASE85_CHECKER defined, it also creates a +** function, is_base85(t), which returns 1 iff the text t contains +** nothing other than base85 numerals and whitespace, or 0 otherwise. +** +** To build the extension: +** Set shell variable SQDIR= +** and variable OPTS to -DOMIT_BASE85_CHECKER if is_base85() unwanted. +** *Nix: gcc -O2 -shared -I$SQDIR $OPTS -fPIC -o base85.so base85.c +** OSX: gcc -O2 -dynamiclib -fPIC -I$SQDIR $OPTS -o base85.dylib base85.c +** Win32: gcc -O2 -shared -I%SQDIR% %OPTS% -o base85.dll base85.c +** Win32: cl /Os -I%SQDIR% %OPTS% base85.c -link -dll -out:base85.dll +** +** To build the standalone program, define PP symbol BASE85_STANDALONE. Eg. +** *Nix or OSX: gcc -O2 -DBASE85_STANDALONE base85.c -o base85 +** Win32: gcc -O2 -DBASE85_STANDALONE -o base85.exe base85.c +** Win32: cl /Os /MD -DBASE85_STANDALONE base85.c +*/ + +#include +#include +#include +#include +#ifndef OMIT_BASE85_CHECKER +# include +#endif + +#ifndef BASE85_STANDALONE + +/* # include "sqlite3ext.h" */ + +SQLITE_EXTENSION_INIT1; + +#else + +# ifdef _WIN32 +# include +# include +# else +# define setmode(fd,m) +# endif + +static char *zHelp = + "Usage: base85 \n" + " is either -r to read or -w to write ,\n" + " content to be converted to/from base85 on stdout/stdin.\n" + " names a binary file to be rendered or created.\n" + " Or, the name '-' refers to the stdin or stdout stream.\n" + ; + +static void sayHelp(){ + printf("%s", zHelp); +} +#endif + +#ifndef U8_TYPEDEF +/* typedef unsigned char u8; */ +#define U8_TYPEDEF +#endif + +/* Classify c according to interval within USASCII set w.r.t. base85 + * Values of 1 and 3 are base85 numerals. Values of 0, 2, or 4 are not. + */ +#define B85_CLASS( c ) (((c)>='#')+((c)>'&')+((c)>='*')+((c)>'z')) + +/* Provide digitValue to b85Numeral offset as a function of above class. */ +static u8 b85_cOffset[] = { 0, '#', 0, '*'-4, 0 }; +#define B85_DNOS( c ) b85_cOffset[B85_CLASS(c)] + +/* Say whether c is a base85 numeral. */ +#define IS_B85( c ) (B85_CLASS(c) & 1) + +#if 0 /* Not used, */ +static u8 base85DigitValue( char c ){ + u8 dv = (u8)(c - '#'); + if( dv>87 ) return 0xff; + return (dv > 3)? dv-3 : dv; +} +#endif + +/* Width of base64 lines. Should be an integer multiple of 5. */ +#define B85_DARK_MAX 80 + + +static char * skipNonB85( char *s ){ + char c; + while( (c = *s) && !IS_B85(c) ) ++s; + return s; +} + +/* Convert small integer, known to be in 0..84 inclusive, to base85 numeral. + * Do not use the macro form with argument expression having a side-effect.*/ +#if 0 +static char base85Numeral( u8 b ){ + return (b < 4)? (char)(b + '#') : (char)(b - 4 + '*'); +} +#else +# define base85Numeral( dn )\ + ((char)(((dn) < 4)? (char)((dn) + '#') : (char)((dn) - 4 + '*'))) +#endif + +static char *putcs(char *pc, char *s){ + char c; + while( (c = *s++)!=0 ) *pc++ = c; + return pc; +} + +/* Encode a byte buffer into base85 text. If pSep!=0, it's a C string +** to be appended to encoded groups to limit their length to B85_DARK_MAX +** or to terminate the last group (to aid concatenation.) +*/ +static char* toBase85( u8 *pIn, int nbIn, char *pOut, char *pSep ){ + int nCol = 0; + while( nbIn >= 4 ){ + int nco = 5; + unsigned long qbv = (((unsigned long)pIn[0])<<24) | + (pIn[1]<<16) | (pIn[2]<<8) | pIn[3]; + while( nco > 0 ){ + unsigned nqv = (unsigned)(qbv/85UL); + unsigned char dv = qbv - 85UL*nqv; + qbv = nqv; + pOut[--nco] = base85Numeral(dv); + } + nbIn -= 4; + pIn += 4; + pOut += 5; + if( pSep && (nCol += 5)>=B85_DARK_MAX ){ + pOut = putcs(pOut, pSep); + nCol = 0; + } + } + if( nbIn > 0 ){ + int nco = nbIn + 1; + unsigned long qv = *pIn++; + int nbe = 1; + while( nbe++ < nbIn ){ + qv = (qv<<8) | *pIn++; + } + nCol += nco; + while( nco > 0 ){ + u8 dv = (u8)(qv % 85); + qv /= 85; + pOut[--nco] = base85Numeral(dv); + } + pOut += (nbIn+1); + } + if( pSep && nCol>0 ) pOut = putcs(pOut, pSep); + *pOut = 0; + return pOut; +} + +/* Decode base85 text into a byte buffer. */ +static u8* fromBase85( char *pIn, int ncIn, u8 *pOut ){ + if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; + while( ncIn>0 ){ + static signed char nboi[] = { 0, 0, 1, 2, 3, 4 }; + char *pUse = skipNonB85(pIn); + unsigned long qv = 0L; + int nti, nbo; + ncIn -= (pUse - pIn); + pIn = pUse; + nti = (ncIn>5)? 5 : ncIn; + nbo = nboi[nti]; + if( nbo==0 ) break; + while( nti>0 ){ + char c = *pIn++; + u8 cdo = B85_DNOS(c); + --ncIn; + if( cdo==0 ) break; + qv = 85 * qv + (c - cdo); + --nti; + } + nbo -= nti; /* Adjust for early (non-digit) end of group. */ + switch( nbo ){ + case 4: + *pOut++ = (qv >> 24)&0xff; + case 3: + *pOut++ = (qv >> 16)&0xff; + case 2: + *pOut++ = (qv >> 8)&0xff; + case 1: + *pOut++ = qv&0xff; + case 0: + break; + } + } + return pOut; +} + +#ifndef OMIT_BASE85_CHECKER +/* Say whether input char sequence is all (base85 and/or whitespace).*/ +static int allBase85( char *p, int len ){ + char c; + while( len-- > 0 && (c = *p++) != 0 ){ + if( !IS_B85(c) && !isspace(c) ) return 0; + } + return 1; +} +#endif + +#ifndef BASE85_STANDALONE + +# ifndef OMIT_BASE85_CHECKER +/* This function does the work for the SQLite is_base85(t) UDF. */ +static void is_base85(sqlite3_context *context, int na, sqlite3_value *av[]){ + assert(na==1); + switch( sqlite3_value_type(av[0]) ){ + case SQLITE_TEXT: + { + int rv = allBase85( (char *)sqlite3_value_text(av[0]), + sqlite3_value_bytes(av[0]) ); + sqlite3_result_int(context, rv); + } + break; + case SQLITE_NULL: + sqlite3_result_null(context); + break; + default: + sqlite3_result_error(context, "is_base85 accepts only text or NULL", -1); + return; + } +} +# endif + +/* This function does the work for the SQLite base85(x) UDF. */ +static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ + int nb, nc, nv = sqlite3_value_bytes(av[0]); + int nvMax = sqlite3_limit(sqlite3_context_db_handle(context), + SQLITE_LIMIT_LENGTH, -1); + char *cBuf; + u8 *bBuf; + assert(na==1); + switch( sqlite3_value_type(av[0]) ){ + case SQLITE_BLOB: + nb = nv; + /* ulongs tail newlines tailenc+nul*/ + nc = 5*(nv/4) + nv%4 + nv/64+1 + 2; + if( nvMax < nc ){ + sqlite3_result_error(context, "blob expanded to base85 too big", -1); + return; + } + cBuf = sqlite3_malloc(nc); + if( !cBuf ) goto memFail; + bBuf = (u8*)sqlite3_value_blob(av[0]); + nc = (int)(toBase85(bBuf, nb, cBuf, "\n") - cBuf); + sqlite3_result_text(context, cBuf, nc, sqlite3_free); + break; + case SQLITE_TEXT: + nc = nv; + nb = 4*(nv/5) + nv%5; /* may overestimate */ + if( nvMax < nb ){ + sqlite3_result_error(context, "blob from base85 may be too big", -1); + return; + }else if( nb<1 ){ + nb = 1; + } + bBuf = sqlite3_malloc(nb); + if( !bBuf ) goto memFail; + cBuf = (char *)sqlite3_value_text(av[0]); + nb = (int)(fromBase85(cBuf, nc, bBuf) - bBuf); + sqlite3_result_blob(context, bBuf, nb, sqlite3_free); + break; + default: + sqlite3_result_error(context, "base85 accepts only blob or text.", -1); + return; + } + return; + memFail: + sqlite3_result_error(context, "base85 OOM", -1); +} + +/* +** Establish linkage to running SQLite library. +*/ +#ifndef SQLITE_SHELL_EXTFUNCS *** 11431 LINES SKIPPED *** From nobody Wed Mar 15 01:58:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbtpM1Dqcz3xpPw; Wed, 15 Mar 2023 01:58: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 4PbtpM0Z6Hz4L6Q; Wed, 15 Mar 2023 01:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678845499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hfhpB8Rpo4adJczUELihAILPOGFFGx+qdJnJzzs6Nic=; b=kv4DoNk5D14vOddmwWFscvRlYEmn4iacteHZ54zM6m2RGl2BnuW3ti1Q1UPP0F/pGvtFKd p1r3E/u/UaY5j/DTfUHaUxG7N14cXBduOOGN4LV9MsA1kn9QcxRjZQeF588663pWbh1ftu +sxGOtmta1hf3PDFT21RzFnw70KFf2xb8L2cx7BIy0tDvdQC8DvEoYR5PKcRLOca/FJLyr MlcT/NCm68G6Ch+59F4VROuQODyScRzQ/voP/Xracz9Pw32ZqRhtmkaEbNV1pVjFTqeoWB q0gKYrIgTmyMIF14EbuySuze1hFApnk9HYFVxCpK37B6g7qfFJeqZkrGU1OJbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678845499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hfhpB8Rpo4adJczUELihAILPOGFFGx+qdJnJzzs6Nic=; b=CYvUIR8p88jLA/GsD0gnsvPAtQGlzoJMIAHA8DW/QuE01QHk/A5aLsueg4+JbrFf/3Hk7s qQFGHonNzgLUGtbX/W9aZYtDdHg/J/Jjhik0kACA1X62pewTlIJCfkRBnM2GePjhsTWF2y odTpgYLLLtFLJ/ZsGbuXA08dsFc70u5gTM4lEo5I4Xt8X8w4B6pu6W8AeXpGfyqbOduYIy hDVZyKF/y51fokNc3bbWPhHr5H0zFrECgB4wfeEplVPLSdyES5ehmNEeT7ryygJlNoneBp E09E0MRIQhnE2I8+QQ8nmVUapGw2VCtC3icvqxuAN425qDXO+AreTIgPMlY4hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678845499; a=rsa-sha256; cv=none; b=Whqg2FHA79fNQ4ZM71L5VPszY6Vdz0ImopVaCJBIO3TzEP49d4P4KsJdgyoCELIMKDEnp3 McIQylHn5iluLNvh7E/RMGtGz87UmTomY9P4dZVqO8SqISYCEDKVCJoMkZ2LjOD2tVR+GM TSb0+FevsrcOevzHwyNWSMXHedaLtjEDVW8tro5Trcs9zdx2N/ncW+00ZJvWgEzTmO6i2X 9R2JhwZL/VqCPKXxGO98a83jhl659spgoPngJ2VT6wqwVcTl3XnYTwB7XVAWx3wcBbEr3G U7UdhSRIjoCedV1MDhZYFRuVti60l5JRiGfSnalmi+Yv5x5vQ4KIqoaYsuOV/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 4PbtpL6dDjzyV4; Wed, 15 Mar 2023 01:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F1wI47093911; Wed, 15 Mar 2023 01:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F1wIb1093910; Wed, 15 Mar 2023 01:58:18 GMT (envelope-from git) Date: Wed, 15 Mar 2023 01:58:18 GMT Message-Id: <202303150158.32F1wIb1093910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 2ed0305bc3f2 - main - CI: Run pkgbase METALOG lint script List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ed0305bc3f24258b977d640d3399d07c47e1b42 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2ed0305bc3f24258b977d640d3399d07c47e1b42 commit 2ed0305bc3f24258b977d640d3399d07c47e1b42 Author: Ed Maste AuthorDate: 2022-11-16 21:24:19 +0000 Commit: Ed Maste CommitDate: 2023-03-15 01:13:46 +0000 CI: Run pkgbase METALOG lint script tools/pkgbase/metalog_reader.lua checks for errors in METALOG (for pkgbase staging), such as hard links with differing modes, duplicate entries, etc. Run it as part of the Cirrus-CI job to prevent regressions. Reviewed by: manu, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37521 --- .cirrus.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 77510e1ea09e..e16a16838d66 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -44,6 +44,8 @@ task: - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes buildworld buildkernel" package_script: - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages" + package_check_script: + - su user -c "/usr/libexec/flua tools/pkgbase/metalog_reader.lua -c /usr/obj/$(pwd -P)/${TARGET}.${TARGET_ARCH}/worldstage/METALOG" test_script: - sh .cirrus-ci/pkg-install.sh qemu-nox11 - sh tools/boot/ci-qemu-test.sh From nobody Wed Mar 15 02:39:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbvk63RZlz3xrgk; Wed, 15 Mar 2023 02:39: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 4Pbvk62yQGz4Pvq; Wed, 15 Mar 2023 02:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678847982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evzuXfcV7ZFgIvv3zMH28/+NvnSg8MBYhFrrTMpyvFU=; b=NLFViaYJ1ft9SX2/s37s0jt//4fLo5O+TRcXb0zq/jfdYnUdCMr1X6YD4k2g8HoJDySLqs tewTsbItaeiEh74NL+KuQOa9hmweD42XJRmnTRvYOt4f/hywZH6CwI2QMJ9tT34BwjSnPr hiaLc2ggzgd3W2d73b+CAE+wPwty/TfKddkuNlgbYRfmemCdewAVPRhi9mnZ6WWvO6NLc2 gQueqp0rA8NywYhmxVdcyb/sFlictVZcFEJrm/kQZnHQtczE2/xfBpeVHfR5RAhKhmq9vd BClPhl7wygzaVMcgZI/UgmfnPWWgF5gncm5BElkZ/BZgi4HtdRIh15izbXiLsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678847982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evzuXfcV7ZFgIvv3zMH28/+NvnSg8MBYhFrrTMpyvFU=; b=Q6RsGk0+xrSpcB4B1YzW33juXD/wZxY7AJldRbpEtciaYeQrgQIFRBoVjEan3UtLzBV7ST B1ashPhXiwzsFbFtc6qNzoAipHN5YCLLgXCFyesMDoxNjZhs34qUw7zyF1cmEchtKobqvX vXMW9MLVnc/BStBF8rltJv8KFIFpZWUfwqqwGr1Eu4edkfBS5QfjLfM7hrqt6WhrTN1blo TLiuI3OogBahFsNAk1+MtEAMC0mR2YUBAY0pAE0ZSjesdJtSKmDiKQuDqIKc64p2Y9cmDn eZ7rmBjIE381sGZEZyL7UdTUHPVI0pZNaYiZy2V5OTJAuWoga+q6AAWCnwRdeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678847982; a=rsa-sha256; cv=none; b=V1fK2mhe/h+WdwCr614BS0NoJYmh8rPrWSs596Qw3W80UIQ+zqQSUfzOexh9gh3C9mzVdN BuKtCWX+hKz3tNeYpxtl+JrqBBGWsdF2yu+rq6RSmuugefsTIuNFnSh5NAXXaW/lZFgIjs qGvA2Obdy+1R2FHzeqX2hrQKCjaVHc7AGBAK646rnIDoSrSCVqXLFs4S6tBECnjBW4qcV6 rt33qaMAYYZ+833VkV+uXwJbvy9a37TEa4BTiAsU+3+ZPh0UsMwOv7E9CvjbS6hKH5LLgt ps0D+1EGISBC9padChQ9361yMEesrOiLDRG3aF/8XULKElJPgqfENv5oTnDldg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbvk621r0z10cq; Wed, 15 Mar 2023 02:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F2dgdn060125; Wed, 15 Mar 2023 02:39:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F2dgU8060124; Wed, 15 Mar 2023 02:39:42 GMT (envelope-from git) Date: Wed, 15 Mar 2023 02:39:42 GMT Message-Id: <202303150239.32F2dgU8060124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1308a17bad88 - main - bhyve: Remove trailing semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1308a17bad883c4ec2242b1d4e7ddb00d25f3e12 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1308a17bad883c4ec2242b1d4e7ddb00d25f3e12 commit 1308a17bad883c4ec2242b1d4e7ddb00d25f3e12 Author: Elyes Haouas AuthorDate: 2023-03-15 02:09:16 +0000 Commit: Warner Losh CommitDate: 2023-03-15 02:39:34 +0000 bhyve: Remove trailing semicolon Macros shouldn't use trailing semicolon. Signed-off-by: Elyes Haouas Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/654 --- usr.sbin/bhyve/acpi.c | 4 ++-- usr.sbin/bhyve/ipc.h | 2 +- usr.sbin/bhyve/pci_emul.h | 2 +- usr.sbin/bhyve/pci_hda.h | 2 +- usr.sbin/bhyve/pci_nvme.c | 2 +- usr.sbin/bhyve/usb_emul.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/acpi.c b/usr.sbin/bhyve/acpi.c index 84a54cc485c5..d53785c4bfba 100644 --- a/usr.sbin/bhyve/acpi.c +++ b/usr.sbin/bhyve/acpi.c @@ -101,10 +101,10 @@ struct basl_fio { }; #define EFPRINTF(...) \ - if (fprintf(__VA_ARGS__) < 0) goto err_exit; + if (fprintf(__VA_ARGS__) < 0) goto err_exit #define EFFLUSH(x) \ - if (fflush(x) != 0) goto err_exit; + if (fflush(x) != 0) goto err_exit /* * A list for additional ACPI devices like a TPM. diff --git a/usr.sbin/bhyve/ipc.h b/usr.sbin/bhyve/ipc.h index 674fc210e0fb..cff7c126efed 100644 --- a/usr.sbin/bhyve/ipc.h +++ b/usr.sbin/bhyve/ipc.h @@ -41,7 +41,7 @@ struct ipc_command { #define IPC_COMMAND(set, name, function) \ static struct ipc_command name ## _ipc_command = \ { #name, function }; \ - DATA_SET(set, name ## _ipc_command); + DATA_SET(set, name ## _ipc_command) #define IPC_COMMAND_FOREACH(pvar, set) SET_FOREACH(pvar, set) diff --git a/usr.sbin/bhyve/pci_emul.h b/usr.sbin/bhyve/pci_emul.h index 117fc78898a2..b54f3f15fbad 100644 --- a/usr.sbin/bhyve/pci_emul.h +++ b/usr.sbin/bhyve/pci_emul.h @@ -82,7 +82,7 @@ struct pci_devemu { int (*pe_resume)(struct pci_devinst *pi); }; -#define PCI_EMUL_SET(x) DATA_SET(pci_devemu_set, x); +#define PCI_EMUL_SET(x) DATA_SET(pci_devemu_set, x) enum pcibar_type { PCIBAR_NONE, diff --git a/usr.sbin/bhyve/pci_hda.h b/usr.sbin/bhyve/pci_hda.h index a021aa9c28da..12d80a92f60a 100644 --- a/usr.sbin/bhyve/pci_hda.h +++ b/usr.sbin/bhyve/pci_hda.h @@ -87,6 +87,6 @@ struct hda_ops { uint8_t dir, uint8_t *buf, size_t count); }; -#define HDA_EMUL_SET(x) DATA_SET(hda_codec_class_set, x); +#define HDA_EMUL_SET(x) DATA_SET(hda_codec_class_set, x) #endif /* _HDA_EMUL_H_ */ diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index cf1c815096d3..2ba893de000b 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -129,7 +129,7 @@ static int nvme_debug = 0; /* Encode number of SQ's and CQ's for Set/Get Features */ #define NVME_FEATURE_NUM_QUEUES(sc) \ (ZERO_BASED((sc)->num_squeues) & 0xffff) | \ - (ZERO_BASED((sc)->num_cqueues) & 0xffff) << 16; + (ZERO_BASED((sc)->num_cqueues) & 0xffff) << 16 #define NVME_DOORBELL_OFFSET offsetof(struct nvme_registers, doorbell) diff --git a/usr.sbin/bhyve/usb_emul.h b/usr.sbin/bhyve/usb_emul.h index 9a2844a8db1e..b5bc0fb6b4d2 100644 --- a/usr.sbin/bhyve/usb_emul.h +++ b/usr.sbin/bhyve/usb_emul.h @@ -65,7 +65,7 @@ struct usb_devemu { int (*ue_stop)(void *sc); int (*ue_snapshot)(void *scarg, struct vm_snapshot_meta *meta); }; -#define USB_EMUL_SET(x) DATA_SET(usb_emu_set, x); +#define USB_EMUL_SET(x) DATA_SET(usb_emu_set, x) /* * USB device events to notify HCI when state changes From nobody Wed Mar 15 02:39:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbvk744zZz3xrjs; Wed, 15 Mar 2023 02:39: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 4Pbvk73bvJz4PwM; Wed, 15 Mar 2023 02:39:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678847983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h4sE6LfswLkzxs4K1QplQAIbEGCVAdeDWifW/y7OpdU=; b=o5Nslxa9o+nT9TO3Jse4e5DybuW5Dxc3HT22wrf7QnGKLk3HGTeY3qDFm1iOonZtamf+MV qfv8caEYBo5gpqTdEsRZNJWJmAhv7Y+fq4MlCFwHoFIEevHgUOFd+NFm0Q+5uYQk76dzu9 Ma8E0btIFh58+92LZraKdmt5PpTPgeNCIcn8bI/HuDHAm9AxYs+mvtrZTvx0A6vW3TZsrS AlXOLaT38yjwDY5WLSWeyXlqjMHNhOYz/ndp95OUQClVqh7VIWHHDP1izN5nMtLWrTEbVC aQ4isRmlWp0eLuazmjz+l4hmNBTJFRezF1NHs/1pd+1pPgYqYuq5wtctSusoQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678847983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h4sE6LfswLkzxs4K1QplQAIbEGCVAdeDWifW/y7OpdU=; b=EDFCdBOGR1/jvFKZ2msSF1p9AjpLR8o4TTpzLm0WLQlkG972uWhe8d8uJSgtXeCRMmaDj2 kcNcLy7Ah6R/7iDbJiiE4sxd1Xh91Y2viECdfYIUPMEb2oXzLg+upRSWwrgaznb4Twxpns Jj2XVhypdz9MadXKhvJU7YliXIe8fNP4qvwWxxqqHtr+qgs7vkZFGwsnBBYFU1D85vHgGK 3IIr20WM2PWiCNrrKWlr5wGj51sz6U1CIJJ2t5eZJ1Wvf/X4OlSotaqjv3G0OTFGg6Lrca ygz/AVUgfWFkc1k+1DbJtTEPMBq9WjGOh3SU2MPCdgoJQ+NV/C3abYm1BnMWZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678847983; a=rsa-sha256; cv=none; b=rFzsYgd7GT3hhktKQN/tyy2csgmhcmez7Ud4+o411f9HbTY2eF3es5/0HbixAerR/MiQUF yb/kGFWFltDvFx96H7snj8gkl1b+CkexXHtmnCp4TbK3d80k2JnBctvsOT2mkqI+dSgIe9 maWR6ihG34lf6eOxWyLyTBI1GsjUDHyJxygvVerImsqo0HbP0eYVzaPoYWflnHpPuQq6mr WSOz4H2r7QrprykoZfxgu/Kr9LzSpqeBj3iVUN1ktXfmzU6VlaTE6Vg1yQcAAVE18ENhj+ zZuyYI1Q06bEGpMTB5Hle44ALWNbw+0lgaLT4z7sXDnhvWI1tQp6w/6/3ABICg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbvk72V8Jz10cr; Wed, 15 Mar 2023 02:39:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F2dhop060148; Wed, 15 Mar 2023 02:39:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F2dhFg060147; Wed, 15 Mar 2023 02:39:43 GMT (envelope-from git) Date: Wed, 15 Mar 2023 02:39:43 GMT Message-Id: <202303150239.32F2dhFg060147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 365348f66a47 - main - lpr: Remove trailing semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 365348f66a47df247b5289b8a86fb20b36d778c1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=365348f66a47df247b5289b8a86fb20b36d778c1 commit 365348f66a47df247b5289b8a86fb20b36d778c1 Author: Elyes Haouas AuthorDate: 2023-03-15 02:09:16 +0000 Commit: Warner Losh CommitDate: 2023-03-15 02:39:34 +0000 lpr: Remove trailing semicolon Signed-off-by: Elyes Haouas Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/654 --- usr.sbin/lpr/lpd/recvjob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c index 890ede4bcbf8..a6e93019481a 100644 --- a/usr.sbin/lpr/lpd/recvjob.c +++ b/usr.sbin/lpr/lpd/recvjob.c @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" -#define ack() (void) write(STDOUT_FILENO, sp, (size_t)1); +#define ack() (void) write(STDOUT_FILENO, sp, (size_t)1) /* * The buffer size to use when reading/writing spool files. From nobody Wed Mar 15 02:39:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbvk919NWz3xrGk; Wed, 15 Mar 2023 02:39: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 4Pbvk84WJ4z4Px2; Wed, 15 Mar 2023 02:39:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678847984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BEbzmmvCYkLW7KvA8Vc73XWF1omegsjjqkbmuUxq2GA=; b=vKav9mWO5e+Rh1dyLjFehjDm+wwPz+wmtNseunASXcwOUf/DTjBNRSDROxp7MjLVpx7ljS Yxfc//Jg0CzEI4p0uEmMcltRB+d2FR6AvkJrwFTlA2OyDSXhNy1mW8JnGBJ+LpeS5pqZnM 3ylEQdHGqXYXYTqkuaHc3cE8lkjzW7SHAcLcB07yWNO1jFCE2sYyyNii3BJVZBGly9BGe/ poKoeZ23AMWNFevAzWQuAd5nFQbgNmRCinO7PWZrxbOLKS/fK0vSibYAk3tJCy8AeeE3XF JHb/E6iI5o8bihRrtg6xjswLKUywcahApsf0JaXYYckzTtorqnLnRMBYZ6xFJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678847984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BEbzmmvCYkLW7KvA8Vc73XWF1omegsjjqkbmuUxq2GA=; b=Iiq+UFLIcBDoj6ge7/xthpnhxJDfRT9uEnRs6hl7y6FaNuv1JSPeoDzKF4mO2MF0OHoPPj I2wdDEMlY1dFg+4Alk35idNQGqVo7DEHcWu5teQt6jSatxJb4+GToQAizqi4U2Xq5Iqy5R RoK/nWev+bBWSq7VnH0z6OSrg42mHfF1nAphMODj537ODYODWF1pWl3zwPqBLfbfBfj1aw v4MXEFjaVLXFwHuYYNz6chHK3XO92fLUCkmxsHVU7rzWSb+2MZ4JajIWPimPO+t2OPjUKw QuVjHx8efXlcGA3eL/2XiiZSx32Av9Kv+ijUkdd214xJOQT1H5jsThyqYWiDTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678847984; a=rsa-sha256; cv=none; b=AgAll7LZ6rMUNfs94kGyfTUE1zUIVg2vkeSzPlnLdsCbQoXnN9W7EbzDzC0Hl0laAKbBoQ U1BRhl17YXrkrUAqZpHIde2cJcZK479B+BBCBAXX7Q7HXX+z0flMday00qvAjPXmZSiyYL Rc1xEddFj7aBdfK5KaSgf95sPPouTLK5NLNHVoTzuPCChi9+91WQtJKs3mLxgToDyjr6hO Jcx9Eqj/nngcIAtknH1JqRgna5vTJlpQnBEAiwoccfqRp+jgwR7LnpqtdTnbe9IlqSzMuQ Z6W+KNNv6VgfmyKuJFDQ4BUGXCINi3uKK8uOMl6nv7t2VdMANkkkMNVyz3pLQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbvk83dJHz10FG; Wed, 15 Mar 2023 02:39:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F2diLu060170; Wed, 15 Mar 2023 02:39:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F2diwf060169; Wed, 15 Mar 2023 02:39:44 GMT (envelope-from git) Date: Wed, 15 Mar 2023 02:39:44 GMT Message-Id: <202303150239.32F2diwf060169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 94dcc95fdf45 - main - pmccontrol: Remove trailing semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94dcc95fdf45eff1dc25d2a51f074684c265ba2e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=94dcc95fdf45eff1dc25d2a51f074684c265ba2e commit 94dcc95fdf45eff1dc25d2a51f074684c265ba2e Author: Elyes Haouas AuthorDate: 2023-03-15 02:09:16 +0000 Commit: Warner Losh CommitDate: 2023-03-15 02:39:34 +0000 pmccontrol: Remove trailing semicolon Signed-off-by: Elyes Haouas Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/654 --- usr.sbin/pmccontrol/pmccontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmccontrol/pmccontrol.c b/usr.sbin/pmccontrol/pmccontrol.c index 9d57a2923784..1130c2c07b20 100644 --- a/usr.sbin/pmccontrol/pmccontrol.c +++ b/usr.sbin/pmccontrol/pmccontrol.c @@ -101,7 +101,7 @@ static FILE *debug_stream = NULL; #if DEBUG #define DEBUG_MSG(...) \ - (void) fprintf(debug_stream, "[pmccontrol] " __VA_ARGS__); + (void) fprintf(debug_stream, "[pmccontrol] " __VA_ARGS__) #else #define DEBUG_MSG(m) /* */ #endif /* !DEBUG */ From nobody Wed Mar 15 02:39:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbvkB4P0yz3xrbT; Wed, 15 Mar 2023 02:39: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 4Pbvk95LRMz4PlG; Wed, 15 Mar 2023 02:39:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678847985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rSHTTJbZqZrA8BHmXoNwCsft/I+EdKZtIwmP5KD+4aw=; b=LKUfDsqAXwlXCMG+SN8+94aG7IdecuwD6rjU2EE7sgM6G1YqUrRuQ1mwNRJsWkV8Mdtzci fNfTQLBkl7Pm7mQ5D9ynqTMj9l3ORPmSE+llxuDCCMB5Sf3pK1DECj/p6yS1P+JjFgBHZ8 03pP9ov0peMsUYW1LkF+UIb/OWI/D9UPq50XchQ+SkRzrCYkpVbmgkVl1Oy7yb9E1S9w2w ju1S+Lcnubpd5JLio0JzRGzTBwS6qcbeelw01/fzPE2YDFlFHJJBgty9l7qIK9dpVj5UZy WFibWMObej+KtS5JMbvbUxwrCTeUthhz/vdyj0Mt5i5GaOE1OFcejBlDdg4zaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678847985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rSHTTJbZqZrA8BHmXoNwCsft/I+EdKZtIwmP5KD+4aw=; b=ZXI1BUvu5gSbaDMj6YvwriIbtrSN7TXFOkMvUai1+e0b/VHRQBaa8o5WU4BBFEjpKwqWCB s99tXdIruUr77ixePxCQDWpJQh+IXG1LRg3y7OyemBRxpTwF8B9imC1CKKLgJfaKFtEB4j Lt7+ku7EkmtriVXLqzLXEa7b8IlE+obu1D8EDVhI/kznFHEvOIw2IrepkJRgY1hEuGugpn 3lyJgKSvMQJqOqlhyqjdNVOl55k5cFERfR1K/7mBxZFxhQ1ZEnfrTyjgGS0t9qmSqUrDj8 zuEXVXuc1P2qrznCGhl8H/7vHA4i5q524kACtblWRHJlpvUeFQDYfoIbdz0Dog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678847985; a=rsa-sha256; cv=none; b=GdRqi55HIytptoWTax79UfHPBdHJ5759cAk3FWGhOYETRVezrtgNSYcfdpg9OTlIdph+Q/ WlLNShmt/p4d6AGwGKUwgU4+BobDSkAQaejR5nSB6CP62iTcmwMeNdMRtLLFLEQF1qlN0H BLRQTnM0pItsNchnTS1PuSeBgY4L/RwAd0WM39a4YQM8r27D6kMoW/4ZmNz4K8pdc9i5T2 KbMnsM6fZ+jJJ0AytsyYuE8VdUrLYGe5S/8mrvLkp2MfIdjXT7rl+LD/JnGOVy6WVN58PG iDOME/d1NwDRxKHWQHrvQAGs+XUXPLapiw1ibHfNA7SlwqyyP2hkJwZBIdXcXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbvk94QPKz10CB; Wed, 15 Mar 2023 02:39:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F2djMO060189; Wed, 15 Mar 2023 02:39:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F2dj2H060188; Wed, 15 Mar 2023 02:39:45 GMT (envelope-from git) Date: Wed, 15 Mar 2023 02:39:45 GMT Message-Id: <202303150239.32F2dj2H060188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 44357c18ccb9 - main - ppp: Remove trailing semicolon List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44357c18ccb9df24a925d43ccc467f65b9ed6bc6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=44357c18ccb9df24a925d43ccc467f65b9ed6bc6 commit 44357c18ccb9df24a925d43ccc467f65b9ed6bc6 Author: Elyes Haouas AuthorDate: 2023-03-15 02:09:16 +0000 Commit: Warner Losh CommitDate: 2023-03-15 02:39:34 +0000 ppp: Remove trailing semicolon Signed-off-by: Elyes Haouas Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/654 --- usr.sbin/ppp/ncp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ppp/ncp.h b/usr.sbin/ppp/ncp.h index 70b00a422310..806c943a891e 100644 --- a/usr.sbin/ppp/ncp.h +++ b/usr.sbin/ppp/ncp.h @@ -96,8 +96,8 @@ extern void ncp2initial(struct ncp *); ncp_ClearUrgentPorts(&(ncp)->cfg.urgent.tcp) #define ncp_ClearUrgentUdpPorts(ncp) \ ncp_ClearUrgentPorts(&(ncp)->cfg.urgent.udp) -#define ncp_ClearUrgentTOS(ncp) (ncp)->cfg.urgent.tos = 0; -#define ncp_SetUrgentTOS(ncp) (ncp)->cfg.urgent.tos = 1; +#define ncp_ClearUrgentTOS(ncp) (ncp)->cfg.urgent.tos = 0 +#define ncp_SetUrgentTOS(ncp) (ncp)->cfg.urgent.tos = 1 #ifndef NOINET6 #define isncp(proto) ((proto) == PROTO_IPCP || (proto) == PROTO_IPV6CP) From nobody Wed Mar 15 03:08:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbwMH4tQXz3xt9q; Wed, 15 Mar 2023 03:08: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 4PbwMH4FyLz3DRq; Wed, 15 Mar 2023 03:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678849707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E1ZNDXteFAzGvDWObTc3fKZ2H5x/TLC9QI7F96bIqJI=; b=eDS7Nea+tnAvkeupOwPPs83Qu1VnG3kI87SrbgzxzNtFW/slmGF7+G6tTVXib5wjAwkeoD spIhaL/VsnVz3b4DdS13M+4BeXg6mKwvmAugxoAnBdeknbwtmZalF1nFzyuGeQV1knWKaj 27bBomJkb6Z14X72aR3/8VtpW4pDs3ppHLLtMxPsqjF8G/i+rxAUcoghP3iLYbyNCImPzd 4G6aFXIkM2QhxaWmXq9jsCw2ZUk25DnbGMy27qwuYPXcEg+fExJDmAVlaGDvEBKgC1gFgq HFsTWMRqqU4hWBJmYlF3vUP6GzObvMD0yjnLq/gn/hf0ChVP5VvtWvvzwyxElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678849707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E1ZNDXteFAzGvDWObTc3fKZ2H5x/TLC9QI7F96bIqJI=; b=iuDWIMO6/rO6urgAoRYicgtQmWyTGr0Ekp/6SK4F3Qa8SeXJT9YbtCaL71z4xYu0yts5Di m8HmXWauKuA3ReoU7tsT7za+qWwmMZNul/gpuaBS29IZoAnsofe/4ONCMtigKCluAniXpx cirAnqbSqIYsFqqB3bBzAj437bkEK0Ne7GoPlhkwFcrWfkbPYEtkqlosFRzyFLqbHa0AVg MRmyxJ3aWFEaNbowVueJXyQ3Rpw4ie3hkRF5H11CU8SqpTDF92UQwtmf6T6/XI+RSMKZmA 1QYVVE4VPqAyfzJCEiHlfEexyb285yE9c/kBSLud1xONjGNDiZ/Nj77FVrr5Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678849707; a=rsa-sha256; cv=none; b=adTQPlWvaHZqp7ar7+mw+QgYOyYyhbFjKKln5PHZy7go5n43F36DEFzz0SZ1uSoMGS9XuY TsyAihEEm2hc0ikUHiL81q9TKarg2x53oyrp4J+ceMSGf6zTPtq5qi9+eDr5XaZsnVlxeC wCx5rPuArppAjzocrhP9gVxzRRMeKyxfHiizyXDsLF+rKX6AKJUpNYoL/GjKaiWdSa+GSd 0eLNmG/iQj4fRXmi5Avk4si6QwwhwItfcr1mIgJh9bAMS4pLKxLO0cdJyznHoWwKtDl4Iv q3VCVOfnuANOlSjq16kCYrkUoVCR8B5a7zDm/s6uJ786Pq9kXExw33m6DT8lBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbwMH3JLFz10wk; Wed, 15 Mar 2023 03:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F38Rh0011245; Wed, 15 Mar 2023 03:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F38Rqk011244; Wed, 15 Mar 2023 03:08:27 GMT (envelope-from git) Date: Wed, 15 Mar 2023 03:08:27 GMT Message-Id: <202303150308.32F38Rqk011244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3693d9140e05 - main - rc: ignore .pkgsave files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3693d9140e05aba9942232df13468f51a6cde136 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3693d9140e05aba9942232df13468f51a6cde136 commit 3693d9140e05aba9942232df13468f51a6cde136 Author: Mina Galić AuthorDate: 2023-03-15 02:52:15 +0000 Commit: Warner Losh CommitDate: 2023-03-15 02:52:15 +0000 rc: ignore .pkgsave files The local parts of rc already skip .sample files; we add .pkgsave to the list, and add logic for base. Thanks to @RhodiumToad for getting this started. Differential Revision: https://reviews.freebsd.org/D27962 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/662 --- libexec/rc/rc | 9 ++++++--- libexec/rc/rc.subr | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index f021251bbd81..8ae048b67c1b 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -94,7 +94,9 @@ fi # Do a first pass to get everything up to $early_late_divider so that # we can do a second pass that includes $local_startup directories # -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` +unset system_rc +find_system_scripts +files=`rcorder ${skip} ${skip_firstboot} ${system_rc} 2>/dev/null` _rc_elem_done=' ' for _rc_elem in ${files}; do @@ -106,7 +108,7 @@ for _rc_elem in ${files}; do esac done -unset files local_rc +unset files local_rc system_rc # Now that disks are mounted, for each dir in $local_startup # search for init scripts that use the new rc.d semantics. @@ -122,7 +124,8 @@ if [ -e ${firstboot_sentinel} ]; then skip_firstboot="" fi -files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null` +find_system_scripts +files=`rcorder ${skip} ${skip_firstboot} ${system_rc} ${local_rc} 2>/dev/null` for _rc_elem in ${files}; do case "$_rc_elem_done" in *" $_rc_elem "*) continue ;; diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index e21504248749..1c01f1cfd071 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -2083,7 +2083,7 @@ find_local_scripts_new() { if [ -d "${dir}" ]; then for file in `grep -l '^# PROVIDE:' ${dir}/* 2>/dev/null`; do case "$file" in - *.sample) ;; + *.sample|*.pkgsave) ;; *) if [ -x "$file" ]; then local_rc="${local_rc} ${file}" fi @@ -2094,6 +2094,19 @@ find_local_scripts_new() { done } +find_system_scripts() { + system_rc='' + for file in /etc/rc.d/*; do + case "${file##*/}" in + *.pkgsave) ;; + *) if [ -x "$file" ]; then + system_rc="${system_rc} ${file}" + fi + ;; + esac + done +} + # check_required_{before|after} command # Check for things required by the command before and after its precmd, # respectively. The two separate functions are needed because some From nobody Wed Mar 15 03:08:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbwMJ5z7hz3xstt; Wed, 15 Mar 2023 03:08: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 4PbwMJ4xnHz3DS9; Wed, 15 Mar 2023 03:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678849708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XkuCoXF1JkR1QK8dw4jOc2FVSvRj36VdUWzUtGh6ysI=; b=oXwSug2M4M45UORHpD3O45azedImkFBony5soAOJieuwP2ig+dJzHBFGTdIufsJk89y+aQ zZI2wRhvi/wVUd8707Ad9ZFcvTxvbEsPSAsTOXcL0trn3zLiXQR3YsDQ8cblQ+yMhBsOll d7ge9FKRQ8wr0NLNNL0QrC/ZlFxQ0UEQKJPQso2mLqRiEa5u6ZeLUjT7kkt/rolxiURD73 TEEJ2lUCRmsdnpKQgrOet/NlGJwajDdRDB4DnpzolO1r3lnDRX53XNtHI6bvA06AnSVpDC Z5SpcCKInuyIODXCKzFVAt+Tk7Z30lW8cf6TJNZ64lQDEcQWfLxswIUIvV43jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678849708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XkuCoXF1JkR1QK8dw4jOc2FVSvRj36VdUWzUtGh6ysI=; b=UOTm2Lvwg955F6TlUZVxS5uKaZ8Toox73a85of+JeBZOcgicHUOPlxnIomp7RaXx06ojrr jREUVJgusnwUKOwznq+gD4nIPtqmal5u6zATA/CgBRpaeLsOOAYQszKqj3c3Qz/7Hy/D0j TRIe4DRI7LCcChXMLeyhVTdrIApySBHpu3wHUz4JJLG5ehGZbliNVbX3gCoWeJjemxXqSN Lj4dbgcd5d60KV7j3lHGetf/3NQlkAftTzwH3dvuJ9dHWK5CpCzPqlVcxf27Kt4Kxwjy/2 jymLwVEt6KX7ZTgpm17WLKajGg20en4bk4hrpR9q4NtkbDdFQIOxZQJ97scwhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678849708; a=rsa-sha256; cv=none; b=LR5oAxplGn/gv2COiIWL2TX32Oa/uJLgwYmpctYeN7YV/xjYL+R7f5BUMygXOZ3WigqZzy +v5zqhF7N9+SvQGLEE0thfc2Ny0rYTEZ0kSEN/Wi6j1qxtjfp9et1EbF7eea4tyBu3cov0 V1DugwnPGfK7s9Rc7uWQlTy/vUfJWIjednaZ/tVrAtLmsIgf3oqzn2u0s3JnxD9sotuij/ ekrvFo5uCANzk7YG3TKyxp6/H4JbjQ2C/e29B3rRrr0dhK6abhAPu1kFb3jLwnu2Adh3Qm CVlXG4X9itwqibV7+IfBfvfB+TzbrJzXXV8rEWbsCmKOb9tIxf0xllYg4OQXJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbwMJ41d5z10wl; Wed, 15 Mar 2023 03:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F38SX4011264; Wed, 15 Mar 2023 03:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F38Svu011263; Wed, 15 Mar 2023 03:08:28 GMT (envelope-from git) Date: Wed, 15 Mar 2023 03:08:28 GMT Message-Id: <202303150308.32F38Svu011263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0b0ae2e4cd22 - main - jail: convert several functions from int to bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b0ae2e4cd22c21f3c1971b1cfff9893b30d9f6f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0b0ae2e4cd22c21f3c1971b1cfff9893b30d9f6f commit 0b0ae2e4cd22c21f3c1971b1cfff9893b30d9f6f Author: Mina Galić AuthorDate: 2023-03-15 03:04:40 +0000 Commit: Warner Losh CommitDate: 2023-03-15 03:05:33 +0000 jail: convert several functions from int to bool these functions exclusively return (0) and (1), so convert them to bool We also convert some networking related jail functions from int to bool some of which were returning an error that was never used. Differential Revision: https://reviews.freebsd.org/D29659 Reviewed by: imp, jamie (earlier version) Pull Request: https://github.com/freebsd/freebsd-src/pull/663 --- sys/kern/kern_jail.c | 37 +++++++++++++++++++++---------------- sys/netinet/in_jail.c | 26 ++++++++++++-------------- sys/netinet6/in6_jail.c | 26 ++++++++++++-------------- sys/sys/jail.h | 18 +++++++++--------- 4 files changed, 54 insertions(+), 53 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 72d89a290269..7b57e5bb9d61 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2794,14 +2794,19 @@ prison_find_name(struct prison *mypr, const char *name) * PR_IP4 and PR_IP6), or only the single bit is examined, without regard * to any other prison data. */ -int +bool prison_flag(struct ucred *cred, unsigned flag) { - return (cred->cr_prison->pr_flags & flag); + return ((cred->cr_prison->pr_flags & flag) != 0); } -int +/* + * See if a prison has the specific allow flag set. + * The prison *should* be locked, or only a single bit is examined, without + * regard to any other prison data. + */ +bool prison_allow(struct ucred *cred, unsigned flag) { @@ -3529,16 +3534,16 @@ prison_check_nfsd(struct ucred *cred) } /* - * Return 1 if p2 is a child of p1, otherwise 0. + * Return true if p2 is a child of p1, otherwise false. */ -int +bool prison_ischild(struct prison *pr1, struct prison *pr2) { for (pr2 = pr2->pr_parent; pr2 != NULL; pr2 = pr2->pr_parent) if (pr1 == pr2) - return (1); - return (0); + return (true); + return (false); } /* @@ -3573,21 +3578,21 @@ prison_isvalid(struct prison *pr) } /* - * Return 1 if the passed credential is in a jail and that jail does not - * have its own virtual network stack, otherwise 0. + * Return true if the passed credential is in a jail and that jail does not + * have its own virtual network stack, otherwise false. */ -int +bool jailed_without_vnet(struct ucred *cred) { if (!jailed(cred)) - return (0); + return (false); #ifdef VIMAGE if (prison_owns_vnet(cred)) - return (0); + return (false); #endif - return (1); + return (true); } /* @@ -3649,9 +3654,9 @@ getjailname(struct ucred *cred, char *name, size_t len) * Determine whether the prison represented by cred owns * its vnet rather than having it inherited. * - * Returns 1 in case the prison owns the vnet, 0 otherwise. + * Returns true in case the prison owns the vnet, false otherwise. */ -int +bool prison_owns_vnet(struct ucred *cred) { @@ -3659,7 +3664,7 @@ prison_owns_vnet(struct ucred *cred) * vnets cannot be added/removed after jail creation, * so no need to lock here. */ - return (cred->cr_prison->pr_flags & PR_VNET ? 1 : 0); + return ((cred->cr_prison->pr_flags & PR_VNET) != 0); } #endif diff --git a/sys/netinet/in_jail.c b/sys/netinet/in_jail.c index 999bcf5112fe..ddc300e9f7b6 100644 --- a/sys/netinet/in_jail.c +++ b/sys/netinet/in_jail.c @@ -144,49 +144,47 @@ prison_get_ip4(struct ucred *cred, struct in_addr *ia) } /* - * Return 1 if we should do proper source address selection or are not jailed. - * We will return 0 if we should bypass source address selection in favour + * Return true if we should do proper source address selection or are not jailed. + * We will return false if we should bypass source address selection in favour * of the primary jail IPv4 address. Only in this case *ia will be updated and * returned in NBO. - * Return EAFNOSUPPORT, in case this jail does not allow IPv4. + * Return true, even in case this jail does not allow IPv4. */ -int +bool prison_saddrsel_ip4(struct ucred *cred, struct in_addr *ia) { struct prison *pr; struct in_addr lia; - int error; KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); if (!jailed(cred)) - return (1); + return (true); pr = cred->cr_prison; if (pr->pr_flags & PR_IP4_SADDRSEL) - return (1); + return (true); lia.s_addr = INADDR_ANY; - error = prison_get_ip4(cred, &lia); - if (error) - return (error); + if (prison_get_ip4(cred, &lia) != 0) + return (true); if (lia.s_addr == INADDR_ANY) - return (1); + return (true); ia->s_addr = lia.s_addr; - return (0); + return (false); } /* * Return true if pr1 and pr2 have the same IPv4 address restrictions. */ -int +bool prison_equal_ip4(struct prison *pr1, struct prison *pr2) { if (pr1 == pr2) - return (1); + return (true); /* * No need to lock since the PR_IP4_USER flag can't be altered for diff --git a/sys/netinet6/in6_jail.c b/sys/netinet6/in6_jail.c index 830addb267fb..33246ecc98d0 100644 --- a/sys/netinet6/in6_jail.c +++ b/sys/netinet6/in6_jail.c @@ -133,49 +133,47 @@ prison_get_ip6(struct ucred *cred, struct in6_addr *ia6) } /* - * Return 1 if we should do proper source address selection or are not jailed. - * We will return 0 if we should bypass source address selection in favour + * Return true if we should do proper source address selection or are not jailed. + * We will return false if we should bypass source address selection in favour * of the primary jail IPv6 address. Only in this case *ia will be updated and * returned in NBO. - * Return EAFNOSUPPORT, in case this jail does not allow IPv6. + * Return true, even in case this jail does not allow IPv6. */ -int +bool prison_saddrsel_ip6(struct ucred *cred, struct in6_addr *ia6) { struct prison *pr; struct in6_addr lia6; - int error; KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); if (!jailed(cred)) - return (1); + return (true); pr = cred->cr_prison; if (pr->pr_flags & PR_IP6_SADDRSEL) - return (1); + return (true); lia6 = in6addr_any; - error = prison_get_ip6(cred, &lia6); - if (error) - return (error); + if (prison_get_ip6(cred, &lia6) != 0) + return (true); if (IN6_IS_ADDR_UNSPECIFIED(&lia6)) - return (1); + return (true); bcopy(&lia6, ia6, sizeof(struct in6_addr)); - return (0); + return (false); } /* * Return true if pr1 and pr2 have the same IPv6 address restrictions. */ -int +bool prison_equal_ip6(struct prison *pr1, struct prison *pr2) { if (pr1 == pr2) - return (1); + return (true); while (pr1 != &prison0 && #ifdef VIMAGE diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 0a5a7c3288d7..644884372d43 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -413,24 +413,24 @@ struct vfsconf; */ #define jailed(cred) (cred->cr_prison != &prison0) -int jailed_without_vnet(struct ucred *); +bool jailed_without_vnet(struct ucred *); void getcredhostname(struct ucred *, char *, size_t); void getcreddomainname(struct ucred *, char *, size_t); void getcredhostuuid(struct ucred *, char *, size_t); void getcredhostid(struct ucred *, unsigned long *); void getjailname(struct ucred *cred, char *name, size_t len); void prison0_init(void); -int prison_allow(struct ucred *, unsigned); +bool prison_allow(struct ucred *, unsigned); int prison_check(struct ucred *cred1, struct ucred *cred2); bool prison_check_nfsd(struct ucred *cred); -int prison_owns_vnet(struct ucred *); +bool prison_owns_vnet(struct ucred *); int prison_canseemount(struct ucred *cred, struct mount *mp); void prison_enforce_statfs(struct ucred *cred, struct mount *mp, struct statfs *sp); struct prison *prison_find(int prid); struct prison *prison_find_child(struct prison *, int); struct prison *prison_find_name(struct prison *, const char *); -int prison_flag(struct ucred *, unsigned); +bool prison_flag(struct ucred *, unsigned); void prison_free(struct prison *pr); void prison_free_locked(struct prison *pr); void prison_hold(struct prison *pr); @@ -441,7 +441,7 @@ void prison_proc_link(struct prison *, struct proc *); void prison_proc_unlink(struct prison *, struct proc *); void prison_proc_iterate(struct prison *, void (*)(struct proc *, void *), void *); void prison_set_allow(struct ucred *cred, unsigned flag, int enable); -int prison_ischild(struct prison *, struct prison *); +bool prison_ischild(struct prison *, struct prison *); bool prison_isalive(const struct prison *); bool prison_isvalid(struct prison *); #if defined(INET) || defined(INET6) @@ -450,24 +450,24 @@ const void *prison_ip_get0(const struct prison *, const pr_family_t); u_int prison_ip_cnt(const struct prison *, const pr_family_t); #endif #ifdef INET -int prison_equal_ip4(struct prison *, struct prison *); +bool prison_equal_ip4(struct prison *, struct prison *); int prison_get_ip4(struct ucred *cred, struct in_addr *ia); int prison_local_ip4(struct ucred *cred, struct in_addr *ia); int prison_remote_ip4(struct ucred *cred, struct in_addr *ia); int prison_check_ip4(const struct ucred *, const struct in_addr *); int prison_check_ip4_locked(const struct prison *, const struct in_addr *); -int prison_saddrsel_ip4(struct ucred *, struct in_addr *); +bool prison_saddrsel_ip4(struct ucred *, struct in_addr *); int prison_qcmp_v4(const void *, const void *); bool prison_valid_v4(const void *); #endif #ifdef INET6 -int prison_equal_ip6(struct prison *, struct prison *); +bool prison_equal_ip6(struct prison *, struct prison *); int prison_get_ip6(struct ucred *, struct in6_addr *); int prison_local_ip6(struct ucred *, struct in6_addr *, int); int prison_remote_ip6(struct ucred *, struct in6_addr *); int prison_check_ip6(const struct ucred *, const struct in6_addr *); int prison_check_ip6_locked(const struct prison *, const struct in6_addr *); -int prison_saddrsel_ip6(struct ucred *, struct in6_addr *); +bool prison_saddrsel_ip6(struct ucred *, struct in6_addr *); int prison_qcmp_v6(const void *, const void *); bool prison_valid_v6(const void *); #endif From nobody Wed Mar 15 03:20:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbwck6wGqz3xtmQ; Wed, 15 Mar 2023 03:20: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 4Pbwck6R3fz3FlR; Wed, 15 Mar 2023 03:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678850406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kenQcEc6uCHCDNT3XdnjmQruTE1gps8pfzc4JJWHvrw=; b=ZRTI1ekKuTdWr85ityWCUEOnrHdh5IAT3q59bOQHlhvkuBNSKExMs6pu5cvOAyA5TbDxMc txQJWymfjbjV/968lGl8uBvfRRU9ATar3+BLHoNsZKSZ9sa/v0rh/fmJ1xl/JP9Mcaxkzh y3fQdNMK9BjONNB0dqxY8zqzjFt3ik6Hsn/xVagy91rX5Zo66jL/Oz36pLbrp9ROo8g5cD XWDIg/kxr7SZfHsSqv5+RQT+UlhymIz+TIXMHmT0Q1HigUSFDptPBRuyMdKPeD68q0sQ69 UDPLKmx1tvvU87Mv8UNJpCl1KP4FDWdknruCznWTcbbi2O5fwPeOhgi41lxyAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678850406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kenQcEc6uCHCDNT3XdnjmQruTE1gps8pfzc4JJWHvrw=; b=xbKd4KXnmva7rsxErzW/cWo83psagsQ5/1IqXbJSKPX5QDyMCOJgEVnVqYr/YC1jAEMUt7 M/cM2ZR7XUgpHW0LuCuA68uJNsQ2U8l0llyOySNgtc1sbbAgDCFfjyPMLvUVnjYsG5sL1Q mon/HRjX3SUt4nT5KeprYuS1EXWt+jjwA0BWsv/GtHT7DrxOdymhUhd+71A7/TnZ94M8KU gYD2ZJKZ57pzRHl63eNQv30s88hKn3wZMG8vyevgvGzSjXaeEz9YAoKe93TdK0f/aNgBtQ 5mm6MsJ+kjVLH6FKGj+rrYYtqJfJ9E7KDvZvGkMnjxjQizlBHF3xf3BIV+VK0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678850406; a=rsa-sha256; cv=none; b=yqXxjKtoFovkbf7W2aXYXXvPRZkjJEKtkzejPO7IPaC/esJL/fIzWscFj/0Gnj3uFkPfsr hojRI5sIwXfrBpKxac60bnXa9c3tqBMR6rYyVppA8YwU1DQOnk1oxQvsJxq5KDjRQi6FW8 8YbhJglQPeNnWy1exq2XHdR/yaUtLnPA6G+jsxVktlfPHsKSTLdIVzV28nqDZMo1H0TnD8 4JFgHQdrgAQ/QOOkTbCpqfSdtxr36E/7YF3EHHW8jhoIUAWcIoaQfg+FRldulWDLO85oKt 7/C+6rMza6hMrr3lTEBwgGluMe5OFHtsnCPYMgMhiMCMsXOS+sI5qjGvKWuplQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pbwck5TDXz11MX; Wed, 15 Mar 2023 03:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F3K6sc030943; Wed, 15 Mar 2023 03:20:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F3K6xL030940; Wed, 15 Mar 2023 03:20:06 GMT (envelope-from git) Date: Wed, 15 Mar 2023 03:20:06 GMT Message-Id: <202303150320.32F3K6xL030940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8e933d9c598e - main - libbe: Avoid double printing cloning errors. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e933d9c598ec847081c322e7ae9a46bf7897886 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8e933d9c598ec847081c322e7ae9a46bf7897886 commit 8e933d9c598ec847081c322e7ae9a46bf7897886 Author: John Grafton AuthorDate: 2023-03-15 03:14:14 +0000 Commit: Warner Losh CommitDate: 2023-03-15 03:15:17 +0000 libbe: Avoid double printing cloning errors. be_clone calls be_clone_cb and both call set_error on the return error path. set_error prints the error resulting in a double print. be_clone_cb should just return the error code and allow be_clone to print it. PR: 265248 Reported by: Graham Perrin Reviewed by: imp, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/685 --- lib/libbe/be.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index cc6b8533a8f9..db06bdbb36a8 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -745,11 +745,11 @@ be_clone_cb(zfs_handle_t *ds, void *data) /* construct the boot environment path from the dataset we're cloning */ if (be_get_path(ldc, dspath, be_path, sizeof(be_path)) != BE_ERR_SUCCESS) - return (set_error(ldc->lbh, BE_ERR_UNKNOWN)); + return (BE_ERR_UNKNOWN); /* the dataset to be created (i.e. the boot environment) already exists */ if (zfs_dataset_exists(ldc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) - return (set_error(ldc->lbh, BE_ERR_EXISTS)); + return (BE_ERR_EXISTS); /* no snapshot found for this dataset, silently skip it */ if (!zfs_dataset_exists(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) @@ -757,7 +757,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) if ((snap_hdl = zfs_open(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) - return (set_error(ldc->lbh, BE_ERR_ZFSOPEN)); + return (BE_ERR_ZFSOPEN); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); @@ -770,7 +770,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) return (-1); if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) - return (set_error(ldc->lbh, BE_ERR_ZFSCLONE)); + return (BE_ERR_ZFSCLONE); nvlist_free(props); zfs_close(snap_hdl); @@ -781,7 +781,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) ldc->depth--; } - return (set_error(ldc->lbh, err)); + return (err); } /* From nobody Wed Mar 15 03:45:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbx9f36tLz3xwBg for ; Wed, 15 Mar 2023 03:45:10 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pbx9f1PvXz3JnP for ; Wed, 15 Mar 2023 03:45:10 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f51.google.com with SMTP id p4so9923340wre.11 for ; Tue, 14 Mar 2023 20:45:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678851908; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nob9k0Ubbu7TQ4Ba2ooQDoi4qYVkkV8AjgHpUSbe6e0=; b=LRJSJxbMXj5a0tAIZ669dAZovVsI8/ZytLVeQ/+Qso6NTIiOpS/bccO4RRbeHFDeJu PMHKgCic3XyvSu9l83Z58grCmP4LtDT76AKZxiS7V/oEeAUI2g+SskzI+B9ueoe3b49w 2fVDoH0yxnxbc5JXSlj1AlGItq7II9vMa10djhQflH57YDf8aZkzRLvKkgF036lm3EMr RizzBTJAtUt2V0fnssBku7+Zb2fl2A3Mrb88WSg0vWXAUsG3pumAvX7k1Oy52AGfG92x Z4/YIpnNMzEo49vexjZgp6qSW13td0h0vZL7A8w1keVnyu4xf5Zj+5Nc7wFVrM4QHylt 3m4Q== X-Gm-Message-State: AO0yUKXmBkTj2Uk/hM//RziXwoPZZFPp0/eXUiU/K3t7iPOtbh6OWzpO YtUISrg4bvZqj2C55cZuCdxV5A== X-Google-Smtp-Source: AK7set/oM5Wjy91yLURogGhLtuU3QX77uJun+VM+u4ixbvAjuH2GKc05HrR6c1mgeCFiZto4O5P0RQ== X-Received: by 2002:a5d:4524:0:b0:2ce:a652:2399 with SMTP id j4-20020a5d4524000000b002cea6522399mr750014wra.14.1678851908474; Tue, 14 Mar 2023 20:45:08 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id t18-20020a5d42d2000000b002ceb7a11eb9sm3472070wrr.42.2023.03.14.20.45.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2023 20:45:07 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 44357c18ccb9 - main - ppp: Remove trailing semicolon From: Jessica Clarke In-Reply-To: <202303150239.32F2dj2H060188@gitrepo.freebsd.org> Date: Wed, 15 Mar 2023 03:45:07 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <27233978-E3A2-46BD-A2A9-BA1854833129@freebsd.org> References: <202303150239.32F2dj2H060188@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4Pbx9f1PvXz3JnP X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 15 Mar 2023, at 02:39, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D44357c18ccb9df24a925d43ccc467f65= b9ed6bc6 >=20 > commit 44357c18ccb9df24a925d43ccc467f65b9ed6bc6 > Author: Elyes Haouas > AuthorDate: 2023-03-15 02:09:16 +0000 > Commit: Warner Losh > CommitDate: 2023-03-15 02:39:34 +0000 >=20 > ppp: Remove trailing semicolon >=20 > Signed-off-by: Elyes Haouas > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/654 > --- > usr.sbin/ppp/ncp.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/usr.sbin/ppp/ncp.h b/usr.sbin/ppp/ncp.h > index 70b00a422310..806c943a891e 100644 > --- a/usr.sbin/ppp/ncp.h > +++ b/usr.sbin/ppp/ncp.h > @@ -96,8 +96,8 @@ extern void ncp2initial(struct ncp *); > ncp_ClearUrgentPorts(&(ncp)->cfg.urgent.tcp) > #define ncp_ClearUrgentUdpPorts(ncp) \ > ncp_ClearUrgentPorts(&(ncp)->cfg.urgent.udp) > -#define ncp_ClearUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 0; > -#define ncp_SetUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 1; > +#define ncp_ClearUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 0 > +#define ncp_SetUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 1 do { ... } while (0)? Jess >=20 > #ifndef NOINET6 > #define isncp(proto) ((proto) =3D=3D PROTO_IPCP || (proto) =3D=3D = PROTO_IPV6CP) From nobody Wed Mar 15 04:09:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbxjy0tJ8z3xxnG for ; Wed, 15 Mar 2023 04:09:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pbxjx5rXSz3LyN for ; Wed, 15 Mar 2023 04:09:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52d.google.com with SMTP id da10so70607399edb.3 for ; Tue, 14 Mar 2023 21:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1678853379; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0UITSQWB1m4lZcD6ozi/zgRG+fyKHfLi258meNTg2iQ=; b=PR8R1iuRmbLvWDUN9vd/dX+FaPOYeRUKSJXSbzNwGTXbvLIJI6hufGyNwzgkUZLEIv wcgxW22rHGp+nPcMUR2mxB/kSNemZqUYqZoGJ9CGbI7QlSVUCDdEMj3kkPMoOu3NRmMC +EwJsrklwQ85wAFatT7XvQ3iZ+wOLzdYLfclDZTlZMdmYcnXNLzr/iY+lfbR3oWnPMZ4 R0RNobEaGflh+S/hRzBzt3tuexAJa/v2v8wRM1mNNL4/GF0f7YegoweK8vM9TSdE1yVh DoTn8SXf2vHpa9RRTjP8Q8I7Us6FIsvZxFK1rfI39xh6+P5RVcpP8iJ3MJgthQJUXTlI 5cIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678853379; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0UITSQWB1m4lZcD6ozi/zgRG+fyKHfLi258meNTg2iQ=; b=LheSDCDjaq60sB6WO0T/Qink0CBmeoIV3Z/XZcUwnHHVaIzHe59GyG7ef1EWYqFoLR EKblTDKVuRUjG/ppFPlukkA2DSor1ZdhWnskjIMQAl5UMFxV36gDyo8SxfxG+r/r2JQ1 IZy/S6d/cBePMNA6L5ekks3AuO2R0Oob0Qz/V/8qjY2Cl3RdV6m6HgLK8UXZ87OXS3hG 2dOXuOPX7+VDDzxC0dZHbPJl1/HOXhJRH5xYj3qt1Q8vcmnjBA0ub2nIk9ArOzveLxIB O94s4YQ3QyOjiDHIUvvnuhgoHy+rh0yslICG+4gkYuA3XUf161z7JPuVR+ftm2DzU7fI 3m9Q== X-Gm-Message-State: AO0yUKXskAk9yfb+2doPy9SldOKRmFtX5cf4/FCKrqjx0JkonE4srCJ+ TRlVWJabrXdOy7OSTzv5aW6dFz9+jQr+dBihXlQfgA== X-Google-Smtp-Source: AK7set9tkhVypinb1iciAis19NtvE51b/BLkZQ+K7RW8XR47lW3RnU+O+oYFzxZOeuKn6W2mSbgdErIT5H4rzcTF62M= X-Received: by 2002:a50:d08d:0:b0:4fb:80cf:898b with SMTP id v13-20020a50d08d000000b004fb80cf898bmr639429edd.7.1678853379214; Tue, 14 Mar 2023 21:09:39 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303150239.32F2dj2H060188@gitrepo.freebsd.org> <27233978-E3A2-46BD-A2A9-BA1854833129@freebsd.org> In-Reply-To: <27233978-E3A2-46BD-A2A9-BA1854833129@freebsd.org> From: Warner Losh Date: Tue, 14 Mar 2023 22:09:29 -0600 Message-ID: Subject: Re: git: 44357c18ccb9 - main - ppp: Remove trailing semicolon To: Jessica Clarke , Elyes Haouas Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000004c630c05f6e8833b" X-Rspamd-Queue-Id: 4Pbxjx5rXSz3LyN X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --0000000000004c630c05f6e8833b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 14, 2023 at 9:45=E2=80=AFPM Jessica Clarke = wrote: > On 15 Mar 2023, at 02:39, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D44357c18ccb9df24a925d43ccc467f6= 5b9ed6bc6 > > > > commit 44357c18ccb9df24a925d43ccc467f65b9ed6bc6 > > Author: Elyes Haouas > > AuthorDate: 2023-03-15 02:09:16 +0000 > > Commit: Warner Losh > > CommitDate: 2023-03-15 02:39:34 +0000 > > > > ppp: Remove trailing semicolon > > > > Signed-off-by: Elyes Haouas > > Reviewed by: imp > > Pull Request: https://github.com/freebsd/freebsd-src/pull/654 > > --- > > usr.sbin/ppp/ncp.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/usr.sbin/ppp/ncp.h b/usr.sbin/ppp/ncp.h > > index 70b00a422310..806c943a891e 100644 > > --- a/usr.sbin/ppp/ncp.h > > +++ b/usr.sbin/ppp/ncp.h > > @@ -96,8 +96,8 @@ extern void ncp2initial(struct ncp *); > > ncp_ClearUrgentPorts(&(ncp)->cfg.urgent.tcp) > > #define ncp_ClearUrgentUdpPorts(ncp) \ > > ncp_ClearUrgentPorts(&(ncp)->cfg.urgent.udp) > > -#define ncp_ClearUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 0; > > -#define ncp_SetUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 1; > > +#define ncp_ClearUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 0 > > +#define ncp_SetUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 1 > > do { ... } while (0)? > That would likely be better... I'll leave that to the original submitter (cc'd) to do as a refinement and submit a followup... I'm not sure how to code automatic detection of this into my script that checks for style(9) compliance and I should have tweaked to this when I Was reviewing it... Thanks Warner > Jess > > > > > #ifndef NOINET6 > > #define isncp(proto) ((proto) =3D=3D PROTO_IPCP || (proto) =3D=3D PROTO= _IPV6CP) > > --0000000000004c630c05f6e8833b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Mar 14, 2023 at 9:45=E2=80=AF= PM Jessica Clarke <jrtc27@freebsd.= org> wrote:
On 15 Mar 2023, at 02:39, Warner Losh <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D44357c18ccb9df24a925d43ccc467f65b9ed6bc6<= /a>
>
> commit 44357c18ccb9df24a925d43ccc467f65b9ed6bc6
> Author:=C2=A0 =C2=A0 =C2=A0Elyes Haouas <
ehaouas@noos.fr>
> AuthorDate: 2023-03-15 02:09:16 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-03-15 02:39:34 +0000
>
>=C2=A0 =C2=A0 ppp: Remove trailing semicolon
>
>=C2=A0 =C2=A0 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
>=C2=A0 =C2=A0 Reviewed by: imp
>=C2=A0 =C2=A0 Pull Request: https://github.com/fr= eebsd/freebsd-src/pull/654
> ---
> usr.sbin/ppp/ncp.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/usr.sbin/ppp/ncp.h b/usr.sbin/ppp/ncp.h
> index 70b00a422310..806c943a891e 100644
> --- a/usr.sbin/ppp/ncp.h
> +++ b/usr.sbin/ppp/ncp.h
> @@ -96,8 +96,8 @@ extern void ncp2initial(struct ncp *);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ncp_ClearUrgentPorts(&(ncp= )->cfg.urgent.tcp)
> #define ncp_ClearUrgentUdpPorts(ncp) \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ncp_ClearUrgentPorts(&(ncp= )->cfg.urgent.udp)
> -#define ncp_ClearUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 0;
> -#define ncp_SetUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 1;
> +#define ncp_ClearUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 0
> +#define ncp_SetUrgentTOS(ncp) (ncp)->cfg.urgent.tos =3D 1

do { ... } while (0)?

That would likely= be better...=C2=A0 I'll leave that to the original submitter (cc'd= ) to do as a refinement and submit a followup...
I'm not sure= how to code automatic detection of this into my script that checks for sty= le(9) compliance
and I should have tweaked to this when I Was rev= iewing it...

Thanks

Warne= r
=C2=A0
Jess

>
> #ifndef NOINET6
> #define isncp(proto) ((proto) =3D=3D PROTO_IPCP || (proto) =3D=3D PROT= O_IPV6CP)

--0000000000004c630c05f6e8833b-- From nobody Wed Mar 15 05:00:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbyrP1hfdz3y1Gc; Wed, 15 Mar 2023 05:00: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 4PbyrP1787z3PXZ; Wed, 15 Mar 2023 05:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678856421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+qPaiR5BALjM9/EtZZgY4XJIhiMbZrkJTCxeeslEa3w=; b=vhZ3D7Y/uUq+8HmEMdtbq1jqm5Hh6facJV/8Vym+8jMgrpGbJnZ1YblYuo94IXDr/Vh2L3 0Zn4sxPxkYGgYdKpWDIicJDXy/58/pJowunCfMQ2wlP6SQLkQZOJQ6uC0ENxiJRJVj2G2v CPkwygZrnIxYio/ngWkn67LtAK+HCCIbWcoDpWL6EUHkBFbFymumO1Q6qcmEIFAqLFKE7i HPpDwhpTvk7oTlVA8Xg1/EhCf69uI1HSa5SWrNTXpmufgf83zY+lc3+tBwDh6Kg1ER0Nng tzflbwRARtLKP6Xs2ejWXZZMLyFwReJeOw7hTpvmas+BxuD16/UOOkByJum8Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678856421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+qPaiR5BALjM9/EtZZgY4XJIhiMbZrkJTCxeeslEa3w=; b=IFTMFiyY3B5SkjxWWOgp0kySio2sA9d3J+qkIdYKStP5tIs9Nyrd92U32U3I74tkcTeOY+ VokM76kj3tsSpE32ulibTxVAVV1XKzud0jZrZyRZUIwWrUyoJEgTm5K1kA99L3DZlmSrMX Pf3TqO/izUzFxk7jz/fHSl+1ExIr4e9JVZTfWCRTPIWW5vB581q70Yv1c3i5d4Pan1AAy/ Ll43a/nZsp7HnrQgFSqDbOHCVjsJ6xVXj0niTqzOE/Tj8n/RridQVSSjj8u3+atrfBanPS 4/Ix/d8KXNp3RS8YBY6XFijZzrVd4FVDh9irIvoo9WvX5o/8tHDZeH/S6Uon2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678856421; a=rsa-sha256; cv=none; b=s2ndgGKsA4L0XPh5QvXpOWT0pt6XAwc7aIm7htb8gwmmqOW7J850PGpqEomNyGvTfEUKD4 A8eGkW679iRfzkM4Q6nqW33/Y8uKbuvRI4vLK6fLNC3j5b6u0S0wOx14gvVI5c0mRWxre5 QxqtRUarg5vmDDhr7xRUEao12j/MqpwBSP8DmWGZ8Pioo7hghl6VlBoPR/3BJcSpHAottU tNs/1ueASTOt1Oxfirb8tNbqQnilq4arUDSHDrRhWhMOoe2daReFvXvSmZmbdp24PPunuo 8LeSnlWLr73eGg0D4f2sRwr/SmUZVfygZ349kTRAiQEqsrq4OwRAhib+frmH2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbyrP08rgz13X4; Wed, 15 Mar 2023 05:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32F50KoB001015; Wed, 15 Mar 2023 05:00:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32F50K9Y001014; Wed, 15 Mar 2023 05:00:20 GMT (envelope-from git) Date: Wed, 15 Mar 2023 05:00:20 GMT Message-Id: <202303150500.32F50K9Y001014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 559e41a11b32 - main - veriexec: Improve comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 559e41a11b325b4292531069a697ce6da7e2e4fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=559e41a11b325b4292531069a697ce6da7e2e4fa commit 559e41a11b325b4292531069a697ce6da7e2e4fa Author: Warner Losh AuthorDate: 2023-03-15 04:59:20 +0000 Commit: Warner Losh CommitDate: 2023-03-15 05:00:16 +0000 veriexec: Improve comments Make it clear we're checking to see if the target is a verified file and prevent its replacement if so. Sponsored by: Netflix Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D39079 --- sys/security/mac_veriexec/mac_veriexec.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/sys/security/mac_veriexec/mac_veriexec.c b/sys/security/mac_veriexec/mac_veriexec.c index 6f06a8577212..e377f61ad21c 100644 --- a/sys/security/mac_veriexec/mac_veriexec.c +++ b/sys/security/mac_veriexec/mac_veriexec.c @@ -602,11 +602,11 @@ mac_veriexec_vnode_check_unlink(struct ucred *cred, struct vnode *dvp __unused, if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) return (0); - /* - * Check if it's a verified file - */ error = mac_veriexec_check_vp(cred, vp, VVERIFY); - if (error == 0) { /* file is verified */ + if (error == 0) { + /* + * The target is verified, so disallow replacement. + */ MAC_VERIEXEC_DBG(2, "(UNLINK) attempted to unlink a protected file (euid: %u)", cred->cr_uid); @@ -643,11 +643,11 @@ mac_veriexec_vnode_check_rename_from(struct ucred *cred, if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) return (0); - /* - * Check if it's a verified file - */ error = mac_veriexec_check_vp(cred, vp, VVERIFY); - if (error == 0) { /* file is verified */ + if (error == 0) { + /* + * The target is verified, so disallow replacement. + */ MAC_VERIEXEC_DBG(2, "(RENAME_FROM) attempted to rename a protected file (euid: %u)", cred->cr_uid); return (EAUTH); @@ -692,11 +692,11 @@ mac_veriexec_vnode_check_rename_to(struct ucred *cred, struct vnode *dvp __unuse if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) return (0); - /* - * Check if it's a verified file - */ error = mac_veriexec_check_vp(cred, vp, VVERIFY); - if (error == 0) { /* file is verified */ + if (error == 0) { + /* + * The target is verified, so disallow replacement. + */ MAC_VERIEXEC_DBG(2, "(RENAME_TO) attempted to overwrite a protected file (euid: %u)", cred->cr_uid); return (EAUTH); @@ -727,13 +727,14 @@ mac_veriexec_vnode_check_setmode(struct ucred *cred, struct vnode *vp, return (0); /* - * Do not allow chmod (set-[gu]id) of verified file + * Prohibit chmod of verified set-[gu]id file. */ error = mac_veriexec_check_vp(cred, vp, VVERIFY); - if (error == EAUTH) /* it isn't verified */ + if (error == EAUTH) /* target not verified */ return (0); if (error == 0 && (mode & (S_ISUID|S_ISGID)) != 0) return (EAUTH); + return (0); } From nobody Wed Mar 15 12:01:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pc8B46rVNz3yRHx; Wed, 15 Mar 2023 12:01: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 4Pc8B46K75z4F4f; Wed, 15 Mar 2023 12:01:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678881676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BUbdZvDYki2ZDOxq8D948NJeioTizcDGrmcl/EMVfd8=; b=jsvOBkwa8bX+Jw+daOH8g0gx0m0mcialIabx7I2AB+eCvCddH/XKeso+n/W/30/f7wqwaX MTz6QYVKoBUz7JtU5UrGUMElw1y71zf/bwPMD5TY3vfX9qSWuHvZsN7F5HaX87hiUbUwPl vLlEuzkZaEXyUVLKAGirz+NwmuhAKykuTwujK1JgSqdUiKR/U7PoayzVJHoVNgrCrHEodb NY7E4tToC93jS/PSgjhd1fat/lc3RrUvyGloHqxPWFXwqw05f5Lk+6co966nBmjw8Z5SBv a4pHbIi5aHZaQGgTYVGVuuZSe1nQIWmFGK20+giWQyzVOPiXPbqfEHBKjrE9og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678881676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BUbdZvDYki2ZDOxq8D948NJeioTizcDGrmcl/EMVfd8=; b=kLQHIuOvmH9smTmSfImdgWKejI6hVhk2y7jHg87W2mBYSmIe3bcg3JVaxsVBnsv3XW/763 0is0dNBuYPiiuPex43h2uW+9qj3IipTx/BK5pw9EmM+xeMhIVtKDI1SopAI+rjnKeMP23i +EHhne4w+OP4x5lx8afNOV+/uJK7uUzx/u0AhAmy9IBeZ9dd/qwbf82YtXSNTWsPOpum6T 5o/2S5zJP3X6eunwK32dBG5MpQaPmoEDPXR7OGHmv02mjtTf2gWQQEz4GwOJuqgMuraEhe j6vblVsq2pAeg0fGK9AdygTy+YTc9HjY7yGjJAkL/nLT7/FkhQYTbhJUd9KCxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678881676; a=rsa-sha256; cv=none; b=v40GCC9Zpg2CKwxid0Lx9ToCPHcdOw4qqDk4Tbhsto2mTb1YEm20e2ow/SFy8gGUPqUYsN BG5nXyO6Sqr5JBANtYpgSI8+C9U8oGiQWcNfGKCF/2rHEkBBqFqXlC+GTKRIKR0lz0Zdar aWYx6trNCJCNCIpemASafYZZiUvkd6HwJgSaI7PlN3urk7cOxkusMbnGH6OIYY7TfudJ9+ C8tu1qvqwJ2HFIrK2gPfCYaGsopvuXeP081R29SvSKNzw5VNGhuMHswyXCgqZNttXDu5hm uhgPV0Ksr+qURLy2cvRL1wgp+M9LgPncRR9Wntsai4VvhoVP8isMvYly9DAloQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pc8B45N0cz1G5X; Wed, 15 Mar 2023 12:01:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FC1Gv6096752; Wed, 15 Mar 2023 12:01:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FC1GjR096751; Wed, 15 Mar 2023 12:01:16 GMT (envelope-from git) Date: Wed, 15 Mar 2023 12:01:16 GMT Message-Id: <202303151201.32FC1GjR096751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b71ef90ec28f - main - Keep per-timer interrupt data together List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b71ef90ec28fdb731733afde495ac74ae59d6196 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b71ef90ec28fdb731733afde495ac74ae59d6196 commit b71ef90ec28fdb731733afde495ac74ae59d6196 Author: Andrew Turner AuthorDate: 2023-03-14 09:27:23 +0000 Commit: Andrew Turner CommitDate: 2023-03-15 11:34:31 +0000 Keep per-timer interrupt data together Eliminate a redundant resource array allow possible use by bhyve later. Reviewed by: kevans Sponsored by: Arm Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37424 --- sys/arm/arm/generic_timer.c | 118 +++++++++++++++++++++++--------------------- 1 file changed, 63 insertions(+), 55 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index 0b48841c9960..36747441ec88 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -97,9 +97,16 @@ __FBSDID("$FreeBSD$"); #define GT_CNTKCTL_PL0VCTEN (1 << 1) /* PL0 CNTVCT and CNTFRQ access */ #define GT_CNTKCTL_PL0PCTEN (1 << 0) /* PL0 CNTPCT and CNTFRQ access */ +struct arm_tmr_softc; + +struct arm_tmr_irq { + struct resource *res; + void *ihl; + int rid; +}; + struct arm_tmr_softc { - struct resource *res[GT_IRQ_COUNT]; - void *ihl[GT_IRQ_COUNT]; + struct arm_tmr_irq irqs[GT_IRQ_COUNT]; uint64_t (*get_cntxct)(bool); uint32_t clkfreq; struct eventtimer et; @@ -108,16 +115,6 @@ struct arm_tmr_softc { static struct arm_tmr_softc *arm_tmr_sc = NULL; -#ifdef DEV_ACPI -static struct resource_spec timer_acpi_spec[] = { - { SYS_RES_IRQ, GT_PHYS_SECURE, RF_ACTIVE | RF_OPTIONAL }, - { SYS_RES_IRQ, GT_PHYS_NONSECURE, RF_ACTIVE }, - { SYS_RES_IRQ, GT_VIRT, RF_ACTIVE }, - { SYS_RES_IRQ, GT_HYP_PHYS, RF_ACTIVE | RF_OPTIONAL }, - { -1, 0 } -}; -#endif - static const struct arm_tmr_irq_defs { int idx; const char *name; @@ -402,6 +399,29 @@ arm_tmr_intr(void *arg) return (FILTER_HANDLED); } +static int +arm_tmr_attach_irq(device_t dev, struct arm_tmr_softc *sc, + const struct arm_tmr_irq_defs *irq_def, int rid, int flags) +{ + sc->irqs[irq_def->idx].res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, flags); + if (sc->irqs[irq_def->idx].res == NULL) { + if (bootverbose || (flags & RF_OPTIONAL) == 0) { + device_printf(dev, + "could not allocate irq for %s interrupt '%s'\n", + (flags & RF_OPTIONAL) != 0 ? "optional" : + "required", irq_def->name); + } + + if ((flags & RF_OPTIONAL) == 0) + return (ENXIO); + } else if (bootverbose) { + device_printf(dev, "allocated irq for '%s'\n", irq_def->name); + } + + return (0); +} + #ifdef FDT static int arm_tmr_fdt_probe(device_t dev) @@ -479,42 +499,18 @@ arm_tmr_fdt_attach(device_t dev) flags &= ~RF_OPTIONAL; } - sc->res[irq_def->idx] = bus_alloc_resource_any(dev, - SYS_RES_IRQ, &rid, flags); - - if (sc->res[irq_def->idx] == NULL) { - device_printf(dev, - "could not allocate irq for %s interrupt '%s'\n", - (flags & RF_OPTIONAL) != 0 ? "optional" : - "required", irq_def->name); - - if ((flags & RF_OPTIONAL) == 0) { - error = ENXIO; - goto out; - } - - continue; - } - - if (bootverbose) { - device_printf(dev, - "allocated irq for '%s'\n", irq_def->name); - } + error = arm_tmr_attach_irq(dev, sc, irq_def, rid, flags); + if (error != 0) + goto out; } error = arm_tmr_attach(dev); out: if (error != 0) { for (i = 0; i < GT_IRQ_COUNT; i++) { - if (sc->res[i] != NULL) { - /* - * rid may not match the index into sc->res in - * a number of cases; e.g., optional sec-phys or - * interrupt-names specifying them in a - * different order than expected. - */ + if (sc->irqs[i].res != NULL) { bus_release_resource(dev, SYS_RES_IRQ, - rman_get_rid(sc->res[i]), sc->res[i]); + sc->irqs[i].rid, sc->irqs[i].res); } } } @@ -578,18 +574,29 @@ arm_tmr_acpi_probe(device_t dev) static int arm_tmr_acpi_attach(device_t dev) { + const struct arm_tmr_irq_defs *irq_def; struct arm_tmr_softc *sc; int error; sc = device_get_softc(dev); - if (bus_alloc_resources(dev, timer_acpi_spec, sc->res)) { - device_printf(dev, "could not allocate resources\n"); - return (ENXIO); + for (int i = 0; i < nitems(arm_tmr_irq_defs); i++) { + irq_def = &arm_tmr_irq_defs[i]; + error = arm_tmr_attach_irq(dev, sc, irq_def, irq_def->idx, + irq_def->flags); + if (error != 0) + goto out; } error = arm_tmr_attach(dev); - if (error != 0) - bus_release_resources(dev, timer_acpi_spec, sc->res); +out: + if (error != 0) { + for (int i = 0; i < GT_IRQ_COUNT; i++) { + if (sc->irqs[i].res != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, + sc->irqs[i].rid, sc->irqs[i].res); + } + } + } return (error); } #endif @@ -643,13 +650,13 @@ arm_tmr_attach(device_t dev) for (i = 0; i < nitems(arm_tmr_irq_defs); i++) { irq_def = &arm_tmr_irq_defs[i]; - MPASS(sc->res[irq_def->idx] != NULL || + MPASS(sc->irqs[irq_def->idx].res != NULL || (irq_def->flags & RF_OPTIONAL) != 0); } #ifdef __aarch64__ /* Use the virtual timer if we have one. */ - if (sc->res[GT_VIRT] != NULL) { + if (sc->irqs[GT_VIRT].res != NULL) { sc->physical = false; first_timer = GT_VIRT; last_timer = GT_VIRT; @@ -667,24 +674,25 @@ arm_tmr_attach(device_t dev) /* Setup secure, non-secure and virtual IRQs handler */ for (i = first_timer; i <= last_timer; i++) { /* If we do not have the interrupt, skip it. */ - if (sc->res[i] == NULL) + if (sc->irqs[i].res == NULL) continue; - error = bus_setup_intr(dev, sc->res[i], INTR_TYPE_CLK, - arm_tmr_intr, NULL, sc, &sc->ihl[i]); + error = bus_setup_intr(dev, sc->irqs[i].res, INTR_TYPE_CLK, + arm_tmr_intr, NULL, sc, &sc->irqs[i].ihl); if (error) { device_printf(dev, "Unable to alloc int resource.\n"); for (int j = first_timer; j < i; j++) - bus_teardown_intr(dev, sc->res[j], &sc->ihl[j]); + bus_teardown_intr(dev, sc->irqs[j].res, + &sc->irqs[j].ihl); return (ENXIO); } } /* Disable the virtual timer until we are ready */ - if (sc->res[GT_VIRT] != NULL) + if (sc->irqs[GT_VIRT].res != NULL) arm_tmr_disable(false); /* And the physical */ - if ((sc->res[GT_PHYS_SECURE] != NULL || - sc->res[GT_PHYS_NONSECURE] != NULL) && HAS_PHYS) + if ((sc->irqs[GT_PHYS_SECURE].res != NULL || + sc->irqs[GT_PHYS_NONSECURE].res != NULL) && HAS_PHYS) arm_tmr_disable(true); arm_tmr_timecount.tc_frequency = sc->clkfreq; From nobody Wed Mar 15 12:01:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pc8B60rH5z3yRDf; Wed, 15 Mar 2023 12:01: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 4Pc8B603Bkz4F7R; Wed, 15 Mar 2023 12:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678881678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aRYf28S4DotnGRb8f0rB4+d4UYxeRJaeepAwF0O72Xg=; b=wjgiYz+QTFxnV+W5I89uWEC3I2SM42uQa9gGultYkxu7yiJPDAPrRnjUnx+l9okEUhmz4B yfR3U5v+Pn8OV5JL/EKY7leTJNwONJ8VtSwehXVW0An8bzOpsdqA+c0uqFtRGt//WN0Zcf RW9ufyq01f2WuYvGyuQo3BaskvYBn2K5AJilNstRPtHALSFtm4MU2XnB6LM35vKpxIpomM Vf4l5b+QOnaRKkGeZH3HQKHDWpzQ5gaLX3JH57ldjzkuv5qQwK7NUHR/XGwMH1FIHL0WXL fUYKgcR+ux3wrzqU3g47jlpctH+XxgKjfI24mQLZtPc8rc59A4C/dceCIbyBmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678881678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aRYf28S4DotnGRb8f0rB4+d4UYxeRJaeepAwF0O72Xg=; b=dy1BUQtEGwj6EbKN17KaISCwWP1fQOTal+Yy33Z3QzOVZXR38DMZMek9NpaACBjolONskk yM3Wunvh1rxRhrUb+W9oDW8MMwkJxAy2HWji3ZSf4dJMX9izKV05vKGomhrVXdIp99+TwK zgiI7EtFtjrI2GmNjWfmv8p8GH6WVFWSsbcP3tylFvZ+x//g3fZm930Wr6pb1sEBljRfGk Njd8ZjcYP+VgK2qPa9lQBgw/BoGccKQ7jYzQJ/MGAWuf4ryYOZCaYwp5xZSRYk+a5xPB0j 9E+e+KS9ybzftW5P9yJUN5EeSdO5zlz695USSe7e2R287zs0kY9xpcFo2JMZIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678881678; a=rsa-sha256; cv=none; b=ZhXryQBUolHyA+yQDbrgMFPceh5GLsOfcHzeLIO8vRz6la4K1Q04K2ub66R/iQbGenRquk wn5vyxPTpjDsHBmQ0z8v0J4s+ZCdysqQiqvupL9L55qVNwa08ctaT4tpV5DfFoNOxjyzGo Jc8gLAMUWS+MNsrvlN2dGZonVvZJYrmU+zU/xbbkRgHVxt9gx+pom6G4iqiLAioJe8V3Mv pn6lyEU2GyfKfbFgfLr2FRX5iiEdnwthAxarfhP5DiOil6N8lt5Xrkr9MrC/DatZfzGP5p RXbZvdRT1wABccG350MIJgMwj75jQQ6ajhDh1bqdHORQdQQHbHL9igDYaPFbqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pc8B565Sqz1Fp5; Wed, 15 Mar 2023 12:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FC1Hu0096776; Wed, 15 Mar 2023 12:01:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FC1H31096775; Wed, 15 Mar 2023 12:01:17 GMT (envelope-from git) Date: Wed, 15 Mar 2023 12:01:17 GMT Message-Id: <202303151201.32FC1H31096775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 6419b48f7d7f - main - Support arm64 stage2 TLB invalidation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6419b48f7d7f3d9048c59945d4ba9ed1b59bb87c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=6419b48f7d7f3d9048c59945d4ba9ed1b59bb87c commit 6419b48f7d7f3d9048c59945d4ba9ed1b59bb87c Author: Andrew Turner AuthorDate: 2022-11-03 16:01:37 +0000 Commit: Andrew Turner CommitDate: 2023-03-15 11:34:32 +0000 Support arm64 stage2 TLB invalidation To invalidate stage 2 mappings on arm64 we may need to call into the hypervisor so add a function pointer that bhyve can use to implement this. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37254 --- sys/arm64/arm64/pmap.c | 83 ++++++++++++++++++++++++++++++++++++++---------- sys/arm64/include/pmap.h | 3 ++ 2 files changed, 69 insertions(+), 17 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 357584e22875..a272bf5756ae 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -402,6 +402,8 @@ SYSCTL_INT(_vm_pmap_vmid, OID_AUTO, epoch, CTLFLAG_RD, &vmids.asid_epoch, 0, void (*pmap_clean_stage2_tlbi)(void); void (*pmap_invalidate_vpipt_icache)(void); +void (*pmap_stage2_invalidate_range)(uint64_t, vm_offset_t, vm_offset_t, bool); +void (*pmap_stage2_invalidate_all)(uint64_t); /* * A pmap's cookie encodes an ASID and epoch number. Cookies for reserved @@ -1549,6 +1551,24 @@ pmap_s1_invalidate_page(pmap_t pmap, vm_offset_t va, bool final_only) isb(); } +static __inline void +pmap_s2_invalidate_page(pmap_t pmap, vm_offset_t va, bool final_only) +{ + PMAP_ASSERT_STAGE2(pmap); + MPASS(pmap_stage2_invalidate_range != NULL); + pmap_stage2_invalidate_range(pmap_to_ttbr0(pmap), va, va + PAGE_SIZE, + final_only); +} + +static __inline void +pmap_invalidate_page(pmap_t pmap, vm_offset_t va, bool final_only) +{ + if (pmap->pm_stage == PM_STAGE1) + pmap_s1_invalidate_page(pmap, va, final_only); + else + pmap_s2_invalidate_page(pmap, va, final_only); +} + /* * Invalidates any cached final- and optionally intermediate-level TLB entries * for the specified virtual address range in the given virtual address space. @@ -1578,6 +1598,25 @@ pmap_s1_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, isb(); } +static __inline void +pmap_s2_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + bool final_only) +{ + PMAP_ASSERT_STAGE2(pmap); + MPASS(pmap_stage2_invalidate_range != NULL); + pmap_stage2_invalidate_range(pmap_to_ttbr0(pmap), sva, eva, final_only); +} + +static __inline void +pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + bool final_only) +{ + if (pmap->pm_stage == PM_STAGE1) + pmap_s1_invalidate_range(pmap, sva, eva, final_only); + else + pmap_s2_invalidate_range(pmap, sva, eva, final_only); +} + /* * Invalidates all cached intermediate- and final-level TLB entries for the * given virtual address space. @@ -1600,6 +1639,23 @@ pmap_s1_invalidate_all(pmap_t pmap) isb(); } +static __inline void +pmap_s2_invalidate_all(pmap_t pmap) +{ + PMAP_ASSERT_STAGE2(pmap); + MPASS(pmap_stage2_invalidate_all != NULL); + pmap_stage2_invalidate_all(pmap_to_ttbr0(pmap)); +} + +static __inline void +pmap_invalidate_all(pmap_t pmap) +{ + if (pmap->pm_stage == PM_STAGE1) + pmap_s1_invalidate_all(pmap); + else + pmap_s2_invalidate_all(pmap); +} + /* * Routine: pmap_extract * Function: @@ -2046,7 +2102,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); pmap_unwire_l3(pmap, va, l1pg, free); } - pmap_s1_invalidate_page(pmap, va, false); + pmap_invalidate_page(pmap, va, false); /* * Put page on a list so that it is released after @@ -3347,7 +3403,7 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_offset_t sva, for (l3 = pmap_l2_to_l3(&l2e, sva); sva != eva; l3++, sva += L3_SIZE) { if (!pmap_l3_valid(pmap_load(l3))) { if (va != eva) { - pmap_s1_invalidate_range(pmap, va, sva, true); + pmap_invalidate_range(pmap, va, sva, true); va = eva; } continue; @@ -3374,7 +3430,7 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_offset_t sva, * still provides access to that page. */ if (va != eva) { - pmap_s1_invalidate_range(pmap, va, + pmap_invalidate_range(pmap, va, sva, true); va = eva; } @@ -3405,7 +3461,7 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_offset_t sva, va = sva; } if (va != eva) - pmap_s1_invalidate_range(pmap, va, sva, true); + pmap_invalidate_range(pmap, va, sva, true); } /* @@ -4311,12 +4367,6 @@ havel3: * Is the specified virtual address already mapped? */ if (pmap_l3_valid(orig_l3)) { - /* - * Only allow adding new entries on stage 2 tables for now. - * This simplifies cache invalidation as we may need to call - * into EL2 to perform such actions. - */ - PMAP_ASSERT_STAGE1(pmap); /* * Wiring change, just update stats. We don't worry about * wiring PT pages as they remain resident as long as there @@ -4371,7 +4421,7 @@ havel3: if (pmap_pte_dirty(pmap, orig_l3)) vm_page_dirty(om); if ((orig_l3 & ATTR_AF) != 0) { - pmap_s1_invalidate_page(pmap, va, true); + pmap_invalidate_page(pmap, va, true); vm_page_aflag_set(om, PGA_REFERENCED); } CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); @@ -4386,7 +4436,7 @@ havel3: } else { KASSERT((orig_l3 & ATTR_AF) != 0, ("pmap_enter: unmanaged mapping lacks ATTR_AF")); - pmap_s1_invalidate_page(pmap, va, true); + pmap_invalidate_page(pmap, va, true); } orig_l3 = 0; } else { @@ -4439,12 +4489,11 @@ validate: * Update the L3 entry */ if (pmap_l3_valid(orig_l3)) { - PMAP_ASSERT_STAGE1(pmap); KASSERT(opa == pa, ("pmap_enter: invalid update")); if ((orig_l3 & ~ATTR_AF) != (new_l3 & ~ATTR_AF)) { /* same PA, different attributes */ orig_l3 = pmap_load_store(l3, new_l3); - pmap_s1_invalidate_page(pmap, va, true); + pmap_invalidate_page(pmap, va, true); if ((orig_l3 & ATTR_SW_MANAGED) != 0 && pmap_pte_dirty(pmap, orig_l3)) vm_page_dirty(m); @@ -5588,7 +5637,7 @@ pmap_remove_pages(pmap_t pmap) } if (lock != NULL) rw_wunlock(lock); - pmap_s1_invalidate_all(pmap); + pmap_invalidate_all(pmap); free_pv_chunk_batch(free_chunks); PMAP_UNLOCK(pmap); vm_page_free_pages_toq(&free, true); @@ -5913,7 +5962,7 @@ retry: (uintptr_t)pmap) & (Ln_ENTRIES - 1)) == 0 && (tpte & ATTR_SW_WIRED) == 0) { pmap_clear_bits(pte, ATTR_AF); - pmap_s1_invalidate_page(pmap, va, true); + pmap_invalidate_page(pmap, va, true); cleared++; } else not_cleared++; @@ -5954,7 +6003,7 @@ small_mappings: if ((tpte & ATTR_AF) != 0) { if ((tpte & ATTR_SW_WIRED) == 0) { pmap_clear_bits(pte, ATTR_AF); - pmap_s1_invalidate_page(pmap, pv->pv_va, true); + pmap_invalidate_page(pmap, pv->pv_va, true); cleared++; } else not_cleared++; diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index f61725e21b7c..eb72f46668c3 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -172,6 +172,9 @@ struct pcb *pmap_switch(struct thread *); extern void (*pmap_clean_stage2_tlbi)(void); extern void (*pmap_invalidate_vpipt_icache)(void); +extern void (*pmap_stage2_invalidate_range)(uint64_t, vm_offset_t, vm_offset_t, + bool); +extern void (*pmap_stage2_invalidate_all)(uint64_t); static inline int pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) From nobody Wed Mar 15 13:55:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcBkR2FZrz3yYVf; Wed, 15 Mar 2023 13:55: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 4PcBkR1jfVz4QsV; Wed, 15 Mar 2023 13:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678888559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lBaK6hD7Yw17Smk+jhpYKuYk8kf4mQcYyC/A+3nMmxQ=; b=JuPJUUZoQqikP6rBr9DktUTH55kY71P511nG5igkJ3ZcOwGrYF/VhD1mNoJ8KSaWDG1ttS KnuICbq1HekmBtZw8HvMkVfeirMwbC1aH52MFdYNsshPY7iWy4vErZ9FiThWwDQsGkRdPd Fe8POF816gfuhpKFKpaRNhNmf5sHAj3/MBjHPhmz9Y834YhIzryh+CwgTkQKZDGNgEZRkB JbYdWDUNzNdzs8p++LKHarlaXVrOWdeCAKFgc0ykoU0J1d87qd5M6a1Femzw07iQKXnfo9 HdUBw6gfzctENxR78YJk/N5glYQ6/NHGyacjBG0STUh6n20cIS310MgkgT1kpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678888559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lBaK6hD7Yw17Smk+jhpYKuYk8kf4mQcYyC/A+3nMmxQ=; b=Cb4uBkd7sezINFuF1O9Ctgz/+iHgrFlnbOW8whcgTSPurha1KsqguA66LbUpt2rAVu2guZ 3b9M5Is5ynrLqSqZ45M7W08vWeQhr7wKKhRDuTEyzOL1a6d/Gr8ZxHF1lmLDq38lhzyuPv 33+xE1b8HhCFFq0CP/0x7AIz56ohEPEoHIS+3477mZ5tefM1EG4iBVpTqGcQAuNmaBEOFe jOK3EbfjpzPZBILN6Nr9ulWiN8F+WuTeRgPEBRd8bcyVfe4HDFxXSaJlfhLSfxHD/5vuvP N8huQYiaEdTJEsuraEwmAzGI7Auo9ZWcw/YXT+/jJW86qKP5eIjPFB1UhtZ/JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678888559; a=rsa-sha256; cv=none; b=HZpr9BzL3wTEU4dfOmSkT3p/C0nOGT1XC1aWU+5qKQzP+79VDquxOaVpamZvVMpquGO/jo xUGpk/LYycehT04XuzzntRyen6ad/RBX2otmeXi3vIf3XPEGDK7LQqCdf7ZV1ZMk1fXv6P AAE9VvlhbNGq8NPICeQpdfSgbjO3kOWHm+ToEiAnWHh5RqFZHxRzxXfux87tRXzNQ7mGow LjLT0bva2iFZ6ukQfZL93nD1Lr3t9HLqnLBcb5pa5eFo5nvlhehXaIoFgvrcEl4IdTRFV/ cU4cnbIRf97GuEHmgtcNOBUODffAF7u47RYCpI15HcFWtb01X2pV2kgGrMzNEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcBkR0RPfz1JMf; Wed, 15 Mar 2023 13:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FDtw2r078579; Wed, 15 Mar 2023 13:55:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FDtw0e078577; Wed, 15 Mar 2023 13:55:58 GMT (envelope-from git) Date: Wed, 15 Mar 2023 13:55:58 GMT Message-Id: <202303151355.32FDtw0e078577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 83b5c80c6923 - main - net: refactor if_clone.c #1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83b5c80c69232da4254250fcd94b2d377356acd7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=83b5c80c69232da4254250fcd94b2d377356acd7 commit 83b5c80c69232da4254250fcd94b2d377356acd7 Author: Alexander V. Chernikov AuthorDate: 2023-03-13 10:41:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-03-15 13:54:22 +0000 net: refactor if_clone.c #1 * Add ifc_find_cloner() * Rename current ifc_find_cloner() to ifc_find_cloner_in_vnet() * Add ifc_find_cloner_match() This change simplifies the code a bit and reduces the diff to the netlink interface cloners merge (D39032). Reviewed by: glebius, kp Differential Revision: https://reviews.freebsd.org/D39046 MFC after: 2 weeks --- sys/net/if_clone.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 7dcb3c271e42..59d60645cb89 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -109,6 +109,8 @@ static int if_clone_createif(struct if_clone *ifc, char *name, size_t len, static int ifc_simple_match(struct if_clone *ifc, const char *name); static int ifc_handle_unit(struct if_clone *ifc, char *name, size_t len, int *punit); +static struct if_clone *ifc_find_cloner(const char *name); +static struct if_clone *ifc_find_cloner_match(const char *name); #ifdef CLONE_COMPAT_13 static int ifc_simple_create_wrapper(struct if_clone *ifc, char *name, size_t maxlen, @@ -195,13 +197,7 @@ ifc_create_ifp(const char *name, struct ifc_data *ifd, int error; /* Try to find an applicable cloner for this request */ - IF_CLONERS_LOCK(); - LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { - if (ifc->ifc_match(ifc, name)) - break; - } - IF_CLONERS_UNLOCK(); - + ifc = ifc_find_cloner_match(name); if (ifc == NULL) return (EINVAL); @@ -266,11 +262,25 @@ ifc_unlink_ifp(struct if_clone *ifc, struct ifnet *ifp) } static struct if_clone * -ifc_find_cloner(const char *name, struct vnet *vnet) +ifc_find_cloner_match(const char *name) +{ + struct if_clone *ifc; + + IF_CLONERS_LOCK(); + LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { + if (ifc->ifc_match(ifc, name)) + break; + } + IF_CLONERS_UNLOCK(); + + return (ifc); +} + +static struct if_clone * +ifc_find_cloner(const char *name) { struct if_clone *ifc; - CURVNET_SET_QUIET(vnet); IF_CLONERS_LOCK(); LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { if (strcmp(ifc->ifc_name, name) == 0) { @@ -278,6 +288,15 @@ ifc_find_cloner(const char *name, struct vnet *vnet) } } IF_CLONERS_UNLOCK(); + + return (ifc); +} + +static struct if_clone * +ifc_find_cloner_in_vnet(const char *name, struct vnet *vnet) +{ + CURVNET_SET_QUIET(vnet); + struct if_clone *ifc = ifc_find_cloner(name); CURVNET_RESTORE(); return (ifc); @@ -326,7 +345,7 @@ if_clone_destroy(const char *name) if (ifp == NULL) return (ENXIO); - ifc = ifc_find_cloner(ifp->if_dname, ifp->if_home_vnet); + ifc = ifc_find_cloner_in_vnet(ifp->if_dname, ifp->if_home_vnet); if (ifc == NULL) { if_rele(ifp); return (EINVAL); From nobody Wed Mar 15 14:49:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcCvr5YMkz3yc5c; Wed, 15 Mar 2023 14:49: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 4PcCvr4rWMz4V6b; Wed, 15 Mar 2023 14:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678891752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a4m8QMDsRYVbqSF+etTTb/tFD+xtlO9/0eB7i5yUOzY=; b=U2KjpOBWGHdDFP67ksUvgVsrUPhv09elZUBKpIqlnlFo1HXllVAGB58MLD4jqiO8gL6nzQ OevweK5itf5aBgVkr8J4zryVE8hz0xyuJz3mxY8XohzPC8sy4x38p6kGYijEucRsE1i1kK MBjgH+wT8EBWR4HX3w9SwQ65R/uI8sAsEEvKfoWD5cl0RpM6QOPkT3g0anpNS7jVBTw4ei 3uW1PcWFlCuGtyM/PaDV2GN/X7pFsZZ7SMETkfLkhogTxU4zyA0JmZ6DRugW/5t8zOeOjU i+wwJjZgiAGDX9Ughr8RWKumLF/UoHnccM8DN8EfMBfqazQ+ukgu78bP2m19RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678891752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a4m8QMDsRYVbqSF+etTTb/tFD+xtlO9/0eB7i5yUOzY=; b=SB4mW98GfbxaLe2pACnhNJUd02atEGGiBc0hkP0krdFeTLjuX7xd8oX4IhwXlqMGMdk/fm ZpUqVwhkQCSH1HRYsGcH6O7MBcgWKnzV1kLcTCKvhchwFUl2fTJXpe7J9F97bcJCH73x16 MOsXCHnz1FofF94xI4CPbZKpgYvusmMxXvy8VdRIvKYtaGQLZK9vq0vN0AnlnkugsoP4wY TC6glZziBeQL8lfe7Gr1GyMCeQKmkTxfpAl/vqDWV5edFDlGLHPH3bZzhzOxIdoeIemOla UJDy+nkHwHZvvK71V3L2yuHx6jZ/nupEoXeucR8pQ5H0A+NPfm0f+xgSyRuUAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678891752; a=rsa-sha256; cv=none; b=I4kur4/bGMKu2YhQ2VXNUS736IUGWB2GCTvZDsvHazNvYbRd04GPAXmu+7rKXmc4X03KY5 N/WSLUJ/4CNbu2OztFbTHzqvXhf4oUz9nUAan1rertEWGQl+3VCfCwptQGjhOid3qngKT4 KzdPCKRKpZ9QmSBzL/m2Q8q+Hii/yXWyNHrbe+EgauB3ctWftL15WNC2ZmMTt8nbSnTw93 YS6tgxbXcpXlXhIxfm9GfC9hlS5wOrX7LXd9V3wYecgiWkb7zf+eusscUk1VmvDxfd95L1 jl7nJQdwNeOcclbAFiEtimdFReT0wzUBdPOSi/uGXMU87le+UoqyyFqB0u5JrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcCvr3ZzSz1KTJ; Wed, 15 Mar 2023 14:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FEnCnN060791; Wed, 15 Mar 2023 14:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FEnC6K060790; Wed, 15 Mar 2023 14:49:12 GMT (envelope-from git) Date: Wed, 15 Mar 2023 14:49:12 GMT Message-Id: <202303151449.32FEnC6K060790@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: 6b488550ee57 - releng/13.2 - epair: Avoid loading m_flags into a short List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 6b488550ee57dc09b7d564aa22f9feb61778a89f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6b488550ee57dc09b7d564aa22f9feb61778a89f commit 6b488550ee57dc09b7d564aa22f9feb61778a89f Author: Mark Johnston AuthorDate: 2023-03-06 14:39:17 +0000 Commit: Mark Johnston CommitDate: 2023-03-15 13:39:34 +0000 epair: Avoid loading m_flags into a short The m_flags field of struct mbuf is 24 bits wide and so gets truncated in a couple of places in the epair code. Instead of preserving the entire flag set, just remember whether M_BCAST or M_MCAST is set. Approved by: re (cperciva) MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit 48227d1c6db8fceaceebbf8578612302d64ca170) (cherry picked from commit c3bd32f225ec093ba0f7cd7fc1a000b02aad5211) --- sys/net/if_epair.c | 97 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 42 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index e7257f5fa551..e2c61f83d940 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -188,39 +188,14 @@ epair_tx_start_deferred(void *arg, int pending) if_rele(sc->ifp); } -static int -epair_menq(struct mbuf *m, struct epair_softc *osc) +static struct epair_queue * +epair_select_queue(struct epair_softc *sc, struct mbuf *m) { - struct ifnet *ifp, *oifp; - int len, ret; - int ridx; - short mflags; - struct epair_queue *q = NULL; uint32_t bucket; #ifdef RSS struct ether_header *eh; -#endif - - /* - * I know this looks weird. We pass the "other sc" as we need that one - * and can get both ifps from it as well. - */ - oifp = osc->ifp; - ifp = osc->oifp; - - M_ASSERTPKTHDR(m); - epair_clear_mbuf(m); - if_setrcvif(m, oifp); - M_SETFIB(m, oifp->if_fib); - - /* Save values as once the mbuf is queued, it's not ours anymore. */ - len = m->m_pkthdr.len; - mflags = m->m_flags; - - MPASS(m->m_nextpkt == NULL); - MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); + int ret; -#ifdef RSS ret = rss_m2bucket(m, &bucket); if (ret) { /* Actually hash the packet. */ @@ -242,11 +217,47 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) break; } } - bucket %= osc->num_queues; + bucket %= sc->num_queues; #else bucket = 0; #endif - q = &osc->queues[bucket]; + return (&sc->queues[bucket]); +} + +static void +epair_prepare_mbuf(struct mbuf *m, struct ifnet *src_ifp) +{ + M_ASSERTPKTHDR(m); + epair_clear_mbuf(m); + if_setrcvif(m, src_ifp); + M_SETFIB(m, src_ifp->if_fib); + + MPASS(m->m_nextpkt == NULL); + MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); +} + +static void +epair_menq(struct mbuf *m, struct epair_softc *osc) +{ + struct ifnet *ifp, *oifp; + int len, ret; + int ridx; + bool mcast; + + /* + * I know this looks weird. We pass the "other sc" as we need that one + * and can get both ifps from it as well. + */ + oifp = osc->ifp; + ifp = osc->oifp; + + epair_prepare_mbuf(m, oifp); + + /* Save values as once the mbuf is queued, it's not ours anymore. */ + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_BCAST | M_MCAST)) != 0; + + struct epair_queue *q = epair_select_queue(osc, m); atomic_set_long(&q->state, (1 << BIT_MBUF_QUEUED)); ridx = atomic_load_int(&q->ridx); @@ -255,7 +266,7 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) /* Ring is full. */ if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); m_freem(m); - return (0); + return; } if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); @@ -265,15 +276,13 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) * the logic another time. */ if_inc_counter(ifp, IFCOUNTER_OBYTES, len); - if (mflags & (M_BCAST|M_MCAST)) + if (mcast) if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); /* Someone else received the packet. */ if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); if (!atomic_testandset_long(&q->state, BIT_QUEUE_TASK)) - taskqueue_enqueue(epair_tasks.tq[bucket], &q->tx_task); - - return (0); + taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); } static void @@ -317,8 +326,10 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) { struct epair_softc *sc; struct ifnet *oifp; - int error, len; - short mflags; +#ifdef ALTQ + int len; + bool mcast; +#endif if (m == NULL) return (0); @@ -355,10 +366,12 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) m_freem(m); return (0); } - len = m->m_pkthdr.len; - mflags = m->m_flags; #ifdef ALTQ + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_BCAST | M_MCAST)) != 0; + int error = 0; + /* Support ALTQ via the classic if_start() path. */ IF_LOCK(&ifp->if_snd); if (ALTQ_IS_ENABLED(&ifp->if_snd)) { @@ -368,7 +381,7 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) IF_UNLOCK(&ifp->if_snd); if (!error) { if_inc_counter(ifp, IFCOUNTER_OBYTES, len); - if (mflags & (M_BCAST|M_MCAST)) + if (mcast) if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); epair_start(ifp); } @@ -377,8 +390,8 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) IF_UNLOCK(&ifp->if_snd); #endif - error = epair_menq(m, oifp->if_softc); - return (error); + epair_menq(m, oifp->if_softc); + return (0); } static int From nobody Wed Mar 15 14:49:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcCvs6V1zz3yc08; Wed, 15 Mar 2023 14:49: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 4PcCvs5jT3z4V2C; Wed, 15 Mar 2023 14:49:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678891753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PIxjPJV+PhDxmyrGCG/rtThg2e7hIy6t4FfEU3B9iys=; b=UhnZJzRq1eYJ+0Mnae7WyWLPALaG0qAfzkS50ihZuXITp7syy2tS35YAr6RlPBjn0Es7Un tor4PZtht4+iL/6UoZTpyQzHGydoOO7kOlt356GB0IncFoha3xtNHr4FiTYWTN1/Q+JmLx JRhHeUBaVjqhPos4uVyH0mdW4f2L4+V3e8yFO2Ed5yiqSBNMMPErDBEDiICr0K5NMPEfQS g7ylco4LAeRX3wEOgTyedBq9LeRI1UdIeBKLuk+xllmdDsFecck7tFdYHH3OLYoBZVYOFH TAGTIV/il5u1iWlP8E8AU2WJc3GjZH1olRrFA6ChbmhHuISXNTCOLS1cD1Pw5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678891753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PIxjPJV+PhDxmyrGCG/rtThg2e7hIy6t4FfEU3B9iys=; b=DyZKDpeh8L2Vczut3+t+UpFLoSHzCpxT3kTQdqAbk9iEtm/55TZKlVWsGQS8wDLh60tu0h z9024ENA4+3EbmgwFxH0pivZxu8jDDnz9IiahqYrzrZ6ESkkA0LmrmAUbjBPw8B8RQWYW+ iZSZeDcLHv2c9a7g1/cXZnv8uCS0/WtihCm6SSv04gRIHrH6PL+pyVv44QcEUF+W/DhI2s 4Rtg25U7ip3k4ELa7WmD5SO7YyvVqAGKEIWP/q1dSu/NwrHGeAgU6aAmhYJRuANNCu6pFk yBBWLd7qTJEIjqUSencmgeqOyfoxJYj95ttiVmBeWZIC0mqT6njTQ+dek/3FjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678891753; a=rsa-sha256; cv=none; b=QCFkmwUk6pyu8UzZSgYCLG71U2c8HIV/gZDDETK9zOUZeg2VsnctleBLt4WTCCe3DJdirg CaC0o+6U4GJGZrn2zIwoOt6WTbHBcsg+9+mBSwVc9jnDQX2dhf7iZITx+gSVvJb6HksJNY mP018AD+Y+md1h8OlK7n2Wukd10p1KS3Hi6uOnJ1sxiTnek6mlVyUPdFzEJpf0ygoLEfUO +3DktJBOcEMI3PrtKGofL61pBY4WLXzYqQPOmYNd6rzFhNTYrEw08bQkXU89Bd5/qT0jUS HBv3Kpbqg8sPv/pdOEH4btWDZyleRNJiPJX1cBagJwC6jVALnR5cJjOg2jffcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcCvs4TW3z1Kr4; Wed, 15 Mar 2023 14:49:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FEnDvv060811; Wed, 15 Mar 2023 14:49:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FEnDmV060810; Wed, 15 Mar 2023 14:49:13 GMT (envelope-from git) Date: Wed, 15 Mar 2023 14:49:13 GMT Message-Id: <202303151449.32FEnDmV060810@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: 5e49311e0177 - releng/13.2 - epair: Simplify the transmit path and address lost wakeups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 5e49311e0177932e0f0323fd547eedb4e50bbb4d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5e49311e0177932e0f0323fd547eedb4e50bbb4d commit 5e49311e0177932e0f0323fd547eedb4e50bbb4d Author: Mark Johnston AuthorDate: 2023-03-01 20:21:30 +0000 Commit: Mark Johnston CommitDate: 2023-03-15 13:39:55 +0000 epair: Simplify the transmit path and address lost wakeups epairs currently shuttle all transmitted packets through a single global taskqueue thread. To hand packets over to the taskqueue thread, each epair maintains a pair of ring buffers and a lockless scheme for notifying the thread of pending work. The implementation can lead to lost wakeups, causing to-be-transmitted packets to end up stuck in the queue. Rather than extending the existing scheme, simply replace it with a linked list protected by a mutex, and use the mutex to synchronize wakeups of the taskqueue thread. This appears to give equivalent or better throughput with >= 16 producer threads and eliminates the lost wakeups. Approved by: re (cperciva) Reviewed by: kp MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D38843 (cherry picked from commit df7bbd8c354a907d2c2f85a6e18f356f76458f57) (cherry picked from commit 762ad964ee346cffdbf3eaa6ff87fa5b32d30738) --- sys/net/if_epair.c | 162 ++++++++++++++++++++++++++--------------------------- 1 file changed, 79 insertions(+), 83 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index e2c61f83d940..aebcaca0cd2f 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -104,15 +104,16 @@ static unsigned int next_index = 0; #define EPAIR_LOCK() mtx_lock(&epair_n_index_mtx) #define EPAIR_UNLOCK() mtx_unlock(&epair_n_index_mtx) -#define BIT_QUEUE_TASK 0 -#define BIT_MBUF_QUEUED 1 - struct epair_softc; struct epair_queue { + struct mtx mtx; + struct mbufq q; int id; - struct buf_ring *rxring[2]; - volatile int ridx; /* 0 || 1 */ - volatile long state; /* taskqueue coordination */ + enum { + EPAIR_QUEUE_IDLE, + EPAIR_QUEUE_WAKING, + EPAIR_QUEUE_RUNNING, + } state; struct task tx_task; struct epair_softc *sc; }; @@ -148,44 +149,49 @@ epair_clear_mbuf(struct mbuf *m) } static void -epair_if_input(struct epair_softc *sc, struct epair_queue *q, int ridx) +epair_tx_start_deferred(void *arg, int pending) { - struct ifnet *ifp; - struct mbuf *m; + struct epair_queue *q = (struct epair_queue *)arg; + if_t ifp; + struct mbuf *m, *n; + bool resched; + + ifp = q->sc->ifp; - ifp = sc->ifp; + if_ref(ifp); CURVNET_SET(ifp->if_vnet); - while (! buf_ring_empty(q->rxring[ridx])) { - m = buf_ring_dequeue_mc(q->rxring[ridx]); - if (m == NULL) - continue; - MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); - (*ifp->if_input)(ifp, m); + mtx_lock(&q->mtx); + m = mbufq_flush(&q->q); + q->state = EPAIR_QUEUE_RUNNING; + mtx_unlock(&q->mtx); + while (m != NULL) { + n = STAILQ_NEXT(m, m_stailqpkt); + m->m_nextpkt = NULL; + if_input(ifp, m); + m = n; } - CURVNET_RESTORE(); -} -static void -epair_tx_start_deferred(void *arg, int pending) -{ - struct epair_queue *q = (struct epair_queue *)arg; - struct epair_softc *sc = q->sc; - int ridx, nidx; - - if_ref(sc->ifp); - ridx = atomic_load_int(&q->ridx); - do { - nidx = (ridx == 0) ? 1 : 0; - } while (!atomic_fcmpset_int(&q->ridx, &ridx, nidx)); - epair_if_input(sc, q, ridx); - - atomic_clear_long(&q->state, (1 << BIT_QUEUE_TASK)); - if (atomic_testandclear_long(&q->state, BIT_MBUF_QUEUED)) + /* + * Avoid flushing the queue more than once per task. We can otherwise + * end up starving ourselves in a multi-epair routing configuration. + */ + mtx_lock(&q->mtx); + if (mbufq_len(&q->q) > 0) { + resched = true; + q->state = EPAIR_QUEUE_WAKING; + } else { + resched = false; + q->state = EPAIR_QUEUE_IDLE; + } + mtx_unlock(&q->mtx); + + if (resched) taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); - if_rele(sc->ifp); + CURVNET_RESTORE(); + if_rele(ifp); } static struct epair_queue * @@ -239,9 +245,9 @@ epair_prepare_mbuf(struct mbuf *m, struct ifnet *src_ifp) static void epair_menq(struct mbuf *m, struct epair_softc *osc) { + struct epair_queue *q; struct ifnet *ifp, *oifp; - int len, ret; - int ridx; + int error, len; bool mcast; /* @@ -257,32 +263,26 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) len = m->m_pkthdr.len; mcast = (m->m_flags & (M_BCAST | M_MCAST)) != 0; - struct epair_queue *q = epair_select_queue(osc, m); + q = epair_select_queue(osc, m); - atomic_set_long(&q->state, (1 << BIT_MBUF_QUEUED)); - ridx = atomic_load_int(&q->ridx); - ret = buf_ring_enqueue(q->rxring[ridx], m); - if (ret != 0) { - /* Ring is full. */ - if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); - m_freem(m); - return; + mtx_lock(&q->mtx); + if (q->state == EPAIR_QUEUE_IDLE) { + q->state = EPAIR_QUEUE_WAKING; + taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); } + error = mbufq_enqueue(&q->q, m); + mtx_unlock(&q->mtx); - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - /* - * IFQ_HANDOFF_ADJ/ip_handoff() update statistics, - * but as we bypass all this we have to duplicate - * the logic another time. - */ - if_inc_counter(ifp, IFCOUNTER_OBYTES, len); - if (mcast) - if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); - /* Someone else received the packet. */ - if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - - if (!atomic_testandset_long(&q->state, BIT_QUEUE_TASK)) - taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); + if (error != 0) { + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); + } else { + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); + if (mcast) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); + } } static void @@ -561,10 +561,9 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) for (int i = 0; i < sca->num_queues; i++) { struct epair_queue *q = &sca->queues[i]; q->id = i; - q->rxring[0] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); - q->rxring[1] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); - q->ridx = 0; - q->state = 0; + q->state = EPAIR_QUEUE_IDLE; + mtx_init(&q->mtx, "epaiq", NULL, MTX_DEF | MTX_NEW); + mbufq_init(&q->q, RXRSIZE); q->sc = sca; NET_TASK_INIT(&q->tx_task, 0, epair_tx_start_deferred, q); } @@ -584,10 +583,9 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) for (int i = 0; i < scb->num_queues; i++) { struct epair_queue *q = &scb->queues[i]; q->id = i; - q->rxring[0] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); - q->rxring[1] = buf_ring_alloc(RXRSIZE, M_EPAIR, M_WAITOK, NULL); - q->ridx = 0; - q->state = 0; + q->state = EPAIR_QUEUE_IDLE; + mtx_init(&q->mtx, "epaiq", NULL, MTX_DEF | MTX_NEW); + mbufq_init(&q->q, RXRSIZE); q->sc = scb; NET_TASK_INIT(&q->tx_task, 0, epair_tx_start_deferred, q); } @@ -707,18 +705,18 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) static void epair_drain_rings(struct epair_softc *sc) { - int ridx; - struct mbuf *m; + for (int i = 0; i < sc->num_queues; i++) { + struct epair_queue *q; + struct mbuf *m, *n; - for (ridx = 0; ridx < 2; ridx++) { - for (int i = 0; i < sc->num_queues; i++) { - struct epair_queue *q = &sc->queues[i]; - do { - m = buf_ring_dequeue_sc(q->rxring[ridx]); - if (m == NULL) - break; - m_freem(m); - } while (1); + q = &sc->queues[i]; + mtx_lock(&q->mtx); + m = mbufq_flush(&q->q); + mtx_unlock(&q->mtx); + + for (; m != NULL; m = n) { + n = m->m_nextpkt; + m_freem(m); } } } @@ -764,8 +762,7 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) ifmedia_removeall(&scb->media); for (int i = 0; i < scb->num_queues; i++) { struct epair_queue *q = &scb->queues[i]; - buf_ring_free(q->rxring[0], M_EPAIR); - buf_ring_free(q->rxring[1], M_EPAIR); + mtx_destroy(&q->mtx); } free(scb->queues, M_EPAIR); free(scb, M_EPAIR); @@ -776,8 +773,7 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) ifmedia_removeall(&sca->media); for (int i = 0; i < sca->num_queues; i++) { struct epair_queue *q = &sca->queues[i]; - buf_ring_free(q->rxring[0], M_EPAIR); - buf_ring_free(q->rxring[1], M_EPAIR); + mtx_destroy(&q->mtx); } free(sca->queues, M_EPAIR); free(sca, M_EPAIR); From nobody Wed Mar 15 15:44:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcF7w3wqTz3yg92; Wed, 15 Mar 2023 15:44: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 4PcF7w3TCcz4Ym7; Wed, 15 Mar 2023 15:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678895084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1hX+B+f5A90jmgOF3vZh8soFKtxHkZ3vchgronl/d2s=; b=X7Sg/LPahIHe0qqxVt9Gye68Nh0G4uERfGfzzwd8LShGlqb8DJLfZ0BMhS7rGIMW/HwkGS ga8BkLj8a1FaZRSJwpcFs6RsCgRlRpNgJyktEu4tfuJuI9AOFu4SaxKtxl3+f0d1FhdNDN EFkhJU1Y4uzWm8UGcjMHl1jzjgPuDyiMAn8yN6+QDrHwpaXFiDg1cvETvM+9Ed6CYGkORh 9Yt6tSgDPJKMKflCxrKHLuJhR1n7ZaGDZLRFOWrYoW+o3xHtMLcS+OSICUV20mHX5/GPUQ oO3i5onyPoelipT7czB2n7aHs5g6UZc1Ww3cgM+xaNl4clghdJ+f5o8dX2oEYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678895084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1hX+B+f5A90jmgOF3vZh8soFKtxHkZ3vchgronl/d2s=; b=xenAUZF5LqMmKSRRnEURmj79Pmo6dtnWJIsoZsZMufMdwKTE7dQfKMF20pF565tzg/qwK5 og/fFZLqJ6SEBwSKITQFbKQiWHuJsnMs6MD4yBV6Fc9r+lbDHftv5Cv0dQtkdzoQRxS+QV DxUqxhjZqBz6f0EWK/wKbd4GKmEvIqwah7R/xaw2n2tAQAVjUA6fBPE8Z3CIfy31e7BEY6 gEN/yHQsVzCJUhcTL9k5guqTid93QcOZmcQQsUgjySf1sWwarardTblfT0mkF5x9T3P9eI v6FZl6XC9iTL0a+NVB5IczcJnA8U7yW17cYwAqaIlJeli2pZCXKTUXH0mVFqlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678895084; a=rsa-sha256; cv=none; b=yKTj7lzX8HDIIHeTDypHuZx+vjalAp0adhXP6Vnsc8Mu8kD4tUQq8KEQ1iY+Tc84aC/ssz YHpa3KidXKnNKN2re7sSOT6oX/d8XGy03ugO+cGVSLx7ZnRf//wvmMtxR7OJ/wa9PeNyWx /cT1fiNMziZpOV4kicIuUVCr/vvG30eJhQEnWdbpnAvzPdiPEr35nvrWq3PJbPMud8gDse ljwTAvW5Hk1kX2M8ZGlgLMq+aDZ5t01H1CM+xDTEGJPmTY/Q0im+VAfoJraZsFBfjHDbe1 C9/q2LUzhYpHmHMDPYLoMKimRdKX6u9cSv+fHdo1F/gTK+PPNdXOEXBSk7myaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcF7w2XZxz1M7n; Wed, 15 Mar 2023 15:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FFii7n058098; Wed, 15 Mar 2023 15:44:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FFiipn058097; Wed, 15 Mar 2023 15:44:44 GMT (envelope-from git) Date: Wed, 15 Mar 2023 15:44:44 GMT Message-Id: <202303151544.32FFiipn058097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 8937bd37d07c - main - arm64: limit EFI excluded regions to physical memory types List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8937bd37d07c5c75995e01457aec00fb0a05c462 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8937bd37d07c5c75995e01457aec00fb0a05c462 commit 8937bd37d07c5c75995e01457aec00fb0a05c462 Author: Mitchell Horne AuthorDate: 2023-03-15 15:26:57 +0000 Commit: Mitchell Horne CommitDate: 2023-03-15 15:28:35 +0000 arm64: limit EFI excluded regions to physical memory types Consolidate add_efi_map_entry() and exclude_efi_map_entry() into a single function, handle_efi_map_entry(), so that the exact set of entry types handled is the same in the addition or exclusion cases. Before, exclude_efi_map_entry() had a 'default' case that would exclude all entry types that were not listed explicitly in the switch statement. Logically, we do not need to exclude a range that could not possibly be added to physmem, and we do not need to exclude bus ranges that are not physical memory, for example EFI_MD_TYPE_IOMEM. Since physmem's ram0 device will reserve bus memory resources for its owned ranges, this was preventing attachment of the watchdog device on the RPI4B. For some reason its region of memory-mapped I/O appeared in the EFI memory map (with the aforementioned EFI_MD_TYPE_IOMEM type). This change fixes the attachment issue, as we prevent the physmem API from messing with this range of bus space. PR: 270044 Reported by: karels, Mark Millard Reviewed by: andrew, karels, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39003 --- sys/arm64/arm64/machdep.c | 71 ++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index a076bd0a046a..0659602a9ded 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -455,36 +455,25 @@ foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, void * } } +/* + * Handle the EFI memory map list. + * + * We will make two passes at this, the first (exclude == false) to populate + * physmem with valid physical memory ranges from recognized map entry types. + * In the second pass we will exclude memory ranges from physmem which must not + * be used for general allocations, either because they are used by runtime + * firmware or otherwise reserved. + * + * Adding the runtime-reserved memory ranges to physmem and excluding them + * later ensures that they are included in the DMAP, but excluded from + * phys_avail[]. + * + * Entry types not explicitly listed here are ignored and not mapped. + */ static void -exclude_efi_map_entry(struct efi_md *p, void *argp __unused) -{ - - switch (p->md_type) { - case EFI_MD_TYPE_CODE: - case EFI_MD_TYPE_DATA: - case EFI_MD_TYPE_BS_CODE: - case EFI_MD_TYPE_BS_DATA: - case EFI_MD_TYPE_FREE: - /* - * We're allowed to use any entry with these types. - */ - break; - default: - physmem_exclude_region(p->md_phys, p->md_pages * EFI_PAGE_SIZE, - EXFLAG_NOALLOC); - } -} - -static void -exclude_efi_map_entries(struct efi_map_header *efihdr) -{ - - foreach_efi_map_entry(efihdr, exclude_efi_map_entry, NULL); -} - -static void -add_efi_map_entry(struct efi_md *p, void *argp __unused) +handle_efi_map_entry(struct efi_md *p, void *argp) { + bool exclude = *(bool *)argp; switch (p->md_type) { case EFI_MD_TYPE_RECLAIM: @@ -496,7 +485,7 @@ add_efi_map_entry(struct efi_md *p, void *argp __unused) /* * Some UEFI implementations put the system table in the * runtime code section. Include it in the DMAP, but will - * be excluded from phys_avail later. + * be excluded from phys_avail. */ case EFI_MD_TYPE_RT_DATA: /* @@ -504,6 +493,12 @@ add_efi_map_entry(struct efi_md *p, void *argp __unused) * region is created to stop it from being added * to phys_avail. */ + if (exclude) { + physmem_exclude_region(p->md_phys, + p->md_pages * EFI_PAGE_SIZE, EXFLAG_NOALLOC); + break; + } + /* FALLTHROUGH */ case EFI_MD_TYPE_CODE: case EFI_MD_TYPE_DATA: case EFI_MD_TYPE_BS_CODE: @@ -512,8 +507,12 @@ add_efi_map_entry(struct efi_md *p, void *argp __unused) /* * We're allowed to use any entry with these types. */ - physmem_hardware_region(p->md_phys, - p->md_pages * EFI_PAGE_SIZE); + if (!exclude) + physmem_hardware_region(p->md_phys, + p->md_pages * EFI_PAGE_SIZE); + break; + default: + /* Other types shall not be handled by physmem. */ break; } } @@ -521,7 +520,15 @@ add_efi_map_entry(struct efi_md *p, void *argp __unused) static void add_efi_map_entries(struct efi_map_header *efihdr) { - foreach_efi_map_entry(efihdr, add_efi_map_entry, NULL); + bool exclude = false; + foreach_efi_map_entry(efihdr, handle_efi_map_entry, &exclude); +} + +static void +exclude_efi_map_entries(struct efi_map_header *efihdr) +{ + bool exclude = true; + foreach_efi_map_entry(efihdr, handle_efi_map_entry, &exclude); } static void From nobody Wed Mar 15 15:49:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcFF84SPcz3ygDk; Wed, 15 Mar 2023 15:49: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 4PcFF83vnrz4ZNd; Wed, 15 Mar 2023 15:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678895356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ji551VYxhRlNEIZ7FnTJk8Y2AXl4HWFFzZfyyyuQJ3A=; b=nMyNP+zbwekd7YQ9ynEoE56676+ZPwmaFPXviTOd9P36cO+mr7umKDS02Es2uxditVGgit z4L1nEBJols6iIyIkUgioR1dPGxm8+JlIEe/kaUsvVYIPXAga/hGr9ZeiP1N7f9oX6g+kV FSwFzs80xUZwWM+fb4YPIZv7GUukCD+hgx5ONL/XTSeKLOLxG1wrCsE33Ge/dTBnOnurUp /UfP89HNlki54Mw5bB1y94Lz6LBnL1ka8cPbxfraSeSLeyXv7NS01nS8G4d7BJl6rZ0YNW Bhd8Lj9ml3z//3twTy47dkfK+fRCcBA+/dfxuWSXQxBwvkWnVJC56NgMVDM42A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678895356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ji551VYxhRlNEIZ7FnTJk8Y2AXl4HWFFzZfyyyuQJ3A=; b=OCngdb+Mm4UTM/QOVGGFoJw4zYE7duvOOLz+sy6iJCS2JIIz3CBQwQJCJSn96fJV9lsHoK ES4Uktdv34MvHuSF4D6D91ceMUZxUwfr2oNo6w5pjzM7+R0dwIM4z1ykT9BB6wvxdyf+EC SYpOFkKICj9/XrUGrtSem8S6PAHm9Hnh6WKChFnC5qy9tCarYMm0rPkWieay8/qpKXW3VJ B672WLXO75w3ZQ4+0PiBLjPec6ZufF6iJOS17BMjva92VIfT8RDPy741kIesTiV4bMMf2l ne85KgZZWE0oPjiqxC5jYuzb3oMX5LsPNqEy1hlHZoddaLqC3Cuy4u5fqhkJxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678895356; a=rsa-sha256; cv=none; b=oSJ4Xdu4zsDMMkINbwibicAUFrtJYcqwTEPsQaVqC/Pb0bFPuOMZ2QilPLekZm8Sg7QMAY s1xegsZl1686kXr8L3b8i0psnw9e5aYc+m7HKpfDoN/PuF6I44tAMQJ/MTclY6+Qh/yXPB gPP7mo4mVd907aORbA/kZWni3z/SpHq2wQSni66tOKr8lnAOVR9Ef09cjFjvwr/4/Mxpiu aePtSL18uoOzqxt7skDhCR9rAE2pqVckl6f7DOpe/QaKkBsivU+orCd3UTAzTdLPuPS9px ribGvDfglLH2UpyIbXC+tiPPGtDrsqZ1MqXYBrhYhXmNLRbLr5hAj+dF9FpGMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcFF82zs8z1MTc; Wed, 15 Mar 2023 15:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FFnGlC058774; Wed, 15 Mar 2023 15:49:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FFnGbU058773; Wed, 15 Mar 2023 15:49:16 GMT (envelope-from git) Date: Wed, 15 Mar 2023 15:49:16 GMT Message-Id: <202303151549.32FFnGbU058773@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 51308cd29b3b - main - Support the arm64 pmap_remove_write for stage 2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51308cd29b3b21cbee3e841a6f44c58987647dbb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=51308cd29b3b21cbee3e841a6f44c58987647dbb commit 51308cd29b3b21cbee3e841a6f44c58987647dbb Author: Andrew Turner AuthorDate: 2022-11-15 17:49:42 +0000 Commit: Andrew Turner CommitDate: 2023-03-15 15:49:00 +0000 Support the arm64 pmap_remove_write for stage 2 The fields we need to adjust are different in stage 1 and stage 2 tables. Handle this by adding variables to hold the bits to check, set, and clear. Reviewed by: alc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37399 --- sys/arm64/arm64/pmap.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index a272bf5756ae..2ea007418c9d 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -5804,7 +5804,7 @@ pmap_remove_write(vm_page_t m) pmap_t pmap; struct rwlock *lock; pv_entry_t next_pv, pv; - pt_entry_t oldpte, *pte; + pt_entry_t oldpte, *pte, set, clear, mask, val; vm_offset_t va; int md_gen, pvh_gen; @@ -5842,7 +5842,6 @@ retry: } TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); - PMAP_ASSERT_STAGE1(pmap); if (!PMAP_TRYLOCK(pmap)) { pvh_gen = pvh->pv_gen; md_gen = m->md.pv_gen; @@ -5858,13 +5857,25 @@ retry: pte = pmap_pte_exists(pmap, pv->pv_va, 3, __func__); oldpte = pmap_load(pte); if ((oldpte & ATTR_SW_DBM) != 0) { + if (pmap->pm_stage == PM_STAGE1) { + set = ATTR_S1_AP_RW_BIT; + clear = 0; + mask = ATTR_S1_AP_RW_BIT; + val = ATTR_S1_AP(ATTR_S1_AP_RW); + } else { + set = 0; + clear = ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE); + mask = ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE); + val = ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE); + } + clear |= ATTR_SW_DBM; while (!atomic_fcmpset_64(pte, &oldpte, - (oldpte | ATTR_S1_AP_RW_BIT) & ~ATTR_SW_DBM)) + (oldpte | set) & ~clear)) cpu_spinwait(); - if ((oldpte & ATTR_S1_AP_RW_BIT) == - ATTR_S1_AP(ATTR_S1_AP_RW)) + + if ((oldpte & mask) == val) vm_page_dirty(m); - pmap_s1_invalidate_page(pmap, pv->pv_va, true); + pmap_invalidate_page(pmap, pv->pv_va, true); } PMAP_UNLOCK(pmap); } From nobody Wed Mar 15 15:49:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcFF95lqMz3ygK0; Wed, 15 Mar 2023 15:49: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 4PcFF94y3Vz4ZJx; Wed, 15 Mar 2023 15:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678895357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AR6IXrR52HKn5owNLXworZT4Ve0r9ken78E3mNMGMgk=; b=tjvoY3W+VBugKL23pydi4cn8xx2+7PmwseQpYguqhkAAUxk1hU6BZfzIKu0Y2LgDhdTXcv tnc5BQcrliB1tkSOcfGacsIlofCo8fGngPgMlz1JMg4smvbMmeLtVm8T9FBOxj7uDg3HXk W/WWTLFJ/VoBLSq8LGLwje809hvzCTc5o21uA2fr6xhWhprYXgxXXgiNRa0RI3Bivd2UI7 aIVGwGqXmegr9C4TS00HO0fLRNVr+/JHbs2C7peibI7lqqLCzCaFhl2b7Rr4kf2QLGrh2W GDXwfCOaNAuSrLR8e5yeiwWGKVMaiS/azDE2G4w1qfcInO+Ehexitg5qW3UDMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678895357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AR6IXrR52HKn5owNLXworZT4Ve0r9ken78E3mNMGMgk=; b=C91gNW3ySEU11H3WuOhNO0RUC6cu1jhA62hbX56XbyCBYdMLFxt5SKbWKJC17GexhzksTs /SKApINK9CaTT2M0HZ7ZYkzBDz5Jggvr9HqMx4Fw7MSJn8I+xmJPaGV3NELP1ntKmB5V5h tYFPt5+gQ2/R35uWxBi3hD6548+G8b0fmU4x2E2p/AN/XATB293+iWXnDEXWfN+80SooTo L2rTbhWkA2EgFoOfDTKg/6VUg9B0fA/EsH82d2sOwL4xsCYBwILgB+YQHI2gqlJfPnNEiL WJUQgqe6g1AFVlu+a+/fO4OyKWPXUTdiobQ1HEG9M/QvVC3kgBhT3CpmWA3aeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678895357; a=rsa-sha256; cv=none; b=MNrzF7l7Ncq9xok/CykxFkt+/OpB3SROP9vs2DCz8DfmnCAFZLuenvfyGM11+lF++PgmFD 0pBbsKyHvQnhKJoTrKZpj8w8zWAjla2KIvAIHlacmXXU786bs1tjTqAmW27qKMT4wlEBr1 Khyk9UOAYKEScYrpBHxFdjhYpWOOaw/VyJv9olwiSjs/1AXoAGEEbYI3LLxEgiP+1DA1RZ r+/lC2/iPT7KpuM4Q9HctiXD3xM4O/XIxgMlJZCRnVEa0BtAer9GXCgn7p09nwYUZxee20 a6aDuM3UooadcCANznOFrU1mY9o/YycAQgfpoE1IcxXNMW6dSopqNs/OZBpVig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcFF93tVGz1MGm; Wed, 15 Mar 2023 15:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FFnHjX058793; Wed, 15 Mar 2023 15:49:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FFnHGh058792; Wed, 15 Mar 2023 15:49:17 GMT (envelope-from git) Date: Wed, 15 Mar 2023 15:49:17 GMT Message-Id: <202303151549.32FFnHGh058792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 02f3d094aead - main - Use the arm physical timer when able List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02f3d094aead055d0ebc709c251c124e6f652fb6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=02f3d094aead055d0ebc709c251c124e6f652fb6 commit 02f3d094aead055d0ebc709c251c124e6f652fb6 Author: Andrew Turner AuthorDate: 2023-03-15 13:33:02 +0000 Commit: Andrew Turner CommitDate: 2023-03-15 15:49:00 +0000 Use the arm physical timer when able To allow bhyve manage the virtual timer while in a guest have FreeBSD use the virtual timer only when bhyve will be unavailable due to not starting at EL2 where the hypervisor switcher will run. Reviewed by: imp, kevans Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D39093 --- sys/arm/arm/generic_timer.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index 36747441ec88..b36fbdf8dcbe 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -655,8 +655,13 @@ arm_tmr_attach(device_t dev) } #ifdef __aarch64__ - /* Use the virtual timer if we have one. */ - if (sc->irqs[GT_VIRT].res != NULL) { + /* + * Use the virtual timer when we can't use the hypervisor. + * A hypervisor guest may change the virtual timer registers while + * executing so any use of the virtual timer interrupt needs to be + * coordinated with the virtual machine manager. + */ + if (!HAS_PHYS) { sc->physical = false; first_timer = GT_VIRT; last_timer = GT_VIRT; @@ -687,12 +692,9 @@ arm_tmr_attach(device_t dev) } } - /* Disable the virtual timer until we are ready */ - if (sc->irqs[GT_VIRT].res != NULL) - arm_tmr_disable(false); - /* And the physical */ - if ((sc->irqs[GT_PHYS_SECURE].res != NULL || - sc->irqs[GT_PHYS_NONSECURE].res != NULL) && HAS_PHYS) + /* Disable the timers until we are ready */ + arm_tmr_disable(false); + if (HAS_PHYS) arm_tmr_disable(true); arm_tmr_timecount.tc_frequency = sc->clkfreq; From nobody Wed Mar 15 15:49:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcFFB6gZqz3ygK2; Wed, 15 Mar 2023 15:49: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 4PcFFB5nywz4ZVZ; Wed, 15 Mar 2023 15:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678895358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DYUvwToTJRFijBW6vL+DkOAeMf/3KE3UTAUh5d55ciw=; b=BweSqGI4/l6HcUHd8ITD1yWEVjGRPjsOX0E7HEVFLsFqZk9uE7PjUqVFFIAujaprK6W7zh vnzwzDA7Pn+4sAGZvdiNHGjKC0SFdOQfhegm7MPtbssNXWqJu3rRCnRrjlSHmcOvI6Jmob ihiB3wgxY3HBf9GuPh7wl7i8NlOZczAD/gSlLREYoQ8h9LykONlYq3xjPanxkNkc/Xma3f cSvZbajruUFvGBhLQvseejsbioVf83haBEGqBDRbdsBMRsL39toGz1A+ks+6aQ9mDmdi3y f0XXpQ8EwWOBCp9MgkG5GvBVoD4frzSZs5Wpot/+1NfbtIrTONjEKWpuUDXo/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678895358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DYUvwToTJRFijBW6vL+DkOAeMf/3KE3UTAUh5d55ciw=; b=sscZfJ08F+sTgOoWRWc0QErsW+477mwcUj0OrNA3chcf4JNLAQC3UDvfxhqJiQ9qr611y4 UnUjulRV7mwiW9a4Xtq9kDesxZKSI9ri0B7ekqFC0X6g3rQIDLvPLFE1fF9pjKK/SoJVSI kcmwMiEtsIbb+5+kLGEtfVvcRYhnUsbvgVUBNSjUW9Qs16sC8ILV/lTLJyFF5ssvxlOC5q zQ1n7COzDnrATTK5FquCSaFE5Gtp9VoIQ7L/zCKyqqOVYA7ug4Ewc+FEuCJw2NEQO3VF7B Ha5ce9vY3rxZ0SIDk3Er/CEN4e7ZvA08Fz2rtmeSr92sahDq5UxEIeGBa8AHHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678895358; a=rsa-sha256; cv=none; b=OS2VWDCcSsFhoG4iVpEWpCB4EKoy4HN4AIiHxu9i2uWuEqFM5fT5qmAiJrylyFtmI8tirR ptgX+JIqGbMsqa44p8YdKoR/SkqgiZGB9hY1GEGdFLKEtydOqiuEb+3mMphedlDHgemZEj IAO7jpZNyzJ/b95TC9HZ/YB8My8pg7F3Ynh2HJ3HI0NPMwe2ZB3TyW5MgAhb4TGvW9AO13 A1I/nCWuBNHqiFT0BRqIzvFjmf2rKeOTJmn5ipCBjn+iuoiQDTkuU1HPvXK9yjarEbP7QP l2tPJZCoebbrlU4l6Zls2YjwRJBDsbXyeyNOrUTgVojwAD+ew2WVnq9smi4v7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcFFB4nJKz1M4m; Wed, 15 Mar 2023 15:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FFnIQN058812; Wed, 15 Mar 2023 15:49:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FFnIfa058811; Wed, 15 Mar 2023 15:49:18 GMT (envelope-from git) Date: Wed, 15 Mar 2023 15:49:18 GMT Message-Id: <202303151549.32FFnIfa058811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 5c4bd8756fbc - main - Stop using the rid as an index in the arm timer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c4bd8756fbc23a48ddd8976df0b8429311fba83 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4bd8756fbc23a48ddd8976df0b8429311fba83 commit 5c4bd8756fbc23a48ddd8976df0b8429311fba83 Author: Andrew Turner AuthorDate: 2023-03-15 13:35:04 +0000 Commit: Andrew Turner CommitDate: 2023-03-15 15:49:00 +0000 Stop using the rid as an index in the arm timer The order of the interrupt array doesn't matter. Store the described interrupts at the start of the array to simplify iterating over them. Reviewed by: imp, kevans Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D39094 --- sys/arm/arm/generic_timer.c | 61 ++++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index b36fbdf8dcbe..b1f42cbc5b34 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -103,12 +103,14 @@ struct arm_tmr_irq { struct resource *res; void *ihl; int rid; + int idx; }; struct arm_tmr_softc { struct arm_tmr_irq irqs[GT_IRQ_COUNT]; uint64_t (*get_cntxct)(bool); uint32_t clkfreq; + int irq_count; struct eventtimer et; bool physical; }; @@ -403,9 +405,12 @@ static int arm_tmr_attach_irq(device_t dev, struct arm_tmr_softc *sc, const struct arm_tmr_irq_defs *irq_def, int rid, int flags) { - sc->irqs[irq_def->idx].res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + struct arm_tmr_irq *irq; + + irq = &sc->irqs[sc->irq_count]; + irq->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, flags); - if (sc->irqs[irq_def->idx].res == NULL) { + if (irq->res == NULL) { if (bootverbose || (flags & RF_OPTIONAL) == 0) { device_printf(dev, "could not allocate irq for %s interrupt '%s'\n", @@ -415,8 +420,13 @@ arm_tmr_attach_irq(device_t dev, struct arm_tmr_softc *sc, if ((flags & RF_OPTIONAL) == 0) return (ENXIO); - } else if (bootverbose) { - device_printf(dev, "allocated irq for '%s'\n", irq_def->name); + } else { + if (bootverbose) + device_printf(dev, "allocated irq for '%s'\n", + irq_def->name); + irq->rid = rid; + irq->idx = irq_def->idx; + sc->irq_count++; } return (0); @@ -507,11 +517,9 @@ arm_tmr_fdt_attach(device_t dev) error = arm_tmr_attach(dev); out: if (error != 0) { - for (i = 0; i < GT_IRQ_COUNT; i++) { - if (sc->irqs[i].res != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, - sc->irqs[i].rid, sc->irqs[i].res); - } + for (i = 0; i < sc->irq_count; i++) { + bus_release_resource(dev, SYS_RES_IRQ, sc->irqs[i].rid, + sc->irqs[i].res); } } @@ -590,11 +598,9 @@ arm_tmr_acpi_attach(device_t dev) error = arm_tmr_attach(dev); out: if (error != 0) { - for (int i = 0; i < GT_IRQ_COUNT; i++) { - if (sc->irqs[i].res != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, - sc->irqs[i].rid, sc->irqs[i].res); - } + for (int i = 0; i < sc->irq_count; i++) { + bus_release_resource(dev, SYS_RES_IRQ, + sc->irqs[i].rid, sc->irqs[i].res); } } return (error); @@ -605,7 +611,9 @@ static int arm_tmr_attach(device_t dev) { struct arm_tmr_softc *sc; +#ifdef INVARIANTS const struct arm_tmr_irq_defs *irq_def; +#endif #ifdef FDT phandle_t node; pcell_t clock; @@ -646,13 +654,25 @@ arm_tmr_attach(device_t dev) return (ENXIO); } +#ifdef INVARIANTS /* Confirm that non-optional irqs were allocated before coming in. */ for (i = 0; i < nitems(arm_tmr_irq_defs); i++) { + int j; + irq_def = &arm_tmr_irq_defs[i]; - MPASS(sc->irqs[irq_def->idx].res != NULL || - (irq_def->flags & RF_OPTIONAL) != 0); + /* Skip optional interrupts */ + if ((irq_def->flags & RF_OPTIONAL) != 0) + continue; + + for (j = 0; j < sc->irq_count; j++) { + if (sc->irqs[j].idx == irq_def->idx) + break; + } + KASSERT(j < sc->irq_count, ("%s: Missing required interrupt %s", + __func__, irq_def->name)); } +#endif #ifdef __aarch64__ /* @@ -677,15 +697,16 @@ arm_tmr_attach(device_t dev) arm_tmr_sc = sc; /* Setup secure, non-secure and virtual IRQs handler */ - for (i = first_timer; i <= last_timer; i++) { - /* If we do not have the interrupt, skip it. */ - if (sc->irqs[i].res == NULL) + for (i = 0; i < sc->irq_count; i++) { + /* Only enable IRQs on timers we expect to use */ + if (sc->irqs[i].idx < first_timer || + sc->irqs[i].idx > last_timer) continue; error = bus_setup_intr(dev, sc->irqs[i].res, INTR_TYPE_CLK, arm_tmr_intr, NULL, sc, &sc->irqs[i].ihl); if (error) { device_printf(dev, "Unable to alloc int resource.\n"); - for (int j = first_timer; j < i; j++) + for (int j = 0; j < i; j++) bus_teardown_intr(dev, sc->irqs[j].res, &sc->irqs[j].ihl); return (ENXIO); From nobody Wed Mar 15 17:38:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcHg92P5Qz3xYBl; Wed, 15 Mar 2023 17:38: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 4PcHg91tb1z3Nrx; Wed, 15 Mar 2023 17:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678901909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g34EXSw6pM5BftAW7gGreYjy7q6vvQd9aMCRf1H8bcc=; b=Ag6MGldGDtODINx0hcEAVqiqkmsjargJMwHCcjwEbEITpPLWUSgcdIAfH7H0OTYk+WHch2 WQgnDK8Gl3BjXdmtW7o7ZC/9QqE8tIXMcSSTb7xAlFExdQXgKSP4JJChQZav+oEajK1GcZ 8E/dpxvhKU+7r5SSA3FvaKVV6DyW63FvQ8MiZgf6+0XNbh0/k7uun9LeZZ1/Qo2L4N3wHR sAoZZ8ugz3Wbg6LDOs+hzvBo0f9TlRZtoH3ROcca28h3GwYjmn/ocB4VwRsf2oS7Yplr1P 35OgY3YwYzm5TeohHd0XNFTdEKdGQMYCwxjxa4g1f4E0hsEM410HTi1F+Mm4zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678901909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g34EXSw6pM5BftAW7gGreYjy7q6vvQd9aMCRf1H8bcc=; b=dZchEFYjVM8dJZuNlgS0BFtwCy+dqelobIg0WF28VShOontEbUoRu5VIqqUDKsWOnrWDPD cLU/k0XzEf1WmGZsYNWgTwMYQZpbafKT4sAk85v/ZOX8xsjiA7TooZG+LZtDMKLqUwNmJH o9Bp3GgYkkMo9kje5uHPj0Wa7Vrs3Yv1TWH9F7pdg9cWjGVb5Qddc0M1Cew5DDPPKbQJ9L NiqKkN2K1EWL9PvVXlTUHgTt45TQyVY8cSAclTg2XBfN2HI0dVjCrknKoU2Rii5A9fZhpn w4ycvIgMA2mGSc0XtRG8edgbW71iWFUhgkaScSRds16Bwzdjwaffkh73UeDAWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678901909; a=rsa-sha256; cv=none; b=v11fCDyZiVJL0MWbFlCMgtlYWFI2wWjzmkyXC840ktzv1SJJGgl/aNnAchQ626iWqeWfb1 z+lDlUbNjv2003MTFUI/hs1nz+7rWOgDl9neRn1zzVlOtK5JxZQL4ZECaANtwZMYyr+ZYQ 388yR7FlZb4xGHf87xFmEY3sORTU4VCEPQxcm5BurgtkC/I6KWrK0i+R2VVdsIaurKAdF7 XbUpZ9eiO2vHIxGGLz0sn3utkzKXbsjbqVXXRXXO9XxBuM8yC0Zswiv7mr/J5l5q8dmPxC /pQhODRBkpzRZe/W1+8QyuT+qhUyZMqN/9yGoYsNpF97yijEnLxqdAiSZ2ga9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcHg90x7pz1PlF; Wed, 15 Mar 2023 17:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FHcT9j039827; Wed, 15 Mar 2023 17:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FHcTpc039826; Wed, 15 Mar 2023 17:38:29 GMT (envelope-from git) Date: Wed, 15 Mar 2023 17:38:29 GMT Message-Id: <202303151738.32FHcTpc039826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 6834ca8a434b - main - ssh: update FREEBSD-upgrade instructions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6834ca8a434b1b934f21bbc068c90ae5c7fec7ef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6834ca8a434b1b934f21bbc068c90ae5c7fec7ef commit 6834ca8a434b1b934f21bbc068c90ae5c7fec7ef Author: Ed Maste AuthorDate: 2022-02-23 18:33:24 +0000 Commit: Ed Maste CommitDate: 2023-03-15 17:37:49 +0000 ssh: update FREEBSD-upgrade instructions Make it clear that the 'freebsd-configure.sh' and 'freebsd-namespace.sh' scripts are run from the crypto/openssh directory. Sponsored by: The FreeBSD Foundation --- crypto/openssh/FREEBSD-upgrade | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index 92abda1d0e4c..86f4676504fc 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -77,6 +77,7 @@ 12) Run the configure script: + $ cd crypto/openssh $ sh freebsd-configure.sh 13) Review changes to config.h very carefully. @@ -89,6 +90,7 @@ 15) Update ssh_namespace.h: + $ cd crypto/openssh $ sh freebsd-namespace.sh 16) Build and install world, reboot, test. Pay particular attention From nobody Wed Mar 15 18:34:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcJw54khrz3xccc; Wed, 15 Mar 2023 18:34: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 4PcJw54HRkz3jkp; Wed, 15 Mar 2023 18:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678905285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bJAyb237f/YcWMmk7XgVsJ9gLkw9MfBmBUU1C8rQMlw=; b=XHMGJfsGHn82VFiBz1tgDXWVC0qJvurKaNgglzw2o9x1Shr87uJh7FiHk8Fae7SlQkujXE JWOHwrvC/rzRKRzWuAGQQvn2XMI1Ag218aK1+N67dhWi7SpcBYHy0Kwr77Oh/Soi270X2t B17ZO3dnhLBjz9yRpdUOtmQfd0hcOczEnVzNdLENxsRKHfv7D14s8OIDfpgOU7pCOMNcmK hBW5p6WaidZ67lbvi4wuvO2cs+4EyVlbTVvjECoaVRCe6aKArID+V2ncUNydo4IdU2vY0E Zn/Z2T16f2+r4UWCGHugmoQCR+EK9Sqo3yMz0hw/clIbyftOmLMdnpBTy6Dzog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678905285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bJAyb237f/YcWMmk7XgVsJ9gLkw9MfBmBUU1C8rQMlw=; b=FdzQM/B+Ie8tQW58goKKIxcHMbRy4yrfmhr/DzpJVUOMC60jknvu7CzLvOL4lYyILo3YNX u1vik7DahUMA9UTjRGQ6wTjuXao9FaPmCcDOzJ0oczUwWeQmMmQPped8aFFhpcv8TuGRMh +M+FL926PqBELeY4OPwkOKEf+9gsBbawwLkGJDzcslMs8Sk9J9aFesnGY0GpZXfXQRywlU pA2/cNkQTliJNlFKKHA6qVYpFao0IFIPLpAQrcwjv/NtH4GnW65xczrnPi2w//2aobMF2u VckWEonOLb7acA2hqClI+IZBAjkSoDZdM4+ZNbbXyjpwbUTHSUpc+Et08n4DVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678905285; a=rsa-sha256; cv=none; b=yaqE3QuSlt6XNmbry+HsyX+BW0/Oupa3Y9cmkWWGybM44tardDhWf/rIQbA20jhCGCZfho J5NF6qf92pHBjiV1EMYHj+UQ9ZIOqxQ0/3V6TSrTHft+YFSvQ1etJgBdgFvxRf3gYh3bPy ijRUMdspsG2F8FwlHuX1t2sCncLTK5unttJjhy+mhYV86daVMHCF2dPDzXiTE6YNS6fLu0 4KkAYccs0DKiLJKJ0/m40IgfHtIi1HahrplbTpplREiay2aX7lJxJbSdcaDsbkw5vsqfyx hlWLmlcC3BxoSI+QdpJOAVkwPZLVekPuVeciBKwCiiQrFdQ63hXSmv2P03CrVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcJw53Mphz1RXd; Wed, 15 Mar 2023 18:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FIYjRe038261; Wed, 15 Mar 2023 18:34:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FIYjAA038260; Wed, 15 Mar 2023 18:34:45 GMT (envelope-from git) Date: Wed, 15 Mar 2023 18:34:45 GMT Message-Id: <202303151834.32FIYjAA038260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: cc67cd58fce0 - main - arm64: Support stage 2 mappings in pmap_remove_all List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc67cd58fce07b7550f7be36508693f0e8e54926 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=cc67cd58fce07b7550f7be36508693f0e8e54926 commit cc67cd58fce07b7550f7be36508693f0e8e54926 Author: Andrew Turner AuthorDate: 2023-03-15 16:27:51 +0000 Commit: Andrew Turner CommitDate: 2023-03-15 18:24:50 +0000 arm64: Support stage 2 mappings in pmap_remove_all This has been hit when testing bhyve. Sponsored by: Arm Ltd --- sys/arm64/arm64/pmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 2ea007418c9d..17abce473c17 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -3622,7 +3622,6 @@ retry: } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); - PMAP_ASSERT_STAGE1(pmap); if (!PMAP_TRYLOCK(pmap)) { pvh_gen = pvh->pv_gen; md_gen = m->md.pv_gen; @@ -3648,7 +3647,7 @@ retry: if (tpte & ATTR_SW_WIRED) pmap->pm_stats.wired_count--; if ((tpte & ATTR_AF) != 0) { - pmap_s1_invalidate_page(pmap, pv->pv_va, true); + pmap_invalidate_page(pmap, pv->pv_va, true); vm_page_aflag_set(m, PGA_REFERENCED); } From nobody Wed Mar 15 20:02:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcLs91sJbz3xj9m; Wed, 15 Mar 2023 20:02: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 4PcLs91R60z3q6b; Wed, 15 Mar 2023 20:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678910541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qAPK0ptYOKP2baoSadOb9gaU4HgndPz4Leu9TkHwdEg=; b=vIB04B41nW/rcWZGT6a0kgzjB/ehi0/A1hlLQXuGpluZhgSHIMmEibzXNUtbiVLNlDyaNo k/atmFpxbq8udVZM2BQmPjpTIY41Xbdxs1exrv7IADm+TakHaofthyYphOkfF52NfK4JbM KJQ2ucsafgurbYEM4luTeMHXI7J3+JqbLeMUQyoMyqVv4WfHVQuZVuV5wsXMBR3rGBetC/ MA+AJZdr0aKlrKYRDUNUlyNxSLC0jjZ32GV/lm2/JkiGGVuSIUJKyWz2y/ZOuWnX3HonjZ gwt5fZKD8Jt/9pyFDYcfHh7AXkPDOWeYmgABNMBeYjYSjZ9ryAELEx70pg1M9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678910541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qAPK0ptYOKP2baoSadOb9gaU4HgndPz4Leu9TkHwdEg=; b=bHtwjE/tOwQ/Fy4gxzmncl79BfJ8fZ4+OJyp2Zm5paLTVYm8GTYH9Qoh7zVk2rkJy5yYYv HJmnOHyJ1u175vfpjfzR8d/CjK7NS9uLR8k1iw/gUgHt5BKnMpx37SgfX4ncF5jlF/MAnI ULb72joG6Mc3zHzRj/7tdHexKgXy60etHk+gASwaL8vcdGUbamqNCrY1Y91RPUvgQQ7Gf8 6qTqELUBHrXptYiGtv+zvbmWamctho14j1qACnT/qom+tLLZEV8H0dn9ueASXbdb3b5gZ9 wBiUTq/s7JuK1DJDCrKj+vJVkMaA2qD8B/r9nPg/mCXKBsPjvQ3LaQgBCDqzLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678910541; a=rsa-sha256; cv=none; b=PWr9INxHYePvhWmquDFQGg+HlMZ4SPkVQWDDyLPrKoM90SwpVb37eGFdyJVtUJ6eJwMkUp F6eRIPp9Nclql/jCvPPXvtZkN1/IIKS/BYAwEQIikXp2EgzcWIWVU77HOqCyeQrp5AuUoG /XqrWNWpPpsVGWvy5GUlw+Ztb7/H5Q4zFjjhX+VXi5pu+7Er95Z55ncsbm/pq0fuLmW35E VTJzoCIfII7pnF7zVuRVvLz0iSZirQeXUWjJ6ztHZ5avHi89gzCQYSZxE1mla0VlLAmmWb gKsDdPGM34cJCfseJ7HGx3PNo9sqaMFL+eU4a0pMusS4fV9SvnFIw/6zWtL99w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcLs90BrLzFpl; Wed, 15 Mar 2023 20:02:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FK2KDn084457; Wed, 15 Mar 2023 20:02:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FK2KkJ084456; Wed, 15 Mar 2023 20:02:20 GMT (envelope-from git) Date: Wed, 15 Mar 2023 20:02:20 GMT Message-Id: <202303152002.32FK2KkJ084456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Justin Hibbits Subject: git: 0a21a6659e5d - stable/13 - dtrace/powerpc: "Fix" stack traces across trap frames List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0a21a6659e5dfe503da587fb0460ae19bd765859 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=0a21a6659e5dfe503da587fb0460ae19bd765859 commit 0a21a6659e5dfe503da587fb0460ae19bd765859 Author: Justin Hibbits AuthorDate: 2023-03-11 16:30:00 +0000 Commit: Justin Hibbits CommitDate: 2023-03-15 19:47:49 +0000 dtrace/powerpc: "Fix" stack traces across trap frames In function boundary tracing the link register is not yet saved to the save stack location, so the save point contains whatever the previous 'lr' save was, or even garbage, at the time the trap is taken. Address this by explicitly loading the link register from the trap frame instead of the stack, and propagate that out. (cherry picked from commit 3e1155ade1baab51458374efd0295bdf6db455fc) (cherry picked from commit e620e088cbd1c062655eee825aaf4f80bd255e1f) --- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c index cce1c907b5d8..1fca72e5b7fd 100644 --- a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c @@ -97,15 +97,18 @@ dtrace_sp_inkernel(uintptr_t sp) } static __inline void -dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc) +dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc, uintptr_t *lr) { vm_offset_t callpc; struct trapframe *frame; + if (lr != 0 && *lr != 0) + callpc = *lr; + else #ifdef __powerpc64__ - callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); #else - callpc = *(vm_offset_t *)(sp + RETURN_OFFSET); + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET); #endif /* @@ -121,6 +124,8 @@ dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc) *nsp = frame->fixreg[1]; if (pc != NULL) *pc = frame->srr0; + if (lr != NULL) + *lr = frame->lr; return; } @@ -128,6 +133,9 @@ dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc) *nsp = *(uintptr_t *)sp; if (pc != NULL) *pc = callpc; + /* lr is only valid for trap frames */ + if (lr != NULL) + *lr = 0; } void @@ -135,7 +143,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) { int depth = 0; - uintptr_t osp, sp; + uintptr_t osp, sp, lr = 0; vm_offset_t callpc; pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; @@ -154,7 +162,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, if (!dtrace_sp_inkernel(sp)) break; osp = sp; - dtrace_next_sp_pc(osp, &sp, &callpc); + dtrace_next_sp_pc(osp, &sp, &callpc, &lr); if (aframes > 0) { aframes--; @@ -513,7 +521,7 @@ dtrace_getstackdepth(int aframes) depth++; osp = sp; - dtrace_next_sp_pc(sp, &sp, NULL); + dtrace_next_sp_pc(sp, &sp, NULL, NULL); } if (depth < aframes) return (0); From nobody Wed Mar 15 20:02:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcLsB4G0pz3xjD7; Wed, 15 Mar 2023 20:02: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 4PcLsB22vGz3qG4; Wed, 15 Mar 2023 20:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678910542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kkIIlH0HkOZWFyXhh0Cp3GxjbumahVV2XUj+Ve70pUk=; b=lvqvS44ahHVUGeG8Fo/rFxhKQUHsWXaJVzO3YO6Yvv8mPoFr33Pm9azntt/M9i6I4XolQL 4LIyQjr3AXttdVwc3xoA0sQ2uAUJf4F4u6zAYTxOBdNzOuUiW0etfJugywx0d3NJm0PdeP AY02Ecaierng/rr54kLRGUlJ+4dD/J03AhgwYcgXLVzJNUENc4rJzyPNq2LyYmO9mBynf0 g6RGZVCef3+rEfzXOVxWWEFbwh2O5byK4jXgUFLNxbYPPEgVAEILJBkJfBOipgu3mYPxXx OjZgSokdhoZy0aNMz4s9tXy4p2pevzNZmUFPcYYbcWt5Mpc/OtA3lbAyuN0gLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678910542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kkIIlH0HkOZWFyXhh0Cp3GxjbumahVV2XUj+Ve70pUk=; b=gO9tguQNYUcPOtgQm0prc8VgisDkbMUFk2BGwg4GQgfczWgI1Mqcue8DJu7FtHmCHQwvg0 R2iuvvdeWCiYBqERSaHu3nbF0C6dDkoNhsM/RHqxc+yDOoE64/t+D8KWZOBZuils1erlT+ pM5nC/2SG8/AytcCGOjdBkeJRrYrF9dHoT85bopjt5VdYIotWT8Xns2l8g1Qtvmrw3icU8 C9Ayw5BQc837Cc1oGxtXoxud/L74xbPM9nAAa9ofj1zdpiZdWR/MnuirHq2HrzC+Y2brVY XPCK72HQabhxqsFjiqDwIngdRXN6n4Acj3XDwkMRVjmFT27avu/8ivpMKET6Rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678910542; a=rsa-sha256; cv=none; b=Y6SvwqVjJcn0Soi7V6Du1+ZOgeBRwHVQqIc4MBKGwNXGaaxhOSL5F8w1Gws5gnXUGo4TGQ q01rFCJt85hU1wyarhhMqvkfMA2CnRe4+aRySj1qjZZeAPOc9vZUCoKGUJ9qs5stKx+U7I Csarn4+uUi4ajSV/pUkvtv1V0rRdzQpHwa9yNjMbgOu6QJPS5I/0aoZ3KR8iuefL0YR1Yp 4ChcqKcdnKpWWGSZNhDAoMJANjmlpWyLiplcFrZ3qBcGdsrOlCwpAVhf+5ZhO1ib0XnUEb reBfuJr43mIumNYVtsaxIFZmViX4RIMkaTMgY5KxyRrxRDGUdkVboRYccs3LSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcLsB16g7zFcj; Wed, 15 Mar 2023 20:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FK2MOb084479; Wed, 15 Mar 2023 20:02:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FK2MZ9084478; Wed, 15 Mar 2023 20:02:22 GMT (envelope-from git) Date: Wed, 15 Mar 2023 20:02:22 GMT Message-Id: <202303152002.32FK2MZ9084478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Justin Hibbits Subject: git: 1026d170f4f7 - stable/13 - dtrace/powerpc: Adjust AFRAMES for fbt and profile List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1026d170f4f70cdeb63cd05819c5557041e8ea94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=1026d170f4f70cdeb63cd05819c5557041e8ea94 commit 1026d170f4f70cdeb63cd05819c5557041e8ea94 Author: Justin Hibbits AuthorDate: 2023-03-11 16:23:38 +0000 Commit: Justin Hibbits CommitDate: 2023-03-15 19:47:49 +0000 dtrace/powerpc: Adjust AFRAMES for fbt and profile FBT_AFRAMES was skipping over too many frames, while PROFILE_AFRAMES was skipping over too few. Adjust them empirically. (cherry picked from commit 635ecbf47015c259226cb47a3de8fc00c9ed5924) --- sys/cddl/dev/fbt/powerpc/fbt_isa.c | 2 +- sys/cddl/dev/profile/profile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cddl/dev/fbt/powerpc/fbt_isa.c b/sys/cddl/dev/fbt/powerpc/fbt_isa.c index 0da74c9cf076..eb7feceb269d 100644 --- a/sys/cddl/dev/fbt/powerpc/fbt_isa.c +++ b/sys/cddl/dev/fbt/powerpc/fbt_isa.c @@ -48,7 +48,7 @@ #define FBT_ENTRY "entry" #define FBT_RETURN "return" -#define FBT_AFRAMES 7 +#define FBT_AFRAMES 5 int fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index 48decf3a89cf..99381ea7d745 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -108,7 +108,7 @@ /* * This value is bogus just to make module compilable on powerpc */ -#define PROF_ARTIFICIAL_FRAMES 3 +#define PROF_ARTIFICIAL_FRAMES 8 #endif struct profile_probe_percpu; From nobody Wed Mar 15 20:07:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcLz46SF8z3xjjt; Wed, 15 Mar 2023 20:07: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 4PcLz44fwnz3rGy; Wed, 15 Mar 2023 20:07:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678910848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cZrZQl06gIzGIChBqvLcdwDffI1RbNUdW1y9Z+n0YRM=; b=qTzpEq7k+6+Bs33L/gMzlBQunw9CIUQ7ZAujmKT+0iebBD4tw5QVSBLqZBFH1l+8dL+qZ6 HT080XRt6qn3NELzzjfRG9xmfV9eAUH3BHVtSrmTooBrodo0xi1grQ2DYVdcGYlj79ie6E hWnOWH7oN6c/Pv5J6Wvww3ukcgO2iqlwQm1tETslhFKpbylcnDUJ7i57xUGeCJXHzJwnT6 RJ6AYo90oa9adYQS0DTdLf7degW566i/FdGCfl9MURhklerbFHz00idP8EToU0mLbMZbT7 TNKHMy/IF2PLsTYPQLHieUA++jw6wt1/kFWAmUlIU8KDm8IjJyqL8wun+BA6Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678910848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cZrZQl06gIzGIChBqvLcdwDffI1RbNUdW1y9Z+n0YRM=; b=aCHK+uSyhVfoBidPIqLbxH0Pb7dwL+aovqWwFnQnATiQuXbGHQG+9LWfs7EK50mlbddsqY Y4gwfhUER0+yXTt4E2L7wMCVn0gCjGx9/AoD8QfoRyrSYZ/ufcD1vicUSLl+oQfFMdHQrI +CnFBUg2cLl3DqmnSiGsOF/yTZqJS4ePZHlBKNqEROHIA/m8gBTsZD+3LKWcHCl2O1zBkw yPHFF1RbPXB0lJIh+5QJiK2niSynGYcvirF3hfbKx6GnmBTsbzHK8C5ECmaooEF156Bxj9 kQwtDpoSI7oo+k6yho/iedC9UqCrvzeinhfzmnVFm5MNG5Kx4xteG5kFakRjyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678910848; a=rsa-sha256; cv=none; b=Yoo8HgtdVYqUFWvupJxcz0meDzTA7Ys54INgUY28RtvG3Qt9MPhF24ZNN/ko1rr7o9jlhL LZlnwnuELJXKhEYqv376ixrDvjYmnC5+H5HAvBoTok8uTQdr3PTNsL0htFxw09aIbVnJ4A IxRgC5OOLcJINR+nFzIv4g56+hUFrNek/nIPpT+q+6HKoF/A6d5boX1KtH/COoV247iwGe KF/cnqZ8T/dbr1D7UB2Q8NUvih0RPL67x722LpFbLq7Hg9x9GReCggFhPR5EZxOnabR2L3 /gNUCQblVyEorp8AKlE9fHAAXHhAEXY5B68q+a2syPuFgOHjmPL/cArxR35X/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 4PcLz43lFMzFZ5; Wed, 15 Mar 2023 20:07:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FK7SMr086427; Wed, 15 Mar 2023 20:07:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FK7Ssu086426; Wed, 15 Mar 2023 20:07:28 GMT (envelope-from git) Date: Wed, 15 Mar 2023 20:07:28 GMT Message-Id: <202303152007.32FK7Ssu086426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Justin Hibbits Subject: git: ed2c3bda43fb - stable/13 - powerpc/pmap: Add pmap_sync_icache() for radix pmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed2c3bda43fbd0bfad9e45c78a59fff8a62422da Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=ed2c3bda43fbd0bfad9e45c78a59fff8a62422da commit ed2c3bda43fbd0bfad9e45c78a59fff8a62422da Author: Justin Hibbits AuthorDate: 2023-03-12 15:46:57 +0000 Commit: Justin Hibbits CommitDate: 2023-03-15 20:06:29 +0000 powerpc/pmap: Add pmap_sync_icache() for radix pmap DTrace pid provider writes to user space to set breakpoints. Failing to sync the icache can lead to SIGTRAP. Radix pmap is the only one missing a pmap_sync_icache() method, so the pid provider would only potentially crash a process on a POWER9 or later system. (cherry picked from commit 6f0b2a235a133a381634ba9a7f5f477c64db9873) --- sys/powerpc/aim/mmu_radix.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 34736d5031bd..9f59d524196f 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -464,6 +464,7 @@ void mmu_radix_remove(pmap_t, vm_offset_t, vm_offset_t); void mmu_radix_remove_all(vm_page_t); void mmu_radix_remove_pages(pmap_t); void mmu_radix_remove_write(vm_page_t); +void mmu_radix_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz); void mmu_radix_unwire(pmap_t, vm_offset_t, vm_offset_t); void mmu_radix_zero_page(vm_page_t); void mmu_radix_zero_page_area(vm_page_t, int, int); @@ -541,6 +542,7 @@ static struct pmap_funcs mmu_radix_methods = { .remove = mmu_radix_remove, .remove_all = mmu_radix_remove_all, .remove_write = mmu_radix_remove_write, + .sync_icache = mmu_radix_sync_icache, .unwire = mmu_radix_unwire, .zero_page = mmu_radix_zero_page, .zero_page_area = mmu_radix_zero_page_area, @@ -5912,6 +5914,25 @@ mmu_radix_unmapdev(vm_offset_t va, vm_size_t size) } } +void +mmu_radix_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ + vm_paddr_t pa = 0; + int sync_sz; + + while (sz > 0) { + pa = pmap_extract(pm, va); + sync_sz = PAGE_SIZE - (va & PAGE_MASK); + sync_sz = min(sync_sz, sz); + if (pa != 0) { + pa += (va & PAGE_MASK); + __syncicache((void *)PHYS_TO_DMAP(pa), sync_sz); + } + va += sync_sz; + sz -= sync_sz; + } +} + static __inline void pmap_pte_attr(pt_entry_t *pte, uint64_t cache_bits, uint64_t mask) { From nobody Wed Mar 15 20:47:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcMrm0lvBz3xlxH; Wed, 15 Mar 2023 20:47: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 4PcMrl72VSz3vcK; Wed, 15 Mar 2023 20:47:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678913224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0HQZt51Y1CJ0iZmE/gfg+083rB07iD0gF6t2/0gmzQQ=; b=lMDDGiD+nQx28yYnw8jnGhHdNzhh4u581trL1z8rpk9cG4VcCqxNjflV/PpBEY2H6Xy1iA 5KewWTJCd4KIYpwx5F6O9skZTvmEYJWz60TlP2D8uNEB4cb2OWjHpLIaEYeLqo02YQ39mc b0p097Ja1hFsxQzNegkyTmpjTx3vxyBv8AfEuHMBDDdSDnWJOcAonzjL2jT8eiEPXi9yuq s5iFYJ5CP8gv9OeOpAs9OxR1VX1CWv4spg3bdlNEm74tjslUOhKKb8U2KNMF2M+liyd0B4 MJntr+Ra4dgwEbp0a+5Kl4R3kGcTZrBKKo/oF7hltd/uA4iJSm8Uo450XxkzqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678913224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0HQZt51Y1CJ0iZmE/gfg+083rB07iD0gF6t2/0gmzQQ=; b=cXN+CGqmFB7LYR8YtF79ZV+gUMlJfAGOwVeoOR4v05ypXJ98jHJQweUhGClPyHXkA0GCR0 eHrL4M4EVl3aQ6AsQMOEp9XZSOXGYv7PiRKLJOdML8HvC7JeiB3unrtsNgu8MDV0Q5Uwd5 9sMZ2RuYh/9SrQwWI4yDY9lcHgOBmFslkoeqhVBizUWF40ccG396PsYfLSwp95Vl/zoPDe 6OsKHXSubg5b4tHxT2HNWlBv5TKKz667nVGFvXRGyUPrI+0wSVESt5BcG5YS+Vcl4Kkl7n QPQrmtcrDrgPlEnsnvfZmJJ1b91sJuOdb4pnVFvTv4IfxzxMFZCrrGGXND/5HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678913224; a=rsa-sha256; cv=none; b=gSnTInrd/Zg5GfjLLH5bHIElUZq3ctqSYF7bkkVJIKzhMZb3bystCGSf7uCb4Ij0+iS6Qb pPNMMruHONpnjjvutmAKyVRI/HPed+DQbF+39YANFeMeG8WIkp8JihLVLf00ti0StozLBV OpbzMPSW32YZofRgFggIrMsvW2diZ7ap2M3mN5tbhsnEZjbeQrAI0+BTDTSO9lTeCdjw4l V2t/GKZws4Q51DmGAUp0Ocy5rzenxHut0svcraZz4lFf32agk2OVJ5WyHzFPm7GDg7wf1E aDJdOOnpYV74Pxk++yKp4L1gXDvojTeYTvuZcV7Crto2L3/fELX8TiJfY9r1DQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcMrl5zL5zGfL; Wed, 15 Mar 2023 20:47:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FKl3KK051865; Wed, 15 Mar 2023 20:47:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FKl32C051864; Wed, 15 Mar 2023 20:47:03 GMT (envelope-from git) Date: Wed, 15 Mar 2023 20:47:03 GMT Message-Id: <202303152047.32FKl32C051864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Justin Hibbits Subject: git: fcd94047f33b - releng/13.2 - dtrace/powerpc: "Fix" stack traces across trap frames List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: fcd94047f33beb98f1eee4d09e29d6c8de31c4a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=fcd94047f33beb98f1eee4d09e29d6c8de31c4a6 commit fcd94047f33beb98f1eee4d09e29d6c8de31c4a6 Author: Justin Hibbits AuthorDate: 2023-03-11 16:30:00 +0000 Commit: Justin Hibbits CommitDate: 2023-03-15 20:27:37 +0000 dtrace/powerpc: "Fix" stack traces across trap frames In function boundary tracing the link register is not yet saved to the save stack location, so the save point contains whatever the previous 'lr' save was, or even garbage, at the time the trap is taken. Address this by explicitly loading the link register from the trap frame instead of the stack, and propagate that out. Approved by: re (cperciva) (cherry picked from commit 3e1155ade1baab51458374efd0295bdf6db455fc) (cherry picked from commit e620e088cbd1c062655eee825aaf4f80bd255e1f) (cherry picked from commit 0a21a6659e5dfe503da587fb0460ae19bd765859) --- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c index cce1c907b5d8..1fca72e5b7fd 100644 --- a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c @@ -97,15 +97,18 @@ dtrace_sp_inkernel(uintptr_t sp) } static __inline void -dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc) +dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc, uintptr_t *lr) { vm_offset_t callpc; struct trapframe *frame; + if (lr != 0 && *lr != 0) + callpc = *lr; + else #ifdef __powerpc64__ - callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); #else - callpc = *(vm_offset_t *)(sp + RETURN_OFFSET); + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET); #endif /* @@ -121,6 +124,8 @@ dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc) *nsp = frame->fixreg[1]; if (pc != NULL) *pc = frame->srr0; + if (lr != NULL) + *lr = frame->lr; return; } @@ -128,6 +133,9 @@ dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc) *nsp = *(uintptr_t *)sp; if (pc != NULL) *pc = callpc; + /* lr is only valid for trap frames */ + if (lr != NULL) + *lr = 0; } void @@ -135,7 +143,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) { int depth = 0; - uintptr_t osp, sp; + uintptr_t osp, sp, lr = 0; vm_offset_t callpc; pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; @@ -154,7 +162,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, if (!dtrace_sp_inkernel(sp)) break; osp = sp; - dtrace_next_sp_pc(osp, &sp, &callpc); + dtrace_next_sp_pc(osp, &sp, &callpc, &lr); if (aframes > 0) { aframes--; @@ -513,7 +521,7 @@ dtrace_getstackdepth(int aframes) depth++; osp = sp; - dtrace_next_sp_pc(sp, &sp, NULL); + dtrace_next_sp_pc(sp, &sp, NULL, NULL); } if (depth < aframes) return (0); From nobody Wed Mar 15 20:47:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcMrn1H59z3xmG9; Wed, 15 Mar 2023 20:47: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 4PcMrn0XbYz3vRG; Wed, 15 Mar 2023 20:47:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678913225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O1wB6Kdohu7AAXGY3XVkRpweiZVyaf+gJ0dqr1swUjE=; b=HlheOwLU/jNn96tznVTyR+x7/v9RAbnNtSnOMuEHpy73avdEnk/BPqTRPH9QXKUE1GG0HV h92RrbX4jKAx67A8zRe2f9b1uqU/TC+EwkwoYAtm8CEwaEEo3FBXU28JWfkUiXW0rA+tO1 xI9GGeE3bhK0F5EHQH88roOY9Cr8UdyA0efqvUrglkHi14Sz3eAI+woPCpVua0nzgJgsZ6 yKMt6VEdxPIJS/rp6GvZweAUPn9KmENCUYJ3jHD4zyAEzTQNBDyySVEuID0sIOrwyTylTZ uhB99lO4vRqyz65NxExP9MdGX0nnwAHuoKW4o9niJn9F69fzFPIFi5yF8vmHsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678913225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O1wB6Kdohu7AAXGY3XVkRpweiZVyaf+gJ0dqr1swUjE=; b=KdqhtTcyhcPIIdQrsQEsiA6VahdQVIvgJXAThfX0pNbTXxcsI9QIR3g9Vjw6b8I2nfozpI 4uP+JYuiBDcjV5e3OQMrBT9dkzYB8Ds8sRzvmKfkGs2B0BxlrzM/CMQzlctyMxJRZpytf1 n3dDKMtYTsiIq8p1IjxANxaXkOa9nqiRxHWYyJQmVaA543hzIV3oViPH3VIYnxLMUXIN8v onmtHAlmJfK57s2uVUSSgmTR8Egu/wmfDZp12h5mG8nRjIO3br1LNar+aL09QEPZfpuK/T CCV59pX0wTSOg4IpIJ7KVkaB/2ax1piupL+q700KI4pdTVCoHOsrXPkz8BCe9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678913225; a=rsa-sha256; cv=none; b=gq4EaY0WJXZyqR/uBfr5ptrHVb0yi4iV75njdsMAnXVb34T9MjI8XS/udfnRpKsfz6GWlU IPRXgn0xZmvyEcyS0Ej4NUpUeWJtE8nmPa1pd0QSVNoamVLgfnnA83WFKRaEs9CIXCuwpf XaOlxdQvdkAttSzS9czKKADRIzIf89CU/ecHU1vfPJ8PJm+52KtKpapd0/ePkl7n2Gxg7x jmVtJW6XBFduVDWDNUuHdI3GSZkKed9qAPkQV5WuBysCETuOr/5PjPX3Py9oX/UNEmNczP a9c+8HdMl0NxTS5qey9raiyAf9k7zqxro6EOR4v1rjGDwc1RIc58Myh5i/XEfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcMrm6QXbzGdQ; Wed, 15 Mar 2023 20:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FKl4n7051884; Wed, 15 Mar 2023 20:47:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FKl4Mb051883; Wed, 15 Mar 2023 20:47:04 GMT (envelope-from git) Date: Wed, 15 Mar 2023 20:47:04 GMT Message-Id: <202303152047.32FKl4Mb051883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Justin Hibbits Subject: git: 72d1ee8d6d76 - releng/13.2 - dtrace/powerpc: Adjust AFRAMES for fbt and profile List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 72d1ee8d6d76bd7a1e123d354a5fb356e3cc7908 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=72d1ee8d6d76bd7a1e123d354a5fb356e3cc7908 commit 72d1ee8d6d76bd7a1e123d354a5fb356e3cc7908 Author: Justin Hibbits AuthorDate: 2023-03-11 16:23:38 +0000 Commit: Justin Hibbits CommitDate: 2023-03-15 20:31:32 +0000 dtrace/powerpc: Adjust AFRAMES for fbt and profile FBT_AFRAMES was skipping over too many frames, while PROFILE_AFRAMES was skipping over too few. Adjust them empirically. Approved by: re (cperciva) (cherry picked from commit 635ecbf47015c259226cb47a3de8fc00c9ed5924) (cherry picked from commit 1026d170f4f70cdeb63cd05819c5557041e8ea94) --- sys/cddl/dev/fbt/powerpc/fbt_isa.c | 2 +- sys/cddl/dev/profile/profile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cddl/dev/fbt/powerpc/fbt_isa.c b/sys/cddl/dev/fbt/powerpc/fbt_isa.c index 0da74c9cf076..eb7feceb269d 100644 --- a/sys/cddl/dev/fbt/powerpc/fbt_isa.c +++ b/sys/cddl/dev/fbt/powerpc/fbt_isa.c @@ -48,7 +48,7 @@ #define FBT_ENTRY "entry" #define FBT_RETURN "return" -#define FBT_AFRAMES 7 +#define FBT_AFRAMES 5 int fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index 48decf3a89cf..99381ea7d745 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -108,7 +108,7 @@ /* * This value is bogus just to make module compilable on powerpc */ -#define PROF_ARTIFICIAL_FRAMES 3 +#define PROF_ARTIFICIAL_FRAMES 8 #endif struct profile_probe_percpu; From nobody Wed Mar 15 20:47:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcMrp20Jcz3xmGC; Wed, 15 Mar 2023 20:47: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 4PcMrp1B0Rz3vgn; Wed, 15 Mar 2023 20:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678913226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/7l9xdjH1DyqYcZsbM9gTdOsFouuLf2O4ssd4Y+AXOc=; b=P7vhnb5cv5ZTlikpUxqgj7erFl8nRGpIoWgEooFpy+KgXongePLJk/TwCH4jin9HSBio0C w9CfCyap33kF1vpXuwC9AvelffmNfKFG3S0R516qqZY3Vu+xhhBLea4pBTjqncOsWAChOX kH3BGV3y5l9+aF00SDtO1A7leGbMqOmW2eP2/+hWQETEZYgKQ5AmssMC1WTpAIhLTfLTey SmfXh4BG5eZR4IDOw5JUG7drTzSAhhFgMcCEv9MB/lJ9H4gKBXr+1frnI06ZJi8bTpA3eB kRWhA3B7FmdP9vrQ3X/sMUE9x3IR8HXRv6NtbmIK5lLxXn3520f9reVFmQ5hcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678913226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/7l9xdjH1DyqYcZsbM9gTdOsFouuLf2O4ssd4Y+AXOc=; b=vSzrVeL2GNNG6H5WrU7fFRyy+l0itGRvS9w9t1xfyBt+NLfZR1R4zuB01F9xy+HNvmv+AD 0rIS1SeRq7oSxVc6wcb0Tgej1wFDDU5KkT7MIy64FYu8AHuf+GJOIr+hX5T5fipuUCiDwN CoAKlWwenoVM0FP3Q6leCSDgS9nS2bgoh4jYrZEf8qT4wOUSkyqMEs4sUJ1/90fDAbpPA5 DDWZNyUI2oiniK7oSKWaKSKZsE/U6XdMGRYOw/yMq5deKKiwUolj+KGSHRexuXJf8Gu+xG /eBGgEJjl4bDEcR/hLlTS5xCIJC723RsksCRKsRxsYkPM7es20qiuKW10mpe9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678913226; a=rsa-sha256; cv=none; b=BGdNM8D6vbATzFUMEvcCSSC3Z/OSZkae8hCVyAp/oSA90buaXvHdEuELvQH3C8Osng4s3p a49+n6tg38/+7f3FP1gqtea64KNDoapMytWfOrCXTNmQHFgUl1nrFmSDtvRVWggxDl0tKi clfSxDW2CuZltB0VWDxWnYp+FS24H5Qnuci7Ng/cM90qMrsC6Hu/dQBNz/kwgDYyxeSEVi KWDU9vMN8ECEs8ZbMrsxnp3C2tG5AOzP4LYKwGxB8dSr+QGOAvlBxgltM6zkZfgEruNc7/ ROZfTT+B/Rz8WrMA7mjkKBcmGd4qiqNyinzfIRnBWxu8/NnzWUfPlKsPe/ezVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcMrp00VHzGH7; Wed, 15 Mar 2023 20:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FKl5Xv051910; Wed, 15 Mar 2023 20:47:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FKl5PZ051909; Wed, 15 Mar 2023 20:47:05 GMT (envelope-from git) Date: Wed, 15 Mar 2023 20:47:05 GMT Message-Id: <202303152047.32FKl5PZ051909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Justin Hibbits Subject: git: f2df50925ee9 - releng/13.2 - powerpc/pmap: Add pmap_sync_icache() for radix pmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: f2df50925ee95ba201e2006931f0c0fbedd8e1ca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=f2df50925ee95ba201e2006931f0c0fbedd8e1ca commit f2df50925ee95ba201e2006931f0c0fbedd8e1ca Author: Justin Hibbits AuthorDate: 2023-03-12 15:46:57 +0000 Commit: Justin Hibbits CommitDate: 2023-03-15 20:31:40 +0000 powerpc/pmap: Add pmap_sync_icache() for radix pmap DTrace pid provider writes to user space to set breakpoints. Failing to sync the icache can lead to SIGTRAP. Radix pmap is the only one missing a pmap_sync_icache() method, so the pid provider would only potentially crash a process on a POWER9 or later system. Approved by: re (cperciva) (cherry picked from commit 6f0b2a235a133a381634ba9a7f5f477c64db9873) (cherry picked from commit ed2c3bda43fbd0bfad9e45c78a59fff8a62422da) --- sys/powerpc/aim/mmu_radix.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 34736d5031bd..9f59d524196f 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -464,6 +464,7 @@ void mmu_radix_remove(pmap_t, vm_offset_t, vm_offset_t); void mmu_radix_remove_all(vm_page_t); void mmu_radix_remove_pages(pmap_t); void mmu_radix_remove_write(vm_page_t); +void mmu_radix_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz); void mmu_radix_unwire(pmap_t, vm_offset_t, vm_offset_t); void mmu_radix_zero_page(vm_page_t); void mmu_radix_zero_page_area(vm_page_t, int, int); @@ -541,6 +542,7 @@ static struct pmap_funcs mmu_radix_methods = { .remove = mmu_radix_remove, .remove_all = mmu_radix_remove_all, .remove_write = mmu_radix_remove_write, + .sync_icache = mmu_radix_sync_icache, .unwire = mmu_radix_unwire, .zero_page = mmu_radix_zero_page, .zero_page_area = mmu_radix_zero_page_area, @@ -5912,6 +5914,25 @@ mmu_radix_unmapdev(vm_offset_t va, vm_size_t size) } } +void +mmu_radix_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ + vm_paddr_t pa = 0; + int sync_sz; + + while (sz > 0) { + pa = pmap_extract(pm, va); + sync_sz = PAGE_SIZE - (va & PAGE_MASK); + sync_sz = min(sync_sz, sz); + if (pa != 0) { + pa += (va & PAGE_MASK); + __syncicache((void *)PHYS_TO_DMAP(pa), sync_sz); + } + va += sync_sz; + sz -= sync_sz; + } +} + static __inline void pmap_pte_attr(pt_entry_t *pte, uint64_t cache_bits, uint64_t mask) { From nobody Wed Mar 15 20:53:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcN0863fkz3xmqH; Wed, 15 Mar 2023 20:53: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 4PcN085sLtz3wVF; Wed, 15 Mar 2023 20:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678913608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EI5guLqmPq4+ZPX+F6wExkYLwtZq1PfxRD86Pvu+4EI=; b=k3Wg1l+Y+nJrUDtl4u9+XPQTtey4SweJSA5sGiszCAenq3+mb440XXpxgM/cTKzcYuA2XL oj5/Wx/FVaHiVZH/MR7zYH2y7tHq/6wKtImBax4SWVxOHX5+LlmB96ItrLDNd52sq4mQ4T K0qSrfdzCSxgN0M2XItFD0+hpH86frG6d4dfPMvAbQDUqH375V6JxcMB50WEc3JxROIiru JWcCsqIwfhh+d2RTAqQEMagT0QqkgQ4DuFgo2jXRsofVV4rjXzNVjT9G9+rdUbjVbU3hPu XsRqSQ3CSvP8IeI98gQrhyU6c1juC071VYdmACpsFGclMzXLvkYok94WWyoipg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678913608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EI5guLqmPq4+ZPX+F6wExkYLwtZq1PfxRD86Pvu+4EI=; b=Xy6ko5jGS35xH4p3TBtAO8+VpyB+ak2xDGgqqdOluOoXM/hnL3g3tpc1fV7GgwG6vhkRvx /6iAJvT0Txb8IdfmPTStV5I7vyTsNTo5mfnFYIkAvuOW9QKKiG8xIHOIePT+CTl179GSkg Ac2/hxU4V5IPgvrk/n5+tcq+8IJRQD7PRXGKoeMBpSVQN4WnIGiyyPxk/bf9+p1KwmoUDG 7rURRpxONPXI6AgPlBdZeNBTMBAbLiH6vG7wp1YO3KfeLd27cXFKViIdyAMzX2ETncDvWC oZVUd+xnL3sNvAlQognCnmVAHp8Y/HBE2GtR1DSpBPmwVqW4FCoKi54oMjarFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678913608; a=rsa-sha256; cv=none; b=c+KpAUbFHBbdXeUvBylGfzzeVjFm630Z/EJ6DF6SIFoHqEPddK7/+4zw07uJxfHstK8iBM zQebz2TG1GEOejzH/ODbBXCW+CMk1ipS9c7vz/mHAc3a15crhFgUhDwMwZmbIvfDN4hmT8 Npdc+afJjtXEWQMHo2kKdH9FZfNP9oTOTbHwKSOJ5NleZXoD3VP95PKAnmNAGCCB8kDnp1 aercnJwIeT9EHVSDJpqIkWgyfx06OqeL7J0kxJassvtltaagvzqtDAgjV5jLGwBooKkIzv cvQi0TBXnxDlPSMbxG2cyN9XQHZfRvoH0HgmBGVmc7orIUJfpuXrsdp1irjv5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcN084w5KzGnZ; Wed, 15 Mar 2023 20:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FKrS2d067987; Wed, 15 Mar 2023 20:53:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FKrSdD067986; Wed, 15 Mar 2023 20:53:28 GMT (envelope-from git) Date: Wed, 15 Mar 2023 20:53:28 GMT Message-Id: <202303152053.32FKrSdD067986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 73ae25c174b5 - main - netlink: improve snl(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73ae25c174b515616050496dea764a943796efef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=73ae25c174b515616050496dea764a943796efef commit 73ae25c174b515616050496dea764a943796efef Author: Alexander V. Chernikov AuthorDate: 2023-03-15 13:56:26 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-03-15 20:53:20 +0000 netlink: improve snl(3) Summary: * add snl_send_message() as a convenient send wrapper * add signed integer parsers * add snl_read_reply_code() to simplify operation result checks * add snl_read_reply_multi() to simplify reading multipart messages * add snl_create_genl_msg_request() * add snl_get_genl_family() to simplify family name->id resolution * add tests for some of the functionality Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D39092 MFC after: 2 weeks --- sys/netlink/netlink_snl.h | 104 +++++++++++++++++++++++++++++------ sys/netlink/netlink_snl_generic.h | 97 ++++++++++++++++++++++++++++++++ tests/sys/netlink/Makefile | 2 +- tests/sys/netlink/test_snl.c | 58 ++++++++++--------- tests/sys/netlink/test_snl_generic.c | 77 ++++++++++++++++++++++++++ 5 files changed, 294 insertions(+), 44 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 31b90003b519..be512b67c7ec 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -258,6 +258,14 @@ snl_send(struct snl_state *ss, void *data, int sz) return (send(ss->fd, data, sz, 0) == sz); } +static inline bool +snl_send_message(struct snl_state *ss, struct nlmsghdr *hdr) +{ + ssize_t sz = NLMSG_ALIGN(hdr->nlmsg_len); + + return (send(ss->fd, hdr, sz, 0) == sz); +} + static inline uint32_t snl_get_seq(struct snl_state *ss) { @@ -298,10 +306,9 @@ snl_read_message(struct snl_state *ss) static inline struct nlmsghdr * snl_read_reply(struct snl_state *ss, uint32_t nlmsg_seq) { - while (true) { - struct nlmsghdr *hdr = snl_read_message(ss); - if (hdr == NULL) - break; + struct nlmsghdr *hdr; + + while ((hdr = snl_read_message(ss)) != NULL) { if (hdr->nlmsg_seq == nlmsg_seq) return (hdr); } @@ -309,16 +316,6 @@ snl_read_reply(struct snl_state *ss, uint32_t nlmsg_seq) return (NULL); } -static inline struct nlmsghdr * -snl_get_reply(struct snl_state *ss, struct nlmsghdr *hdr) -{ - uint32_t nlmsg_seq = hdr->nlmsg_seq; - - if (snl_send(ss, hdr, hdr->nlmsg_len)) - return (snl_read_reply(ss, nlmsg_seq)); - return (NULL); -} - /* * Checks that attributes are sorted by attribute type. */ @@ -472,6 +469,34 @@ snl_attr_get_uint64(struct snl_state *ss __unused, struct nlattr *nla, return (false); } +static inline bool +snl_attr_get_int8(struct snl_state *ss, struct nlattr *nla, const void *arg, + void *target) +{ + return (snl_attr_get_uint8(ss, nla, arg, target)); +} + +static inline bool +snl_attr_get_int16(struct snl_state *ss, struct nlattr *nla, const void *arg, + void *target) +{ + return (snl_attr_get_uint16(ss, nla, arg, target)); +} + +static inline bool +snl_attr_get_int32(struct snl_state *ss, struct nlattr *nla, const void *arg, + void *target) +{ + return (snl_attr_get_uint32(ss, nla, arg, target)); +} + +static inline bool +snl_attr_get_int64(struct snl_state *ss, struct nlattr *nla, const void *arg, + void *target) +{ + return (snl_attr_get_uint64(ss, nla, arg, target)); +} + static inline bool snl_attr_get_string(struct snl_state *ss __unused, struct nlattr *nla, const void *arg __unused, void *target) @@ -573,14 +598,55 @@ static const struct snl_field_parser nlf_p_errmsg[] = { #undef _OUT SNL_DECLARE_PARSER(snl_errmsg_parser, struct nlmsgerr, nlf_p_errmsg, nla_p_errmsg); +#define _IN(_field) offsetof(struct nlmsgerr, _field) +#define _OUT(_field) offsetof(struct snl_errmsg_data, _field) +static const struct snl_attr_parser nla_p_donemsg[] = {}; + +static const struct snl_field_parser nlf_p_donemsg[] = { + { .off_in = _IN(error), .off_out = _OUT(error), .cb = snl_field_get_uint32 }, +}; +#undef _IN +#undef _OUT +SNL_DECLARE_PARSER(snl_donemsg_parser, struct nlmsgerr, nlf_p_donemsg, nla_p_donemsg); + static inline bool -snl_check_return(struct snl_state *ss, struct nlmsghdr *hdr, struct snl_errmsg_data *e) +snl_read_reply_code(struct snl_state *ss, uint32_t nlmsg_seq, struct snl_errmsg_data *e) { - if (hdr != NULL && hdr->nlmsg_type == NLMSG_ERROR) - return (snl_parse_nlmsg(ss, hdr, &snl_errmsg_parser, e)); + struct nlmsghdr *hdr = snl_read_reply(ss, nlmsg_seq); + + if (hdr == NULL) { + e->error = EINVAL; + } else if (hdr->nlmsg_type == NLMSG_ERROR) { + if (!snl_parse_nlmsg(ss, hdr, &snl_errmsg_parser, e)) + e->error = EINVAL; + return (e->error == 0); + } + return (false); } +/* + * Assumes e is zeroed + */ +static inline struct nlmsghdr * +snl_read_reply_multi(struct snl_state *ss, uint32_t nlmsg_seq, struct snl_errmsg_data *e) +{ + struct nlmsghdr *hdr = snl_read_reply(ss, nlmsg_seq); + + if (hdr == NULL) { + e->error = EINVAL; + } else if (hdr->nlmsg_type == NLMSG_ERROR) { + if (!snl_parse_nlmsg(ss, hdr, &snl_errmsg_parser, e)) + e->error = EINVAL; + } if (hdr->nlmsg_type == NLMSG_DONE) { + snl_parse_nlmsg(ss, hdr, &snl_donemsg_parser, e); + } else + return (hdr); + + return (NULL); +} + + /* writer logic */ struct snl_writer { char *base; @@ -849,4 +915,8 @@ snl_send_msgs(struct snl_writer *nw) return (snl_send(nw->ss, nw->base, offset)); } +static const struct snl_hdr_parser *snl_all_core_parsers[] = { + &snl_errmsg_parser, &snl_donemsg_parser, +}; + #endif diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h new file mode 100644 index 000000000000..a725e6948b43 --- /dev/null +++ b/sys/netlink/netlink_snl_generic.h @@ -0,0 +1,97 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2022 Alexander V. Chernikov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _NETLINK_NETLINK_SNL_GENERIC_H_ +#define _NETLINK_NETLINK_SNL_GENERIC_H_ + +#include +#include +#include + +/* Genetlink helpers */ +static inline struct nlmsghdr * +snl_create_genl_msg_request(struct snl_writer *nw, int genl_family, uint8_t genl_cmd) +{ + assert(nw->hdr == NULL); + + struct nlmsghdr *hdr = snl_reserve_msg_object(nw, struct nlmsghdr); + hdr->nlmsg_type = genl_family; + hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; + nw->hdr = hdr; + struct genlmsghdr *ghdr = snl_reserve_msg_object(nw, struct genlmsghdr); + ghdr->cmd = genl_cmd; + + return (hdr); +} + +static struct snl_field_parser snl_fp_genl[] = {}; + +#define SNL_DECLARE_GENL_PARSER(_name, _np) SNL_DECLARE_PARSER(_name,\ + struct genlmsghdr, snl_fp_genl, _np) + +struct _getfamily_attrs { + uint16_t family_id; + char *family_name; +}; + +#define _IN(_field) offsetof(struct genlmsghdr, _field) +#define _OUT(_field) offsetof(struct _getfamily_attrs, _field) +static struct snl_attr_parser _nla_p_getfam[] = { + { .type = CTRL_ATTR_FAMILY_ID , .off = _OUT(family_id), .cb = snl_attr_get_uint16 }, + { .type = CTRL_ATTR_FAMILY_NAME, .off = _OUT(family_name), .cb = snl_attr_get_string }, +}; +#undef _IN +#undef _OUT +SNL_DECLARE_GENL_PARSER(_genl_ctrl_getfam_parser, _nla_p_getfam); + +static inline uint16_t +snl_get_genl_family(struct snl_state *ss, const char *family_name) +{ + struct snl_writer nw; + struct nlmsghdr *hdr; + + snl_init_writer(ss, &nw); + hdr = snl_create_genl_msg_request(&nw, GENL_ID_CTRL, CTRL_CMD_GETFAMILY); + snl_add_msg_attr_string(&nw, CTRL_ATTR_FAMILY_NAME, family_name); + if (snl_finalize_msg(&nw) == NULL || !snl_send_message(ss, hdr)) + return (0); + + hdr = snl_read_reply(ss, hdr->nlmsg_seq); + if (hdr != NULL && hdr->nlmsg_type != NLMSG_ERROR) { + struct _getfamily_attrs attrs = {}; + + if (snl_parse_nlmsg(ss, hdr, &_genl_ctrl_getfam_parser, &attrs)) + return (attrs.family_id); + } + + return (0); +} + +static const struct snl_hdr_parser *snl_all_genl_parsers[] = { + &_genl_ctrl_getfam_parser, +}; + +#endif diff --git a/tests/sys/netlink/Makefile b/tests/sys/netlink/Makefile index 175be36ea083..16559f0e9d3d 100644 --- a/tests/sys/netlink/Makefile +++ b/tests/sys/netlink/Makefile @@ -5,7 +5,7 @@ WARNS?= 1 TESTSDIR= ${TESTSBASE}/sys/netlink -ATF_TESTS_C += test_snl +ATF_TESTS_C += test_snl test_snl_generic ATF_TESTS_PYTEST += test_nl_core.py ATF_TESTS_PYTEST += test_rtnl_iface.py ATF_TESTS_PYTEST += test_rtnl_ifaddr.py diff --git a/tests/sys/netlink/test_snl.c b/tests/sys/netlink/test_snl.c index daacc1aaacec..85bdff7fb163 100644 --- a/tests/sys/netlink/test_snl.c +++ b/tests/sys/netlink/test_snl.c @@ -20,13 +20,25 @@ require_netlink(void) atf_tc_skip("netlink module not loaded"); } -ATF_TC(snl_verify_parsers); -ATF_TC_HEAD(snl_verify_parsers, tc) +ATF_TC(snl_verify_core_parsers); +ATF_TC_HEAD(snl_verify_core_parsers, tc) { - atf_tc_set_md_var(tc, "descr", "Tests snl(3) parsers are correct"); + atf_tc_set_md_var(tc, "descr", "Tests snl(3) core nlmsg parsers are correct"); } -ATF_TC_BODY(snl_verify_parsers, tc) +ATF_TC_BODY(snl_verify_core_parsers, tc) +{ + SNL_VERIFY_PARSERS(snl_all_core_parsers); + +} + +ATF_TC(snl_verify_route_parsers); +ATF_TC_HEAD(snl_verify_route_parsers, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests snl(3) route parsers are correct"); +} + +ATF_TC_BODY(snl_verify_route_parsers, tc) { SNL_VERIFY_PARSERS(snl_all_route_parsers); @@ -61,45 +73,39 @@ SNL_DECLARE_PARSER(link_parser, struct ifinfomsg, fp_link, ap_link); ATF_TC_BODY(snl_list_ifaces, tc) { struct snl_state ss; + struct snl_writer nw; require_netlink(); if (!snl_init(&ss, NETLINK_ROUTE)) atf_tc_fail("snl_init() failed"); - struct { - struct nlmsghdr hdr; - struct ifinfomsg ifmsg; - } msg = { - .hdr.nlmsg_type = RTM_GETLINK, - .hdr.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST, - .hdr.nlmsg_seq = snl_get_seq(&ss), - }; - msg.hdr.nlmsg_len = sizeof(msg); - - if (!snl_send(&ss, &msg, sizeof(msg))) { - snl_free(&ss); - atf_tc_fail("snl_send() failed"); - } + snl_init_writer(&ss, &nw); + + struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETLINK); + ATF_CHECK(hdr != NULL); + ATF_CHECK(snl_reserve_msg_object(&nw, struct ifinfomsg) != NULL); + ATF_CHECK(snl_finalize_msg(&nw) != NULL); + uint32_t seq_id = hdr->nlmsg_seq; - struct nlmsghdr *hdr; + ATF_CHECK(snl_send_message(&ss, hdr)); + + struct snl_errmsg_data e = {}; int count = 0; - while ((hdr = snl_read_message(&ss)) != NULL && hdr->nlmsg_type != NLMSG_DONE) { - if (hdr->nlmsg_seq != msg.hdr.nlmsg_seq) - continue; - struct nl_parsed_link link = {}; - if (!snl_parse_nlmsg(&ss, hdr, &link_parser, &link)) - continue; + while ((hdr = snl_read_reply_multi(&ss, seq_id, &e)) != NULL) { count++; } + ATF_REQUIRE(e.error == 0); + ATF_REQUIRE_MSG(count > 0, "Empty interface list"); } ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, snl_verify_core_parsers); + ATF_TP_ADD_TC(tp, snl_verify_route_parsers); ATF_TP_ADD_TC(tp, snl_list_ifaces); - ATF_TP_ADD_TC(tp, snl_verify_parsers); return (atf_no_error()); } diff --git a/tests/sys/netlink/test_snl_generic.c b/tests/sys/netlink/test_snl_generic.c new file mode 100644 index 000000000000..c65d134f080d --- /dev/null +++ b/tests/sys/netlink/test_snl_generic.c @@ -0,0 +1,77 @@ +#include +#include +#include + +#include +#include + +#include +#include "netlink/netlink_snl.h" +#include "netlink/netlink_snl_generic.h" + +#include + +static void +require_netlink(void) +{ + if (modfind("netlink") == -1) + atf_tc_skip("netlink module not loaded"); +} + +ATF_TC(snl_verify_genl_parsers); +ATF_TC_HEAD(snl_verify_genl_parsers, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests snl(3) generic parsers are correct"); +} + +ATF_TC_BODY(snl_verify_genl_parsers, tc) +{ + SNL_VERIFY_PARSERS(snl_all_genl_parsers); + +} + +ATF_TC(test_snl_get_genl_family_success); +ATF_TC_HEAD(test_snl_get_genl_family_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests successfull resolution of the 'nlctrl' family"); +} + +ATF_TC_BODY(test_snl_get_genl_family_success, tc) +{ + struct snl_state ss; + + require_netlink(); + + if (!snl_init(&ss, NETLINK_GENERIC)) + atf_tc_fail("snl_init() failed"); + + ATF_CHECK_EQ(snl_get_genl_family(&ss, "nlctrl"), GENL_ID_CTRL); +} + +ATF_TC(test_snl_get_genl_family_failure); +ATF_TC_HEAD(test_snl_get_genl_family_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests unsuccessfull resolution of 'no-such-family' family"); +} + +ATF_TC_BODY(test_snl_get_genl_family_failure, tc) +{ + struct snl_state ss; + + require_netlink(); + + if (!snl_init(&ss, NETLINK_GENERIC)) + atf_tc_fail("snl_init() failed"); + + ATF_CHECK_EQ(snl_get_genl_family(&ss, "no-such-family"), 0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, snl_verify_genl_parsers); + ATF_TP_ADD_TC(tp, test_snl_get_genl_family_success); + ATF_TP_ADD_TC(tp, test_snl_get_genl_family_failure); + + return (atf_no_error()); +} + From nobody Wed Mar 15 21:35:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcNx53LMMz3xqFs; Wed, 15 Mar 2023 21:35: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 4PcNx52ZMWz437R; Wed, 15 Mar 2023 21:35:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678916153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TA2vp8YeCO50kC2bmheQLVAeDaU4FPtdV4YlDL60on0=; b=CgHlIsJWAteqr9mP2vepzLV5YRTuaSeEnNPSHuU5n/5n6JKenEtgRTz2TxKScKzH0d0KKH FO2LGTEKAIoxU5a6FQliS48BjmDKzJZzGgliuwxB0VstPOer3RRCBTpddvkvWwipJVrtp1 8hyEt5MS/K3Ybqc79gcYx71Y5m37mAb0soLd/jWHi1tBOS34Xr0/vJTR3J00WF4FPRlrN/ 51ZrKCne4njx+dzqtWb74I3O/BjaF91Jk1NwT5Z3fCpMQg+wATJCE5rVwdvf9lz+pJhhvQ 2IyLvrf9vrqZ8DWh8R31neooc92Hb5d4n4IhLaF8+X+inU+I46dQ3HcviQpV0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678916153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TA2vp8YeCO50kC2bmheQLVAeDaU4FPtdV4YlDL60on0=; b=p0+/0BwYD7EiLZ2oTklKvxlKjAzC1qLpZve0s6NTjdHYz5KoXnFtjf6jvSGj/Y1ewTfR/y cRtik4/dlp7eERHunrqhOO5Yp99f/aq533wxdoVT5kSu4T23UdkytxSpW+aSY1uOP7KQS4 EDPr4sslB0uKm2/sFcCxlfSafKj5YgtN9HfF093c/WRgJyVnbBXrHj/Wr44lop6MzEEJHz hDjsWz+J6ZEK/re6XZJmeppK23jNFKrqIU3O45uHxrPvveZnSQz1R2uf9w1UpEoV8siRSw JoZw6UZXFfJ4pIiW7ogBMIhAnaq/zawaq5xtETmf3q6bljx9PHvpsXZOUFmPuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678916153; a=rsa-sha256; cv=none; b=Nd37m4hhf3/X37UkI5skwOPaCuSjPlri6vwhlt4f2dRAUls4wgBWP8lBv7iNHDwvr4HI2X EEaRSxh5XxA44YgHHiWsOvi2GLHqY4b8Av/nnwR9RuQVOEJO/KNnqxo4svLnI1x6Vr2Ao+ HJOBEFSg6nzXvRFcEEDqmw/+c4Jw0b/fEUZl0gYdOi6pxjOXNu0OdjpX9n6XA/5OxpaY/Q D2cWBrm7f4I+wuYbpac3CW1s3KTlRkHs3r2sgGNceuBsFNfzWlJJE3FgnmWOPQQGG+O9Bd WgD0efralzfT+7O657pepevqlZYVfk9oRJ+8nbAU4+IYDCddCumOzYFon9u5Cg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcNx51PSqzGqt; Wed, 15 Mar 2023 21:35:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FLZrTV034579; Wed, 15 Mar 2023 21:35:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FLZru7034578; Wed, 15 Mar 2023 21:35:53 GMT (envelope-from git) Date: Wed, 15 Mar 2023 21:35:53 GMT Message-Id: <202303152135.32FLZru7034578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 6026b45aabb3 - main - sctp: improve negotiation of zero checksum feature List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6026b45aabb3324934d076db53b48c50ce30a63d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6026b45aabb3324934d076db53b48c50ce30a63d commit 6026b45aabb3324934d076db53b48c50ce30a63d Author: Michael Tuexen AuthorDate: 2023-03-15 21:29:52 +0000 Commit: Michael Tuexen CommitDate: 2023-03-15 21:29:52 +0000 sctp: improve negotiation of zero checksum feature Enforce consistency between announcing 0-cksum support and actually using it in the association. The value from the inp when the INIT ACK is sent must be used, not the one from the inp when the cookie is received. --- sys/netinet/sctp_header.h | 3 ++- sys/netinet/sctp_input.c | 2 ++ sys/netinet/sctp_output.c | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_header.h b/sys/netinet/sctp_header.h index 4d5b5bc9db0b..93dda17ae9b1 100644 --- a/sys/netinet/sctp_header.h +++ b/sys/netinet/sctp_header.h @@ -180,7 +180,7 @@ struct sctp_init { } SCTP_PACKED; #define SCTP_IDENTIFICATION_SIZE 16 #define SCTP_ADDRESS_SIZE 4 -#define SCTP_RESERVE_SPACE 6 +#define SCTP_RESERVE_SPACE 5 /* state cookie header */ struct sctp_state_cookie { /* this is our definition... */ uint8_t identification[SCTP_IDENTIFICATION_SIZE]; /* id of who we are */ @@ -207,6 +207,7 @@ struct sctp_state_cookie { /* this is our definition... */ uint8_t ipv4_scope; /* IPv4 private addr scope */ uint8_t loopback_scope; /* loopback scope information */ + uint8_t zero_checksum; /* copy of the inp value */ uint8_t reserved[SCTP_RESERVE_SPACE]; /* Align to 64 bits */ /* * at the end is tacked on the INIT chunk and the INIT-ACK chunk diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index dfc74e1e84f3..6299c5c7d827 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1880,6 +1880,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), aack); } + asoc->zero_checksum = cookie->zero_checksum; /* process the INIT-ACK info (my info) */ asoc->my_vtag = ntohl(initack_cp->init.initiate_tag); @@ -2076,6 +2077,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, SCTP_FROM_SCTP_INPUT + SCTP_LOC_18); return (NULL); } + asoc->zero_checksum = cookie->zero_checksum; /* process the INIT-ACK info (my info) */ asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 97e89cb1396c..2ce05336482a 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5804,6 +5804,11 @@ do_a_abort: #endif } } + if (asoc != NULL) { + stc.zero_checksum = asoc->zero_checksum > 0 ? 1 : 0; + } else { + stc.zero_checksum = inp->zero_checksum; + } /* Now lets put the SCTP header in place */ initack = mtod(m, struct sctp_init_ack_chunk *); /* Save it off for quick ref */ From nobody Wed Mar 15 21:57:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcPQ64Gf0z3xr2S; Wed, 15 Mar 2023 21:57: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 4PcPQ63crlz44NG; Wed, 15 Mar 2023 21:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678917454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pABz+mJaD5RLWFFsAGSc2ga17Oy/PtL5dVG6wc3A7AU=; b=HTWmY6e87+odPqjHvRoN52pHWCurXmQaWbbZt825tIYQ+leYFPaXdTbchhqQZqyYJ2besH LNj3hY7iFfQaOM1vSZCannnuZhaDivBy7HrXaOTtkFYd6S4q1LAcNzdpEqJGYBtbKDYzC0 6lEHlqJ2J5gQnn3jx2NrhDAhJD1UmeoljADoinNgtTEI/Ms2JyirRh97s47s3+2rO798sk EgOOG1FRrvLz/xKDqAOekEi9MJBY6j3zwsXy0rG2V2YiLijN5shQJCi5JRlU7DyAb9SvF/ 11jjdsmAHlpyJE4Ang7T/cUDwx2tzth969qc+v0j4Ke5XvhunjLrrfVBFmZdVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678917454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pABz+mJaD5RLWFFsAGSc2ga17Oy/PtL5dVG6wc3A7AU=; b=E+0TTDljtiWPvOzONqrH4G7kIhkSRv9B7QNMCSmAS8zDKOzZXcMqSpRr42by/WLk2d8h7i eKwvlZDreZwwzVrcOJdG0hR0DgbygB6bEtKwBmkq8gpHHI9WPfnpSrouDst+W6WEcxb6C6 nJlZlVVNciuK4EE2FFeuVzzyGWhnQz2wxqoeT3p5GnXX3N1dF70yi4WZQgc2TPxkIZYQgb u5/j0dsUV7MzjYTfwcfYZoOLuA8vQgNAzWYM3nuaC2gOP57TbmTuA+0d6kEBndYOvz1zAf 2otavq8Kl+ZrxgcegI/SGF4L40rUWagwjcVBQuanuUXrX0UN2UchRML7W+8mYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678917454; a=rsa-sha256; cv=none; b=He+A9rDD2cSQReMRIFua9xLj4irbYjTS+ZSKr3dGikIDwd/mr0fjiq6EY0DREROS7QfNhb FAPxYnOSbzygyTQujG/Sy+C7f0fxnA1avupmC4Y2j06GJqPBvni39ACmFlh7oYuL+6znzB unrkrC25FYzxhilgIhv8IW46D9Lfu0mjHzE3ztZnYcedYGZU1FPSuEjDT5R/pMhJrm66Rw UOWUN3Gek3yZ8NLjOD920njdIMPlVYTEZeAF5YsnjNPTKUa1uIrlzXbDzq2c2WQNe4toBD SIrW04uzy3l/WcQcU9pNkMbyjpClrk3Ee5wwnXogjm8oP3/E53V0wvWCQXlp2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcPQ62gNVzJ83; Wed, 15 Mar 2023 21:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FLvYTC067615; Wed, 15 Mar 2023 21:57:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FLvYLL067614; Wed, 15 Mar 2023 21:57:34 GMT (envelope-from git) Date: Wed, 15 Mar 2023 21:57:34 GMT Message-Id: <202303152157.32FLvYLL067614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: cee09bda03c8 - main - sctp: allow disabling of SCTP_ACCEPT_ZERO_CHECKSUM socket option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cee09bda03c8be540f1c02d933db714ee2bd6ec7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=cee09bda03c8be540f1c02d933db714ee2bd6ec7 commit cee09bda03c8be540f1c02d933db714ee2bd6ec7 Author: Michael Tuexen AuthorDate: 2023-03-15 21:55:23 +0000 Commit: Michael Tuexen CommitDate: 2023-03-15 21:55:23 +0000 sctp: allow disabling of SCTP_ACCEPT_ZERO_CHECKSUM socket option --- sys/netinet/sctp_usrreq.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 57d5abdebd30..65edfb49a955 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -6840,18 +6840,10 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, SCTP_CHECK_AND_CAST(value, optval, uint32_t, optsize); SCTP_INP_WLOCK(inp); - if (*value == 0) { - /* - * Do not allow turning zero checksum - * acceptance off again, since this could - * result in inconsistent behaviour for - * listeners. - */ - if (inp->zero_checksum > 0) { - error = EINVAL; - } - } else { + if (*value != 0) { inp->zero_checksum = 1; + } else { + inp->zero_checksum = 0; } SCTP_INP_WUNLOCK(inp); break; From nobody Wed Mar 15 22:36:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcQHb41mFz3xtTw; Wed, 15 Mar 2023 22:36: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 4PcQHb3Ys9z47CQ; Wed, 15 Mar 2023 22:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678919819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6zqLsSPczd3LJ1o9NrOAeidM2Bn6y9RlZZ/ZieOUVz0=; b=H7Dw1aXPTG8xblmuMzDCa0+11B38WLxkrsOAQ2R8+VdeopxgbXuQbe6HZioedrNtzDVU61 tGo5Up1Lw+uLOqlkqqfsMgq6UC6zcVtJFwzkemo4TWKcMVazQhmdqGfA8+V/X5TQpBIbJx ptRef6hV4codu7CsY1DcRSQOzeIhmHvVCwQUxFr0EFSTB0kLL7n0uErkQJ4mnw1HHc8isk GimAvlsKicm/t1+jnGJfSw1AMs7zUnw4Z4NGXxc80X7yed5NaNjXe1cwOfovU11mrp5Pfe jx9mszNo57VqdndAIZAffvIoE67vJPv3u2d2rVojVJl0z8B6zqNN4AgElFZGHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678919819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6zqLsSPczd3LJ1o9NrOAeidM2Bn6y9RlZZ/ZieOUVz0=; b=QpnCPWR8O84l1CNlqtEDv09o7x7lCK4nNPGvryHhyS9iGkojB5Y/tJg0MELWhOL0V96Cxg NCwTouYJge13jzw14OH/t7yErBKMZunrLoPv0Z4bGnIVIPd1bRE+Q4ie7lCVl0jgN6Zp9I Pjg+mea90p3IROIDlsYf5WS2z913lh3lcZ07gkZ5g61JRzXg3JI5py5dcqzj/pSeLVDHtb /CNWgX+Y7tKv0ZPfiDnt+0gXZ+UwbQw8kFJWh4vu/ReGMbhW92ulDPLgmcqDSMVytBU7hZ HQ9MByGM2j9PKuyH/PYNbUqteHp37kli7LkxQzkvlHDrJSETkk/NJP6GPhmrmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678919819; a=rsa-sha256; cv=none; b=MAdfaGPDJ9a2Xp4PVDWXkOlGEdvvgz6IJ/N69RJuolSgR31b0I5m8hyKxBt6O28KdT6eKf 2HBFGynNhU3JxLbxjOGxSBuRdfQSHkgD63HR6cLp/VSFC0IoAhjBzoHwYHA8/SkErEpYQ0 pagsNknNsrXcJl0tcRNoZXExHtiCxECNCdiTuQ0gR057FIfv2yuL/NL5n8ujQghlyJwUAZ lG4zmBNtxupYQ6hr9jn+hhNdgy/b6jQhnhdV01SLGvBKPGOLxH0eWutet/JpdbGLDofoNG kizQsRs4DiB3dfmFcHv/lW3FjC6T3OkvwLBufmBpULIa4fS3sKccEgT8/w8q1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcQHb2c3CzKJy; Wed, 15 Mar 2023 22:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FMaxo5033434; Wed, 15 Mar 2023 22:36:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FMaxaW033433; Wed, 15 Mar 2023 22:36:59 GMT (envelope-from git) Date: Wed, 15 Mar 2023 22:36:59 GMT Message-Id: <202303152236.32FMaxaW033433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: bd66219c6dc1 - stable/13 - sesutil: don't malloc in a tight loop List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bd66219c6dc10178cfcda8beedc39b92e95bdaad Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=bd66219c6dc10178cfcda8beedc39b92e95bdaad commit bd66219c6dc10178cfcda8beedc39b92e95bdaad Author: Alan Somers AuthorDate: 2023-02-09 22:23:51 +0000 Commit: Alan Somers CommitDate: 2023-03-15 22:35:49 +0000 sesutil: don't malloc in a tight loop Reported by: mav Sponsored by: Axcient Reviwed by: mav Differential Revision: https://reviews.freebsd.org/D38473 (cherry picked from commit 4bd4e4b45e8bfbe855406098f393bdf4eda7104d) --- usr.sbin/sesutil/sesutil.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/usr.sbin/sesutil/sesutil.c b/usr.sbin/sesutil/sesutil.c index fe74a8d8ce90..47aa85a60a2e 100644 --- a/usr.sbin/sesutil/sesutil.c +++ b/usr.sbin/sesutil/sesutil.c @@ -417,6 +417,17 @@ objmap(int argc, char **argv __unused) usage(stderr, "map"); } + memset(&e_desc, 0, sizeof(e_desc)); + /* SES4r02 allows element descriptors of up to 65536 characters */ + e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (e_desc.elm_desc_str == NULL) + xo_err(EXIT_FAILURE, "calloc()"); + + e_devname.elm_devnames = calloc(128, sizeof(char)); + if (e_devname.elm_devnames == NULL) + xo_err(EXIT_FAILURE, "calloc()"); + e_devname.elm_names_size = 128; + /* Get the list of ses devices */ if (glob(uflag, 0, NULL, &g) == GLOB_NOMATCH) { globfree(&g); @@ -481,28 +492,16 @@ objmap(int argc, char **argv __unused) xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); } /* Get the description of the element */ - memset(&e_desc, 0, sizeof(e_desc)); e_desc.elm_idx = e_ptr[j].elm_idx; e_desc.elm_desc_len = UINT16_MAX; - e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); - if (e_desc.elm_desc_str == NULL) { - close(fd); - xo_err(EXIT_FAILURE, "calloc()"); - } if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t) &e_desc) < 0) { close(fd); xo_err(EXIT_FAILURE, "ENCIOC_GETELMDESC"); } + e_desc.elm_desc_str[e_desc.elm_desc_len] = '\0'; /* Get the device name(s) of the element */ - memset(&e_devname, 0, sizeof(e_devname)); e_devname.elm_idx = e_ptr[j].elm_idx; - e_devname.elm_names_size = 128; - e_devname.elm_devnames = calloc(128, sizeof(char)); - if (e_devname.elm_devnames == NULL) { - close(fd); - xo_err(EXIT_FAILURE, "calloc()"); - } if (ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t) &e_devname) <0) { /* Continue even if we can't look up devnames */ @@ -525,14 +524,14 @@ objmap(int argc, char **argv __unused) } print_extra_status(e_ptr[j].elm_type, e_status.cstat, PRINT_STYLE_DASHED); xo_close_instance("elements"); - free(e_desc.elm_desc_str); - free(e_devname.elm_devnames); } xo_close_list("elements"); free(e_ptr); close(fd); } globfree(&g); + free(e_devname.elm_devnames); + free(e_desc.elm_desc_str); xo_close_list("enclosures"); xo_close_container("sesutil"); xo_finish(); @@ -727,6 +726,10 @@ show(int argc, char **argv __unused) first_ses = true; + e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (e_desc.elm_desc_str == NULL) + xo_err(EXIT_FAILURE, "calloc()"); + /* Get the list of ses devices */ if (glob(uflag, 0, NULL, &g) == GLOB_NOMATCH) { globfree(&g); @@ -808,19 +811,14 @@ show(int argc, char **argv __unused) continue; /* Get the description of the element */ - memset(&e_desc, 0, sizeof(e_desc)); e_desc.elm_idx = e_ptr[j].elm_idx; e_desc.elm_desc_len = UINT16_MAX; - e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); - if (e_desc.elm_desc_str == NULL) { - close(fd); - xo_err(EXIT_FAILURE, "calloc()"); - } if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t) &e_desc) < 0) { close(fd); xo_err(EXIT_FAILURE, "ENCIOC_GETELMDESC"); } + e_desc.elm_desc_str[e_desc.elm_desc_len] = '\0'; switch (e_ptr[j].elm_type) { case ELMTYP_DEVICE: @@ -853,7 +851,6 @@ show(int argc, char **argv __unused) */ break; } - free(e_desc.elm_desc_str); } if (prev_type != (elm_type_t)-1 && prev_type != ELMTYP_DEVICE && prev_type != ELMTYP_ARRAY_DEV) @@ -863,6 +860,7 @@ show(int argc, char **argv __unused) close(fd); } globfree(&g); + free(e_desc.elm_desc_str); xo_close_list("enclosures"); xo_close_container("sesutil"); xo_finish(); From nobody Wed Mar 15 22:40:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcQN54D3Lz3xtvW; Wed, 15 Mar 2023 22:40: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 4PcQN53hnzz47Yj; Wed, 15 Mar 2023 22:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678920053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBhUw2KEeclBdML5leEWssv7rvrwb6RDlzkQ7Fkb3wo=; b=C3DvDEH0IHb3wd7bDTOAUnnN7LCa2Me885GbezZ8nmPb/13QGZnwUeEGL8VcfUwHlQ/+4H pNi9ZWeWbi/KnSbfkfeNiKe5d74JpB3AHXj9fb3PfImk1BIQ2rzg8hX5OyUHvWzVU2xl+V /D8JekWg0cf+cMhz/sQgL0QDbtDGq5SoX+IH1sDHddL62+9nRJzO5c9wNqxOvXIvld3IX5 SRv0DOI6rJA0wU+z0lTgw8IvpVvkUHfYFtJLY/xKefj00ZYWX551IYqOOeZdbSwAIePFqB cMMNxG6sNuse0PRrh2zCZtzsScW6gQOPEdka8V2S7zjsq9CorS+k61thwrVZhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678920053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBhUw2KEeclBdML5leEWssv7rvrwb6RDlzkQ7Fkb3wo=; b=ve1AlBoDcNTOxPPH7sW6rhS9K6KzBXhg2ENGXhGPHkG0ZzK0Vpj3D9oAR0y0wsZOmARYBp miUXsBhVF1E6hx807rhOgDvsx7gWea3VRk8ProB3EdeN4U+HgFBR7U8bPgoFR7fdwy1rQN WIqy4Ze8AIFcgFKodAxe7PaRvATiPi0DpFUmrpJTjlbe3O5G4wHKFMflBjSprcf7h/VTTI C0lgYQaiK2ZMKaGiSF/rLWFwtWHXCbR/FHOxrVfvyuHQkt5Vzqub5m1ZqOKqFCIYXYxA7Z +uuXKkFXRjrrppQFjbVaYU4SpKwD1U/J+lV/3CVjJ4gFRnvitlpFfWBjtpH1tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678920053; a=rsa-sha256; cv=none; b=i3JVW56FmFpjnhU4AfKLR5zMNMw7O+1+DfckX4+hBm/cCOc6NvzFyAOOkp7AsDozhheXaa WwFbGWrgTr4EuDksZpmI6/T+JnZxSDEF7PpiG64Id6gnjKs4noswjTUNMW2mOMY+eyquuL XvudzRr0e1JpwIpjTsD+oGysqXsy/WGCddCADt+lPj9YV2jGc2T3QNE5fh1tKK4vfR/Qw1 d5H4eya9PEBNWnfgOCTJbuyUw4xshb53M3KB5ueKuvgaTFQ9ceEz+hRdsG+Iq257zJhzb8 quuJmAmdt7xL1QHaUrb36rrIfHLlq6lot/JVa249PtHgo5awPy9+yZKjDrrtbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcQN52mTGzK2h; Wed, 15 Mar 2023 22:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FMer74042483; Wed, 15 Mar 2023 22:40:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FMerRI042482; Wed, 15 Mar 2023 22:40:53 GMT (envelope-from git) Date: Wed, 15 Mar 2023 22:40:53 GMT Message-Id: <202303152240.32FMerRI042482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 3205b36fba10 - stable/13 - fusefs: fix a buffer overflow in the tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3205b36fba10f31ac715957aa41fd0d1ccd41ec9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=3205b36fba10f31ac715957aa41fd0d1ccd41ec9 commit 3205b36fba10f31ac715957aa41fd0d1ccd41ec9 Author: Alan Somers AuthorDate: 2023-02-22 00:13:56 +0000 Commit: Alan Somers CommitDate: 2023-03-15 22:39:40 +0000 fusefs: fix a buffer overflow in the tests The actual overflow occured in the ReadAhead.readahead test. Surprisingly it has never segfaulted or resulted in any bad behavior. Sponsored by: Axcient Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38718 (cherry picked from commit 0c9df4afc239ee52961443e95bca8be81f0dea9e) --- tests/sys/fs/fusefs/bmap.cc | 2 ++ tests/sys/fs/fusefs/io.cc | 3 +++ tests/sys/fs/fusefs/mockfs.hh | 2 +- tests/sys/fs/fusefs/setattr.cc | 1 + tests/sys/fs/fusefs/utils.cc | 6 ++++++ tests/sys/fs/fusefs/write.cc | 2 ++ 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/sys/fs/fusefs/bmap.cc b/tests/sys/fs/fusefs/bmap.cc index 56821f367a82..91d8ab563690 100644 --- a/tests/sys/fs/fusefs/bmap.cc +++ b/tests/sys/fs/fusefs/bmap.cc @@ -210,6 +210,8 @@ TEST_P(BmapEof, eof) _) ).WillOnce(Invoke(ReturnImmediate([=](auto in, auto& out) { size_t osize = in.body.read.size; + + assert(osize < sizeof(out.body.bytes)); out.header.len = sizeof(struct fuse_out_header) + osize; bzero(out.body.bytes, osize); }))); diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index 1502bd263f51..a8815434c6d8 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -141,6 +141,8 @@ void SetUp() ssize_t isize = in.body.write.size; off_t iofs = in.body.write.offset; + assert((size_t)isize <= sizeof(in.body.bytes) - + sizeof(struct fuse_write_in)); ASSERT_EQ(isize, pwrite(m_backing_fd, buf, isize, iofs)) << strerror(errno); SET_OUT_HEADER_LEN(out, write); @@ -158,6 +160,7 @@ void SetUp() void *buf = out.body.bytes; ssize_t osize; + assert((size_t)isize <= sizeof(out.body.bytes)); osize = pread(m_backing_fd, buf, isize, iofs); ASSERT_LE(0, osize) << strerror(errno); out.header.len = sizeof(struct fuse_out_header) + osize; diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 121d985e56fe..edbaf7ef770f 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -206,7 +206,7 @@ union fuse_payloads_out { * The protocol places no limits on the size of bytes. Choose * a size big enough for anything we'll test. */ - uint8_t bytes[0x20000]; + uint8_t bytes[0x40000]; fuse_entry_out entry; fuse_entry_out_7_8 entry_7_8; fuse_lk_out getlk; diff --git a/tests/sys/fs/fusefs/setattr.cc b/tests/sys/fs/fusefs/setattr.cc index e245c274ba07..e08f2124e06f 100644 --- a/tests/sys/fs/fusefs/setattr.cc +++ b/tests/sys/fs/fusefs/setattr.cc @@ -530,6 +530,7 @@ TEST_F(Setattr, truncate_discards_cached_data) { auto osize = std::min( static_cast(cur_size) - in.body.read.offset, static_cast(in.body.read.size)); + assert(osize <= sizeof(out.body.bytes)); out.header.len = sizeof(struct fuse_out_header) + osize; if (should_have_data) memset(out.body.bytes, 'X', osize); diff --git a/tests/sys/fs/fusefs/utils.cc b/tests/sys/fs/fusefs/utils.cc index d4edca5ca945..b13ecfd9cb88 100644 --- a/tests/sys/fs/fusefs/utils.cc +++ b/tests/sys/fs/fusefs/utils.cc @@ -400,6 +400,7 @@ void FuseTest::expect_read(uint64_t ino, uint64_t offset, uint64_t isize, }, Eq(true)), _) ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + assert(osize <= sizeof(out.body.bytes)); out.header.len = sizeof(struct fuse_out_header) + osize; memmove(out.body.bytes, contents, osize); }))).RetiresOnSaturation(); @@ -502,6 +503,8 @@ void FuseTest::expect_write(uint64_t ino, uint64_t offset, uint64_t isize, bool pid_ok; uint32_t wf = in.body.write.write_flags; + assert(isize <= sizeof(in.body.bytes) - + sizeof(struct fuse_write_in)); if (wf & FUSE_WRITE_CACHE) pid_ok = true; else @@ -534,6 +537,9 @@ void FuseTest::expect_write_7_8(uint64_t ino, uint64_t offset, uint64_t isize, const char *buf = (const char*)in.body.bytes + FUSE_COMPAT_WRITE_IN_SIZE; bool pid_ok = (pid_t)in.header.pid == getpid(); + + assert(isize <= sizeof(in.body.bytes) - + FUSE_COMPAT_WRITE_IN_SIZE); return (in.header.opcode == FUSE_WRITE && in.header.nodeid == ino && in.body.write.fh == FH && diff --git a/tests/sys/fs/fusefs/write.cc b/tests/sys/fs/fusefs/write.cc index 4e76414a601a..800376395e97 100644 --- a/tests/sys/fs/fusefs/write.cc +++ b/tests/sys/fs/fusefs/write.cc @@ -97,6 +97,8 @@ void maybe_expect_write(uint64_t ino, uint64_t offset, uint64_t size, const char *buf = (const char*)in.body.bytes + sizeof(struct fuse_write_in); + assert(size <= sizeof(in.body.bytes) - + sizeof(struct fuse_write_in)); return (in.header.opcode == FUSE_WRITE && in.header.nodeid == ino && in.body.write.offset == offset && From nobody Wed Mar 15 22:47:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcQWF00Fwz3xvSN; Wed, 15 Mar 2023 22:47: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 4PcQWD6bszz49HB; Wed, 15 Mar 2023 22:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678920424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8x/YPYrFv/I+YU8mJJw83c1sczZsmz47DQdHcRpF15E=; b=wtKLrVMEOmS35Ft2e0NMtY7jg12Gfnz0KI4+QySV2Y7bNiUmTEqTpPEAfGXQxT39lwumxG PctUHb8lPcJRMe2/uTH2ItQRbWxNCbGS2e/lLuUmPFZAWPHZcy2xRKpa8+Ql7fIOGmAVej 0tQV3URkk3WNUJJP//zBMUuaxR33G6cWyB7Rbaixc0zi+bYM90GZMtPVeQzlVUPHsV+2f0 8rs8y9t7sU0PHaILx6AdxtrFi/AMop0u4HsT69PBYJvoSU8oz05ht3+YgbYpWn2PZ7ecD3 rtHxeH9Os7CiEL/2UHShpMoRwtfym1GM4ia7SgnAgPfbkPIE7xEdDeoEVuA5Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678920424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8x/YPYrFv/I+YU8mJJw83c1sczZsmz47DQdHcRpF15E=; b=JkayXWnm0XKeX+DB2GqUwaO83QJyDsHWjl6ahF6iqmZfkjh4rzyGdz05wECYRdLCe7g277 dOcSYNrI9VeNm0VtyRtb5U+iI6YGUMnTknxGdrTfPSZ5aak4bLxaGv0KZXFdV+u5/pp1j+ xbZMkQnyumcf+IhemMosOIyLlEX5BF4z8tUPv5ihl5sUQwK1+/uNCq7pE4o4kJ9aFAtbLO XER6+q67Iut2K/ZPNA5l75PQPtQcd6paqw4LghCfQZoM63cJqltYL84MLrLkgOj3iv+Jsk BNYZagF0ZuVkEvBGfwxA3RiSJ2yhWPbS1yR4iPEuXO8ZBM95+G+C7pP9Nkr9Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678920424; a=rsa-sha256; cv=none; b=kJjcIhFhbsu6ZynHIjgT1r3/RkAB6ncNEt64z5DFR+AMiPB3aH2qvU9KKz8No3Pb+J0TsB qO6CCtC0ZKO40U84VCTVq3n88SpuFRZtaWAKqGnoKPhrU4H3+b/Mppf8hgrfnuS4vT7Nnr yaT6vLmCu0yrIzVYfxvjifAnJjHA1ZOf5l3leW3wsogBKYwjOK/phzkeWc/iuhF89+oO2E y9Ay57RVM1bL6ZOqBTBgE/XVbByYaYy6nyionmv5rHeMnuayF+zD6/rXFydQi9QziRJh8q 70AJOn36tXNaYOf8CApOg6363wROIiREh+VkM6qMz0OB95o80+oNGpwWlOeobQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcQWD5dfHzKR1; Wed, 15 Mar 2023 22:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32FMl4wn049769; Wed, 15 Mar 2023 22:47:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FMl4Sl049768; Wed, 15 Mar 2023 22:47:04 GMT (envelope-from git) Date: Wed, 15 Mar 2023 22:47:04 GMT Message-Id: <202303152247.32FMl4Sl049768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 4e4e299b0950 - stable/13 - fusefs: add some more test cases for bad fuse servers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4e4e299b0950358d3e189d5dbef0c106bbc39973 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4e4e299b0950358d3e189d5dbef0c106bbc39973 commit 4e4e299b0950358d3e189d5dbef0c106bbc39973 Author: Alan Somers AuthorDate: 2023-02-21 23:26:37 +0000 Commit: Alan Somers CommitDate: 2023-03-15 22:41:14 +0000 fusefs: add some more test cases for bad fuse servers Sponsored by: Axcient Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38719 (cherry picked from commit 5f51c9c328a63d7290f634b1742f03545eaa2c1c) --- tests/sys/fs/fusefs/Makefile | 1 + tests/sys/fs/fusefs/bad_server.cc | 105 ++++++++++++++++++++++++++++++++++++++ tests/sys/fs/fusefs/lookup.cc | 2 +- tests/sys/fs/fusefs/mockfs.cc | 6 +-- tests/sys/fs/fusefs/mockfs.hh | 7 ++- 5 files changed, 112 insertions(+), 9 deletions(-) diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index 04b68681ec9a..df3753967603 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -11,6 +11,7 @@ TESTSDIR= ${TESTSBASE}/sys/fs/fusefs # out, so we get more granular reporting. GTESTS+= access GTESTS+= allow_other +GTESTS+= bad_server GTESTS+= bmap GTESTS+= cache GTESTS+= copy_file_range diff --git a/tests/sys/fs/fusefs/bad_server.cc b/tests/sys/fs/fusefs/bad_server.cc new file mode 100644 index 000000000000..34392da0090a --- /dev/null +++ b/tests/sys/fs/fusefs/bad_server.cc @@ -0,0 +1,105 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2023 Axcient + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +extern "C" { +#include +#include +} + +#include "mockfs.hh" +#include "utils.hh" + +using namespace testing; + +class BadServer: public FuseTest {}; + +/* + * If the server sends a response for an unknown request, the kernel should + * gracefully return EINVAL. + */ +TEST_F(BadServer, UnknownUnique) +{ + mockfs_buf_out out; + + out.header.len = sizeof(out.header); + out.header.error = 0; + out.header.unique = 99999; // Invalid! + out.expected_errno = EINVAL; + m_mock->write_response(out); +} + +/* + * If the server sends less than a header's worth of data, the kernel should + * gracefully return EINVAL. + */ +TEST_F(BadServer, ShortWrite) +{ + mockfs_buf_out out; + + out.header.len = sizeof(out.header) - 1; + out.header.error = 0; + out.header.unique = 0; // Asynchronous notification + out.expected_errno = EINVAL; + m_mock->write_response(out); +} + +/* + * It is illegal to report an error, and also send back a payload. + */ +TEST_F(BadServer, ErrorWithPayload) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillOnce(Invoke([&](auto in, auto &out) { + // First send an invalid response + std::unique_ptr out0(new mockfs_buf_out); + out0->header.unique = in.header.unique; + out0->header.error = -ENOENT; + SET_OUT_HEADER_LEN(*out0, entry); // Invalid! + out0->expected_errno = EINVAL; + out.push_back(std::move(out0)); + + // Then, respond to the lookup so we can complete the test + std::unique_ptr out1(new mockfs_buf_out); + out1->header.unique = in.header.unique; + out1->header.error = -ENOENT; + out1->header.len = sizeof(out1->header); + out.push_back(std::move(out1)); + + // The kernel may disconnect us for bad behavior, so don't try + // to read any more. + m_mock->m_quit = true; + })); + + EXPECT_NE(0, access(FULLPATH, F_OK)); + + EXPECT_EQ(ENOENT, errno); +} diff --git a/tests/sys/fs/fusefs/lookup.cc b/tests/sys/fs/fusefs/lookup.cc index c654dd46bae5..7a5be84b48be 100644 --- a/tests/sys/fs/fusefs/lookup.cc +++ b/tests/sys/fs/fusefs/lookup.cc @@ -289,7 +289,7 @@ TEST_F(Lookup, ejustreturn) .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { out.header.len = sizeof(out.header); out.header.error = 2; - m_mock->m_expected_write_errno = EINVAL; + out.expected_errno = EINVAL; }))); EXPECT_NE(0, access(FULLPATH, F_OK)); diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index e012df8c3488..43e8dd3b0371 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -431,7 +431,6 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, const bool trueval = true; m_daemon_id = NULL; - m_expected_write_errno = 0; m_kernel_minor_version = kernel_minor_version; m_maxreadahead = max_readahead; m_maxwrite = MIN(max_write, max_max_write); @@ -801,7 +800,6 @@ void MockFS::loop() { bzero(in.get(), sizeof(*in)); read_request(*in, buflen); - m_expected_write_errno = 0; if (m_quit) break; if (verbosity > 0) @@ -1034,9 +1032,9 @@ void MockFS::write_response(const mockfs_buf_out &out) { FAIL() << "not yet implemented"; } r = write(m_fuse_fd, &out, out.header.len); - if (m_expected_write_errno) { + if (out.expected_errno) { ASSERT_EQ(-1, r); - ASSERT_EQ(m_expected_write_errno, errno) << strerror(errno); + ASSERT_EQ(out.expected_errno, errno) << strerror(errno); } else { ASSERT_TRUE(r > 0 || errno == EAGAIN) << strerror(errno); } diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index edbaf7ef770f..51ed5ad72ee6 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -233,6 +233,8 @@ union fuse_payloads_out { struct mockfs_buf_out { fuse_out_header header; union fuse_payloads_out body; + /* the expected errno of the write to /dev/fuse */ + int expected_errno; /* Default constructor: zero everything */ mockfs_buf_out() { @@ -333,16 +335,13 @@ class MockFS { */ void read_request(mockfs_buf_in& in, ssize_t& res); + public: /* Write a single response back to the kernel */ void write_response(const mockfs_buf_out &out); - public: /* pid of child process, for two-process test cases */ pid_t m_child_pid; - /* the expected errno of the next write to /dev/fuse */ - int m_expected_write_errno; - /* Maximum size of a FUSE_WRITE write */ uint32_t m_maxwrite; From nobody Thu Mar 16 00:12:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcSPX3f1gz3y1Vp; Thu, 16 Mar 2023 00:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcSPX2rPTz4HW9; Thu, 16 Mar 2023 00:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678925536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LPXVLWvQEGzcZbOATrqFPkXJZmfHcU9IpljzgZEyQ8=; b=tLLN+i1GnWKarqyie4hx0UMOvwyFLcZPE0BBZHF3bNRdeNoOrtbsarPbwBPQAJOiLpP5FA nHgGrZ945TJC8YYDualbu0tHaabkHf2hK1lHZybtj1p0WKm9YFkZvMnu0wxUqPLnHYtJQ5 6sFz/GGSvgF5uRnOMDb6NT7aIgIJuV+1/Zw87wmfjrtK4b4dPLuDtbFdFZDffI1Kxdww98 QvIFTDAM+tpUUs5JkH+yTtB1s+CsmQyPSLZhspU4PUl4tgPd+lMloIPft7v5Fwxz3fFhxA mQ34VMhahxt54HXAsa5xT/jkzz0YK+5hySInTT4cpSYY6YJ06Pwh1QtoYq16nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678925536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LPXVLWvQEGzcZbOATrqFPkXJZmfHcU9IpljzgZEyQ8=; b=k8DUDavQLiSwabzzoUqmkN3iVzqNJRHSFrGKUVr9MR9DIMvMd7IUhT0glci2DG50Jzlb9y qqKEvlfCuwLndVJ4UkXcTL11J1pwTa9+ISHCLdDA5XxiQqbVKMer9AhNi7lujdiPLECBnk 6+CNjqEFz8/FuPEmqUxkt+yB4YBsXCsUhexIcs+lWgO4VUWUfTlElaOp2El8WBx/jjA+XP /T1+YwVzHM7sMX+og6qlDSM7o6PqwLhI0Rdlq6EIGm9LRdiIeahoLVGvdbxJFre5j3Qj7F 5DwI35TeVwQTphrL1C5aLub++Qkl+6cOD1M/TMHIq+uzryxaKv0ivOfhm8npPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678925536; a=rsa-sha256; cv=none; b=K9af3w8ZeSGSOhLbDssX/eAuczk34IgnCWxNz8fg7EsqpVHZzn0KcVgSRqbSPiGa29CZVU vKX8kM0AQruoR+3OwrHLSt5HpbNcrELvbFfibvUGGknecm+HTiMhEw8dLQ9KQ6S+UAbTc+ cT/wtYHtzcJznXvY436C05XHNsDnI5DaV19nQRH94swzbu88t1x5+iUOaM2ZD3irj0VzKH SM5OqJ2BxEDACgxRUKl3cWCT1T7zLcGSSLcT8eJ3D6FmWszKA3aT0RP6OzqkqiNiYvBFQ5 KhwyqgBMhMOLEsm35O0Q6DBAVgQaccEcxMVcLQidR5tL1hlmx8VAQrirgFJqfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcSPX1w5vzM1R; Thu, 16 Mar 2023 00:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32G0CG95096384; Thu, 16 Mar 2023 00:12:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32G0CGFH096383; Thu, 16 Mar 2023 00:12:16 GMT (envelope-from git) Date: Thu, 16 Mar 2023 00:12:16 GMT Message-Id: <202303160012.32G0CGFH096383@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: 3a60f9c605a2 - releng/13.2 - makefs: make msdos creation go fast List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/13.2 X-Git-Reftype: branch X-Git-Commit: 3a60f9c605a26784607e2b44f4fc184dca414445 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3a60f9c605a26784607e2b44f4fc184dca414445 commit 3a60f9c605a26784607e2b44f4fc184dca414445 Author: Warner Losh AuthorDate: 2023-03-13 20:28:51 +0000 Commit: Warner Losh CommitDate: 2023-03-15 23:14:12 +0000 makefs: make msdos creation go fast Add missing brelse(bp). Without it the cache grows and we have a n^2 lookup. I'm not entirely sure why we read the block before we write it back out, since the only side effect of that is to allocate memory, clear the memory, read it in from disk, throw it away with the contents of the file being written out. We likely should just do a getblk() here instead, but even with all that, this takes the time it takes to create a 150MB msdos fs image down from 5 minutes to 30 seconds. Old: 317.663u 0.685s 5:18.34 100.0% 198+360k 0+19io 1009pf+0w New: 7.330u 23.841s 0:31.17 100.0% 198+360k 0+250522io 4pf+0w See code review for how we got this. tl;dr: netbsd move brelse into bwrite and we picked up msdos code after that, but not the move. That change should be picked up later. Sponsored by: Netflix Reviewed by: emaste MFC After: 1 day (13.2 is coming fast) Differential Revision: https://reviews.freebsd.org/D39025 Approved by: re@ (cperciva) (cherry picked from commit 370e009188ba90c3290b1479aa06ec98b66e140a) (cherry picked from commit aa1e6a4f4c28c7051ee9431ecb7802309cc1bf96) --- usr.sbin/makefs/msdos/msdosfs_vnops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/makefs/msdos/msdosfs_vnops.c b/usr.sbin/makefs/msdos/msdosfs_vnops.c index ff470576ee79..198efae31a0e 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vnops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c @@ -501,6 +501,7 @@ msdosfs_wfile(const char *path, struct denode *dep, fsnode *node) cpsize = MIN((nsize - offs), blsize - on); memcpy(bp->b_data + on, dat + offs, cpsize); bwrite(bp); + brelse(bp); offs += cpsize; } From nobody Thu Mar 16 00:12:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcSPY4PBDz3y1SG; Thu, 16 Mar 2023 00:12: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 4PcSPY3xTjz4HFd; Thu, 16 Mar 2023 00:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678925537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ctzlDYiOil4ek/azypgsJv2eUUcrpPXreQKhEBOdDF0=; b=Sc1V+DRlqUVhExEEGfVcDA1ACqMMhsjIqrSM9yevQFmLTHURhbWegxoTjubF8s/Hemdpqo Rfit1S5MQJqmXlBjf7flTMv0Z2YaRgD03PAZeIjbdD1XZbHOByzI9gWL4rgeoctBJUTu/h YMWLEcaihbR00BfAMbu1+T9+FydWGFBmpW7bCpxE4vVyQkj1ZSD34Y1uZljA5oJ+WSGDQg nq9pWwESRKCIs21CxK8M5Ae+c8+xewBYRd7rvryu/k1xOqpP1R6lHr8WwqkM6peinys1Mh 2uervAVoD3wlAVUBlLeL63jSUZIYM/f5KteLB9Kk3qa95+9l/RIvWwodkaGRgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678925537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ctzlDYiOil4ek/azypgsJv2eUUcrpPXreQKhEBOdDF0=; b=Xa2nfpfAUiHzVDkvLaXMj2I4aPW0y/nlg/hJ0SbzjD2jZv9135vdsMfM7AhxCg2XTQU0Pg BqvLY5gF0FM6kGoRvBB09gVtX/kWE4DssxvryFFmZv5ZnljGIMMAVEfQFPSgQ5bwXCmgB2 JYVtrPwPMJIswmEJtIFFjFTGcVD+aaeQ9qTeV1RDJQyaVoK8OWK26lwGHfymwAi41FQv2G aKc2jsUIWd415CQ2FaAsAuJyieLeZpGV+m5IC6LI3P3JfJ4R5D0dknV8YpycErMOqaXFSy 1g0DUBzqDSqk6pc4Q9p+bXHOsrZVjMM63sPXEPIxKPSxQibi85Q99/LZWU4dWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678925537; a=rsa-sha256; cv=none; b=fT2H2xGeacQRpV13qefAFTjTZuPTLExZvpS4W4DolFf3tmZ8A3DPYCrD7do93oEgwgPNnM DIeR3mtJcoT3TIn+6RgQW9WOO3SP+ozB90DATAlxeauzTEUsWc49HwFo0KxUPbSmJrB0JC FS4XKqrUroyO08nlPvC4fCvjc7KZwhftRoN1boxsvBYdOIZE+IHqgaUks277y9AY2hn314 neSFEQYa7IMMSsGE/z9V3g9Kkx6aqyJ9T9My5MQ7og5+9YVcR4aOgOgmMZNU74wTF+Msgq 2axsTguHSqhxFfyNajX5wmZ2HETm14IF4xafYTREUKb532hB75RqC6YIGlPniA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcSPY33KyzMbB; Thu, 16 Mar 2023 00:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32G0CHUn096410; Thu, 16 Mar 2023 00:12:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32G0CHPe096409; Thu, 16 Mar 2023 00:12:17 GMT (envelope-from git) Date: Thu, 16 Mar 2023 00:12:17 GMT Message-Id: <202303160012.32G0CHPe096409@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: 2c101fca1991 - releng/13.2 - netlink: Fix "version introduced" documentation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/13.2 X-Git-Reftype: branch X-Git-Commit: 2c101fca1991de4d257070dad01a398c1f13545e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2c101fca1991de4d257070dad01a398c1f13545e commit 2c101fca1991de4d257070dad01a398c1f13545e Author: Tom Hukins AuthorDate: 2023-03-04 15:59:02 +0000 Commit: Warner Losh CommitDate: 2023-03-15 23:14:29 +0000 netlink: Fix "version introduced" documentation netlink(4) and associated features will exist in FreeBSD 14.0 but they will also exist in 13.2, an older version, from commits such as 02b958b1 and b309249b. This commit needs merging to stable/13 and releng/13.2. MFC after: 2days (needs to be in RC2) Reviewed by: imp,melifaro Pull Request: https://github.com/freebsd/freebsd-src/pull/651 Approved by: re@ (cperciva) (cherry picked from commit 6d2feb39ad13768f3ea06381fcd95937a09f0d62) --- share/man/man3/snl.3 | 2 +- share/man/man4/genetlink.4 | 2 +- share/man/man4/netlink.4 | 2 +- share/man/man4/rtnetlink.4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man3/snl.3 b/share/man/man3/snl.3 index 9fdeeaf56178..78a6b67e88a9 100644 --- a/share/man/man3/snl.3 +++ b/share/man/man3/snl.3 @@ -297,7 +297,7 @@ and The .Dv SNL library appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS This library was implemented by .An Alexander Chernikov Aq Mt melifaro@FreeBSD.org . diff --git a/share/man/man4/genetlink.4 b/share/man/man4/genetlink.4 index 2c5b9b99f994..a21963b5e3bd 100644 --- a/share/man/man4/genetlink.4 +++ b/share/man/man4/genetlink.4 @@ -138,7 +138,7 @@ The following groups are defined: The .Dv NETLINK_GENERIC protocol family appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS The netlink was implementated by .An -nosplit diff --git a/share/man/man4/netlink.4 b/share/man/man4/netlink.4 index c0d9b5a88ade..50adebd0c6c7 100644 --- a/share/man/man4/netlink.4 +++ b/share/man/man4/netlink.4 @@ -346,7 +346,7 @@ or .Re .Sh HISTORY The netlink protocol appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS The netlink was implemented by .An -nosplit diff --git a/share/man/man4/rtnetlink.4 b/share/man/man4/rtnetlink.4 index 5849508b74c2..1e52640eec56 100644 --- a/share/man/man4/rtnetlink.4 +++ b/share/man/man4/rtnetlink.4 @@ -525,7 +525,7 @@ RTNLGRP_NEIGH Notifies on ARP/NDP neighbor arrival/removal/change The .Dv NETLINK_ROUTE protocol family appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS The netlink was implementated by .An -nosplit From nobody Thu Mar 16 04:15:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcYpv73hfz3yHL2; Thu, 16 Mar 2023 04:16:07 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcYpv6czcz3LxW; Thu, 16 Mar 2023 04:16:07 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678940167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/b9fIWRLj2fR0Ocf2O8U5WsSqPn6oZDtmWyzAgmN4gw=; b=HB2IAfWlG3doUjiRSlkydFU8E3ZlQDbRfFcyKHgFUYXhwnzKpIWaBD8wEapadCxcXwunve dalZGQTc2vChV9hdxoOEHULmIGRPFioJlCHjriFVU1gVqcZhg+ZaPfzE8qoM6P15QGtGrs lFVVbz0WrfiuRGBo+EGAhHyhAqDOI7zZBgPlOitvpaKWOXOrWH/aqJfo/gLKyYCy3ABFbr ZXR+i9fYuuPiuTfE+S6iaHwXaHfbZuvkStc2DlnMwJuKDnuENsElASoNERjnz+FMumbxIy Gjcm6eNQBJm2VeqJrMU40kymIMihN5JKt4cmlTIOKK/Rn0y9caPeNSeq0gmt9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678940167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/b9fIWRLj2fR0Ocf2O8U5WsSqPn6oZDtmWyzAgmN4gw=; b=NTLHBO04wqVxFBYN/H+yPyH6rA3AjZAn2iIWQVLxBYKHmf2P4dPzEmkNwOa5YG6Unyussf 7NZq/aic1mX6Mm8fHi/WHYCfkyjbRhyzaVmpicj2AVPgAsgwUDv2ExF/Hpf73nIyVIVYAo cUI9uTzWiGWesW4Tcd0ZDYfpSqtMglI+QUEOX36RPQD+sMrCaQHriBzU7ssDgq+ejMAb6q A9rU52OCrG+MMArzpUqtpIR6FO4vaD2AN8JLFt9EVr2X13DqQIA+TOgOkuPx0bOm5Vgr5m 7x5u8TyVm18p8dp2C0Cwk5tHdVQOl4sb8fFEZbVm3mhaTJ0gU0ktjcgDS/uPQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678940167; a=rsa-sha256; cv=none; b=fL+vh6PoZcX0JAhypc+8XwnompxsyafJYm47mAMBllZuK4tRUnzth5mV4HmAOzai2ZNGS/ rfo8czdcCE18dLuByl0LSqK/w/O4FvTKVIwqMJ/jvi04Oo4x/2Kx9fhVgytMXT+vIg7XfE EifzmClpQbi5qyNuVZlo/rs3C6L+LYse45FzfSp1jpG8IBeMSNckch2ElHiH9u0RzDaZK3 GIqR8xDwGMnOj2k3lIyjHfhDh38mS7DQAxY7xHDJ2xYdU+m4Np5x4Bdqqu5zkSkqPwMtJJ mccMBRoif6H6q4AcrEESbvePrWpMWns/HXjeOF7aVluAZ+f1rYgtvKiKOBEbqA== Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PcYpv5SHfzN8G; Thu, 16 Mar 2023 04:16:07 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f171.google.com with SMTP id p20so154254qkh.0; Wed, 15 Mar 2023 21:16:07 -0700 (PDT) X-Gm-Message-State: AO0yUKWy0QlFVSr+Mho9T/hVuI8oW5Tx1+7gZ4UeUzBhUlD/LMtTwwRS AddXbqZFPwlGxyZ78ucdZGBvQcpC6S+DMAW7eV8= X-Google-Smtp-Source: AK7set9Xnbd4RO3TQnvdwsBMEU/e5MR8WKKJ2qMB2E+rRKfGW69JBYUY3UYNzeZ92ODCPB9UlbMtxzRrqSCvrQ+vBLw= X-Received: by 2002:a05:620a:c06:b0:745:ad92:8887 with SMTP id l6-20020a05620a0c0600b00745ad928887mr2525316qki.13.1678940167154; Wed, 15 Mar 2023 21:16:07 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303030055.3230tl3S091663@gitrepo.freebsd.org> In-Reply-To: <202303030055.3230tl3S091663@gitrepo.freebsd.org> From: Kyle Evans Date: Wed, 15 Mar 2023 23:15:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 2fee87562948 - main - abstract out the vm detection via smbios.. To: John-Mark Gurney Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On Thu, Mar 2, 2023 at 6:55=E2=80=AFPM John-Mark Gurney w= rote: > > The branch main has been updated by jmg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D2fee8756294820ff9ec6f8d173= 24e7d8a0a45040 > > commit 2fee8756294820ff9ec6f8d17324e7d8a0a45040 > Author: John-Mark Gurney > AuthorDate: 2023-02-23 20:59:50 +0000 > Commit: John-Mark Gurney > CommitDate: 2023-03-03 00:54:21 +0000 > > abstract out the vm detection via smbios.. > > This makes the detection of VMs common between platforms that > have SMBios. > > Reviewed by: imp, kib > Differential Revision: https://reviews.freebsd.org/D38800 > --- > sys/amd64/amd64/machdep.c | 3 ++ > sys/arm64/arm64/machdep.c | 4 ++ > sys/conf/files.arm64 | 2 + > sys/conf/files.x86 | 1 + > sys/dev/smbios/smbios.h | 4 ++ > sys/dev/smbios/smbios_subr.c | 104 +++++++++++++++++++++++++++++++++++++= ++++++ > sys/i386/i386/machdep.c | 3 ++ > sys/x86/x86/identcpu.c | 57 ------------------------ > 8 files changed, 121 insertions(+), 57 deletions(-) > > diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c > index f33f2c6509f0..480db1ed2c31 100644 > --- a/sys/amd64/amd64/machdep.c > +++ b/sys/amd64/amd64/machdep.c > [... snip ...] > @@ -1315,6 +1317,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) > > identify_cpu1(); > identify_hypervisor(); > + identify_hypervisor_smbios(); > identify_cpu_fixup_bsp(); > identify_cpu2(); > initializecpucache(); This brings in a behavior change that I don't think you intended. Previously, we wouldn't let smbios clobber a vm_guest detected from cpuid due to an early return, but nothing is stopping it from happening now. I think this call should've been protected behind a `vm_guest =3D=3D VM_GUEST_NO || vm_guest =3D=3D VM_GUEST_VM` (the latter be= ing "CPUID2_HV was set but we couldn't determine anything useful after that"), perhaps? Thanks, Kyle Evans From nobody Thu Mar 16 09:50:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcjDr3xn5z3ydKS; Thu, 16 Mar 2023 09:50: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 4PcjDr3W81z44Sy; Thu, 16 Mar 2023 09:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678960236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NPIBFT1nAzLwl3ZzDYZiTwsQelo6fy3tilrExZ5TRpc=; b=i8c31fkBzmiPp6nIg+fX9ScqXr5/ISQazLmmeCiXwzp6HJNJL8Rw6y14jsx8230ZnFI4ns Ljyo3ncZ20QZ5NqGsUhVn9DxtLm203ELRkLq35b55F5erSA28Aoh0D6FEq5o8ARI3OhhlC 7+Mlr2qBh8cF2Jr09SF51gZEjfRocBN6sFfJuQ0JaWiEiDJmI5XyBjP0vP2cxV3O8yjWIV WfOY84/cy3nnVC2wFXA99Aiu+fJTr4q7bRK7Sj7WRWdxchdoA9vpv39W2f05hkJYDp7AWK Kso5YvcpbyVhWdg/JXiZdmBZPhhmcY7zEesYWc53ikp/XK27KB2W/NhlJvCOIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678960236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NPIBFT1nAzLwl3ZzDYZiTwsQelo6fy3tilrExZ5TRpc=; b=i59nCoKPycDipXHtXOeIsjTu8BmIP+akFlBC4YOgz++Fw5oIo36p+Cpveb2X05RFBWEzj/ i7oBof/SRKHJ7bTq+SFpHzLjJnS+g1p1oVKYhQex8AOsz63ceOLFm3++N4L+sPW6VLHQXx uWrQn9RZru98USldBR2bYM9XPvwoibizWsxeRkabL+wibnFmb6tcPT/Y5/piC8LC4Jlgbl tihBtXWHHLo/M/NynIEJMI4AeYTOagFO809+SO0tvkX7mu2SeOJOMHKj6CYSDIUQIECNwG DMKFlOhg8BhxatAgSydbL8xzAyb7E8MWaxZ8KkLElB9R0Oi5O5JUhMaw5wfYdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678960236; a=rsa-sha256; cv=none; b=SMl+GTIXyU1bf9DazmmaECULZpMK7ko4FalkrnstFeB86RxnwDm65DWDO6roXR5toeOb8p JiyShOB0snVRYxliMZyo2QJp86EHX8eqP0VA/NLN9D89DRRUqxNjjwIYpbc/ysNlF+v4TU CAFq5VP4JXzRPvnr9qZXHdOX4WIfzxZIiAg514Vl3Yv20OGXrfdJoNbt/WWSQ9+fvAy8sc CvfMEp8iXoX7HPahlF1+y47r/9hyhCrPwGqriEzRQ1ytjFjhXLImkCK7wTG7VuYzGNICwp CUBz/KCMTfUZDOeLQCpOCO9MaTrj6ENlIMG4l9ihqzpBU+B/tDJDORDiioyQ6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcjDr2KwvzfDr; Thu, 16 Mar 2023 09:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32G9oaiM040977; Thu, 16 Mar 2023 09:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32G9oaqV040976; Thu, 16 Mar 2023 09:50:36 GMT (envelope-from git) Date: Thu, 16 Mar 2023 09:50:36 GMT Message-Id: <202303160950.32G9oaqV040976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: c91ae48a25ed - main - sctp: don't do RTT measurements with cookies List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c91ae48a25edd426efc49ade14fb675e07a0f5ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c91ae48a25edd426efc49ade14fb675e07a0f5ed commit c91ae48a25edd426efc49ade14fb675e07a0f5ed Author: Michael Tuexen AuthorDate: 2023-03-16 09:45:13 +0000 Commit: Michael Tuexen CommitDate: 2023-03-16 09:45:13 +0000 sctp: don't do RTT measurements with cookies When receiving a cookie, the receiver does not know whether the peer retransmitted the COOKIE-ECHO chunk or not. Therefore, don't do an RTT measurement. It might be much too long. To overcome this limitation, one could do at least two things: 1. Bundle the INIT-ACK chunk with a HEARTBEAT chunk for doing the RTT measurement. But this is not allowed. 2. Add a flag to the COOKIE-ECHO chunk, which indicates that it is the initial transmission, and not a retransmission. But this requires an RFC. MFC after: 1 week --- sys/netinet/sctp_input.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 6299c5c7d827..3da483bdf37a 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1351,7 +1351,6 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, struct sctp_queued_to_read *sq, *nsq; struct sctp_nets *net; struct mbuf *op_err; - struct timeval old; int init_offset, initack_offset, i; int retval; int spec_flag = 0; @@ -1499,16 +1498,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, } /* notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_UP; - /* - * since we did not send a HB make sure we don't - * double things - */ - old.tv_sec = cookie->time_entered.tv_sec; - old.tv_usec = cookie->time_entered.tv_usec; net->hb_responded = 1; - sctp_calculate_rto(stcb, asoc, net, &old, - SCTP_RTT_FROM_NON_DATA); - if (stcb->asoc.sctp_autoclose_ticks && (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE))) { sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, @@ -2204,17 +2194,11 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); *netp = sctp_findnet(stcb, init_src); if (*netp != NULL) { - struct timeval old; - /* * Since we did not send a HB, make sure we don't double * things. */ (*netp)->hb_responded = 1; - /* Calculate the RTT. */ - old.tv_sec = cookie->time_entered.tv_sec; - old.tv_usec = cookie->time_entered.tv_usec; - sctp_calculate_rto(stcb, asoc, *netp, &old, SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); From nobody Thu Mar 16 10:01:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcjTJ4mqlz3yf5V; Thu, 16 Mar 2023 10:01: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 4PcjTJ4F0Sz45Kw; Thu, 16 Mar 2023 10:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678960884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nBgEVCt/iJuPpG0J1fYI1vGM4zPTHB61Qv2ko+uMV+8=; b=rvLNNd1I7y4OkDlO9lM3tcWPaMG0HR/AI0u2/BsLUwT3a1x96MCz9HZNjcDYm8wmh8YOGK 53GNYSn3ICdEOE0bcQw5gL2givi7CApVA0a3siju+iNPsoYRkJegNZ4h6qO9l5EshFTKPR /dPMPWbX+6M2QxXtFcf8lkzNV5ymP07v9cwI0COUqMfE6p9s5uOu/iKmRWCqT3z4nLkNkr FSn1QpGcUsoHJoQGgNEao+ZZwRUuGuk1IEFqBnicj1wPyiqGUV/73GnjTxHW8q+4vjFwfd 1ENJF1K9fPL4g10VtM0dsZ7pKknxIIKPGxsCXJ08tq3rjvsKcWZgoxA2RX0Ykw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678960884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nBgEVCt/iJuPpG0J1fYI1vGM4zPTHB61Qv2ko+uMV+8=; b=eKIe4EBxzy0xFx1Rb727L1iAR822MQBllNIUWTfsXfSPTCvaBiwwT0ih36ko2JxJhNGBxL PqCzQ8VbyWwQBYsKPgy0v1DgYlqTRKHmczF6ftp3w0RG3tLBdi1HFW9uEZCprIapoXY7Xm WgISAQxB3+BSVet1+jPwsKrRVXI/bK+DqTry9oKnPo4gIWwnvSIYRBGvRo1TuEbtxJCgeq DckkeIOEJYn94mwAwPOi2rs2O+15Qz9SvMqth5NN64688p0tJgWhPtyve33ru7Kwoe9R75 +vW2QuhWbqC2m2b9mFbtsY9emWGpArfwreKix2wUJJvc9yl5gFxCdUvA41/nzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678960884; a=rsa-sha256; cv=none; b=VG/Pb6kvDHMYngvUHqN7KWZ3JOX+JV3ixV7nJFnMrkgVkAG5LB1qTaCYT5rE4ZRndz7TPB CI9fPYk1pUCd1BNCdthco+p+K7IS4xz5XjrpT1bkWWkYz1iZAkw48ImjfVlSMajtx/ePFp tvOP+kvF2ZFzG7U065En1/niLDSuD6QDaqDnmxzJaJJFKMWxbT1D16Ymo7dgQg0WoOnHki UM8DGQ0cUAP3KeXWhczaw+RhTqLHooekKVLD9YmQKZM/yQfEjvdNGLMp29ypJAqA3EJYuX OdvOpNmPYk6ddvaZ+dQU7fd8SolWl5wPz68a59J1gbwiM3eoRzRPY6Kco39LdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcjTJ3HfszfQD; Thu, 16 Mar 2023 10:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GA1OT1062706; Thu, 16 Mar 2023 10:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GA1Ovc062705; Thu, 16 Mar 2023 10:01:24 GMT (envelope-from git) Date: Thu, 16 Mar 2023 10:01:24 GMT Message-Id: <202303161001.32GA1Ovc062705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b52b61c0b6b1 - main - pf: distinguish forwarding and output cases for pf_refragment6() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b52b61c0b6b1cb309461060f53cd5b7f5c3bb4ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b52b61c0b6b1cb309461060f53cd5b7f5c3bb4ed commit b52b61c0b6b1cb309461060f53cd5b7f5c3bb4ed Author: Kristof Provost AuthorDate: 2023-03-12 17:34:42 +0000 Commit: Kristof Provost CommitDate: 2023-03-16 09:59:04 +0000 pf: distinguish forwarding and output cases for pf_refragment6() Re-introduce PFIL_FWD, because pf's pf_refragment6() needs to know if we're ip6_forward()-ing or ip6_output()-ing. ip6_forward() relies on m->m_pkthdr.rcvif, at least for link-local traffic (for in6_get_unicast_scopeid()). rcvif is not set for locally generated traffic (e.g. from icmp6_reflect()), so we need to call the correct output function. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revisi: https://reviews.freebsd.org/D39061 --- sys/net/pfil.c | 15 +++++++++++++-- sys/net/pfil.h | 4 +++- sys/net/pfvar.h | 2 +- sys/netinet6/ip6_forward.c | 2 +- sys/netpfil/pf/pf.c | 2 +- sys/netpfil/pf/pf_norm.c | 10 ++++++++-- 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/sys/net/pfil.c b/sys/net/pfil.c index e6f3ff8c1269..71b126558b44 100644 --- a/sys/net/pfil.c +++ b/sys/net/pfil.c @@ -202,8 +202,11 @@ pfil_mbuf_common(pfil_chain_t *pch, struct mbuf **m, struct ifnet *ifp, pfil_return_t rv; NET_EPOCH_ASSERT(); - KASSERT(flags == PFIL_IN || flags == PFIL_OUT, - ("%s: unsupported flags %d", __func__, flags)); + KASSERT((flags & ~(PFIL_IN|PFIL_OUT|PFIL_FWD)) == 0, + ("%s: unsupported flags %#x", __func__, flags)); + KASSERT((flags & ~PFIL_FWD) == PFIL_IN || + (flags & ~PFIL_FWD) == PFIL_OUT, + ("%s: conflicting directions %#x", __func__, flags)); rv = PFIL_PASS; CK_STAILQ_FOREACH(link, pch, link_chain) { @@ -231,6 +234,14 @@ pfil_mbuf_out(struct pfil_head *head, struct mbuf **m, struct ifnet *ifp, return (pfil_mbuf_common(&head->head_out, m, ifp, PFIL_OUT, inp)); } +int +pfil_mbuf_fwd(struct pfil_head *head, struct mbuf **m, struct ifnet *ifp, + struct inpcb *inp) +{ + + return (pfil_mbuf_common(&head->head_out, m, ifp, PFIL_OUT | PFIL_FWD, inp)); +} + /* * pfil_head_register() registers a pfil_head with the packet filter hook * mechanism. diff --git a/sys/net/pfil.h b/sys/net/pfil.h index b99ec6896266..96a43d05fbac 100644 --- a/sys/net/pfil.h +++ b/sys/net/pfil.h @@ -80,7 +80,7 @@ struct pfilioc_link { #define PFIL_IN 0x00010000 #define PFIL_OUT 0x00020000 -/* UNUSED 0x00040000 */ +#define PFIL_FWD 0x00040000 #define PFIL_DIR(f) ((f) & (PFIL_IN|PFIL_OUT)) #define PFIL_HEADPTR 0x00100000 #define PFIL_HOOKPTR 0x00200000 @@ -179,6 +179,8 @@ int pfil_mbuf_in(struct pfil_head *, struct mbuf **, struct ifnet *, struct inpcb *inp); int pfil_mbuf_out(struct pfil_head *, struct mbuf **, struct ifnet *, struct inpcb *inp); +int pfil_mbuf_fwd(struct pfil_head *, struct mbuf **, struct ifnet *, + struct inpcb *); /* * Minimally exposed structure to avoid function call in case of absence diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index bb058c8e8ae6..b97524f34bc3 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2135,7 +2135,7 @@ int pf_normalize_ip6(struct mbuf **, int, struct pfi_kkif *, u_short *, void pf_poolmask(struct pf_addr *, struct pf_addr*, struct pf_addr *, struct pf_addr *, u_int8_t); void pf_addr_inc(struct pf_addr *, sa_family_t); -int pf_refragment6(struct ifnet *, struct mbuf **, struct m_tag *); +int pf_refragment6(struct ifnet *, struct mbuf **, struct m_tag *, bool); #endif /* INET6 */ u_int32_t pf_new_isn(struct pf_kstate *); diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 293fcd977344..c8f9079e0aa7 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -321,7 +321,7 @@ again: odst = ip6->ip6_dst; /* Run through list of hooks for forwarded packets. */ - if (pfil_mbuf_out(V_inet6_pfil_head, &m, nh->nh_ifp, + if (pfil_mbuf_fwd(V_inet6_pfil_head, &m, nh->nh_ifp, NULL) != PFIL_PASS) goto freecopy; ip6 = mtod(m, struct ip6_hdr *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0ccf1fcfc693..f20851cb60e8 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7953,7 +7953,7 @@ done: /* If reassembled packet passed, create new fragments. */ if (action == PF_PASS && *m0 && dir == PF_OUT && (mtag = m_tag_find(m, PF_REASSEMBLED, NULL)) != NULL) - action = pf_refragment6(ifp, m0, mtag); + action = pf_refragment6(ifp, m0, mtag, pflags & PFIL_FWD); SDT_PROBE4(pf, ip, test6, done, action, reason, r, s); diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 283f6771221c..bc5f6d38a2bf 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -942,7 +942,8 @@ fail: #ifdef INET6 int -pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag) +pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag, + bool forward) { struct mbuf *m = *m0, *t; struct pf_fragment_tag *ftag = (struct pf_fragment_tag *)(mtag + 1); @@ -1009,7 +1010,12 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag) memset(&pd, 0, sizeof(pd)); pd.pf_mtag = pf_find_mtag(m); if (error == 0) - ip6_forward(m, 0); + if (forward) { + MPASS(m->m_pkthdr.rcvif != NULL); + ip6_forward(m, 0); + } else { + ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); + } else m_freem(m); } From nobody Thu Mar 16 10:01:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcjTK6LFwz3yf5X; Thu, 16 Mar 2023 10:01: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 4PcjTK5p2Bz45DM; Thu, 16 Mar 2023 10:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678960885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G4hrmuGyRwYVEit0jv7b5bax1xmni62JWdKBQva8NNE=; b=C0I8/nP/1H43dz3jbkeT5mx1KV5wtDMPGwiKMbGzJQ7yaCPuPMinv0ZHDMvS/nKyIWlRdz IcnneGzDPl+pAaoNgFmiciga1hC+xahwQYhfUCrldt9Pb2M3Ard9BvXcxeTGS8bkpqsUnu sOvQxrHmBnDI8bZFzucvH8GFtddFpXs3qs+w8CokybLUv6I5XvVFkONCeVI4N1R5/qWpOW YarSmNPsLv84ZrJxpqLpJp8JJHvsQUtboHRi7pFoPxMWV1EspvionF8ctp0H7QGSplYhyF +y/hEVGcW5TJpy7LcoUK//luQ+ehkr3//V++Im2lL35FnXKd+mOecKy88AeAHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678960885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G4hrmuGyRwYVEit0jv7b5bax1xmni62JWdKBQva8NNE=; b=OzO02XtE7PTQPwIymQFyxsPiEQcgOTYtuwzIQUwy8wEHkRFtJQes6II4jOT5n2NjzfGjeQ ZVcsXzR5LoYGmi8NaOwMrGZ4UXduSqcEYgPdL4s0JmMYjCfoXRmJxjA3MD35ALa5rGF43J YQ/9X7yJHOgj9WnQLh2D0ixEzVC3uCrUOdVyEUp1eX5+5bPgUcHW7kBty59+678/UAKWIF i8XBkNCKC2qILwPLwk2FGOsgLcaYUMSHa/v1uO4B8hbw3GyvYcsH4PQm41CiPYX1uPCUFV IyKMc4o8fytPlWWXZ57E1fPFWMPFLaexX1ixtprxXuu8ooGC0qRz940HcilFlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678960885; a=rsa-sha256; cv=none; b=J9Wu0rwIbzVXO40m9snldpHiOQYv129Tcwka5D2PBSQKYLN6BXL3Xl1n+xxUuOdeeL7cU5 /4TryiFODPk2Qwr+XaS0uDPgGxuufM0EmXrWzVjJgPARST1+fmTapOn+8TYoI3xuzSnCkj dJh+MgkIXOTZuVMjsDiw7pjq6QYDAwvOLfxjtK+EmVzGKUnZ+Gz/0sgELC9SsFQKWJJNVY tP6Qx6tvLgr4bDb6FGm7zUB5XQth+TissopcfQ1GEjlpo3ZewG4KHujiACTSBGH76deEbG 6QrC0Ol4RLu1AVIOZGsgkaUlnDaIbdLRX9u5Fqr5RcBu6QPefLWHFCpC29hZKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcjTK46DJzfFk; Thu, 16 Mar 2023 10:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GA1PvI062725; Thu, 16 Mar 2023 10:01:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GA1PB0062724; Thu, 16 Mar 2023 10:01:25 GMT (envelope-from git) Date: Thu, 16 Mar 2023 10:01:25 GMT Message-Id: <202303161001.32GA1PB0062724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 80e76c61ccc4 - main - pf: set scope in pf_refragment6() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80e76c61ccc47651ca1be34b912d53536db34e6f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=80e76c61ccc47651ca1be34b912d53536db34e6f commit 80e76c61ccc47651ca1be34b912d53536db34e6f Author: Kristof Provost AuthorDate: 2023-03-13 09:27:59 +0000 Commit: Kristof Provost CommitDate: 2023-03-16 09:59:04 +0000 pf: set scope in pf_refragment6() Link-local traffic needs to have a scope embedded before it's passed on to ip6_output(). Do so in pf_refragment6(), because when we end up here in the output path we may have passed through ip6_output() already (before being reassembled), where the scope would have been removed. Re-embed the scope so that link-local traffic is sent correctly. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39062 --- sys/netpfil/pf/pf_norm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index bc5f6d38a2bf..8d36e72d71b2 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -946,6 +947,7 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag, bool forward) { struct mbuf *m = *m0, *t; + struct ip6_hdr *hdr; struct pf_fragment_tag *ftag = (struct pf_fragment_tag *)(mtag + 1); struct pf_pdesc pd; uint32_t frag_id; @@ -972,13 +974,17 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag, *(mtod(m, char *) + off) = IPPROTO_FRAGMENT; m = *m0; } else { - struct ip6_hdr *hdr; - hdr = mtod(m, struct ip6_hdr *); proto = hdr->ip6_nxt; hdr->ip6_nxt = IPPROTO_FRAGMENT; } + /* In case of link-local traffic we'll need a scope set. */ + hdr = mtod(m, struct ip6_hdr *); + + in6_setscope(&hdr->ip6_src, ifp, NULL); + in6_setscope(&hdr->ip6_dst, ifp, NULL); + /* The MTU must be a multiple of 8 bytes, or we risk doing the * fragmentation wrong. */ maxlen = maxlen & ~7; From nobody Thu Mar 16 10:01:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcjTM3Fxlz3ydy5; Thu, 16 Mar 2023 10:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcjTL69yCz45RC; Thu, 16 Mar 2023 10:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678960886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UuXFwQNpV0ZZkYw1AjRT7O1CXYPXD4cMoQNv7Yls1Ug=; b=nBU+T/0Csyc/ft0NI8wuiwY2hUG2Ldn8VHg9Ezm5LulDljrcSBF7BSqOGt3dgDm66GOt3l JSJ0XlMGegeocGm1GaQvAtn1cLRBIbCZ9QQQ3nJBxO0Nm/Kj7hsO1jv/CX/dWbijCTYd3W l5189PpFfiPooDPny3/KxcsOjIXy+0jjnMQRVOz/bIo6sHeZJ2mDTD5jGbZQg/q9Kk8Hy4 60ab7CWdHcKmKGZR5/TUZpftz5YKS/PATsz+FmxtBOLPootuQ84lUmrRAQg+4NNroBhlLn tPwSF30/FzMSDxd3SI62L/D7k+S5uDjxDk2Psrb3FUaXDTr1TJmxef0VSVb+bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678960886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UuXFwQNpV0ZZkYw1AjRT7O1CXYPXD4cMoQNv7Yls1Ug=; b=DHCvCix1eYHoVX1SiskeO9IvNp6yW8Z6g62eZbRt8r+Z3Tl9VYz1M4LsHwsvEhDP7ha5LZ KNwlV4FkIhp9CcdruC3Bt1CcaV8aG5fZH4XUN5r3cZ5odnx0BQigPtgvkXGMT9w3A+6R0H RodI0HFBchZ36WqFeRcW0T7KfwbGq2Unz29vT5Eok2dvTQC9IZg2wOFyC3Zcd0FQh/YE4j JU4/+ZVH7j3nNDi1A3dlOkIb26NQ6TDiuiXNmTxIrBsX7zADNHR2WEkDDcrMK0zKJA+Vdu OR6YehIXLZ4vKIXnyPa0VMMN6S+0o9B20mH4SpeDMwCJjOFA6Nw5gz/jdJv55A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678960886; a=rsa-sha256; cv=none; b=mSOeRYuFl6ZZn9hfxyvQ+BMS1UpZwwXEg8GJvaw7o5w6h5TjyfsNZFCphXvDrnjT59iF1B 5KsMvDj2/rgmBRj8zmsU2ZFaiemcx5PWqiHQJkvQDrg4L3RUDWCtBx9lk1aNJdbjPaj8PO 3T2vMupQw6PuhLVMItKyKjkHxcM9LdRwuKP4zYuqgvL+/IC0DPlkbw52ZI73G0W+ZQOj+R k1GTZuDz39ODnSNL2rhRnXHPTZz8eB5vhCOjLgGNJ0XF+1cWOa7igWMplyaAkgDaj1T89N WTZYb/7XNQCvCPdPbRW5CIBie1xcb4NUeuX6XZfaoj/Oks5wev62MLF41Ecnsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcjTL4nJ8zfFq; Thu, 16 Mar 2023 10:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GA1Q4v062752; Thu, 16 Mar 2023 10:01:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GA1QqA062751; Thu, 16 Mar 2023 10:01:26 GMT (envelope-from git) Date: Thu, 16 Mar 2023 10:01:26 GMT Message-Id: <202303161001.32GA1QqA062751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 225e85513fd7 - main - pf tests: test IPv6 fragmentation with link-local addresses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 225e85513fd7a5e31f649e35f0b99454bb725776 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=225e85513fd7a5e31f649e35f0b99454bb725776 commit 225e85513fd7a5e31f649e35f0b99454bb725776 Author: Kristof Provost AuthorDate: 2023-03-12 15:08:31 +0000 Commit: Kristof Provost CommitDate: 2023-03-16 09:59:04 +0000 pf tests: test IPv6 fragmentation with link-local addresses We've observed a panic after pf_refragment6() with link-local addresses, because pf_refragment6() calls ip6_forward() even for a simple output case. That results in us entering ip6_forward() with an mbuf with a NULL m->m_pkthdr.rcvif, which can cause a NULL deref (but seemingly not for GUAs. Test sending fragmented link-local packets to pf. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39063 --- tests/sys/netpfil/pf/fragmentation.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/sys/netpfil/pf/fragmentation.sh b/tests/sys/netpfil/pf/fragmentation.sh index 03ba5030d8aa..554a9fdecc09 100644 --- a/tests/sys/netpfil/pf/fragmentation.sh +++ b/tests/sys/netpfil/pf/fragmentation.sh @@ -103,6 +103,10 @@ v6_body() jexec singsing ifconfig ${epair_link}b inet6 -ifdisabled ifconfig ${epair_send}a inet6 -ifdisabled + ifconfig ${epair_send}a + jexec alcatraz ifconfig ${epair_send}b + lladdr=$(jexec alcatraz ifconfig ${epair_send}b | awk '/ scopeid / { print($2); }' | cut -f 1 -d %) + jexec alcatraz pfctl -e pft_set_rules alcatraz \ "scrub fragment reassemble" \ @@ -120,6 +124,12 @@ v6_body() atf_check -s exit:0 -o ignore\ ping -6 -c 1 -b 70000 -s 65000 2001:db8:42::2 + # Force an NDP lookup + ping -6 -c 1 ${lladdr}%${epair_send}a + + atf_check -s exit:0 -o ignore\ + ping -6 -c 1 -b 70000 -s 65000 ${lladdr}%${epair_send}a + # Forwarding test atf_check -s exit:0 -o ignore \ ping -6 -c 1 2001:db8:43::3 From nobody Thu Mar 16 10:08:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcjd641lhz3yfZX; Thu, 16 Mar 2023 10:08: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 4Pcjd6241rz46MM; Thu, 16 Mar 2023 10:08:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678961290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QC3OVIJ8y8OXfOR2pJ/ijGhKkKQ6w9oxo5Y+ZAR3cUU=; b=N8cJwiuuZa9lRrC7Z4uxM8h0igG259VLTchr5YgEGOo4l4TsbckDTvTyWFuKA0F7BeEwjI tjyoSrRef3fgkhDjnGa5eDB6JXgSbcHzi3T3teqWlIfOGRr/wXVkh5LNAdvlSvryo2yKKB Ji+lOJl8b7TomFbjCqeT3w8DOV83jDSD3ezCIgKcytU+/jhIBBW9sB5hLeIl89b4X+pjed pVKLZPyeNxcX8cPCMxiT/wvs/7Lp9qXliGCd7EeF+s36wXShqhbs9vGsXsLpDdQd8jkmmL ibqHacpQ4ySvP3syD2aPS7C02qzqzHEmXLZO/+BMP6/+Q0LML6SLcK7TlT1Exw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678961290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QC3OVIJ8y8OXfOR2pJ/ijGhKkKQ6w9oxo5Y+ZAR3cUU=; b=gFo52AHQ+uJloTG2Q+7l9y5c8P0I2AYr3O+jFhkbwn2J/a7+1lB8YgVK5lVFrQcS9GkCSC QEyLuYHKX1AlNzNGPJmF3LYh+2pRmlViSOslemHWfvF6Aj4iW7yN/75ZxAFXNK/sBGT4ni +TV4xApibkRpeMjtuXFxQuRn1MhmGB30hMrgg1lekY1wbiNAhrdoqy6i58B4DCUKAhG6Ez YZMXh9Njo4YvLFtjARpmYRxXhAqmSIsEIT0o9ekIQvT+oaLZha3txPeDY5c51L6L5/VaBC OTbrf4PptgKeuffG1t9mwf/dUAYrYQ/BXvBrOsN57gPKrUiPN38OwndOCBcbbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678961290; a=rsa-sha256; cv=none; b=gGMze1E0kZKlBtybJrSOuQNc7PwAiptDZJZONVmU2T9gD1vwACiAM9sj5Hb6Q0rd17vCYe t6EA3wj2wSg7Cs/hLdGq3kHzJD1dNsMrv8VmDNwYQ84GNgsiAEYMEvVQtrc0W5k/u9Ygwp vz+9jWe+s3LYjtnxhrofwepgzWiB9/InDuzCMQxeYN5OTTTAbHA7Eb9AhKPGSzVwS9KWLN 7OLnOl2/twMIum4Q9SBNPLlQLHbKHJOsr9YmmAMAcLZM07S58Oc9prP9GZOOvk1bBoMLEc fAlvuRu7OilNJzxWqsDmgwPKmbu/9SKGsXMrYHiL1VSQzPbxMaXYADjTQOZhvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcjd60t4zzffN; Thu, 16 Mar 2023 10:08:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GA8A0h065588; Thu, 16 Mar 2023 10:08:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GA8AIS065587; Thu, 16 Mar 2023 10:08:10 GMT (envelope-from git) Date: Thu, 16 Mar 2023 10:08:10 GMT Message-Id: <202303161008.32GA8AIS065587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 49cad3daf2a3 - main - carp: carp_master_down_locked() requires net epoch List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49cad3daf2a3abe8270f71ee5b15b8990a19529d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=49cad3daf2a3abe8270f71ee5b15b8990a19529d commit 49cad3daf2a3abe8270f71ee5b15b8990a19529d Author: Zhenlei Huang AuthorDate: 2023-03-16 10:00:13 +0000 Commit: Zhenlei Huang CommitDate: 2023-03-16 10:07:03 +0000 carp: carp_master_down_locked() requires net epoch Reviewed by: kp Fixes: 1d126e9b9474 carp: Widen epoch coverage MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D39113 --- sys/netinet/ip_carp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 22b256238774..1b8b10b06168 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1728,6 +1728,7 @@ carp_carprcp(struct carpreq *carpr, struct carp_softc *sc, int priv) int carp_ioctl(struct ifreq *ifr, u_long cmd, struct thread *td) { + struct epoch_tracker et; struct carpreq carpr; struct ifnet *ifp; struct carp_softc *sc = NULL; @@ -1812,8 +1813,10 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct thread *td) carp_delroute(sc); break; case MASTER: + NET_EPOCH_ENTER(et); carp_master_down_locked(sc, "user requested via ifconfig"); + NET_EPOCH_EXIT(et); break; default: break; From nobody Thu Mar 16 12:19:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcmYB3TTvz3y3GD; Thu, 16 Mar 2023 12:19: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 4PcmYB2zkHz4KLP; Thu, 16 Mar 2023 12:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NvK84X4PTaykf2W8kvnJbPdPHHSKIU4DOhdLvHtBz9s=; b=easp+YRuaGnnP6nI2k21YL7UPzolX7HeHHCD9wZA4tDHEYSWQ118Ddq7a+MzwNPymphDoo y834ynuorc2Wj+dW0dtL8r7Nc5F8z7lGjXen/6oluwGfBvmQIhuKMYAbcYw4ehKoaSpT7e +5dmGoUfxqTfpqADU21sVEjTQ1oapU9FIXhMZsDGt3sLUbP4PAUe4woA5cLNYXch7/JCW/ GYUX4E2FqVKBOZ1KVD5gV0dCxATirggbGJzrX+u86Fi0wjrJZ3+2lolE//lQiqsxvuAJf/ W6h0NLWt0VM3wd5w9+TveqcwtPdJ86MwDvlqSWOEKuXXEDraj7EGrlleRC3/Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NvK84X4PTaykf2W8kvnJbPdPHHSKIU4DOhdLvHtBz9s=; b=qVycn8LgrsoIACzUV8VaAkBGftia1tv9zVZaWopggFhMHz+lpEdPPrloJZboFezFvo779n jhOpUWalGrHYIAU1nVBR5CdRzi3wFoz3C4RSl+YLub0HkDQpnOeuj2uv+uvxQWxb7tYP32 oHfJw6f29NRgvItWrNwZmWtc8RtXkGcI2bMWTUsiQh6567mF9iBNT1T283ZJQpbdBy97MH zPD8DK5ATiYgFKVWSEIgqP7SgVlrJ2t2aWW5cgslt5QeOT7jNhqD4k7nHrFLWkrfc1b7BW 5Xp9hKMmkcSbx6TK5VjwoMlR3rGEywGfK4DvActdMeLsyyLOUNEnbrdGTYRdvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678969198; a=rsa-sha256; cv=none; b=rkUXLN0u9V2eAy0PYFLhK04XBTBFj9E+xPJtBRvAFHe2fJFj+m02qKKZQEVhpEQbO6TSVH 5EctfaYYEunAB2bHk0uyaT9M/N539V/bDCJj72tFhz4ytGpAlyaTPMIYz/1doE9/aimhi+ lmV3gHfRlwoeEfhLnmtx/BdZ3yFALjArDiy6AQYgJyjooDdEX+NxoJdqVPwzukHyQG9g5m GTGeqgAucsM+2xfkrnHRpl3ztv/gqJGy3+1J6TRQ3fhTeQvKkKMQwDi+n4mz/qKaHzpfcn g1dQ1kNeKgmvLcVswgUpcWW6xW8c703D0giTVA99+a+pyjJdA+0T4HtnsFenAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcmYB225xzhqV; Thu, 16 Mar 2023 12:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GCJwAp079820; Thu, 16 Mar 2023 12:19:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GCJwHE079819; Thu, 16 Mar 2023 12:19:58 GMT (envelope-from git) Date: Thu, 16 Mar 2023 12:19:58 GMT Message-Id: <202303161219.32GCJwHE079819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 6cb78fa479c7 - main - tarfs: Repeat tests using GNU tar if available. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6cb78fa479c7ac8d2b615f903638691a32dc855c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6cb78fa479c7ac8d2b615f903638691a32dc855c commit 6cb78fa479c7ac8d2b615f903638691a32dc855c Author: Dag-Erling Smørgrav AuthorDate: 2023-03-16 11:31:01 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-16 11:31:22 +0000 tarfs: Repeat tests using GNU tar if available. Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: ngie, asomers Differential Revision: https://reviews.freebsd.org/D39018 --- tests/sys/fs/tarfs/mktar.c | 11 ++-- tests/sys/fs/tarfs/tarfs_test.sh | 106 +++++++++++++++++++++++++++++++++++---- 2 files changed, 104 insertions(+), 13 deletions(-) diff --git a/tests/sys/fs/tarfs/mktar.c b/tests/sys/fs/tarfs/mktar.c index 9b3d7910a12c..4e7d1acc1c82 100644 --- a/tests/sys/fs/tarfs/mktar.c +++ b/tests/sys/fs/tarfs/mktar.c @@ -48,6 +48,7 @@ #define SHORTLINKNAME "short_link" #define LONGLINKNAME "long_link" +static bool opt_g; static bool opt_v; static void verbose(const char *fmt, ...) @@ -163,7 +164,7 @@ static void usage(void) { - fprintf(stderr, "usage: %s [-v] tarfile\n", PROGNAME); + fprintf(stderr, "usage: %s [-gv] tarfile\n", PROGNAME); exit(EXIT_FAILURE); } @@ -175,8 +176,10 @@ main(int argc, char *argv[]) int opt, wstatus; pid_t pid; - while ((opt = getopt(argc, argv, "v")) != -1) + while ((opt = getopt(argc, argv, "gv")) != -1) switch (opt) { + case 'g': + opt_g = true; case 'v': opt_v = true; break; @@ -220,10 +223,12 @@ main(int argc, char *argv[]) err(1, "fork()"); if (pid == 0) { verbose("creating tarball"); - execlp("tar", "tar", + execlp(opt_g ? "gtar" : "tar", + "tar", "-c", "-f", tarfilename, "-C", dirname, + "--posix", "--zstd", #if 0 "--options", "zstd:frame-per-file", diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index 32576cbf57b6..6e44a8081cb2 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -26,12 +26,23 @@ # SUCH DAMAGE. # -mktar="$(dirname $(realpath "$0"))"/mktar mnt="$(realpath ${TMPDIR:-/tmp})/mnt" # expected SHA256 checksum of file contained in test tarball sum=4da2143234486307bb44eaa610375301781a577d1172f362b88bb4b1643dee62 +tar() { + if [ -n "${TARFS_USE_GNU_TAR}" ] ; then + gtar --posix --absolute-names "$@" + else + bsdtar "$@" + fi +} + +mktar() { + "$(atf_get_srcdir)"/mktar ${TARFS_USE_GNU_TAR+-g} "$@" +} + atf_test_case tarfs_basic cleanup tarfs_basic_head() { atf_set "descr" "Basic function test" @@ -41,7 +52,7 @@ tarfs_basic_body() { local tarball="${PWD}/tarfs_test.tar.zst" kldload -n tarfs || atf_skip "This test requires tarfs and could not load it" mkdir "${mnt}" - "${mktar}" "${tarball}" + mktar "${tarball}" atf_check mount -rt tarfs "${tarball}" "${mnt}" atf_check -o match:"^${tarball} on ${mnt} \(tarfs," mount atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -f%d,%i "${mnt}"/hard_link)" @@ -53,6 +64,20 @@ tarfs_basic_cleanup() { umount "${mnt}" || true } +atf_test_case tarfs_basic_gnu cleanup +tarfs_basic_gnu_head() { + atf_set "descr" "Basic function test using GNU tar" + atf_set "require.user" "root" + atf_set "require.progs" "gtar" +} +tarfs_basic_gnu_body() { + TARFS_USE_GNU_TAR=true + tarfs_basic_body +} +tarfs_basic_gnu_cleanup() { + tarfs_basic_cleanup +} + atf_test_case tarfs_notdir_device cleanup tarfs_notdir_device_head() { atf_set "descr" "Regression test for PR 269519 and 269561" @@ -62,11 +87,11 @@ tarfs_notdir_device_body() { kldload -n tarfs || atf_skip "This test requires tarfs and could not load it" mkdir "${mnt}" atf_check mknod d b 0xdead 0xbeef - tar cf tarfs_notdir.tar d + tar -cf tarfs_notdir.tar d rm d mkdir d echo "boom" >d/f - tar rf tarfs_notdir.tar d/f + tar -rf tarfs_notdir.tar d/f atf_check -s not-exit:0 -e match:"Invalid" \ mount -rt tarfs tarfs_notdir.tar "${mnt}" } @@ -74,6 +99,20 @@ tarfs_notdir_device_cleanup() { umount "${mnt}" || true } +atf_test_case tarfs_notdir_device_gnu cleanup +tarfs_notdir_device_gnu_head() { + atf_set "descr" "Regression test for PR 269519 and 269561 using GNU tar" + atf_set "require.user" "root" + atf_set "require.progs" "gtar" +} +tarfs_notdir_device_gnu_body() { + TARFS_USE_GNU_TAR=true + tarfs_notdir_device_body +} +tarfs_notdir_device_gnu_cleanup() { + tarfs_notdir_device_cleanup +} + atf_test_case tarfs_notdir_dot cleanup tarfs_notdir_dot_head() { atf_set "descr" "Regression test for PR 269519 and 269561" @@ -83,11 +122,11 @@ tarfs_notdir_dot_body() { kldload -n tarfs || atf_skip "This test requires tarfs and could not load it" mkdir "${mnt}" echo "hello" >d - tar cf tarfs_notdir.tar d + tar -cf tarfs_notdir.tar d rm d mkdir d echo "world" >d/f - tar rf tarfs_notdir.tar d/./f + tar -rf tarfs_notdir.tar d/./f atf_check -s not-exit:0 -e match:"Invalid" \ mount -rt tarfs tarfs_notdir.tar "${mnt}" } @@ -95,6 +134,20 @@ tarfs_notdir_dot_cleanup() { umount "${mnt}" || true } +atf_test_case tarfs_notdir_dot_gnu cleanup +tarfs_notdir_dot_gnu_head() { + atf_set "descr" "Regression test for PR 269519 and 269561 using GNU tar" + atf_set "require.user" "root" + atf_set "require.progs" "gtar" +} +tarfs_notdir_dot_gnu_body() { + TARFS_USE_GNU_TAR=true + tarfs_notdir_dot_body +} +tarfs_notdir_dot_gnu_cleanup() { + tarfs_notdir_dot_cleanup +} + atf_test_case tarfs_notdir_dotdot cleanup tarfs_notdir_dotdot_head() { atf_set "descr" "Regression test for PR 269519 and 269561" @@ -104,11 +157,11 @@ tarfs_notdir_dotdot_body() { kldload -n tarfs || atf_skip "This test requires tarfs and could not load it" mkdir "${mnt}" echo "hello" >d - tar cf tarfs_notdir.tar d + tar -cf tarfs_notdir.tar d rm d mkdir d echo "world" >f - tar rf tarfs_notdir.tar d/../f + tar -rf tarfs_notdir.tar d/../f atf_check -s not-exit:0 -e match:"Invalid" \ mount -rt tarfs tarfs_notdir.tar "${mnt}" } @@ -116,6 +169,20 @@ tarfs_notdir_dotdot_cleanup() { umount "${mnt}" || true } +atf_test_case tarfs_notdir_dotdot_gnu cleanup +tarfs_notdir_dotdot_gnu_head() { + atf_set "descr" "Regression test for PR 269519 and 269561 using GNU tar" + atf_set "require.user" "root" + atf_set "require.progs" "gtar" +} +tarfs_notdir_dotdot_gnu_body() { + TARFS_USE_GNU_TAR=true + tarfs_notdir_dotdot_body +} +tarfs_notdir_dotdot_gnu_cleanup() { + tarfs_notdir_dotdot_cleanup +} + atf_test_case tarfs_notdir_file cleanup tarfs_notdir_file_head() { atf_set "descr" "Regression test for PR 269519 and 269561" @@ -125,11 +192,11 @@ tarfs_notdir_file_body() { kldload -n tarfs || atf_skip "This test requires tarfs and could not load it" mkdir "${mnt}" echo "hello" >d - tar cf tarfs_notdir.tar d + tar -cf tarfs_notdir.tar d rm d mkdir d echo "world" >d/f - tar rf tarfs_notdir.tar d/f + tar -rf tarfs_notdir.tar d/f atf_check -s not-exit:0 -e match:"Invalid" \ mount -rt tarfs tarfs_notdir.tar "${mnt}" } @@ -137,10 +204,29 @@ tarfs_notdir_file_cleanup() { umount "${mnt}" || true } +atf_test_case tarfs_notdir_file_gnu cleanup +tarfs_notdir_file_gnu_head() { + atf_set "descr" "Regression test for PR 269519 and 269561 using GNU tar" + atf_set "require.user" "root" + atf_set "require.progs" "gtar" +} +tarfs_notdir_file_gnu_body() { + TARFS_USE_GNU_TAR=true + tarfs_notdir_file_body +} +tarfs_notdir_file_gnu_cleanup() { + tarfs_notdir_file_cleanup +} + atf_init_test_cases() { atf_add_test_case tarfs_basic + atf_add_test_case tarfs_basic_gnu atf_add_test_case tarfs_notdir_device + atf_add_test_case tarfs_notdir_device_gnu atf_add_test_case tarfs_notdir_dot + atf_add_test_case tarfs_notdir_dot_gnu atf_add_test_case tarfs_notdir_dotdot + atf_add_test_case tarfs_notdir_dotdot_gnu atf_add_test_case tarfs_notdir_file + atf_add_test_case tarfs_notdir_file_gnu } From nobody Thu Mar 16 12:19:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcmYC4pNzz3y3Bn; Thu, 16 Mar 2023 12:19: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 4PcmYC3s0Qz4KJH; Thu, 16 Mar 2023 12:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u+JKUxxlz0vbPFt3yb9ZKY4LVzzQ8c2YADXzoIlnUk0=; b=VbkaPYnfGCH+KpRybYNSrEdflYXP4qiMK7H85K/9ZvSYrvEwCHk6AfceY7N938RPI1LsSq dUuz75CB48JQRQy7PRcdz15MPqeHBfoyV3icqyXoKx5xobpNtXVlMG/e8LF12Stfx7vXjq MESoozVyPhya97M6HKRySxsIJ3WFoNRdgndZRmvO/NPnOhZvJgatNOf1F486FrA6bNXJVE luMtEmemXEqAQMbBd9+gFSAeRHs/FnE/MKV0zXXx0kWH4f8zc6sm5B2aThrAIg0DyDda7W nUNulsrIMGBLpCOB7G004XRulgsDWZ1PP21FsSqfFgReMJ6SogVBNSZRJwWHoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u+JKUxxlz0vbPFt3yb9ZKY4LVzzQ8c2YADXzoIlnUk0=; b=PRqq11hzXxK3SKoo2WnjOBHN4PYJuCAmnlIgrlcEgCh6wk5uPXyOl845mClRh3Z95Z7dR4 /vc1M4LsHzeuoVlhmyq+XyKgFMqzLFyBBG1A25+xhwn5SJeRCOufIF8To1BZjiBgQyq0Vb ifVZkG2DhpbzTLZEa6IyrxBKquFAL4ztoHzKuW0O52xcU5ogCQrD8aZT2mrtx+ElTNNW1v ryFuK2Igp5K5qtovfj6BZd9dJ0C/Hqati1KKSmY9JvFHpUlL7wFjU7M+oArpkk4SdBIZT4 Pk0G8ytqnyU5zmfqLT0zmAS5Nj/Uga/JZCzlKh5gv4x+BcqlrXG5yyiOUl7LHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678969199; a=rsa-sha256; cv=none; b=ZNGGOih7k+q2+1wlNcFNyht5r8Pv2m6/EckqQzFvqD6jLdyYK9EW33fI7biOEvyD+Q1WnR gnCQg/Vvm3ST9afJrAwoRd1VVZzXagmYr3z7bR4Fa2IooKpmicVJfBAuOzm0EzuYHhWvR4 yRZkoDLjc7uQSgcQRwN6yxL+KTw0CCIDjmPxNvd8YSCerLyEpbrl0oaADNT9vEuWuD2yxh MkUEiKqdSaaD+tLslesOGcXsDcNMKwT2KTVLc+GEPYKYz09WyEsd2b35GZnNduyl+Ecw6l G6pvuB3Y2L2Dvk10x3pDIiVmkyj52CgdTpPZqnwFQW3rAfdH50faPMm6O50Q8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcmYC2fByzjmr; Thu, 16 Mar 2023 12:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GCJxVg079845; Thu, 16 Mar 2023 12:19:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GCJxF1079844; Thu, 16 Mar 2023 12:19:59 GMT (envelope-from git) Date: Thu, 16 Mar 2023 12:19:59 GMT Message-Id: <202303161219.32GCJxF1079844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: fd8c98a52f71 - main - tarfs: Correctly track link count. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd8c98a52f7178d8071cf201f2eb14f00d904a7d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fd8c98a52f7178d8071cf201f2eb14f00d904a7d commit fd8c98a52f7178d8071cf201f2eb14f00d904a7d Author: Dag-Erling Smørgrav AuthorDate: 2023-03-16 11:31:06 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-16 11:31:22 +0000 tarfs: Correctly track link count. Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39019 --- sys/fs/tarfs/tarfs_subr.c | 13 +++++++++++++ sys/fs/tarfs/tarfs_vfsops.c | 7 +++---- tests/sys/fs/tarfs/tarfs_test.sh | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sys/fs/tarfs/tarfs_subr.c b/sys/fs/tarfs/tarfs_subr.c index 0cba43a8c21b..6aa7eaedb773 100644 --- a/sys/fs/tarfs/tarfs_subr.c +++ b/sys/fs/tarfs/tarfs_subr.c @@ -384,6 +384,18 @@ tarfs_free_node(struct tarfs_node *tnp) tmp = tnp->tmp; switch (tnp->type) { + case VREG: + if (tnp->nlink-- > 1) + return; + if (tnp->other != NULL) + tarfs_free_node(tnp->other); + break; + case VDIR: + if (tnp->nlink-- > 2) + return; + if (tnp->parent != NULL && tnp->parent != tnp) + tarfs_free_node(tnp->parent); + break; case VLNK: if (tnp->link.name) free(tnp->link.name, M_TARFSNAME); @@ -397,6 +409,7 @@ tarfs_free_node(struct tarfs_node *tnp) free(tnp->blk, M_TARFSBLK); if (tnp->ino >= TARFS_MININO) free_unr(tmp->ino_unr, tnp->ino); + TAILQ_REMOVE(&tmp->allnodes, tnp, entries); free(tnp, M_TARFSNODE); tmp->nfiles--; } diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index 03dc598f4b69..9d7297eb9d73 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -406,16 +406,14 @@ static void tarfs_free_mount(struct tarfs_mount *tmp) { struct mount *mp; - struct tarfs_node *tnp; + struct tarfs_node *tnp, *tnp_next; MPASS(tmp != NULL); TARFS_DPF(ALLOC, "%s: Freeing mount structure %p\n", __func__, tmp); TARFS_DPF(ALLOC, "%s: freeing tarfs_node structures\n", __func__); - while (!TAILQ_EMPTY(&tmp->allnodes)) { - tnp = TAILQ_FIRST(&tmp->allnodes); - TAILQ_REMOVE(&tmp->allnodes, tnp, entries); + TAILQ_FOREACH_SAFE(tnp, &tmp->allnodes, entries, tnp_next) { tarfs_free_node(tnp); } @@ -744,6 +742,7 @@ again: error = EINVAL; goto bad; } + tnp->other->nlink++; break; case TAR_TYPE_SYMLINK: if (link == NULL) { diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index 6e44a8081cb2..50d98f857e06 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -59,6 +59,8 @@ tarfs_basic_body() { atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/short_link)" atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/long_link)" atf_check_equal "$(sha256 -q "${mnt}"/sparse_file)" ${sum} + atf_check_equal "$(stat -f%l "${mnt}"/sparse_file)" 2 + atf_check_equal "$(stat -f%l "${mnt}"/hard_link)" 2 } tarfs_basic_cleanup() { umount "${mnt}" || true From nobody Thu Mar 16 12:20:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcmYD5Ngwz3y39K; Thu, 16 Mar 2023 12:20: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 4PcmYD4gZ7z4KMN; Thu, 16 Mar 2023 12:20:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9SRBVfQEw7f0GLgq/QW/aONd7EeUZkl0PR92MVce5Mk=; b=bKr+YU5/pJ6HZob0ND/lIARUX1yEOjhSLie6wmwAnfDf4hJmNeP9gXBenctSoRB7IeiRek s5wXfjFoF6laxOO6IPpjlIj5CDfpRgCnqmX/xCKuL7TBiE0FSFZXLKe00i+nEs0ascGL8X VocOY794Jp/tq9mMxwUEoPP4jp6ijgGCW65vZ9TqSp1J7f5OPHqQUGt0N/cK8RlU6I24nQ SK00c27HbdjA4ehjvNPFK7CqbGPsJg5mO7NE3csNrk44/0CgujY8TlR1gRmUnTcLddbaxv 8LNQrDcRPlum/trh4gLXkpP6DrnxETOlockUKGANbF7/B7nWp7gKEeVmG2Na6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9SRBVfQEw7f0GLgq/QW/aONd7EeUZkl0PR92MVce5Mk=; b=xGyl108LcGZ3H5UFg4KeyhugmYrT8L3T17LwKuzozFf4hO+ilLUbT9ZSYxDqktTTcxQKjX +78uDRju3wRy/gSzHJUt+/q+nz+eMDIOfhYqOBCIy4KMC4gzIBlwculsEkZ0VCKL+txFEu URqfIXh5xzPy9WFAgoO9rES/hpp4ZRiyei6KpRRi8AuDK3zJAg7rsk1PWntiGDtv/jz95r 4wD6nPsmhbFqnLYiEucNR+8qAQ5J+otAnuIVozNfgCwYBgXcTVG5Hs7RucKjeCpjNiZHhE g4qs6nTAWHfgwfkf5Glbn61UyCTOieTVH8xct1XZaY/59NCyMFoHvbAcqSFIoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678969200; a=rsa-sha256; cv=none; b=lM8MZxIS425/XrSUkzOdw59AqD3QbLif+VMrR6BMEKalxSrVKR+DWGAcOq+KgnPoJA2Shw YuDVUdrSF/sbZ2SYS0VP4ZarRCTVyO+Dos+QU+l31prlZy4zDCkjH3l1cfi+PZOdZajsRb 0au55Yk+suF52CidRxELdVdFbpsibfEBmxDJd6a7i1yJ3twoM3BF0nOd//KyjphL8FNQCs 3iM22uD+5oasyJpZpaSE0Xg/S6JyPoOwyxn2F/axKbXOkEAfOT3+eDMJCBkRKb5c84zaIw ahnKfEQqE7wWTvFDYqFFYC6ybZZm21Jl3m1doA0KUEyKXAhUFCI+BV6tXjCxGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcmYD3RSWzjWp; Thu, 16 Mar 2023 12:20:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GCK075079990; Thu, 16 Mar 2023 12:20:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GCK0IB079971; Thu, 16 Mar 2023 12:20:00 GMT (envelope-from git) Date: Thu, 16 Mar 2023 12:20:00 GMT Message-Id: <202303161220.32GCK0IB079971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: e81d55b43948 - main - tarfs: Support tar files which include file modes with permissions. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e81d55b43948e4ebcd20a9563521aae54ab727cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e81d55b43948e4ebcd20a9563521aae54ab727cc commit e81d55b43948e4ebcd20a9563521aae54ab727cc Author: Dag-Erling Smørgrav AuthorDate: 2023-03-16 11:31:10 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-16 11:31:22 +0000 tarfs: Support tar files which include file modes with permissions. Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39020 --- sys/fs/tarfs/tarfs_vfsops.c | 4 ++-- tests/sys/fs/tarfs/tarfs_test.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index 9d7297eb9d73..837fc7644ac1 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -515,12 +515,12 @@ again: /* get standard attributes */ num = tarfs_str2int64(hdrp->mode, sizeof(hdrp->mode)); - if (num < 0 || num > ALLPERMS) { + if (num < 0 || num > (S_IFMT|ALLPERMS)) { TARFS_DPF(ALLOC, "%s: invalid file mode at %zu\n", __func__, TARFS_BLOCKSIZE * (blknum - 1)); mode = S_IRUSR; } else { - mode = num; + mode = num & ALLPERMS; } num = tarfs_str2int64(hdrp->uid, sizeof(hdrp->uid)); if (num < 0 || num > UID_MAX) { diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index 50d98f857e06..d0624b79eb2d 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -59,6 +59,7 @@ tarfs_basic_body() { atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/short_link)" atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/long_link)" atf_check_equal "$(sha256 -q "${mnt}"/sparse_file)" ${sum} + atf_check_equal "$(stat -f%p "${mnt}"/sparse_file)" 100644 atf_check_equal "$(stat -f%l "${mnt}"/sparse_file)" 2 atf_check_equal "$(stat -f%l "${mnt}"/hard_link)" 2 } From nobody Thu Mar 16 12:20:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcmYF5fv3z3y3Lc; Thu, 16 Mar 2023 12:20: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 4PcmYF4tjyz4KPp; Thu, 16 Mar 2023 12:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C+NCt6GARlz6Bi3F6moi02X2FhLdutZrVU68X+k+lYg=; b=nMtu74tPKy+V+uzTaDck9OAh4C2WeUvA/2eL8fskdt7Wrj9UGtvMaM/V1sDFHoDHTJ2WF1 aE87vwecUmAFZ0L08LocOQU5AzBpAxeVBHxgJvp51vLphk/zqc0IZZXuhnjJe8aYmPl81A glatBiI7AepFM7k6Jo+KZvc4vGkXQNbA6BgAEkBJpUhTCPnan474AxdujngYwcv3kXzL7O Ww/FFjyn2SV+U+rO90by+NNz5K0/TlSB+Q4bGdJH6NSDaByU6dXYfFOgFzqAK/bpYHixr+ hmvzQklRrdEVWx1p7yvgdxY/I/9GIHZYzokCpS54asEZJYkTwsdOFwrAjIlOZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678969201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C+NCt6GARlz6Bi3F6moi02X2FhLdutZrVU68X+k+lYg=; b=EA8Gn+NXOOE2bLezF21oCr4fSVYCMeYuk+flljUNwVhrjrxhswOJBxsDTFdd1teo4rscmu jW0FnxtigfuCMF1eBVid6haTwTMPe8sFlF5UlgaqbhPx6AsPn3U0mUMaaoaY+fPzR1NUfa 4CGnPI1e6KX6tHU/WhTCxornKaTPq9UYdriLsTa29+WAvBj4ZcHHB6sY1pDoPcVAoK8J4i /+GctgjcHJSp5ws6tcBmjpBL/9SzV7QN5TfTDCuTE5VfWOPTiw2U9D9mf+n5HH5N4xAOGD ANxkD1ICknuPoHVys9W1hPZEaBfWC10zJNc93NrOpYxtkyZmVfuU9Hl3+kEtaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678969201; a=rsa-sha256; cv=none; b=P4o2LSmpT/Sx/E3pWJB0KalpXOpNTCYF5Wg2kKzhSZvTKsESoRzJoHhjg2Jn4ewRS1vESh JjzCvEcRHvoJ3LvZ++te0WHjMmCcChNI5VrVCpU1l7DIk2SeuJ4Z8eNwPh0lTAi6qceSYC qD/cRFk6xQt1GoMI0iff2Xn14PGUyARtzFZ3ZM/91y9gZnTKxrQ39ejXlUX6Uy3BYW/Myn H4/9XEBgLiE+J1Zigse1/5Vmb5tCwZ/TprADsTeId82iQK0ISBQDSW17hKZH+4RRlLtKPV NwYGQgv4HlmlHzNyeP1ZmbFNvtzZWR4SzNMnO2GOpR48PsUZDu+0CJ0z4YxdNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcmYF3t3qzhqW; Thu, 16 Mar 2023 12:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GCK1Vt081698; Thu, 16 Mar 2023 12:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GCK1cB081696; Thu, 16 Mar 2023 12:20:01 GMT (envelope-from git) Date: Thu, 16 Mar 2023 12:20:01 GMT Message-Id: <202303161220.32GCK1cB081696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: ef184e989b54 - main - tarfs: Fix backtracking during node creation. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef184e989b548da3a0cb703f58db00921ad612c4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ef184e989b548da3a0cb703f58db00921ad612c4 commit ef184e989b548da3a0cb703f58db00921ad612c4 Author: Dag-Erling Smørgrav AuthorDate: 2023-03-16 11:31:14 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-16 11:31:22 +0000 tarfs: Fix backtracking during node creation. Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39082 --- sys/fs/tarfs/tarfs_vfsops.c | 5 +++++ tests/sys/fs/tarfs/mktar.c | 10 +--------- tests/sys/fs/tarfs/tarfs_test.sh | 12 ++++++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index 837fc7644ac1..17d6814ba973 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -347,6 +347,11 @@ tarfs_lookup_path(struct tarfs_mount *tmp, char *name, size_t namelen, } tnp = parent; parent = tnp->parent; + cn.cn_nameptr = tnp->name; + cn.cn_namelen = tnp->namelen; + do_lookup = true; + TARFS_DPF(LOOKUP, "%s: back to %.*s/\n", __func__, + (int)tnp->namelen, tnp->name); name += len; namelen -= len; continue; diff --git a/tests/sys/fs/tarfs/mktar.c b/tests/sys/fs/tarfs/mktar.c index 4e7d1acc1c82..391ac9170171 100644 --- a/tests/sys/fs/tarfs/mktar.c +++ b/tests/sys/fs/tarfs/mktar.c @@ -41,7 +41,6 @@ #define PROGNAME "mktar" #define SUBDIRNAME "directory" -#define EMPTYDIRNAME "empty" #define NORMALFILENAME "file" #define SPARSEFILENAME "sparse_file" #define HARDLINKNAME "hard_link" @@ -128,11 +127,6 @@ mktar(void) if (mkdir(SUBDIRNAME, 0755) != 0) err(1, "%s", SUBDIRNAME); - /* create a second subdirectory which will remain empty */ - verbose("mkdir %s", EMPTYDIRNAME); - if (mkdir(EMPTYDIRNAME, 0755) != 0) - err(1, "%s", EMPTYDIRNAME); - /* create a normal file */ verbose("creating %s", NORMALFILENAME); mknormalfile(NORMALFILENAME, 0644); @@ -233,7 +227,7 @@ main(int argc, char *argv[]) #if 0 "--options", "zstd:frame-per-file", #endif - "./" EMPTYDIRNAME "/../" NORMALFILENAME, + "./" SUBDIRNAME "/../" NORMALFILENAME, "./" SPARSEFILENAME, "./" HARDLINKNAME, "./" SHORTLINKNAME, @@ -262,8 +256,6 @@ main(int argc, char *argv[]) (void)unlink(HARDLINKNAME); verbose("rm %s", SPARSEFILENAME); (void)unlink(SPARSEFILENAME); - verbose("rmdir %s", EMPTYDIRNAME); - (void)rmdir(EMPTYDIRNAME); verbose("rmdir %s", SUBDIRNAME); (void)rmdir(SUBDIRNAME); verbose("cd -"); diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index d0624b79eb2d..15354aac501a 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -58,10 +58,14 @@ tarfs_basic_body() { atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -f%d,%i "${mnt}"/hard_link)" atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/short_link)" atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/long_link)" - atf_check_equal "$(sha256 -q "${mnt}"/sparse_file)" ${sum} - atf_check_equal "$(stat -f%p "${mnt}"/sparse_file)" 100644 - atf_check_equal "$(stat -f%l "${mnt}"/sparse_file)" 2 - atf_check_equal "$(stat -f%l "${mnt}"/hard_link)" 2 + atf_check -o inline:"${sum}\n" sha256 -q "${mnt}"/sparse_file + atf_check -o inline:"2,40755\n" stat -f%l,%p "${mnt}"/directory + atf_check -o inline:"1,100644\n" stat -f%l,%p "${mnt}"/file + atf_check -o inline:"2,100644\n" stat -f%l,%p "${mnt}"/hard_link + atf_check -o inline:"1,120755\n" stat -f%l,%p "${mnt}"/long_link + atf_check -o inline:"1,120755\n" stat -f%l,%p "${mnt}"/short_link + atf_check -o inline:"2,100644\n" stat -f%l,%p "${mnt}"/sparse_file + atf_check -o inline:"3,40755\n" stat -f%l,%p "${mnt}" } tarfs_basic_cleanup() { umount "${mnt}" || true From nobody Thu Mar 16 12:29:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcmmd6pL1z3y3yK; Thu, 16 Mar 2023 12:29:53 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pcmmd1mQFz4MCX; Thu, 16 Mar 2023 12:29:53 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; none Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 0B91C3200948; Thu, 16 Mar 2023 08:29:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 16 Mar 2023 08:29:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1678969790; x=1679056190; bh=KuHyTExokoOGXTGn12L71BjNPtz53tNjgSV X7duKzzY=; b=JeWVtrzPzR5p1uwm/kcGE3PjXJuHMvfHJRTMMD7drgXvCAlIZ+7 69t9B1jsr5bTa1ClsTUAauqB3KZlXQpL+nVzzG5tgTXyS0eSPX7bkQKapMbrGkyx IHx8Rc0kRtXkhtCYd+mFlgykhE/H/5itSrzZ4XyUkogVMbT2r3g+3FNo9g2qu/+j ccPZIGh6QMvyZiqc7PM6od8b27TlaXGlBMGlyCeKKgrSg+vrLTqS3IIzl7BxEXVD 0z8mK5NrTygLf197dDO8oPypmSwqGxQBGxk0URCDSB3CD9ZG30sBO145tKApL6fY jRjnEPEAO/S7VJ18HBXZdJ31nF5vIMIc58Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1678969790; x=1679056190; bh=KuHyTExokoOGXTGn12L71BjNPtz53tNjgSV X7duKzzY=; b=NAVqvB1WQ6e+gmReeUxhcXsFmDNwoiqXaRhOrzA8izsp7xN8YAq WnkVEBnPoxSWP5zaQIgsYkMPvMUPx10qBVhfO661wZdNURpqf6hsNyU6rup/YdBn La5z0EZbQudxW9+7nH347xUYVeKYGuACrRsqPq3zsFntlHqpxDWMR74wNUwies7a PVb1mpALwp1S4ZrKzDmssz/PY4hvhmXvbCMOyg4eLAmddNVr9n4JI1b3DyBblPRP tpf5tM/3fs7U7/AkWIwoMGA9HwsP3107FmFUFOR6xF+ERdwapMKzRSLbfdLsFb+v i/FvAPcT8BqhqYDhYmsAHQ6OR3JrBXlq1jg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeftddggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpegjuhhr ihcuoeihuhhrihesrggvthgvrhhnrdhorhhgqeenucggtffrrghtthgvrhhnpedvkedthf ekueeuveelfedutefhgfekiefgteevudeigefgjeeugeehffejfefghfenucffohhmrghi nhepfhhrvggvsghsugdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpeihuhhrihesrggvthgvrhhnrdhorhhg X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Mar 2023 08:29:49 -0400 (EDT) Message-ID: Date: Thu, 16 Mar 2023 13:29:48 +0100 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: git: 2fee87562948 - main - abstract out the vm detection via smbios.. Content-Language: en-US To: Kyle Evans , John-Mark Gurney Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202303030055.3230tl3S091663@gitrepo.freebsd.org> From: Yuri In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Pcmmd1mQFz4MCX X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Kyle Evans wrote: > On Thu, Mar 2, 2023 at 6:55 PM John-Mark Gurney wrote: >> >> The branch main has been updated by jmg: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=2fee8756294820ff9ec6f8d17324e7d8a0a45040 >> >> commit 2fee8756294820ff9ec6f8d17324e7d8a0a45040 >> Author: John-Mark Gurney >> AuthorDate: 2023-02-23 20:59:50 +0000 >> Commit: John-Mark Gurney >> CommitDate: 2023-03-03 00:54:21 +0000 >> >> abstract out the vm detection via smbios.. >> >> This makes the detection of VMs common between platforms that >> have SMBios. >> >> Reviewed by: imp, kib >> Differential Revision: https://reviews.freebsd.org/D38800 >> --- >> sys/amd64/amd64/machdep.c | 3 ++ >> sys/arm64/arm64/machdep.c | 4 ++ >> sys/conf/files.arm64 | 2 + >> sys/conf/files.x86 | 1 + >> sys/dev/smbios/smbios.h | 4 ++ >> sys/dev/smbios/smbios_subr.c | 104 +++++++++++++++++++++++++++++++++++++++++++ >> sys/i386/i386/machdep.c | 3 ++ >> sys/x86/x86/identcpu.c | 57 ------------------------ >> 8 files changed, 121 insertions(+), 57 deletions(-) >> >> diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c >> index f33f2c6509f0..480db1ed2c31 100644 >> --- a/sys/amd64/amd64/machdep.c >> +++ b/sys/amd64/amd64/machdep.c >> [... snip ...] >> @@ -1315,6 +1317,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) >> >> identify_cpu1(); >> identify_hypervisor(); >> + identify_hypervisor_smbios(); >> identify_cpu_fixup_bsp(); >> identify_cpu2(); >> initializecpucache(); > > This brings in a behavior change that I don't think you intended. > Previously, we wouldn't let smbios clobber a vm_guest detected from > cpuid due to an early return, but nothing is stopping it from > happening now. I think this call should've been protected behind a > `vm_guest == VM_GUEST_NO || vm_guest == VM_GUEST_VM` (the latter being > "CPUID2_HV was set but we couldn't determine anything useful after > that"), perhaps? (sorry, don't have the original message, replying here) This also seem to have broken Hyper-V VM boot: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270239. Gen2 VM boots again with this commit reverted. From nobody Thu Mar 16 12:51:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcnFS5xqjz3y51D for ; Thu, 16 Mar 2023 12:51: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 4PcnFS5WbTz4NBb; Thu, 16 Mar 2023 12:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678971084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6QcWe8s3kb/zJ9Quhgmq5alXh/CF66wjhV8UX2OaODs=; b=V+iokHr7bqrUleoYxIsXL02o0uLYvnICSIaTp8gb1uoYMUu4x3DDFjkaGkxgbHHVDZIwG/ DllHwxi7RnRYeELvpZNRdfee5wj/jhr2U2208NShHa/Q7eLBZ1IgTXoU5eF6LJhXSrtrM1 eAannOnwwPUY+lpiwFq2Vbo4bxrqxERr8Y9XbQuees7mr0F7Yg7zZVE2ZNmIP9szi9HR7X GiVE/DHch7qj/folkXGnb867ZSPhkvSXvbaqb8+himvgh5ZugeXxcBsLgx9muYUbF3fZ0q HXyGZEekrk4fsEPks1Ot0EtwKltQiY6+tM83M525Sc4NvOBLEIWSGi5tbPuuMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678971084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6QcWe8s3kb/zJ9Quhgmq5alXh/CF66wjhV8UX2OaODs=; b=hzTpP8CwMeG2uiArzMASbr8eshe3iWbk6rn9O/7gku6J/rhmtOUSEwLo2HdnPXeVwhENyj 2BPb4kEyxyv/MVFbamL0p1dV3zvY2hLR8gxXpCGTAgvwupaABgP0/v7cRRYaS9P7BHPnju BbYjIiEQnt3tsMhUI8k+Lvi6x8ELCXZKcc35Rdo9RyBj89T6xXiNXr7LzuQQFhbQtqKdlC +ZxBBJFXpgAkoLU7w+4IpIVTeRnV6PKzBkF7HXi1LHov0tqG3zu9/ylL5IDwN6BDalDj5q ZCiUfgMeNK12+AZ910mLus8pxeIDmEG6niJdk3wc2hWBorIfMdeDvLo4kgdUkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678971084; a=rsa-sha256; cv=none; b=SZ6eiEqB826SXblLch7NRM6+gCRqh8wsO4kPX6OYnBTIEU2X++Q8qpVFnGIxZqQEc4ODVU DnXl6LU22qKPhTz/KJ/vc4bTTKmn5VqLLYnubMbp+P06cVbnicFEDbdn3X6vHYW78dTgxm 0++2A77gjfykNwpTIooHpOzARXzzIHquipck5jQrQhIy8v57YlZzA/riNZi32nl1difSkU teUZj0ehp5SG5KzFG7p5YxcR6bV4BFDIpBp+fQUirWsRtjTAPhrJVD4a+88++xIjwyp9Fk pdM1NccwxsmX08H43jespXAsdEd561xMwBMgKZOVDNmGUCViNmzTvRDRB++KEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcnFS4HVczkNX; Thu, 16 Mar 2023 12:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GCpOlI038303; Thu, 16 Mar 2023 12:51:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GCpOqI038302; Thu, 16 Mar 2023 12:51:24 GMT (envelope-from git) Date: Thu, 16 Mar 2023 12:51:24 GMT Message-Id: <202303161251.32GCpOqI038302@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 7ee81174ca89..36b354d74be5 - vendor/openssh - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/vendor/openssh X-Git-Reftype: branch X-Git-Commit: 36b354d74be5adbb73d7dcd2ceb49b5105145d02 X-Git-Oldrev: 7ee81174ca89a92a4c1686170d433dae500ae144 X-Git-Newrev: 36b354d74be5adbb73d7dcd2ceb49b5105145d02 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch vendor/openssh has been updated by emaste: URL: https://cgit.FreeBSD.org/src/log/?id=7ee81174ca89..36b354d74be5 36b354d74be5 Vendor import of OpenSSH 9.3p1 From nobody Thu Mar 16 12:51:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcnFf1JQJz3y573 for ; Thu, 16 Mar 2023 12:51: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 4PcnFf0Ny1z4NpK; Thu, 16 Mar 2023 12:51:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678971094; h=from:from:reply-to:subject:subject: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+o83Yi07RV/PYJvwaS4/yHTAjBCnqU2wydpV6JnjQ8=; b=T86B1UzbSvpIgaLVc8Yb2Oeg8S4iZv835ZDLuF2FDpBJ7HE70DUZJam164kyR2Wgim2FVv ntJNFIdr/7RhCtpUyBH0MUmT0BStq3wX3/ZgeMmXcOVFGuNmLAkkMlDev9CfzlDwWaSI4M +2SAtXVNJOGhOaCiNBJgcXKMQGBHfHrlG5ZduEhi6bMHD/0JpETvJ4v123mJ3cUYpfojDh DC00PnZHpy67DB5ccEJ2E+b0op86ve75OKJOSHbjU4ZfagLtH8vCqTugByQEJuVwNSvw32 hzJZavbvBIlOtFD8oQjMMgdUwvr9gYbECSL0zvjJoNtyXwEweWU4TOt4M+pazQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678971094; h=from:from:reply-to:subject:subject: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+o83Yi07RV/PYJvwaS4/yHTAjBCnqU2wydpV6JnjQ8=; b=FgXY1F7LizTUVWIlq7f4SbgLBwGk5kULRuMbK2gbfaYK4JmERzLe3gVF8GWrasUful3S/M 1y11dC8W5ngvhP51v3xUWEwBYO5ECSViFKWMFL9fMNjayuD++reAKpozvCDRK5hzPOFkxj Ja5l4vICxkRuTdyrZnL88YR14Xc3eFzitA5Mfd+ZxRriUJecJ+V9NRfvTHdA09cG1i4jw6 ZMjGlRuvW7q22dR4B9tuswslqi5c/oZCNq8HvHJdqmoKQWLvyrWVl1LYxHJWWp0Nh7xu5a PIoL9CQviCVRW2VFmiIpq9BNAixtSa0aFM0E51QB1OnPTe39IaE7u3xp1Bbnjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678971094; a=rsa-sha256; cv=none; b=m0cUmMMyim6igiPsTxsc8pVFlXbX5j/lEvjK8yz+7XPl1vjrPU1NvyOBK2lEpid6tgZ/85 OzmKNp4NJZ6mAomNRXxkKBLgRZGDUfK7sCbdrBaUgHcDENmOTt9cENzCXA2rR4TqH9Tn4U 0vAp8cSWgUQIbSpC62kOLWltKMtSAH+kBDU5UL0QhsH5mQRXmxpJmMjGpftSLVglDVygja TiIpsQiNGFf6xH+1jIOR7GBAYTjDTLuDKqjHJaQslP99TQS781/JJbH7RXX3ypQHJsfKWz AukNFAafHmbnJFTxUqsltCpLolvvyCT+J5NSbcwJJHvypwblh1IR3AT7vlUCNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcnFd6WhVzkQp; Thu, 16 Mar 2023 12:51:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GCpXZ4038414; Thu, 16 Mar 2023 12:51:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GCpXfF038413; Thu, 16 Mar 2023 12:51:33 GMT (envelope-from git) Date: Thu, 16 Mar 2023 12:51:33 GMT Message-Id: <202303161251.32GCpXfF038413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 0ab801295204 - Create tag vendor/openssh/9.3p1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/tags/vendor/openssh/9.3p1 X-Git-Reftype: annotated tag X-Git-Commit: 0ab801295204814940a5f63ef42a10e61b35b2f5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The annotated tag vendor/openssh/9.3p1 has been created by emaste: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/openssh/9.3p1 tag vendor/openssh/9.3p1 Tagger: Ed Maste TaggerDate: 2023-03-16 12:44:15 +0000 Tag OpenSSH 9.3p1 commit 36b354d74be5adbb73d7dcd2ceb49b5105145d02 Author: Ed Maste AuthorDate: 2023-03-16 12:41:22 +0000 Commit: Ed Maste CommitDate: 2023-03-16 12:41:22 +0000 Vendor import of OpenSSH 9.3p1 From nobody Thu Mar 16 13:00:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcnRS383Sz3y5Ws; Thu, 16 Mar 2023 13:00: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 4PcnRS2TTdz4NsV; Thu, 16 Mar 2023 13:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678971604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jseqzrz0mHCFPZPTPiOZIaWlgS2TBfC+yJOBTCTo/hE=; b=Idhhuykq84INFK4GUBGnaeDoCOX9ELYM7fJE0TY6C7MlzXZ+i7zACmswHxyMawpvj41I/p DWzXVrJFlXvqmIROqC1Njslig/BM1CCFm+h5DCqSjd4TvYcpmaCiFqaMOQ+Xu6Mx4kihmV 9BFpOz/U85V3U0i89wmdUBBhurqhxK4qnItZHICJ1uJgM9AX2y0dsBEd7tiSw8jZXIq+OG AUaG26IqEkRAKBJt+fuDpT/s3ShvSvga5GcILEBl3xs1m83EJCyZYPJp3vxPCY12YyJT/N w4sMA9urXbwhadlRuSwrASogwkWzC1rD7etV4Mtu4XGbZCqlFYqtS63sna4s5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678971604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jseqzrz0mHCFPZPTPiOZIaWlgS2TBfC+yJOBTCTo/hE=; b=hk3olslMjbv8KT2XC6w3WNKk7zlUkQME7lXR1Cboq066O5ncy8R2qyLgWQQmUtjYUzTrx1 DBS9uBXjP3qp5zOKgvSoOdd7JufPgMELBORdN/9+v4FF+IaIa8m1GZQ6qlqpExR68fnC3j aFYNnGtbdqKpz1CCxlD4kOrb6Rkc25M121MOLoRhxkoLYI2eMRZIOBhW+fY0n6EqOYA2YP NJwT3jcpo7QFZ31xdNF2krDrhSbzHOHMPp2GtEVSSY9FDHPsXoAQdLEzrkJ+C86Fun7AL2 sMH00v7a9RUHsl6ECIJvB9HyMVHiiUryGKN1VdM873iDP3sw8bJ8BOx2X6+k1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678971604; a=rsa-sha256; cv=none; b=uWYdZphhg0Oxvp7NvtX2cLkQqEIjras6aYs6a3rdZxhUtKjGO7Aj112JhGNcHP88Chbo/t 3ugczexED/VR/HZRY2MNfrBaNX5+eYZRk4JvM/oZGJNi1SBnYgHdpFGh3iwkA1P3Dgx9WI hB/+r8Chb2fe3U81/NycDRYlCVCTfdZYn6he7F/AlHlTUUXUgvekOor8evvWTVmMFiR+ct ONSy//2O29a0Kphn5oa2qor9vPouLArmQ6fsF3yowW+gRhhYIRJuNt5bVRxa+ZOSB2ATRr btyL0NKeGnGSOk4N3G9XqrQJwvp8xvK0hBC9DhMYwtU0b7ZXPozcIhGJW4b4Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcnRS1P7MzkRB; Thu, 16 Mar 2023 13:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GD040b048250; Thu, 16 Mar 2023 13:00:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GD04EJ048246; Thu, 16 Mar 2023 13:00:04 GMT (envelope-from git) Date: Thu, 16 Mar 2023 13:00:04 GMT Message-Id: <202303161300.32GD04EJ048246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 79f5d67caa69 - main - stress2: New problem found was added List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79f5d67caa6990a0c0cf1fc7dffe02720ba249fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=79f5d67caa6990a0c0cf1fc7dffe02720ba249fa commit 79f5d67caa6990a0c0cf1fc7dffe02720ba249fa Author: Peter Holm AuthorDate: 2023-03-16 12:59:16 +0000 Commit: Peter Holm CommitDate: 2023-03-16 12:59:16 +0000 stress2: New problem found was added --- tools/test/stress2/misc/suj12.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/test/stress2/misc/suj12.sh b/tools/test/stress2/misc/suj12.sh index d0cbecfb1a37..48b138fbd2d3 100755 --- a/tools/test/stress2/misc/suj12.sh +++ b/tools/test/stress2/misc/suj12.sh @@ -32,6 +32,9 @@ # OOM seen: https://people.freebsd.org/~pho/stress/log/suj12.txt +# watchdogd fired: +# https://people.freebsd.org/~pho/stress/log/log0428.txt + . ../default.cfg gnop load || exit 0 From nobody Thu Mar 16 13:13:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcnl01Lhyz3y6FQ; Thu, 16 Mar 2023 13:13: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 4Pcnl00nkyz4QDZ; Thu, 16 Mar 2023 13:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OOSjko2RltHfWWUVG3lFY9Pe+Pk8LqAIKdqf+itwiLQ=; b=hX17M9mMwIMqvgjHSXis5dGSV7zIjvzXgKbXjj/TnHX4vVlFVJQ3HUdv/S7IrFJCUfiWIN 41WonnBm+0K29RUI0f8i9j1QRuFhkKO41FuEhE/mn839NfUy9yyKJYeiFsr29aiiVWuFEw YB5iLrbnUv0EeMp58IJpXhL4DDg/IvjY525Ma8bfEHbio31j304ydnlCcZyUSbHSmcTW5e DAio5/WjgkcvbiLaiUyWsdPOuwM+gzr+l2AqgqYru8X3VvVTWTtYlOlHF6omYmLS57ZOEQ 6e84bfOR1ZphXm3FKUrnLHLEusA/9y9Y+BD81eInIjRfbuWKhBkviiScOmtJAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OOSjko2RltHfWWUVG3lFY9Pe+Pk8LqAIKdqf+itwiLQ=; b=Rg4eo7WeRag2dGqb+b9eeXKym3O5gkkyGBgemN3NP7IQQOjn5RrpsWF1QsdLLTbZ1dqMSN zEANQOFn0/qPWoUk0fM/tClN9YorgUpNmYHJjjbt+kj2XtpKLQriaQLO7OMHOIiTqZYalD BnHx0yM7SYmIXk4/hUOIIzOVlj9ZdJ84op0NtA1SorI/OyWk/hkTIQYPA6ifmsNS58Fk6/ T20yytqZfTP+rjJG9VS2SGHKQZhQq/HuKGsgEGOXNvOpYwxIOtENUtX0Ci7stRbOATfXkU NpoRyhtK7PkJazG07E3NTICkJc2mE2SRSfaLF4kmQDi3bjvsCwJ0duYB7fY0Ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678972412; a=rsa-sha256; cv=none; b=oh9LxikkrfxNDep+qjfhJMBNhe/zcyMejjriONZhGsp9TgZcEb3KPmGwlWts2PMIfPZdak v9hTkqvBrEdzv8yJ8CkIqsQMfOh+lHNjrlMP0nuUgz7+NAxzmrqKX3Sv+cEwWVWNWHIjkJ 9tgYsCw+vak6ZMQcfW7vqNcrX8LZInv/zt1m64wPNQ5lXgtRFtKBXMe2KBexnBWD9Llxc/ 1CI2GrJtq6F1sGNq/QqzLeIXJOmHL05CgF+D41LA+PHoFQu/t+ByReyzVfN/ytdUiD4FUt fz1iZ8MBcN3UZW4sKwDJ+UpyjsXz3NdBT4syuayPAkQEp300BaPXh4NLLISAnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcnkz6wtfzkt7; Thu, 16 Mar 2023 13:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GDDV19077714; Thu, 16 Mar 2023 13:13:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GDDVDi077713; Thu, 16 Mar 2023 13:13:31 GMT (envelope-from git) Date: Thu, 16 Mar 2023 13:13:31 GMT Message-Id: <202303161313.32GDDVDi077713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 61dad7633cd3 - releng/13.2 - route.8: Don't reference an external command in EXAMPLES List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 61dad7633cd3eeacd734cdb0338331b751bd6ab0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=61dad7633cd3eeacd734cdb0338331b751bd6ab0 commit 61dad7633cd3eeacd734cdb0338331b751bd6ab0 Author: Gordon Bergling AuthorDate: 2023-03-14 13:55:28 +0000 Commit: Gordon Bergling CommitDate: 2023-03-16 13:13:03 +0000 route.8: Don't reference an external command in EXAMPLES It is better to mention the externel command for showing the routing table as using an explicit command. PR: 231579 Suggested by: karels Reviewed by: karles, gbe Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D39075 (cherry picked from commit 21f268182838f072f96234c727778d5603a580e3) --- sbin/route/route.8 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index 5b6e13281447..afcf55ab44c7 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd February 26, 2023 +.Dd March 14, 2023 .Dt ROUTE 8 .Os .Sh NAME @@ -488,9 +488,8 @@ Remove all routes from the routing table: .Pp .Dl route flush .Pp -List all routing tables: -.Pp -.Dl netstat -r +The routing table can be listed with +.Xr netstat 1 . .Sh DIAGNOSTICS .Bl -diag .It "add [host \&| network ] %s: gateway %s flags %x" From nobody Thu Mar 16 13:17:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcnqC2720z3y6Fy; Thu, 16 Mar 2023 13:17: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 4PcnqC1GRwz3Bss; Thu, 16 Mar 2023 13:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMH7H5S63DdS19UQKqaTrHuqGPUEr/FZmB5VILcnQk8=; b=NsfEzofXJBMgBrnOf/S3X0kEH64eCMOMR3gBsXbEO7xjRNE0FfEXWvOzqpWNT1Rg3gL0MW K8dhmXCDHmvjOiD5gbqf2lNxbLHq/j4brwZRISwJoFY310ru1lKWi8TY1WtVaP5B1iPgNX j7X/EQ3YeBCECp2sizNz6DJZco/SY+14b8lzCD9mpg3w1iP5BPuUg8VdltSMCzYJFynkyJ AIeKUNTUvseBKpWQE4+8ZgMsdYaKIOaSIJSWSCbK74GbE1nOd7UVQau3T9uSPkSCQ56J8i TRVB3YIgCVrMi18Z4hE7woJ7C1IS6f+I4zsTcN5e3yhNiNGMoglX5DM6TtvAbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMH7H5S63DdS19UQKqaTrHuqGPUEr/FZmB5VILcnQk8=; b=UdRNc2/3dWdP/3SF8ZB5aEBcDb5DtblYOdOr3I18rAFgbNqN5eFNjfagqrfyLrywXrlIe5 h5yzpkJmiWkiX6r/j5AuaOzSCixfMcWYZu57sQw20BathgGW9FspukP4qAiXEaZWwiaCAP Dj/CzdFoKbGeXC6e1EFayk6qEMfFjSH5NsL2aoqUY2n0YVGzAVtAJELTqFQXB5+DTmENWe MoReH1yg/7JU1y736P0BFbzIJM6aVbBChrLyhGSh9k3Bwb5kwFHilIMFXWmZVVyHbfFy6n /uLtFYVFZucibNvq9asKewae5/ZEwVsKdGk1oq9xKEAfkEyqS96YofXHhnA3pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678972631; a=rsa-sha256; cv=none; b=fE9AdvLrc7Ak242ucfLvI5MdxzFFFa7+7GpQV/dzA8/HOeOm3IqKt0HdboARPagGBthlx/ Df7HM2McJpVhBEm9kFsRl9Jcd7d8YISs/38RiynE7leQEoT+6YFpH+5zzj5nq1iAUpJg9j IZUo1PZvPcIV9U2XDNpJSANJT+QoChbCFzK6RHP4qhi1HK7NYR6HWfGVvjodOVvAy3D4l1 d7M4S8ktee64cc9MfGDcXbOd5f1WwNoWe6pqZLkmpB75RhBxB1WrnHomRxd6T4ljIWeaMX jwrq8ccKzLc/56lqbIECHv4O41C5dNrx0XOEJgk/T31dZyD86N8WdtoO49g76A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcnqC0KmZzlG5; Thu, 16 Mar 2023 13:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GDHAh9078258; Thu, 16 Mar 2023 13:17:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GDHAQt078257; Thu, 16 Mar 2023 13:17:10 GMT (envelope-from git) Date: Thu, 16 Mar 2023 13:17:10 GMT Message-Id: <202303161317.32GDHAQt078257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 473ab212dc1f - main - Allow psci.h to be used by userspace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 473ab212dc1f72c1765f112568237d229d4e0441 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=473ab212dc1f72c1765f112568237d229d4e0441 commit 473ab212dc1f72c1765f112568237d229d4e0441 Author: Andrew Turner AuthorDate: 2023-03-16 12:08:32 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 13:08:00 +0000 Allow psci.h to be used by userspace Wrap parts of psci.h that aren't usable by userspace in _KERNEL checks. This allows it to be used to implement PSCI and SMCCC by bhyve in userspace. Sponsored by: Arm Ltd Sponsored by: Innovate UK Sponsored by: The FreeBSD Foundation --- sys/dev/psci/psci.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/psci/psci.h b/sys/dev/psci/psci.h index 8004498426c5..be5f55f49115 100644 --- a/sys/dev/psci/psci.h +++ b/sys/dev/psci/psci.h @@ -32,6 +32,7 @@ #include #include +#ifdef _KERNEL typedef int (*psci_initfn_t)(device_t dev, int default_version); typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t, register_t, register_t, register_t, register_t, @@ -52,6 +53,7 @@ psci_call(register_t a, register_t b, register_t c, register_t d) return (psci_callfn(a, b, c, d, 0, 0, 0, 0, NULL)); } +#endif /* * PSCI return codes. @@ -102,6 +104,7 @@ psci_call(register_t a, register_t b, register_t c, register_t d) #define PSCI_VER_MAJOR(v) (((v) >> 16) & 0xFF) #define PSCI_VER_MINOR(v) ((v) & 0xFF) +#ifdef _KERNEL enum psci_fn { PSCI_FN_VERSION, PSCI_FN_CPU_SUSPEND, @@ -115,5 +118,6 @@ enum psci_fn { PSCI_FN_SYSTEM_RESET, PSCI_FN_MAX }; +#endif #endif /* _MACHINE_PSCI_H_ */ From nobody Thu Mar 16 13:17:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcnqD2f5Tz3y6Tl; Thu, 16 Mar 2023 13:17: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 4PcnqD28WPz4QkZ; Thu, 16 Mar 2023 13:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o1fRjm31u4xngXQX3/q2YLbQBCfV4mIfVOkT31PyxoA=; b=fjftXTQz84SgQdPKso3mjUS1zEMOjEkXDRJP18A3rNGENsMtN+PdSCpZSbq5oJPVUO8uFA N4r0jIltRULsYI+faF1FumLv3AEt8H3m06Qo5LF0OK9KhN6YQ4dzxRQASphVh+QbxQ899e ERfiOBTYJo3oMggeH+hRd8IGcO8WtpN7s4j+sMLnmYaxrFHSi3Ke+VKRjV72eZFBVKXC3z o81bCy/hf64f+8Ws2MWiTCGLKS8HuN0VHLXSgWrI+N5v9D+LXzW4xNLwv41tVf+HIvwk3P I/4Fpo1sr+3c6GRK22aWjvk/s7FyzOJ2xDX3OwpjkhptNuvoJllGCVXvGeNduQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o1fRjm31u4xngXQX3/q2YLbQBCfV4mIfVOkT31PyxoA=; b=R5fABqs9MaB11fGcPFGuyvzl8qR3gXVLJYILR9NHNLsIqFnBOOcGVHDNRX0wZOpvBj8s1G okNi45bVwcgVGr7c5J2f1aSL7r4vCJxqWJp2LlIYjx4hK8TiTC2h2J+6nREB60lm6TPlrO GVOJ7/mclmpU0wRZVOZtJwl0Uei32UBMSi0qVN4/vt72SW16QNXxEBFaVuWr0ArK1VanIs bOhvj9+ncpqh7DgzSaiuorpAEp6ajDWLMUG02q0PM1b+ZlMnG1wAzdibwTarSqso41TZMP DtdDJi4GhiBZIrftd651wX5RhEjevNPRQuxUc9hUj3NeHFDWvVUxTiT3wjzHNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678972632; a=rsa-sha256; cv=none; b=QIyd2nK1sq2+YVos7sPpP9GiuvXeQDWc8IxuEu8/xfEqk4Pw43G44nPBR3rkRzLpaZU4o8 W3W9FDgFpFSAN4QshzQDC1sRcov3clKtf4Jfd17yoZTNqJWGshEPm+uIKc8cQRu3ZWF6He VEI++dyFA954YWQoyLbhCOza+tnBVef2WXIPNCV5SwjwWZ6ySVy5htFxNBaC5KXgBcjMdM klwx5LDenMqVo+/IANP4i7jpivV6wy+qRF5HolELG8dKdIzAbi4hwYwDqMM9hUHBO65KJj XyMR+tZTHFovq2tzwruYJwq6cNvgPnOgixULxrzOTfdXSgRiqBRWqw+hYLfeEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcnqD1FJSzl17; Thu, 16 Mar 2023 13:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GDHC0W078277; Thu, 16 Mar 2023 13:17:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GDHCc5078276; Thu, 16 Mar 2023 13:17:12 GMT (envelope-from git) Date: Thu, 16 Mar 2023 13:17:12 GMT Message-Id: <202303161317.32GDHCc5078276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e89be21854b3 - main - Add a psci macro to build a version value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e89be21854b3aa33efd2e06529a181343281659d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e89be21854b3aa33efd2e06529a181343281659d commit e89be21854b3aa33efd2e06529a181343281659d Author: Andrew Turner AuthorDate: 2023-03-16 12:14:01 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 13:08:00 +0000 Add a psci macro to build a version value Add PSCI_VER that takes a major and minor version and builds the value returned by the firmware. This will be used by bhyve. Sponsored by: Arm Ltd --- sys/dev/psci/psci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/psci/psci.h b/sys/dev/psci/psci.h index be5f55f49115..671f082bb119 100644 --- a/sys/dev/psci/psci.h +++ b/sys/dev/psci/psci.h @@ -103,6 +103,7 @@ psci_call(register_t a, register_t b, register_t c, register_t d) #define PSCI_VER_MAJOR(v) (((v) >> 16) & 0xFF) #define PSCI_VER_MINOR(v) ((v) & 0xFF) +#define PSCI_VER(maj, min) (((maj) << 16) | (min)) #ifdef _KERNEL enum psci_fn { From nobody Thu Mar 16 13:17:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcnqF3swXz3y6XQ; Thu, 16 Mar 2023 13:17: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 4PcnqF37r2z3C3v; Thu, 16 Mar 2023 13:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRsKdtK5+C/jKGtbcf/fsfadeSlO1IpyEnZcgLR6t2s=; b=WUG2gxkh+tNtbM0V1MkIP4q4T1jEImFxGeVc2oWmOjY1XEpmB64XBjX9EZJ8ao7jE1aizp JVebN1qwbNPvPCHSUiV5AIyaPzw4lGbydSPYqUHcXlL99xZfwChAb8OBlwmAkuekvzcSP4 8XVykHXWJfQe1F5lIktXE3tMpUtFF8fsEW9S+nbKMMapXfd5Poq0UDdWM9lE/5NAOUZxIT wEwQA2LdmZH1kx1Niusiypvo0DBXyXqy4CakVndS8Qzk+TLY0d/LARCRdrgWRAolgg0wMw k6hqyonfhPxnswmL00Rg9TZRdF8VL48clVSYyIaD/co4xELL3EfMEhFYxw671w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRsKdtK5+C/jKGtbcf/fsfadeSlO1IpyEnZcgLR6t2s=; b=P0YZlrn56PnkIZVJE9PtYzOoR/2ZRwLjMXu73we9jqUUEjASfYCqW0Ghamo2mpngh1x+Vf p5B4Iu1TNLeTQNMw+oMZ9yWrB5YGGziARkPoI46LWbhvfrwOEUG5tkmzOxdckkZEW/g95e BXwZuFIhX9afswm8FaGvbMCNWbKRHwzZm+wC5N+rvuzxqUtknBOw8o7ZjdXweVagw9NBAt KJbTGc1aFtkOryDsIAycM5Uu6Yy60R28ozxe9XTDJvldkD61iYj0Scs9iAvgvMA8/QSXPF jv+QsnUGT0lDqBsqfwcsPIUDGhiNszXQlHW4vKWBDowZP9ud/7bfOCNGToNlHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678972633; a=rsa-sha256; cv=none; b=csEwIJQJ1SVNeae0ZaH7lx87HvXwZ4V+wZgfuU/8sRryQVP0KKpUO9VnZWY25a/g5/ROTS iOk6q9g+1HwqxQZqKh9Y3Crk87yf5vq8V29Q7lD7gTTSmYRMvO8RYYrW3QFJ6d0p0wfd6n lUFKWg3ryOtTBtZ2NC8os7X8/2ITsH2c1wYngMgeC1CPyp7Vwice5skU42soSoaMtMv4+l 07xt6AqENtWjTvzdKzHk5N6jDXVSXN0R1IissYWN972h/+MrMoW3AiShcTgd4DHZo7NPfS k4mkSvq74hgov7sS6fIsFC4kBXU7a0XRYekjkl7BcCv1Qqt/HajP/fGGHqRatw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcnqF2B4Kzkdh; Thu, 16 Mar 2023 13:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GDHDBK078296; Thu, 16 Mar 2023 13:17:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GDHDNi078295; Thu, 16 Mar 2023 13:17:13 GMT (envelope-from git) Date: Thu, 16 Mar 2023 13:17:13 GMT Message-Id: <202303161317.32GDHDNi078295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7d0b91591966 - main - Add PSCI affinity info return values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d0b915919665cb43107b36ad103791515eade5b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7d0b915919665cb43107b36ad103791515eade5b commit 7d0b915919665cb43107b36ad103791515eade5b Author: Andrew Turner AuthorDate: 2023-03-16 12:16:59 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 13:08:00 +0000 Add PSCI affinity info return values These can be returned from the PSCI AFFINITY_INFO call. This is not marked as optional so bhyve will need to implement it & can use these macros. Sponsored by: Arm Ltd --- sys/dev/psci/psci.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/psci/psci.h b/sys/dev/psci/psci.h index 671f082bb119..207158b417ab 100644 --- a/sys/dev/psci/psci.h +++ b/sys/dev/psci/psci.h @@ -105,6 +105,10 @@ psci_call(register_t a, register_t b, register_t c, register_t d) #define PSCI_VER_MINOR(v) ((v) & 0xFF) #define PSCI_VER(maj, min) (((maj) << 16) | (min)) +#define PSCI_AFFINITY_INFO_ON 0 +#define PSCI_AFFINITY_INFO_OFF 1 +#define PSCI_AFFINITY_INFO_ON_PENDING 2 + #ifdef _KERNEL enum psci_fn { PSCI_FN_VERSION, From nobody Thu Mar 16 14:25:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcqLK66Bxz3yB65; Thu, 16 Mar 2023 14:25: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 4PcqLK5ZHJz3K5F; Thu, 16 Mar 2023 14:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678976745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZWC5W7Oal08srsssRxoI6UpFc05lz+nzwW9bSbMD9ME=; b=wA2XwojhEL96KVhFvhEOp+nXlxtPwSEH3aayNFfyQu3UZfj75+bSNB8zlahuKinIhHk8HG VTc9bYYjWMBXxC0u6rBuxLiO3H7TV+nYt6MRwQLjIdjbdAN1F2jjHYMF+WvYrBz/fVBgQo 6SeE4PT3/ZNiFNaz+GWKHpWqPAWryEK11YPUDCuenyTSWb5nLt0Q1YEtfbd7RC0PoEFnnc h91ev1CPSalKQttJCAqkhyhGFJP51vduDCqVvm7ruDKYYBKw9M18bLgl4jz/RGDmpL1Qaq Uzny0AB5isbK6LTr8hx9xhKxilO5XT2SQTh9wlRhxQS4WxrM7tIXmTyyT+o0zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678976745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZWC5W7Oal08srsssRxoI6UpFc05lz+nzwW9bSbMD9ME=; b=ocjdZxdhb5R/zc625fCQXN4ea1qHqYzRMN28uTRSCEVJefM9zPRqmZZdbKaPf4Az7GwxG/ YIsjMdd7tUSpV8AM1jMggO0RBAxVnvGHvoem6wKg5pdd17LrWhe1d5woCYSpXdyqhaoeQw lO1/3AyK5uqJJqIE/yi4sk07AhEU42bzPYdaGyUgA+paTggzq7gPITtLOqg2JXL01yCcgq NFi7fqdQotM0wtqN1qkJyi3v5hadN7eRMN3LvByrm4q6rsSwOZ0N9NdVRRAd4VeAqJE+yi lCjSyRZEirfveAy6GvLiJy7A72V9oYaB8XJEQVQuZ52V/FPbLHIQAtp4MJbAEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678976745; a=rsa-sha256; cv=none; b=Blz6T91yNDsgC1IYDgUkZWgZ6MKeLiDQRONbqzXgIGTmRmQDYcXsW3SPxHtqVYSozB0YIC siU+CUQ7VHP8OKwa0PECmClun217ePecNglNY8FP/Ah5slSIzM4NDRdvBB3h/my4daM4dI q6RbwtagPHc/EFujZ54nTpGwV2dVbIE306Q4o4s3Ghoi8i7rJfiZHwApBeRY2kMwJhtOiE gtAAs56jmno0BPqNeR8qwdJAN/t41wrFeekvB6HcTED/RWsN6gTZ7WOBHJPuPU0jwfwWXR RXOlUgI+OQe5BmT38f2UosysD/gu1q4h07Ctzn4Chjwbo2T3MeLCjTuq122rNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcqLK4cBKzmrq; Thu, 16 Mar 2023 14:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GEPjiY092323; Thu, 16 Mar 2023 14:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GEPjLs092322; Thu, 16 Mar 2023 14:25:45 GMT (envelope-from git) Date: Thu, 16 Mar 2023 14:25:45 GMT Message-Id: <202303161425.32GEPjLs092322@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: 565e917b4432 - stable/13 - netmap: Remove obsolete compatibility defines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 565e917b4432ac64ddf52353cbf1a35a5aafa302 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=565e917b4432ac64ddf52353cbf1a35a5aafa302 commit 565e917b4432ac64ddf52353cbf1a35a5aafa302 Author: Mark Johnston AuthorDate: 2023-03-09 23:16:53 +0000 Commit: Mark Johnston CommitDate: 2023-03-16 14:25:33 +0000 netmap: Remove obsolete compatibility defines No functional change intended. Reviewed by: vmaffione MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39001 (cherry picked from commit 626d1e4a82e25d274cdadfebfd81a28e968efb5b) --- sys/dev/netmap/netmap_freebsd.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c index 2bfb80476528..b9055d589df1 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -1024,11 +1024,6 @@ netmap_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, * Replace the passed in reqpage page with our own fake page and * free up the all of the original pages. */ -#ifndef VM_OBJECT_WUNLOCK /* FreeBSD < 10.x */ -#define VM_OBJECT_WUNLOCK VM_OBJECT_UNLOCK -#define VM_OBJECT_WLOCK VM_OBJECT_LOCK -#endif /* VM_OBJECT_WUNLOCK */ - VM_OBJECT_WUNLOCK(object); page = vm_page_getfake(paddr, memattr); VM_OBJECT_WLOCK(object); From nobody Thu Mar 16 14:31:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcqTb4ShFz3yBFL; Thu, 16 Mar 2023 14:32:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcqTb3zH2z3KlG; Thu, 16 Mar 2023 14:32:03 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678977123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wIT7gO7hHooGqxS6kz6DvVXsZ/o0ZB7etKLRSZojvbc=; b=CEF5ua1PCbbk8Vc4aZzyA7N1yGUX0H+zSu215dpa9lokH5l0tn09yIZRbR5p6mA/LTMeQp RsoDl1i1DTDG8gvCmH/TriGgA0qhmxTj3EHVDAzy25GF0w41w/igKjoSIwHqqIoYMES7qF KdcXDTTA7M+N59OZi1+i5gR4l/v6GpXGO+/dhCZ1d9z3y48X1OlggPl9AClvu2u1EDeO5T laD+IR0Mc93CXDZtWRE7caff59AWOYhJaNwmsewHjvPkEpXLE+4JSjRIAi9T8HOK52yyDZ NiTmMU80OoDW+6jngk73C8C1VdNA3LDLBVJ6b9liF2A3YqL6rzJkpPJEFe6SJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678977123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wIT7gO7hHooGqxS6kz6DvVXsZ/o0ZB7etKLRSZojvbc=; b=sftrlHSEeDTKK0+yHBa+Ri+/INHFRvcp2ZaYAiFpa27paN7Q4J/QEyq/mrPmEaBg0FIF7w y65VnZijYQ9YkzQtd28smIJSqU5NU88vtgE8joy78dKhBJaTte9MliFOd4lnDVYpUDFZwR W+IwvNBejythBtCBIDU4J7eL8wwoY8v+dn7j/vAlhqQHD6XE6o5Kx2oGTT71KQ7zcNobW/ dEJU1nM3IRxll5doNuEibOq9T9aSTRRIBuEvzUhtoliSudCRw3cCVuweL3Eza7J561kBHY 3DJY7rBwVbZgM2yphUbugavvUUTvm5D0es9dULikLWGE/oY4fhhQdHoRs3O7NA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678977123; a=rsa-sha256; cv=none; b=fXraO1Ll1I3d54NbTOeeGhtJ7ah37ztAv3qv/CD/mygdtp5AlJqWKSgIH7yh0k2uFDcpf7 aBd2FuJA6+hUG33RHIuKeZkSJ5K96Wc2j8bIR3OEnwKkCG1G5e/g5+X16+JTCpkB21Dtxa jlq51EQrXVgR79S63MRqNMBqCdIwOnCIh0a8aKlv8k2d2v4CHRQoUF21L6pqQOqnhiqtwx 1It+B7iey+W9qbWmUF4yXv+mzpW26nutAT+om4oaoVm/BDadolDb1h1PMtQYWQNTfFqi1T l+ZoGiHXQpEQ8zNlns2rTnYv5ZA4GShg7Ydxf+fx6lguBL031x9DtSI8gatlBg== Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PcqTb31f5zYfZ; Thu, 16 Mar 2023 14:32:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f48.google.com with SMTP id f1so1310053qvx.13; Thu, 16 Mar 2023 07:32:03 -0700 (PDT) X-Gm-Message-State: AO0yUKXRfv0YxFLWW3RACSZccRYAbhxrqwPoJIDKNfWGATTA9jcHd/H8 eXIUqNNFYeNC8SHHHnSoNw2rDwXVl3p7LT5DCak= X-Google-Smtp-Source: AK7set+5yIFIKYUvTjv3OxKFp9yN26l74e1e69cIdBUo2z+YDPcjH4MGIAt6qFTdfId+5yAL9SWMyVNziH4ZPmwlX5s= X-Received: by 2002:ad4:59c7:0:b0:56f:fe44:f257 with SMTP id el7-20020ad459c7000000b0056ffe44f257mr4737752qvb.1.1678977122739; Thu, 16 Mar 2023 07:32:02 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303030055.3230tl3S091663@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Thu, 16 Mar 2023 09:31:51 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 2fee87562948 - main - abstract out the vm detection via smbios.. To: Yuri Cc: Kyle Evans , John-Mark Gurney , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On Thu, Mar 16, 2023 at 7:29=E2=80=AFAM Yuri wrote: > > Kyle Evans wrote: > > On Thu, Mar 2, 2023 at 6:55=E2=80=AFPM John-Mark Gurney wrote: > >> > >> The branch main has been updated by jmg: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D2fee8756294820ff9ec6f8d= 17324e7d8a0a45040 > >> > >> commit 2fee8756294820ff9ec6f8d17324e7d8a0a45040 > >> Author: John-Mark Gurney > >> AuthorDate: 2023-02-23 20:59:50 +0000 > >> Commit: John-Mark Gurney > >> CommitDate: 2023-03-03 00:54:21 +0000 > >> > >> abstract out the vm detection via smbios.. > >> > >> This makes the detection of VMs common between platforms that > >> have SMBios. > >> > >> Reviewed by: imp, kib > >> Differential Revision: https://reviews.freebsd.org/D38800 > >> --- > >> sys/amd64/amd64/machdep.c | 3 ++ > >> sys/arm64/arm64/machdep.c | 4 ++ > >> sys/conf/files.arm64 | 2 + > >> sys/conf/files.x86 | 1 + > >> sys/dev/smbios/smbios.h | 4 ++ > >> sys/dev/smbios/smbios_subr.c | 104 ++++++++++++++++++++++++++++++++++= +++++++++ > >> sys/i386/i386/machdep.c | 3 ++ > >> sys/x86/x86/identcpu.c | 57 ------------------------ > >> 8 files changed, 121 insertions(+), 57 deletions(-) > >> > >> diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c > >> index f33f2c6509f0..480db1ed2c31 100644 > >> --- a/sys/amd64/amd64/machdep.c > >> +++ b/sys/amd64/amd64/machdep.c > >> [... snip ...] > >> @@ -1315,6 +1317,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfre= e) > >> > >> identify_cpu1(); > >> identify_hypervisor(); > >> + identify_hypervisor_smbios(); > >> identify_cpu_fixup_bsp(); > >> identify_cpu2(); > >> initializecpucache(); > > > > This brings in a behavior change that I don't think you intended. > > Previously, we wouldn't let smbios clobber a vm_guest detected from > > cpuid due to an early return, but nothing is stopping it from > > happening now. I think this call should've been protected behind a > > `vm_guest =3D=3D VM_GUEST_NO || vm_guest =3D=3D VM_GUEST_VM` (the latte= r being > > "CPUID2_HV was set but we couldn't determine anything useful after > > that"), perhaps? > > (sorry, don't have the original message, replying here) > > This also seem to have broken Hyper-V VM boot: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270239. > > Gen2 VM boots again with this commit reverted. Sorry, I should have led with this. A private report had indicated to me as such and that they had bisected it down to this commit. They've since confirmed that on HyperV: smbios.system.product=3D"Virtual Machine" and that avoiding the smbios detection if vm_guest has a specific vendor already set does indeed fix it. Thanks, Kyle Evans From nobody Thu Mar 16 14:32:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcqVb6cx5z3yBWC; Thu, 16 Mar 2023 14:32: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 4PcqVb64vJz3L8q; Thu, 16 Mar 2023 14:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678977175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v7gV+WncDqr/AUtx00sQ6x+Zk8oBFYsZWtJPWVyL8Nc=; b=OG6jVGnf5gjTDCxW81yKfn8WkfjHTi3mip61XdIy+M7a/xnNBZHMMHxPHynACXZMc275nQ x5ojVImqX/p2MPZJN52gMXA546me0y6Kop5SLZwHIx/GNMrxVM1gwCvk+5corH24VqDwRI 4Mm1ITBHL1QfVZGq1QOpZAKHmX7ogcHgZn0JTa7McNhgaIf+kSU4FWvL2ZeTuzmMLtZdc2 jZTcPC3K+dEnvYNCppn9Nr9krfFZPSPAMXhcitdkbCCEMcL+MToBNc4myKbQYOMwphJY3c uLwqSKZpiIAIOMM8G5WSdWtQyDBgT63UijC8g25FeHB0ACuoOy5FQvgv8Q5+bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678977175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v7gV+WncDqr/AUtx00sQ6x+Zk8oBFYsZWtJPWVyL8Nc=; b=HtP2gZaggyxOUtrJBo5DHPiRENvCM86WU2ias1y+/ACrWya8yzEcEbDuNimufpuiooreiV LEChipHZtTe+JZDPY0SKbaIlpvWrXcCPY1SMfOyyN/HNeMhLfZ/NH5uVWo0/L9Ar5i6ywl 6Owh8uT7yk1Y9+5TEvBTsRlpGkLGw06yA848Z3eI+EnhP9uaLY+ORZpsRt0fBdnnsia/zL wAeBwJrkfbsPcOtFxfk/4z3BPFpmY1RB8UACxV5OdDKeUgxZ5adb+SSx+qeydDs5mJmSEe 1bHEqMvdWJdruALJchowgERyiwUvcMdth7IV84iAJ7qlbobA8pCuU8Oilko1Aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678977175; a=rsa-sha256; cv=none; b=pi+ldLyHG1fG9RSD0GAHXOR24FwZHKdxlcE8cV2SRx81qXpd4/v6MgFYOTZZIIEN30qGqP vcxmxnW9ehh70GeIZC9G6DBjfjNM67QjZ2aIf1FibtPEgkZo8PIKVJ++qyZt0H6n0VA1fa lkXssUv6GQd5niQTIiFD3EuUYqYDBeudsH1H1glN0YolBBAOWuA3Hw+oqFmt8QoRMJsN3i NPtW1+TDWbuhVfGV9YAhSojdGn+2UEObX2KxN+XTV1ng5qaL47YXRxxgNcLjW3GUzH73ye jUWTfused5+0Vzef5Uc9KKAcsgJxldEIrCX4D2HMQy4wwuwEwPCKMXucCZX7jA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcqVb57Stzn0B; Thu, 16 Mar 2023 14:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GEWt3q008530; Thu, 16 Mar 2023 14:32:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GEWtDn008529; Thu, 16 Mar 2023 14:32:55 GMT (envelope-from git) Date: Thu, 16 Mar 2023 14:32:55 GMT Message-Id: <202303161432.32GEWtDn008529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 4d3fc8b0570b - main - ssh: Update to OpenSSH 9.3p1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d3fc8b0570b29fb0d6ee9525f104d52176ff0d4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4d3fc8b0570b29fb0d6ee9525f104d52176ff0d4 commit 4d3fc8b0570b29fb0d6ee9525f104d52176ff0d4 Merge: 7d0b91591966 36b354d74be5 Author: Ed Maste AuthorDate: 2023-03-16 14:29:55 +0000 Commit: Ed Maste CommitDate: 2023-03-16 14:29:55 +0000 ssh: Update to OpenSSH 9.3p1 This release fixes a number of security bugs and has minor new features and bug fixes. Security fixes, from the release notes (https://www.openssh.com/txt/release-9.3): This release contains fixes for a security problem and a memory safety problem. The memory safety problem is not believed to be exploitable, but we report most network-reachable memory faults as security bugs. * ssh-add(1): when adding smartcard keys to ssh-agent(1) with the per-hop destination constraints (ssh-add -h ...) added in OpenSSH 8.9, a logic error prevented the constraints from being communicated to the agent. This resulted in the keys being added without constraints. The common cases of non-smartcard keys and keys without destination constraints are unaffected. This problem was reported by Luci Stanescu. * ssh(1): Portable OpenSSH provides an implementation of the getrrsetbyname(3) function if the standard library does not provide it, for use by the VerifyHostKeyDNS feature. A specifically crafted DNS response could cause this function to perform an out-of-bounds read of adjacent stack data, but this condition does not appear to be exploitable beyond denial-of- service to the ssh(1) client. The getrrsetbyname(3) replacement is only included if the system's standard library lacks this function and portable OpenSSH was not compiled with the ldns library (--with-ldns). getrrsetbyname(3) is only invoked if using VerifyHostKeyDNS to fetch SSHFP records. This problem was found by the Coverity static analyzer. Sponsored by: The FreeBSD Foundation crypto/openssh/.depend | 51 +- crypto/openssh/.github/ci-status.md | 7 +- crypto/openssh/.github/configs | 2 +- crypto/openssh/.github/run_test.sh | 2 +- crypto/openssh/.github/setup_ci.sh | 6 +- crypto/openssh/.github/workflows/c-cpp.yml | 1 + crypto/openssh/.github/workflows/selfhosted.yml | 3 + crypto/openssh/.github/workflows/upstream.yml | 1 + crypto/openssh/ChangeLog | 15098 ++++++++++--------- crypto/openssh/Makefile.in | 5 + crypto/openssh/README | 3 +- crypto/openssh/README.md | 1 + crypto/openssh/auth-pam.c | 15 +- crypto/openssh/auth-shadow.c | 14 +- crypto/openssh/auth.c | 3 +- crypto/openssh/auth2-hostbased.c | 9 +- crypto/openssh/auth2-none.c | 3 +- crypto/openssh/auth2-pubkey.c | 8 +- crypto/openssh/auth2-pubkeyfile.c | 3 +- crypto/openssh/auth2.c | 5 +- crypto/openssh/authfd.c | 9 +- crypto/openssh/authfile.c | 4 +- crypto/openssh/canohost.c | 5 +- crypto/openssh/channels.c | 42 +- crypto/openssh/channels.h | 4 +- crypto/openssh/clientloop.c | 14 +- crypto/openssh/compat.c | 53 +- crypto/openssh/compat.h | 14 +- crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/dispatch.c | 3 +- crypto/openssh/dns.c | 8 +- crypto/openssh/dns.h | 4 +- crypto/openssh/hostfile.c | 15 +- crypto/openssh/kex.c | 72 +- crypto/openssh/kex.h | 5 +- crypto/openssh/kexgexs.c | 3 +- crypto/openssh/krl.c | 3 +- crypto/openssh/misc.c | 5 +- crypto/openssh/misc.h | 5 +- crypto/openssh/moduli.c | 13 +- crypto/openssh/monitor.c | 11 +- crypto/openssh/mux.c | 4 +- crypto/openssh/openbsd-compat/bsd-getentropy.c | 2 +- crypto/openssh/openbsd-compat/bsd-snprintf.c | 90 +- crypto/openssh/openbsd-compat/getopt.h | 3 + crypto/openssh/openbsd-compat/getopt_long.c | 14 + crypto/openssh/openbsd-compat/getrrsetbyname.c | 47 +- .../openssh/openbsd-compat/libressl-api-compat.c | 14 +- crypto/openssh/openbsd-compat/mktemp.c | 23 + crypto/openssh/openbsd-compat/openbsd-compat.h | 3 + crypto/openssh/packet.c | 4 +- crypto/openssh/progressmeter.c | 95 +- crypto/openssh/readconf.c | 11 +- crypto/openssh/regress/Makefile | 6 +- crypto/openssh/regress/agent-getpeereid.sh | 3 +- crypto/openssh/regress/agent-restrict.sh | 6 +- crypto/openssh/regress/agent.sh | 4 +- crypto/openssh/regress/dhgex.sh | 6 +- crypto/openssh/regress/integrity.sh | 4 +- crypto/openssh/regress/keygen-sshfp.sh | 22 +- crypto/openssh/regress/knownhosts.sh | 20 +- crypto/openssh/regress/multiplex.sh | 4 +- crypto/openssh/regress/sshd-log-wrapper.sh | 12 - crypto/openssh/regress/test-exec.sh | 88 +- crypto/openssh/regress/timestamp.c | 46 + .../openssh/regress/unittests/kex/test_proposal.c | 47 +- crypto/openssh/regress/unittests/kex/tests.c | 8 +- .../openssh/regress/unittests/misc/test_ptimeout.c | 6 +- crypto/openssh/sandbox-seccomp-filter.c | 93 +- crypto/openssh/scp.c | 8 +- crypto/openssh/servconf.c | 15 +- crypto/openssh/serverloop.c | 5 +- crypto/openssh/session.c | 4 +- crypto/openssh/sftp-client.c | 3 +- crypto/openssh/sftp-server.c | 4 +- crypto/openssh/sftp.c | 14 +- crypto/openssh/ssh-add.c | 9 +- crypto/openssh/ssh-agent.c | 8 +- crypto/openssh/ssh-dss.c | 3 +- crypto/openssh/ssh-ecdsa-sk.c | 3 +- crypto/openssh/ssh-ecdsa.c | 4 +- crypto/openssh/ssh-keygen.1 | 19 +- crypto/openssh/ssh-keygen.c | 42 +- crypto/openssh/ssh-keyscan.1 | 19 +- crypto/openssh/ssh-keyscan.c | 22 +- crypto/openssh/ssh-pkcs11.c | 8 +- crypto/openssh/ssh-rsa.c | 3 +- crypto/openssh/ssh.c | 3 +- crypto/openssh/ssh_config.5 | 6 +- crypto/openssh/ssh_namespace.h | 4 +- crypto/openssh/sshconnect.c | 5 +- crypto/openssh/sshconnect2.c | 81 +- crypto/openssh/sshd.8 | 20 +- crypto/openssh/sshd.c | 92 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 20 +- crypto/openssh/umac.c | 5 +- crypto/openssh/version.h | 6 +- secure/lib/libssh/Makefile | 1 + 100 files changed, 8556 insertions(+), 8103 deletions(-) diff --cc crypto/openssh/README.md index 3da933817989,000000000000..9431b0ffdd89 mode 100644,000000..100644 --- a/crypto/openssh/README.md +++ b/crypto/openssh/README.md @@@ -1,85 -1,0 +1,86 @@@ +# Portable OpenSSH + +[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/openssh.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:openssh) ++[![Coverity Status](https://scan.coverity.com/projects/21341/badge.svg)](https://scan.coverity.com/projects/openssh-portable) + +OpenSSH is a complete implementation of the SSH protocol (version 2) for secure remote login, command execution and file transfer. It includes a client ``ssh`` and server ``sshd``, file transfer utilities ``scp`` and ``sftp`` as well as tools for key generation (``ssh-keygen``), run-time key storage (``ssh-agent``) and a number of supporting programs. + +This is a port of OpenBSD's [OpenSSH](https://openssh.com) to most Unix-like operating systems, including Linux, OS X and Cygwin. Portable OpenSSH polyfills OpenBSD APIs that are not available elsewhere, adds sshd sandboxing for more operating systems and includes support for OS-native authentication and auditing (e.g. using PAM). + +## Documentation + +The official documentation for OpenSSH are the man pages for each tool: + +* [ssh(1)](https://man.openbsd.org/ssh.1) +* [sshd(8)](https://man.openbsd.org/sshd.8) +* [ssh-keygen(1)](https://man.openbsd.org/ssh-keygen.1) +* [ssh-agent(1)](https://man.openbsd.org/ssh-agent.1) +* [scp(1)](https://man.openbsd.org/scp.1) +* [sftp(1)](https://man.openbsd.org/sftp.1) +* [ssh-keyscan(8)](https://man.openbsd.org/ssh-keyscan.8) +* [sftp-server(8)](https://man.openbsd.org/sftp-server.8) + +## Stable Releases + +Stable release tarballs are available from a number of [download mirrors](https://www.openssh.com/portable.html#downloads). We recommend the use of a stable release for most users. Please read the [release notes](https://www.openssh.com/releasenotes.html) for details of recent changes and potential incompatibilities. + +## Building Portable OpenSSH + +### Dependencies + +Portable OpenSSH is built using autoconf and make. It requires a working C compiler, standard library and headers. + +``libcrypto`` from either [LibreSSL](https://www.libressl.org/) or [OpenSSL](https://www.openssl.org) may also be used. OpenSSH may be built without either of these, but the resulting binaries will have only a subset of the cryptographic algorithms normally available. + +[zlib](https://www.zlib.net/) is optional; without it transport compression is not supported. + +FIDO security token support needs [libfido2](https://github.com/Yubico/libfido2) and its dependencies and will be enabled automatically if they are found. + +In addition, certain platforms and build-time options may require additional dependencies; see README.platform for details about your platform. + +### Building a release + +Releases include a pre-built copy of the ``configure`` script and may be built using: + +``` +tar zxvf openssh-X.YpZ.tar.gz +cd openssh +./configure # [options] +make && make tests +``` + +See the [Build-time Customisation](#build-time-customisation) section below for configure options. If you plan on installing OpenSSH to your system, then you will usually want to specify destination paths. + +### Building from git + +If building from git, you'll need [autoconf](https://www.gnu.org/software/autoconf/) installed to build the ``configure`` script. The following commands will check out and build portable OpenSSH from git: + +``` +git clone https://github.com/openssh/openssh-portable # or https://anongit.mindrot.org/openssh.git +cd openssh-portable +autoreconf +./configure +make && make tests +``` + +### Build-time Customisation + +There are many build-time customisation options available. All Autoconf destination path flags (e.g. ``--prefix``) are supported (and are usually required if you want to install OpenSSH). + +For a full list of available flags, run ``./configure --help`` but a few of the more frequently-used ones are described below. Some of these flags will require additional libraries and/or headers be installed. + +Flag | Meaning +--- | --- +``--with-pam`` | Enable [PAM](https://en.wikipedia.org/wiki/Pluggable_authentication_module) support. [OpenPAM](https://www.openpam.org/), [Linux PAM](http://www.linux-pam.org/) and Solaris PAM are supported. +``--with-libedit`` | Enable [libedit](https://www.thrysoee.dk/editline/) support for sftp. +``--with-kerberos5`` | Enable Kerberos/GSSAPI support. Both [Heimdal](https://www.h5l.org/) and [MIT](https://web.mit.edu/kerberos/) Kerberos implementations are supported. +``--with-selinux`` | Enable [SELinux](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) support. + +## Development + +Portable OpenSSH development is discussed on the [openssh-unix-dev mailing list](https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev) ([archive mirror](https://marc.info/?l=openssh-unix-dev)). Bugs and feature requests are tracked on our [Bugzilla](https://bugzilla.mindrot.org/). + +## Reporting bugs + +_Non-security_ bugs may be reported to the developers via [Bugzilla](https://bugzilla.mindrot.org/) or via the mailing list above. Security bugs should be reported to [openssh@openssh.com](mailto:openssh.openssh.com). diff --cc crypto/openssh/auth.c index 93610963f3b3,000000000000..f390df839d62 mode 100644,000000..100644 --- a/crypto/openssh/auth.c +++ b/crypto/openssh/auth.c @@@ -1,880 -1,0 +1,879 @@@ - /* $OpenBSD: auth.c,v 1.159 2022/12/09 00:17:40 dtucker Exp $ */ ++/* $OpenBSD: auth.c,v 1.160 2023/03/05 05:34:09 dtucker Exp $ */ +/* + * Copyright (c) 2000 Markus Friedl. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR 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. + */ + +#include "includes.h" + +#include +#include +#include +#include + +#include + +#include +#include +#include +#ifdef HAVE_PATHS_H +# include +#endif +#include +#ifdef HAVE_LOGIN_H +#include +#endif +#ifdef USE_SHADOW +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include "xmalloc.h" +#include "match.h" +#include "groupaccess.h" +#include "log.h" +#include "sshbuf.h" +#include "misc.h" +#include "servconf.h" +#include "sshkey.h" +#include "hostfile.h" +#include "auth.h" +#include "auth-options.h" +#include "canohost.h" +#include "uidswap.h" +#include "packet.h" +#include "loginrec.h" +#ifdef GSSAPI +#include "ssh-gss.h" +#endif +#include "authfile.h" +#include "monitor_wrap.h" +#include "ssherr.h" - #include "compat.h" +#include "channels.h" +#include "blacklist_client.h" + +/* import */ +extern ServerOptions options; +extern struct include_list includes; +extern int use_privsep; +extern struct sshbuf *loginmsg; +extern struct passwd *privsep_pw; +extern struct sshauthopt *auth_opts; + +/* Debugging messages */ +static struct sshbuf *auth_debug; + +/* + * Check if the user is allowed to log in via ssh. If user is listed + * in DenyUsers or one of user's groups is listed in DenyGroups, false + * will be returned. If AllowUsers isn't empty and user isn't listed + * there, or if AllowGroups isn't empty and one of user's groups isn't + * listed there, false will be returned. + * If the user's shell is not executable, false will be returned. + * Otherwise true is returned. + */ +int +allowed_user(struct ssh *ssh, struct passwd * pw) +{ + struct stat st; + const char *hostname = NULL, *ipaddr = NULL; + u_int i; + int r; + + /* Shouldn't be called if pw is NULL, but better safe than sorry... */ + if (!pw || !pw->pw_name) + return 0; + + if (!options.use_pam && platform_locked_account(pw)) { + logit("User %.100s not allowed because account is locked", + pw->pw_name); + return 0; + } + + /* + * Deny if shell does not exist or is not executable unless we + * are chrooting. + */ + if (options.chroot_directory == NULL || + strcasecmp(options.chroot_directory, "none") == 0) { + char *shell = xstrdup((pw->pw_shell[0] == '\0') ? + _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */ + + if (stat(shell, &st) == -1) { + logit("User %.100s not allowed because shell %.100s " + "does not exist", pw->pw_name, shell); + free(shell); + return 0; + } + if (S_ISREG(st.st_mode) == 0 || + (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)) == 0) { + logit("User %.100s not allowed because shell %.100s " + "is not executable", pw->pw_name, shell); + free(shell); + return 0; + } + free(shell); + } + + if (options.num_deny_users > 0 || options.num_allow_users > 0 || + options.num_deny_groups > 0 || options.num_allow_groups > 0) { + hostname = auth_get_canonical_hostname(ssh, options.use_dns); + ipaddr = ssh_remote_ipaddr(ssh); + } + + /* Return false if user is listed in DenyUsers */ + if (options.num_deny_users > 0) { + for (i = 0; i < options.num_deny_users; i++) { + r = match_user(pw->pw_name, hostname, ipaddr, + options.deny_users[i]); + if (r < 0) { + fatal("Invalid DenyUsers pattern \"%.100s\"", + options.deny_users[i]); + } else if (r != 0) { + logit("User %.100s from %.100s not allowed " + "because listed in DenyUsers", + pw->pw_name, hostname); + return 0; + } + } + } + /* Return false if AllowUsers isn't empty and user isn't listed there */ + if (options.num_allow_users > 0) { + for (i = 0; i < options.num_allow_users; i++) { + r = match_user(pw->pw_name, hostname, ipaddr, + options.allow_users[i]); + if (r < 0) { + fatal("Invalid AllowUsers pattern \"%.100s\"", + options.allow_users[i]); + } else if (r == 1) + break; + } + /* i < options.num_allow_users iff we break for loop */ + if (i >= options.num_allow_users) { + logit("User %.100s from %.100s not allowed because " + "not listed in AllowUsers", pw->pw_name, hostname); + return 0; + } + } + if (options.num_deny_groups > 0 || options.num_allow_groups > 0) { + /* Get the user's group access list (primary and supplementary) */ + if (ga_init(pw->pw_name, pw->pw_gid) == 0) { + logit("User %.100s from %.100s not allowed because " + "not in any group", pw->pw_name, hostname); + return 0; + } + + /* Return false if one of user's groups is listed in DenyGroups */ + if (options.num_deny_groups > 0) + if (ga_match(options.deny_groups, + options.num_deny_groups)) { + ga_free(); + logit("User %.100s from %.100s not allowed " + "because a group is listed in DenyGroups", + pw->pw_name, hostname); + return 0; + } + /* + * Return false if AllowGroups isn't empty and one of user's groups + * isn't listed there + */ + if (options.num_allow_groups > 0) + if (!ga_match(options.allow_groups, + options.num_allow_groups)) { + ga_free(); + logit("User %.100s from %.100s not allowed " + "because none of user's groups are listed " + "in AllowGroups", pw->pw_name, hostname); + return 0; + } + ga_free(); + } + +#ifdef CUSTOM_SYS_AUTH_ALLOWED_USER + if (!sys_auth_allowed_user(pw, loginmsg)) + return 0; +#endif + + /* We found no reason not to let this user try to log on... */ + return 1; +} + +/* + * Formats any key left in authctxt->auth_method_key for inclusion in + * auth_log()'s message. Also includes authxtct->auth_method_info if present. + */ +static char * +format_method_key(Authctxt *authctxt) +{ + const struct sshkey *key = authctxt->auth_method_key; + const char *methinfo = authctxt->auth_method_info; + char *fp, *cafp, *ret = NULL; + + if (key == NULL) + return NULL; + + if (sshkey_is_cert(key)) { + fp = sshkey_fingerprint(key, + options.fingerprint_hash, SSH_FP_DEFAULT); + cafp = sshkey_fingerprint(key->cert->signature_key, + options.fingerprint_hash, SSH_FP_DEFAULT); + xasprintf(&ret, "%s %s ID %s (serial %llu) CA %s %s%s%s", + sshkey_type(key), fp == NULL ? "(null)" : fp, + key->cert->key_id, + (unsigned long long)key->cert->serial, + sshkey_type(key->cert->signature_key), + cafp == NULL ? "(null)" : cafp, + methinfo == NULL ? "" : ", ", + methinfo == NULL ? "" : methinfo); + free(fp); + free(cafp); + } else { + fp = sshkey_fingerprint(key, options.fingerprint_hash, + SSH_FP_DEFAULT); + xasprintf(&ret, "%s %s%s%s", sshkey_type(key), + fp == NULL ? "(null)" : fp, + methinfo == NULL ? "" : ", ", + methinfo == NULL ? "" : methinfo); + free(fp); + } + return ret; +} + +void +auth_log(struct ssh *ssh, int authenticated, int partial, + const char *method, const char *submethod) +{ + Authctxt *authctxt = (Authctxt *)ssh->authctxt; + int level = SYSLOG_LEVEL_VERBOSE; + const char *authmsg; + char *extra = NULL; + + if (use_privsep && !mm_is_monitor() && !authctxt->postponed) + return; + + /* Raise logging level */ + if (authenticated == 1 || + !authctxt->valid || + authctxt->failures >= options.max_authtries / 2 || + strcmp(method, "password") == 0) + level = SYSLOG_LEVEL_INFO; + + if (authctxt->postponed) + authmsg = "Postponed"; + else if (partial) + authmsg = "Partial"; + else { + authmsg = authenticated ? "Accepted" : "Failed"; + if (authenticated) + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_OK, "ssh"); + } + + if ((extra = format_method_key(authctxt)) == NULL) { + if (authctxt->auth_method_info != NULL) + extra = xstrdup(authctxt->auth_method_info); + } + + do_log2(level, "%s %s%s%s for %s%.100s from %.200s port %d ssh2%s%s", + authmsg, + method, + submethod != NULL ? "/" : "", submethod == NULL ? "" : submethod, + authctxt->valid ? "" : "invalid user ", + authctxt->user, + ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh), + extra != NULL ? ": " : "", + extra != NULL ? extra : ""); + + free(extra); + +#if defined(CUSTOM_FAILED_LOGIN) || defined(SSH_AUDIT_EVENTS) + if (authenticated == 0 && !(authctxt->postponed || partial)) { + /* Log failed login attempt */ +# ifdef CUSTOM_FAILED_LOGIN + if (strcmp(method, "password") == 0 || + strncmp(method, "keyboard-interactive", 20) == 0 || + strcmp(method, "challenge-response") == 0) + record_failed_login(ssh, authctxt->user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh"); +# endif +# ifdef SSH_AUDIT_EVENTS + audit_event(ssh, audit_classify_auth(method)); +# endif + } +#endif +#if defined(CUSTOM_FAILED_LOGIN) && defined(WITH_AIXAUTHENTICATE) + if (authenticated) + sys_auth_record_login(authctxt->user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh", + loginmsg); +#endif +} + +void +auth_maxtries_exceeded(struct ssh *ssh) +{ + Authctxt *authctxt = (Authctxt *)ssh->authctxt; + + error("maximum authentication attempts exceeded for " + "%s%.100s from %.200s port %d ssh2", + authctxt->valid ? "" : "invalid user ", + authctxt->user, + ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh)); + ssh_packet_disconnect(ssh, "Too many authentication failures"); + /* NOTREACHED */ +} + +/* + * Check whether root logins are disallowed. + */ +int +auth_root_allowed(struct ssh *ssh, const char *method) +{ + switch (options.permit_root_login) { + case PERMIT_YES: + return 1; + case PERMIT_NO_PASSWD: + if (strcmp(method, "publickey") == 0 || + strcmp(method, "hostbased") == 0 || + strcmp(method, "gssapi-with-mic") == 0) + return 1; + break; + case PERMIT_FORCED_ONLY: + if (auth_opts->force_command != NULL) { + logit("Root login accepted for forced command."); + return 1; + } + break; + } + logit("ROOT LOGIN REFUSED FROM %.200s port %d", + ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); + return 0; +} + + +/* + * Given a template and a passwd structure, build a filename + * by substituting % tokenised options. Currently, %% becomes '%', + * %h becomes the home directory and %u the username. + * + * This returns a buffer allocated by xmalloc. + */ +char * +expand_authorized_keys(const char *filename, struct passwd *pw) +{ + char *file, uidstr[32], ret[PATH_MAX]; + int i; + + snprintf(uidstr, sizeof(uidstr), "%llu", + (unsigned long long)pw->pw_uid); + file = percent_expand(filename, "h", pw->pw_dir, + "u", pw->pw_name, "U", uidstr, (char *)NULL); + + /* + * Ensure that filename starts anchored. If not, be backward + * compatible and prepend the '%h/' + */ + if (path_absolute(file)) + return (file); + + i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file); + if (i < 0 || (size_t)i >= sizeof(ret)) + fatal("expand_authorized_keys: path too long"); + free(file); + return (xstrdup(ret)); +} + +char * +authorized_principals_file(struct passwd *pw) +{ + if (options.authorized_principals_file == NULL) + return NULL; + return expand_authorized_keys(options.authorized_principals_file, pw); +} + +/* return ok if key exists in sysfile or userfile */ +HostStatus +check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host, + const char *sysfile, const char *userfile) +{ + char *user_hostfile; + struct stat st; + HostStatus host_status; + struct hostkeys *hostkeys; + const struct hostkey_entry *found; + + hostkeys = init_hostkeys(); + load_hostkeys(hostkeys, host, sysfile, 0); + if (userfile != NULL) { + user_hostfile = tilde_expand_filename(userfile, pw->pw_uid); + if (options.strict_modes && + (stat(user_hostfile, &st) == 0) && + ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || + (st.st_mode & 022) != 0)) { + logit("Authentication refused for %.100s: " + "bad owner or modes for %.200s", + pw->pw_name, user_hostfile); + auth_debug_add("Ignored %.200s: bad ownership or modes", + user_hostfile); + } else { + temporarily_use_uid(pw); + load_hostkeys(hostkeys, host, user_hostfile, 0); + restore_uid(); + } + free(user_hostfile); + } + host_status = check_key_in_hostkeys(hostkeys, key, &found); + if (host_status == HOST_REVOKED) + error("WARNING: revoked key for %s attempted authentication", + host); + else if (host_status == HOST_OK) + debug_f("key for %s found at %s:%ld", + found->host, found->file, found->line); + else + debug_f("key for host %s not found", host); + + free_hostkeys(hostkeys); + + return host_status; +} + +struct passwd * +getpwnamallow(struct ssh *ssh, const char *user) +{ +#ifdef HAVE_LOGIN_CAP + extern login_cap_t *lc; +#ifdef HAVE_AUTH_HOSTOK + const char *from_host, *from_ip; +#endif +#ifdef BSD_AUTH + auth_session_t *as; +#endif +#endif + struct passwd *pw; + struct connection_info *ci; + u_int i; + + ci = get_connection_info(ssh, 1, options.use_dns); + ci->user = user; + parse_server_match_config(&options, &includes, ci); + log_change_level(options.log_level); + log_verbose_reset(); + for (i = 0; i < options.num_log_verbose; i++) + log_verbose_add(options.log_verbose[i]); + process_permitopen(ssh, &options); + +#if defined(_AIX) && defined(HAVE_SETAUTHDB) + aix_setauthdb(user); +#endif + + pw = getpwnam(user); + +#if defined(_AIX) && defined(HAVE_SETAUTHDB) + aix_restoreauthdb(); +#endif + if (pw == NULL) { + BLACKLIST_NOTIFY(ssh, BLACKLIST_BAD_USER, user); + logit("Invalid user %.100s from %.100s port %d", + user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); +#ifdef CUSTOM_FAILED_LOGIN + record_failed_login(ssh, user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh"); +#endif +#ifdef SSH_AUDIT_EVENTS + audit_event(ssh, SSH_INVALID_USER); +#endif /* SSH_AUDIT_EVENTS */ + return (NULL); + } + if (!allowed_user(ssh, pw)) + return (NULL); +#ifdef HAVE_LOGIN_CAP + if ((lc = login_getpwclass(pw)) == NULL) { + debug("unable to get login class: %s", user); + return (NULL); + } +#ifdef HAVE_AUTH_HOSTOK + from_host = auth_get_canonical_hostname(ssh, options.use_dns); + from_ip = ssh_remote_ipaddr(ssh); + if (!auth_hostok(lc, from_host, from_ip)) { + debug("Denied connection for %.200s from %.200s [%.200s].", + pw->pw_name, from_host, from_ip); + return (NULL); + } +#endif /* HAVE_AUTH_HOSTOK */ +#ifdef HAVE_AUTH_TIMEOK + if (!auth_timeok(lc, time(NULL))) { + debug("LOGIN %.200s REFUSED (TIME)", pw->pw_name); + return (NULL); + } +#endif /* HAVE_AUTH_TIMEOK */ +#ifdef BSD_AUTH + if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || + auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { + debug("Approval failure for %s", user); + pw = NULL; + } + if (as != NULL) + auth_close(as); +#endif +#endif + if (pw != NULL) + return (pwcopy(pw)); + return (NULL); +} + +/* Returns 1 if key is revoked by revoked_keys_file, 0 otherwise */ +int +auth_key_is_revoked(struct sshkey *key) +{ + char *fp = NULL; + int r; + + if (options.revoked_keys_file == NULL) + return 0; + if ((fp = sshkey_fingerprint(key, options.fingerprint_hash, + SSH_FP_DEFAULT)) == NULL) { + r = SSH_ERR_ALLOC_FAIL; + error_fr(r, "fingerprint key"); + goto out; + } + + r = sshkey_check_revoked(key, options.revoked_keys_file); + switch (r) { + case 0: + break; /* not revoked */ + case SSH_ERR_KEY_REVOKED: + error("Authentication key %s %s revoked by file %s", + sshkey_type(key), fp, options.revoked_keys_file); + goto out; + default: + error_r(r, "Error checking authentication key %s %s in " + "revoked keys file %s", sshkey_type(key), fp, + options.revoked_keys_file); + goto out; + } + + /* Success */ + r = 0; + + out: + free(fp); + return r == 0 ? 0 : 1; +} + +void +auth_debug_add(const char *fmt,...) +{ + char buf[1024]; + va_list args; + int r; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + debug3("%s", buf); + if (auth_debug != NULL) + if ((r = sshbuf_put_cstring(auth_debug, buf)) != 0) + fatal_fr(r, "sshbuf_put_cstring"); +} + +void +auth_debug_send(struct ssh *ssh) +{ + char *msg; + int r; + + if (auth_debug == NULL) + return; + while (sshbuf_len(auth_debug) != 0) { + if ((r = sshbuf_get_cstring(auth_debug, &msg, NULL)) != 0) + fatal_fr(r, "sshbuf_get_cstring"); + ssh_packet_send_debug(ssh, "%s", msg); + free(msg); + } +} + +void +auth_debug_reset(void) +{ + if (auth_debug != NULL) + sshbuf_reset(auth_debug); + else if ((auth_debug = sshbuf_new()) == NULL) + fatal_f("sshbuf_new failed"); +} + +struct passwd * +fakepw(void) +{ + static int done = 0; + static struct passwd fake; + const char hashchars[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz0123456789"; /* from bcrypt.c */ + char *cp; + + if (done) + return (&fake); + + memset(&fake, 0, sizeof(fake)); + fake.pw_name = "NOUSER"; + fake.pw_passwd = xstrdup("$2a$10$" + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); + for (cp = fake.pw_passwd + 7; *cp != '\0'; cp++) + *cp = hashchars[arc4random_uniform(sizeof(hashchars) - 1)]; +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS + fake.pw_gecos = "NOUSER"; +#endif + fake.pw_uid = privsep_pw == NULL ? (uid_t)-1 : privsep_pw->pw_uid; + fake.pw_gid = privsep_pw == NULL ? (gid_t)-1 : privsep_pw->pw_gid; +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS + fake.pw_class = ""; +#endif + fake.pw_dir = "/nonexist"; + fake.pw_shell = "/nonexist"; + done = 1; + + return (&fake); +} + +/* + * Returns the remote DNS hostname as a string. The returned string must not + * be freed. NB. this will usually trigger a DNS query the first time it is + * called. + * This function does additional checks on the hostname to mitigate some + * attacks on based on conflation of hostnames and IP addresses. + */ + +static char * +remote_hostname(struct ssh *ssh) +{ + struct sockaddr_storage from; + socklen_t fromlen; + struct addrinfo hints, *ai, *aitop; + char name[NI_MAXHOST], ntop2[NI_MAXHOST]; + const char *ntop = ssh_remote_ipaddr(ssh); + + /* Get IP address of client. */ + fromlen = sizeof(from); + memset(&from, 0, sizeof(from)); + if (getpeername(ssh_packet_get_connection_in(ssh), + (struct sockaddr *)&from, &fromlen) == -1) { + debug("getpeername failed: %.100s", strerror(errno)); + return xstrdup(ntop); + } + + ipv64_normalise_mapped(&from, &fromlen); + if (from.ss_family == AF_INET6) + fromlen = sizeof(struct sockaddr_in6); + + debug3("Trying to reverse map address %.100s.", ntop); + /* Map the IP address to a host name. */ + if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), + NULL, 0, NI_NAMEREQD) != 0) { + /* Host name not found. Use ip address. */ + return xstrdup(ntop); + } + + /* + * if reverse lookup result looks like a numeric hostname, + * someone is trying to trick us by PTR record like following: + * 1.1.1.10.in-addr.arpa. IN PTR 2.3.4.5 + */ + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype = SOCK_DGRAM; /*dummy*/ + hints.ai_flags = AI_NUMERICHOST; + if (getaddrinfo(name, NULL, &hints, &ai) == 0) { + logit("Nasty PTR record \"%s\" is set up for %s, ignoring", + name, ntop); + freeaddrinfo(ai); + return xstrdup(ntop); + } + + /* Names are stored in lowercase. */ + lowercase(name); + + /* + * Map it back to an IP address and check that the given + * address actually is an address of this host. This is + * necessary because anyone with access to a name server can + * define arbitrary names for an IP address. Mapping from + * name to IP address can be trusted better (but can still be + * fooled if the intruder has access to the name server of + * the domain). + */ + memset(&hints, 0, sizeof(hints)); + hints.ai_family = from.ss_family; + hints.ai_socktype = SOCK_STREAM; + if (getaddrinfo(name, NULL, &hints, &aitop) != 0) { + logit("reverse mapping checking getaddrinfo for %.700s " + "[%s] failed.", name, ntop); + return xstrdup(ntop); + } + /* Look for the address from the list of addresses. */ + for (ai = aitop; ai; ai = ai->ai_next) { + if (getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop2, + sizeof(ntop2), NULL, 0, NI_NUMERICHOST) == 0 && *** 7651 LINES SKIPPED *** From nobody Thu Mar 16 15:37:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcrwg3YnGz3yFdh; Thu, 16 Mar 2023 15:37: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 4Pcrwg2sMqz3R1b; Thu, 16 Mar 2023 15:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678981027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=idgElQ7JZvip3V1EVYC0Z+6p6xN/XQ1xUAW7JLFLWlA=; b=hhymNmIoi2qdqWjjwMF2HwupEW9rtGxOVGTSe5xpF+Tn3YgF4RDLTfYbwj3rdzh6RKinWs 5TlEMFTffgUKOuOG8m4kV+c1BlIUf2ADYvN+FB++UEgBu6yFNfEEMk99WzP5ZHYfTNg5ml dfZFXP58dab7SJuoUaciAADbb0YrV4JRTDeEWWZ+Nc4BTRXqqrZ5BfBK0r+a8wPVfKJP6o +pPemaOT+x1maTptaLN2DodVfRRfoaDIPoI9hkehGvcP7pFb/Oi15F29bYrGj4pubOzGMF hATb10XlQwbHPyjfk2tvaBVnDXkSQAEqE4566c+J4pr2sZLvHGwlevGILWv3ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678981027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=idgElQ7JZvip3V1EVYC0Z+6p6xN/XQ1xUAW7JLFLWlA=; b=wJ4V64e3guKHzRBriD1VQmAGbuc0aiFn6TZtRV688Mlbx9xxBi8lvKD4Mo5cZXxCk6aloM 58oQ8slhaaYTEV7EPJzZKQs2YnS3T94y7n/SklQxLeh21Qku8YI7ZBR9bztVvxP5X3ywtz G+/VWV5CXQMOC0kZyUvTc9x/UK8xj1epKhKODmhcvgdSN/vTEH2LD0Rvq2KpBNQc+3F+xz ySU0kqMysKF7Q19jS9bCYx1cMO7YSIHxCKjWgPbPwcZwk5CObLjGEk50jsmkmw5hCsV6M3 WLtA1h/RmLBejH4ihne1bfYI217TpZKCwLTAjU8NKQ9Au60mVV2SToEmVYbxAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678981027; a=rsa-sha256; cv=none; b=HsKTxnZuUBr6QsWMeHc+1gYzjnYceUDjxQrXCKhWlRp/rLUeWHqfC++uNv4/3kt5cbJP2m Q7JP1KtJYncfFEITlAX1UBmZHgMolfqpjTXmAJ9JMMV0L/3Fn7H3qDnnPFCvl0hmQ/yS6m oFp4/Zn8MG3YI+PueOkAAa6EM8YZRDXTkk9e79DYZ02XATaKyzDVmm42JV5xEwtngihoe7 zg0qzFk+r2RGp9dbXdZKbeH6WxctDBqXTtVOK0B8uERXWLVhTVGZDpSYl3mEDjJj4c2Inu GIP7KlBV7G/YVTzUKZcRh/EUF/LopLECNF6Usq00qFUqFHXWtO6ej8qQ087+fA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcrwg1nsgzpTC; Thu, 16 Mar 2023 15:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GFb7lF007277; Thu, 16 Mar 2023 15:37:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GFb71e007276; Thu, 16 Mar 2023 15:37:07 GMT (envelope-from git) Date: Thu, 16 Mar 2023 15:37:07 GMT Message-Id: <202303161537.32GFb71e007276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: fa3af3ce5010 - main - tail: Verify correct behavior when input does not end in a newline. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa3af3ce5010740f28faed22e0a1e819491f26b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fa3af3ce5010740f28faed22e0a1e819491f26b4 commit fa3af3ce5010740f28faed22e0a1e819491f26b4 Author: Dag-Erling Smørgrav AuthorDate: 2023-03-16 15:36:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-16 15:37:02 +0000 tail: Verify correct behavior when input does not end in a newline. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D39116 --- usr.bin/tail/tests/tail_test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.bin/tail/tests/tail_test.sh b/usr.bin/tail/tests/tail_test.sh index e8263864f28c..36d6cdb68692 100755 --- a/usr.bin/tail/tests/tail_test.sh +++ b/usr.bin/tail/tests/tail_test.sh @@ -392,6 +392,19 @@ si_number_body() { atf_check cmp outfile expectfile } +atf_test_case no_lf_at_eof +no_lf_at_eof_head() +{ + atf_set "descr" "File does not end in newline" +} +no_lf_at_eof_body() +{ + printf "a\nb\nc" >infile + atf_check -o inline:"c" tail -1 infile + atf_check -o inline:"b\nc" tail -2 infile + atf_check -o inline:"a\nb\nc" tail -3 infile + atf_check -o inline:"a\nb\nc" tail -4 infile +} atf_init_test_cases() { @@ -416,4 +429,5 @@ atf_init_test_cases() atf_add_test_case silent_header atf_add_test_case verbose_header atf_add_test_case si_number + atf_add_test_case no_lf_at_eof } From nobody Thu Mar 16 15:44:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcs5j0YDgz3yGJV; Thu, 16 Mar 2023 15:44: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 4Pcs5j0Lmfz3hfW; Thu, 16 Mar 2023 15:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678981497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rVr6CY0arcT4ilSxYrlnNuLSpCwxuzOE/UKI2M2aVF8=; b=l2SjH9CCuiQhet8Frz+CfHJWN7gTHOKSt/aV/hp+Klj00NSes34k2LeE+ni4RaPdrXxSIg 1yICry10S6C+c4V2h1baMvK6e0mPabySLTRuL8WnPf3UX7d6nNrhYHJMdxANy6fttCImGh 6Ki3Ep6bINzy3afh02tdx9nV+gHGWLslQbVaChMepxhecIoN/UlJnWNZX0b2H/ava+8Glw P2gr1jhiFL1PTCNkvxyJHddKiDKaVi4ghJGB1tQfSRtlTRuNgoPA9OXSCDAth9QaAHqWv/ LNI60Vaa8tTeNRfQ1ZZKRQoYbpR4N5ceTWl7BxLvrXFIVs/ko8m1pyA/qE7YBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678981497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rVr6CY0arcT4ilSxYrlnNuLSpCwxuzOE/UKI2M2aVF8=; b=i5aiOpm6t2l7H+Hw5Pgop0hGOjhe3hD0Tvl2H/08Hr0nFYrtVbAnV7am+5tO/o6icUihdV jDBh4P48l38FxUrvCLeBi5DxSB+oKi/aK0S7g6JmTdx0dEFNQw3XYfMqXcZHo2ajG2rVfq LmMXOGeHMJOr/2paqmWuc7gVV3hJwBJEIBVNErtFGGnJconUV30bY+1ceuWGssRLr4KHyD AumxltpC7RG6k/JYcDGVwqIBbaDer0t5BdLqc1OzHHWBd4RdrNWsozr7FoKGknTQSwPO3S bPz4MpE4jRyEuFtFSRKld2wBz2kWGsnxnUDWU9G7cc1LtVtW0NJasaovChN3TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678981497; a=rsa-sha256; cv=none; b=uAAiyEs6l8bwW7I8D+yz+b3h1pjwA19XkoADpRw9x0Sw3CYE1KzTWkXJO/V35oUBgFaTuB fJgISS5XLlKZFmycQnp+L0ih71EN1IP0ah1Wir48IVrDRRH91L5glzfAdvGGopSy3/6J0q U7qu8ifbeZ78u/6mQLlc/OkUB2Yr7aoFTO82R4WwyykLomw2xtm3Oy6W9WYHLmSv5S00Mv RaciYG1/3S6iMRtkIT0Nl16BHk6J6aIUsj3Em/bVIk70ydptfKLLSJF4Aoe4X5sA/GgGkM l6v4vEmK2so4PlfHtVleMjN/cvaxD2KY/Kc4Cs1ku83C8229GIbRYlLcURdi3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcs5h6VqhzpCJ; Thu, 16 Mar 2023 15:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GFiuFb023308; Thu, 16 Mar 2023 15:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GFiuHO023307; Thu, 16 Mar 2023 15:44:56 GMT (envelope-from git) Date: Thu, 16 Mar 2023 15:44:56 GMT Message-Id: <202303161544.32GFiuHO023307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 69c7c8119058 - main - Move access to tcp's t_logstate into inline functions and provide new tracepoint and bbpoint capabilities. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69c7c81190580ade16e608c6edaaa9f63dcd9052 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=69c7c81190580ade16e608c6edaaa9f63dcd9052 commit 69c7c81190580ade16e608c6edaaa9f63dcd9052 Author: Randall Stewart AuthorDate: 2023-03-16 15:43:16 +0000 Commit: Randall Stewart CommitDate: 2023-03-16 15:43:16 +0000 Move access to tcp's t_logstate into inline functions and provide new tracepoint and bbpoint capabilities. The TCP stacks have long accessed t_logstate directly, but in order to do tracepoints and the new bbpoints we need to move to using the new inline functions. This adds them and moves rack to now use the tcp_tracepoints. Reviewed by: tuexen, gallatin Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D38831 --- sys/conf/options | 1 + sys/netinet/cc/cc_cubic.c | 2 +- sys/netinet/cc/cc_newreno.c | 2 +- sys/netinet/tcp.h | 12 ++ sys/netinet/tcp_accounting.h | 8 - sys/netinet/tcp_hpts.c | 2 +- sys/netinet/tcp_input.c | 2 +- sys/netinet/tcp_log_buf.c | 328 ++++++++++++++++++++++++++----- sys/netinet/tcp_log_buf.h | 228 +++++++++++++++++++-- sys/netinet/tcp_lro.c | 2 +- sys/netinet/tcp_output.c | 7 +- sys/netinet/tcp_ratelimit.c | 2 +- sys/netinet/tcp_stacks/bbr.c | 82 ++++---- sys/netinet/tcp_stacks/rack.c | 216 +++++--------------- sys/netinet/tcp_stacks/rack_bbr_common.c | 2 +- sys/netinet/tcp_subr.c | 68 ++++++- sys/netinet/tcp_timer.c | 6 +- sys/netinet/tcp_usrreq.c | 6 +- sys/netinet/tcp_var.h | 14 +- 19 files changed, 694 insertions(+), 296 deletions(-) diff --git a/sys/conf/options b/sys/conf/options index 37218f8a83d8..6dd19582f346 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -227,6 +227,7 @@ SYSVSEM opt_sysvipc.h SYSVSHM opt_sysvipc.h SW_WATCHDOG opt_watchdog.h TCPHPTS opt_inet.h +TCP_ACCOUNTING opt_inet.h TURNSTILE_PROFILING UMTX_PROFILING UMTX_CHAINS opt_global.h diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index cb4c79378132..7257aea56028 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -129,7 +129,7 @@ cubic_log_hystart_event(struct cc_var *ccv, struct cubic *cubicd, uint8_t mod, u if (hystart_bblogs == 0) return; tp = ccv->ccvc.tcp; - if (tp->t_logstate != TCP_LOG_STATE_OFF) { + if (tcp_bblogging_on(tp)) { union tcp_log_stackspecific log; struct timeval tv; diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index fb5ffed43a15..79148e93bfe0 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -139,7 +139,7 @@ newreno_log_hystart_event(struct cc_var *ccv, struct newreno *nreno, uint8_t mod if (hystart_bblogs == 0) return; tp = ccv->ccvc.tcp; - if (tp->t_logstate != TCP_LOG_STATE_OFF) { + if (tcp_bblogging_on(tp)) { union tcp_log_stackspecific log; struct timeval tv; diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 371bb88b9b17..1c34442f2617 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -330,6 +330,18 @@ struct tcphdr { /* Maximum length of log ID. */ #define TCP_LOG_ID_LEN 64 +/* TCP accounting counters */ +#define TCP_NUM_PROC_COUNTERS 11 +#define TCP_NUM_CNT_COUNTERS 13 + +/* Must match counter array sizes in tcpcb */ +struct tcp_perf_info { + uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; + uint64_t tcp_proc_time[TCP_NUM_CNT_COUNTERS]; + uint64_t timebase; /* timebase for tcp_proc_time */ + uint8_t tb_is_stable; /* timebase is stable/invariant */ +}; + /* * The TCP_INFO socket option comes from the Linux 2.6 TCP API, and permits * the caller to query certain information about the state of a TCP diff --git a/sys/netinet/tcp_accounting.h b/sys/netinet/tcp_accounting.h index a2e2d4edd46d..51ced29c217c 100644 --- a/sys/netinet/tcp_accounting.h +++ b/sys/netinet/tcp_accounting.h @@ -25,15 +25,7 @@ #define CYC_HANDLE_MAP 11 #define CYC_HANDLE_ACK 12 -/* Should the tp->xxx array's be alloc'ed? */ /* #define TCP_NUM_PROC_COUNTERS 11 defined in tcp_var.h */ /* #define TCP_NUM_CNT_COUNTERS 13 defined in tcp_var.h */ -#ifdef _KERNEL -#ifdef TCP_ACCOUNTING -extern counter_u64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; -extern counter_u64_t tcp_proc_time[TCP_NUM_PROC_COUNTERS]; -#endif -#endif - #endif diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 25876ebd4105..5ea7bc3dc127 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1344,7 +1344,7 @@ again: } CURVNET_SET(inp->inp_vnet); /* Lets do any logging that we might want to */ - if (hpts_does_tp_logging && (tp->t_logstate != TCP_LOG_STATE_OFF)) { + if (hpts_does_tp_logging && tcp_bblogging_on(tp)) { tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout); } diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7b9c5668e888..992f8ea16e3d 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -104,10 +104,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include +#include #include #include #include diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c index a147b201b2fd..491e1c23588c 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -29,8 +29,10 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include #include +#include #include #include #include @@ -45,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include /* Must come after qmath.h and tree.h */ #include - #include #include @@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* Default expiry time */ #define TCP_LOG_EXPIRE_TIME ((sbintime_t)60 * SBT_1S) @@ -85,6 +87,9 @@ RB_PROTOTYPE_STATIC(tcp_log_id_tree, tcp_log_id_bucket, tlb_rb, tcp_log_id_cmp) SYSCTL_NODE(_net_inet_tcp, OID_AUTO, bb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Black Box controls"); +SYSCTL_NODE(_net_inet_tcp_bb, OID_AUTO, tp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP Black Box Trace Point controls"); + SYSCTL_BOOL(_net_inet_tcp_bb, OID_AUTO, log_verbose, CTLFLAG_RW, &tcp_log_verbose, 0, "Force verbose logging for TCP traces"); @@ -92,6 +97,23 @@ SYSCTL_INT(_net_inet_tcp_bb, OID_AUTO, log_session_limit, CTLFLAG_RW, &tcp_log_session_limit, 0, "Maximum number of events maintained for each TCP session"); +uint32_t tcp_trace_point_config = 0; +SYSCTL_U32(_net_inet_tcp_bb_tp, OID_AUTO, number, CTLFLAG_RW, + &tcp_trace_point_config, TCP_LOG_STATE_HEAD_AUTO, + "What is the trace point number to activate (0=none, 0xffffffff = all)?"); + +uint32_t tcp_trace_point_bb_mode = TCP_LOG_STATE_CONTINUAL; +SYSCTL_U32(_net_inet_tcp_bb_tp, OID_AUTO, bbmode, CTLFLAG_RW, + &tcp_trace_point_bb_mode, TCP_LOG_STATE_HEAD_AUTO, + "What is BB logging mode that is activated?"); + +int32_t tcp_trace_point_count = 0; +SYSCTL_U32(_net_inet_tcp_bb_tp, OID_AUTO, count, CTLFLAG_RW, + &tcp_trace_point_count, TCP_LOG_STATE_HEAD_AUTO, + "How many connections will have BB logging turned on that hit the tracepoint?"); + + + SYSCTL_UMA_MAX(_net_inet_tcp_bb, OID_AUTO, log_global_limit, CTLFLAG_RW, &tcp_log_zone, "Maximum number of events maintained for all TCP sessions"); @@ -264,7 +286,7 @@ struct tcp_log_id_bucket volatile u_int tlb_refcnt; volatile u_int tlb_reqcnt; uint32_t tlb_loglimit; - uint8_t tlb_logstate; + int8_t tlb_logstate; }; struct tcp_log_id_node @@ -514,6 +536,61 @@ tcp_log_increment_reqcnt(struct tcp_log_id_bucket *tlb) atomic_fetchadd_int(&tlb->tlb_reqcnt, 1); } +int +tcp_log_apply_ratio(struct tcpcb *tp, int ratio) +{ + struct tcp_log_id_bucket *tlb; + struct inpcb *inp = tptoinpcb(tp); + uint32_t hash, ratio_hash_thresh; + int rv, tree_locked; + + rv = 0; + tree_locked = TREE_UNLOCKED; + tlb = tp->t_lib; + + INP_WLOCK_ASSERT(inp); + if (tlb == NULL) { + INP_WUNLOCK(inp); + return (EOPNOTSUPP); + } + ratio_hash_thresh = max(1, UINT32_MAX / ratio); + TCPID_BUCKET_REF(tlb); + INP_WUNLOCK(inp); + TCPID_BUCKET_LOCK(tlb); + + hash = hash32_buf(tlb->tlb_id, strlen(tlb->tlb_id), 0); + if (hash > ratio_hash_thresh && tp->_t_logstate == TCP_LOG_STATE_OFF && + tlb->tlb_logstate == TCP_LOG_STATE_OFF) { + /* + * Ratio decision not to log this log ID (and this connection by + * way of association). We only apply a log ratio log disable + * decision if it would not interfere with a log enable decision + * made elsewhere e.g. tcp_log_selectauto() or setsockopt(). + */ + tlb->tlb_logstate = TCP_LOG_STATE_RATIO_OFF; + INP_WLOCK(inp); + RECHECK_INP(); + (void)tcp_log_state_change(tp, TCP_LOG_STATE_OFF); +done: + INP_WUNLOCK(inp); + } + + INP_UNLOCK_ASSERT(inp); + if (!tcp_log_unref_bucket(tlb, &tree_locked, NULL)) + TCPID_BUCKET_UNLOCK(tlb); + + if (tree_locked == TREE_WLOCKED) { + TCPID_TREE_WLOCK_ASSERT(); + TCPID_TREE_WUNLOCK(); + } else if (tree_locked == TREE_RLOCKED) { + TCPID_TREE_RLOCK_ASSERT(); + TCPID_TREE_RUNLOCK(); + } else + TCPID_TREE_UNLOCK_ASSERT(); + + return (rv); +} + /* * Associate the specified tag with a particular TCP log ID. * Called with INPCB locked. Returns with it unlocked. @@ -565,7 +642,7 @@ tcp_log_set_id(struct tcpcb *tp, char *id) struct tcp_log_id_node *tln; struct inpcb *inp = tptoinpcb(tp); int tree_locked, rv; - bool bucket_locked; + bool bucket_locked, same; tlb = NULL; tln = NULL; @@ -574,17 +651,41 @@ tcp_log_set_id(struct tcpcb *tp, char *id) restart: INP_WLOCK_ASSERT(inp); - /* See if the ID is unchanged. */ - if ((tp->t_lib != NULL && !strcmp(tp->t_lib->tlb_id, id)) || - (tp->t_lib == NULL && *id == 0)) { + same = ((tp->t_lib != NULL && !strcmp(tp->t_lib->tlb_id, id)) || + (tp->t_lib == NULL && *id == 0)); + if (tp->_t_logstate && STAILQ_FIRST(&tp->t_logs) && !same) { + /* + * There are residual logs left we may + * be changing id's so dump what we can. + */ + switch(tp->_t_logstate) { + case TCP_LOG_STATE_HEAD_AUTO: + (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from head at id switch", + M_NOWAIT, false); + break; + case TCP_LOG_STATE_TAIL_AUTO: + (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from tail at id switch", + M_NOWAIT, false); + break; + case TCP_LOG_STATE_CONTINUAL: + (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from continual at id switch", + M_NOWAIT, false); + break; + case TCP_LOG_VIA_BBPOINTS: + (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from bbpoints at id switch", + M_NOWAIT, false); + break; + } + } + if (same) { if (tp->t_lib != NULL) { tcp_log_increment_reqcnt(tp->t_lib); - if ((tp->t_lib->tlb_logstate) && + if ((tp->t_lib->tlb_logstate > TCP_LOG_STATE_OFF) && (tp->t_log_state_set == 0)) { /* Clone in any logging */ - tp->t_logstate = tp->t_lib->tlb_logstate; + tp->_t_logstate = tp->t_lib->tlb_logstate; } if ((tp->t_lib->tlb_loglimit) && (tp->t_log_state_set == 0)) { @@ -873,10 +974,10 @@ refind: SLIST_INSERT_HEAD(&tlb->tlb_head, tln, tln_list); tp->t_lib = tlb; tp->t_lin = tln; - if (tp->t_lib->tlb_logstate) { + if (tp->t_lib->tlb_logstate > TCP_LOG_STATE_OFF) { /* Clone in any logging */ - tp->t_logstate = tp->t_lib->tlb_logstate; + tp->_t_logstate = tp->t_lib->tlb_logstate; } if (tp->t_lib->tlb_loglimit) { /* The loglimit too */ @@ -1189,7 +1290,7 @@ tcp_log_tcpcbinit(struct tcpcb *tp) if ((tcp_log_auto_all == true) && tcp_log_auto_mode && tcp_log_selectauto()) { - tp->t_logstate = tcp_log_auto_mode; + tp->_t_logstate = tcp_log_auto_mode; tp->t_flags2 |= TF2_LOG_AUTO; } } @@ -1325,17 +1426,57 @@ tcp_log_tcpcbfini(struct tcpcb *tp) struct tcp_log_mem *log_entry; sbintime_t callouttime; - INP_WLOCK_ASSERT(tptoinpcb(tp)); - - TCP_LOG_EVENT(tp, NULL, NULL, NULL, TCP_LOG_CONNEND, 0, 0, NULL, false); + INP_WLOCK_ASSERT(tptoinpcb(tp)); +#ifdef TCP_ACCOUNTING + if (tp->_t_logstate) { + struct tcp_log_buffer *lgb; + union tcp_log_stackspecific log; + struct timeval tv; + int i; + + memset(&log, 0, sizeof(log)); + if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { + for (i = 0; itcp_cnt_counters[i]; + } + lgb = tcp_log_event(tp, NULL, + NULL, + NULL, + TCP_LOG_ACCOUNTING, 0, + 0, &log, false, NULL, NULL, 0, &tv); + lgb->tlb_flex1 = TCP_NUM_CNT_COUNTERS; + lgb->tlb_flex2 = 1; + for (i = 0; itcp_proc_time[i]; + } + lgb = tcp_log_event(tp, NULL, + NULL, + NULL, + TCP_LOG_ACCOUNTING, 0, + 0, &log, false, NULL, NULL, 0, &tv); + if (tptoinpcb(tp)->inp_flags2 & INP_MBUF_ACKCMP) + lgb->tlb_flex1 = TCP_NUM_CNT_COUNTERS; + else + lgb->tlb_flex1 = TCP_NUM_PROC_COUNTERS; + lgb->tlb_flex2 = 2; + } + log.u_bbr.timeStamp = tcp_get_usecs(&tv); + log.u_bbr.cur_del_rate = tp->t_end_info; + TCP_LOG_EVENTP(tp, NULL, + NULL, + NULL, + TCP_LOG_CONNEND, 0, + 0, &log, false, &tv); + } +#endif /* * If we were gathering packets to be automatically dumped, try to do * it now. If this succeeds, the log information in the TCPCB will be * cleared. Otherwise, we'll handle the log information as we do * for other states. */ - switch(tp->t_logstate) { + switch(tp->_t_logstate) { case TCP_LOG_STATE_HEAD_AUTO: (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from head", M_NOWAIT, false); @@ -1344,6 +1485,10 @@ tcp_log_tcpcbfini(struct tcpcb *tp) (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from tail", M_NOWAIT, false); break; + case TCP_LOG_VIA_BBPOINTS: + (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from bbpoints", + M_NOWAIT, false); + break; case TCP_LOG_STATE_CONTINUAL: (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from continual", M_NOWAIT, false); @@ -1493,7 +1638,7 @@ tcp_log_tcpcbfini(struct tcpcb *tp) * Change the log state to off (just in case anything tries to sneak * in a last-minute log). */ - tp->t_logstate = TCP_LOG_STATE_OFF; + tp->_t_logstate = TCP_LOG_STATE_OFF; } static void @@ -1510,7 +1655,7 @@ tcp_log_purge_tp_logbuf(struct tcpcb *tp) KASSERT(tp->t_lognum == 0, ("%s: After freeing entries, tp->t_lognum=%d (expected 0)", __func__, tp->t_lognum)); - tp->t_logstate = TCP_LOG_STATE_OFF; + tp->_t_logstate = TCP_LOG_STATE_OFF; } /* @@ -1520,7 +1665,7 @@ tcp_log_purge_tp_logbuf(struct tcpcb *tp) */ struct tcp_log_buffer * -tcp_log_event_(struct tcpcb *tp, struct tcphdr *th, struct sockbuf *rxbuf, +tcp_log_event(struct tcpcb *tp, struct tcphdr *th, struct sockbuf *rxbuf, struct sockbuf *txbuf, uint8_t eventid, int errornum, uint32_t len, union tcp_log_stackspecific *stackinfo, int th_hostorder, const char *output_caller, const char *func, int line, const struct timeval *itv) @@ -1547,13 +1692,14 @@ tcp_log_event_(struct tcpcb *tp, struct tcphdr *th, struct sockbuf *rxbuf, tcp_log_purge_tp_logbuf(tp); return (NULL); } - KASSERT(tp->t_logstate == TCP_LOG_STATE_HEAD || - tp->t_logstate == TCP_LOG_STATE_TAIL || - tp->t_logstate == TCP_LOG_STATE_CONTINUAL || - tp->t_logstate == TCP_LOG_STATE_HEAD_AUTO || - tp->t_logstate == TCP_LOG_STATE_TAIL_AUTO, - ("%s called with unexpected tp->t_logstate (%d)", __func__, - tp->t_logstate)); + KASSERT(tp->_t_logstate == TCP_LOG_STATE_HEAD || + tp->_t_logstate == TCP_LOG_STATE_TAIL || + tp->_t_logstate == TCP_LOG_STATE_CONTINUAL || + tp->_t_logstate == TCP_LOG_STATE_HEAD_AUTO || + tp->_t_logstate == TCP_LOG_VIA_BBPOINTS || + tp->_t_logstate == TCP_LOG_STATE_TAIL_AUTO, + ("%s called with unexpected tp->_t_logstate (%d)", __func__, + tp->_t_logstate)); /* * Get the serial number. We do this early so it will @@ -1589,7 +1735,7 @@ retry: "to set tp %p to TCP_LOG_STATE_CLEAR", __func__, __LINE__, tp); #endif - tp->t_logstate = TCP_LOG_STATE_OFF; + tp->_t_logstate = TCP_LOG_STATE_OFF; } return (NULL); } @@ -1598,12 +1744,12 @@ retry: * the buffers. If successful, deactivate tracing. Otherwise, * leave it active so we will retry. */ - if (tp->t_logstate == TCP_LOG_STATE_HEAD_AUTO && + if (tp->_t_logstate == TCP_LOG_STATE_HEAD_AUTO && !tcp_log_dump_tp_logbuf(tp, "auto-dumped from head", M_NOWAIT, false)) { - tp->t_logstate = TCP_LOG_STATE_OFF; + tp->_t_logstate = TCP_LOG_STATE_OFF; return(NULL); - } else if ((tp->t_logstate == TCP_LOG_STATE_CONTINUAL) && + } else if ((tp->_t_logstate == TCP_LOG_STATE_CONTINUAL) && !tcp_log_dump_tp_logbuf(tp, "auto-dumped from continual", M_NOWAIT, false)) { if (attempt_count == 0) { @@ -1614,15 +1760,26 @@ retry: counter_u64_add(tcp_log_que_fail4, 1); #endif return(NULL); - } else if (tp->t_logstate == TCP_LOG_STATE_HEAD_AUTO) + + } else if ((tp->_t_logstate == TCP_LOG_VIA_BBPOINTS) && + !tcp_log_dump_tp_logbuf(tp, "auto-dumped from bbpoints", + M_NOWAIT, false)) { + if (attempt_count == 0) { + attempt_count++; + goto retry; + } +#ifdef TCPLOG_DEBUG_COUNTERS + counter_u64_add(tcp_log_que_fail4, 1); +#endif + return(NULL); + } else if (tp->_t_logstate == TCP_LOG_STATE_HEAD_AUTO) return(NULL); /* If in HEAD state, just deactivate the tracing and return. */ - if (tp->t_logstate == TCP_LOG_STATE_HEAD) { - tp->t_logstate = TCP_LOG_STATE_OFF; + if (tp->_t_logstate == TCP_LOG_STATE_HEAD) { + tp->_t_logstate = TCP_LOG_STATE_OFF; return(NULL); } - /* * Get a buffer to reuse. If that fails, just give up. * (We can't log anything without a buffer in which to @@ -1647,7 +1804,7 @@ retry: /* Basic entries. */ if (itv == NULL) - getmicrouptime(&log_buf->tlb_tv); + microuptime(&log_buf->tlb_tv); else memcpy(&log_buf->tlb_tv, itv, sizeof(struct timeval)); log_buf->tlb_ticks = ticks; @@ -1663,12 +1820,18 @@ retry: log_buf->tlb_rxbuf.tls_sb_acc = rxbuf->sb_acc; log_buf->tlb_rxbuf.tls_sb_ccc = rxbuf->sb_ccc; log_buf->tlb_rxbuf.tls_sb_spare = 0; + } else { + log_buf->tlb_rxbuf.tls_sb_acc = 0; + log_buf->tlb_rxbuf.tls_sb_ccc = 0; } if (txbuf != NULL) { log_buf->tlb_eventflags |= TLB_FLAG_TXBUF; log_buf->tlb_txbuf.tls_sb_acc = txbuf->sb_acc; log_buf->tlb_txbuf.tls_sb_ccc = txbuf->sb_ccc; log_buf->tlb_txbuf.tls_sb_spare = 0; + } else { + log_buf->tlb_txbuf.tls_sb_acc = 0; + log_buf->tlb_txbuf.tls_sb_ccc = 0; } /* Copy values from tp to the log entry. */ #define COPY_STAT(f) log_buf->tlb_ ## f = tp->f @@ -1700,8 +1863,6 @@ retry: COPY_STAT_T(fbyte_out); #undef COPY_STAT #undef COPY_STAT_T - log_buf->tlb_flex1 = 0; - log_buf->tlb_flex2 = 0; /* Copy stack-specific info. */ if (stackinfo != NULL) { memcpy(&log_buf->tlb_stackinfo, stackinfo, @@ -1721,6 +1882,8 @@ retry: optlen = (th->th_off << 2) - sizeof (struct tcphdr); if (optlen > 0) memcpy(log_buf->tlb_opts, th + 1, optlen); + } else { + memset(&log_buf->tlb_th, 0, sizeof(*th)); } /* Verbose information */ @@ -1749,8 +1912,10 @@ int tcp_log_state_change(struct tcpcb *tp, int state) { struct tcp_log_mem *log_entry; + int rv; INP_WLOCK_ASSERT(tptoinpcb(tp)); + rv = 0; switch(state) { case TCP_LOG_STATE_CLEAR: while ((log_entry = STAILQ_FIRST(&tp->t_logs)) != NULL) @@ -1758,15 +1923,27 @@ tcp_log_state_change(struct tcpcb *tp, int state) /* Fall through */ case TCP_LOG_STATE_OFF: - tp->t_logstate = TCP_LOG_STATE_OFF; + tp->_t_logstate = TCP_LOG_STATE_OFF; break; case TCP_LOG_STATE_TAIL: case TCP_LOG_STATE_HEAD: case TCP_LOG_STATE_CONTINUAL: + case TCP_LOG_VIA_BBPOINTS: case TCP_LOG_STATE_HEAD_AUTO: case TCP_LOG_STATE_TAIL_AUTO: - tp->t_logstate = state; + /* + * When the RATIO_OFF state is set for the bucket, the log ID + * this tp is associated with has been probabilistically opted + * out of logging per tcp_log_apply_ratio(). + */ + if (tp->t_lib == NULL || + tp->t_lib->tlb_logstate != TCP_LOG_STATE_RATIO_OFF) { + tp->_t_logstate = state; + } else { + rv = ECANCELED; + tp->_t_logstate = TCP_LOG_STATE_OFF; + } break; default: @@ -1774,11 +1951,12 @@ tcp_log_state_change(struct tcpcb *tp, int state) } if (tcp_disable_all_bb_logs) { /* We are prohibited from doing any logs */ - tp->t_logstate = TCP_LOG_STATE_OFF; + tp->_t_logstate = TCP_LOG_STATE_OFF; + rv = EBUSY; } tp->t_flags2 &= ~(TF2_LOG_AUTO); - return (0); + return (rv); } /* If tcp_drain() is called, flush half the log entries. */ @@ -1792,13 +1970,26 @@ tcp_log_drain(struct tcpcb *tp) if ((target = tp->t_lognum / 2) == 0) return; + /* + * XXXRRS: At this I don't think this is wise that + * we do this. All that a drain call means is that + * we are hitting one of the system mbuf limits. BB + * logging, or freeing of them, will not create any + * more mbufs and really has nothing to do with + * the system running out of mbufs. For now I + * am changing this to free any "AUTO" by dumping + * them out. But this should either be changed + * so that it gets called when we hit the BB limit + * or it should just not get called (one of the two) + * since I don't think the mbuf <-> BB log cleanup + * is the right thing to do here. + */ /* * If we are logging the "head" packets, we want to discard * from the tail of the queue. Otherwise, we want to discard * from the head. */ - if (tp->t_logstate == TCP_LOG_STATE_HEAD || - tp->t_logstate == TCP_LOG_STATE_HEAD_AUTO) { + if (tp->_t_logstate == TCP_LOG_STATE_HEAD) { skip = tp->t_lognum - target; STAILQ_FOREACH(log_entry, &tp->t_logs, tlm_queue) if (!--skip) @@ -1818,7 +2009,16 @@ tcp_log_drain(struct tcpcb *tp) KASSERT(target == 0, ("%s: After removing from tail, target was %d", __func__, target)); - } else if (tp->t_logstate == TCP_LOG_STATE_CONTINUAL) { + } else if (tp->_t_logstate == TCP_LOG_STATE_HEAD_AUTO) { + (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from head at drain", + M_NOWAIT, false); + } else if (tp->_t_logstate == TCP_LOG_STATE_TAIL_AUTO) { + (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from tail at drain", + M_NOWAIT, false); + } else if (tp->_t_logstate == TCP_LOG_VIA_BBPOINTS) { + (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from bbpoints", + M_NOWAIT, false); + } else if (tp->_t_logstate == TCP_LOG_STATE_CONTINUAL) { (void)tcp_log_dump_tp_logbuf(tp, "auto-dumped from continual", M_NOWAIT, false); } else { @@ -2181,7 +2381,7 @@ tcp_log_dump_tp_logbuf(struct tcpcb *tp, char *reason, int how, bool force) KASSERT(tp->t_lognum == 0, ("%s: After freeing entries, tp->t_lognum=%d (expected 0)", __func__, tp->t_lognum)); - tp->t_logstate = TCP_LOG_STATE_OFF; + tp->_t_logstate = TCP_LOG_STATE_OFF; return (0); } @@ -2632,9 +2832,47 @@ tcp_log_dump_tp_bucket_logbufs(struct tcpcb *tp, char *reason) void tcp_log_flowend(struct tcpcb *tp) { - if (tp->t_logstate != TCP_LOG_STATE_OFF) { + if (tp->_t_logstate != TCP_LOG_STATE_OFF) { struct socket *so = tptosocket(tp); TCP_LOG_EVENT(tp, NULL, &so->so_rcv, &so->so_snd, TCP_LOG_FLOWEND, 0, 0, NULL, false); } } + +void +tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags) +{ + struct inpcb *inp; + struct tcpcb *tp; + + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("tcp_log_sendfile: inp == NULL")); + + /* quick check to see if logging is enabled for this connection */ + tp = intotcpcb(inp); + if ((inp->inp_flags & INP_DROPPED) || + (tp->_t_logstate == TCP_LOG_STATE_OFF)) { + return; + } + + INP_WLOCK(inp); + /* double check log state now that we have the lock */ + if (inp->inp_flags & INP_DROPPED) + goto done; + if (tp->_t_logstate != TCP_LOG_STATE_OFF) { + struct timeval tv; + tcp_log_eventspecific_t log; + + microuptime(&tv); + log.u_sf.offset = offset; + log.u_sf.length = nbytes; + log.u_sf.flags = flags; + + TCP_LOG_EVENTP(tp, NULL, + &tptosocket(tp)->so_rcv, + &tptosocket(tp)->so_snd, + TCP_LOG_SENDFILE, 0, 0, &log, false, &tv); + } +done: + INP_WUNLOCK(inp); +} diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index f82d2bf3a9b3..2b708c6545ce 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2016-2018 Netflix, Inc. + * Copyright (c) 2016-2020 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -101,13 +101,42 @@ struct tcp_log_bbr { uint32_t pkt_epoch; }; -/* Per-stack stack-specific info. */ +/* shadows tcp_log_bbr struct element sizes */ +struct tcp_log_raw { + uint64_t u64_flex[4]; + uint32_t u32_flex[14]; + uint16_t u16_flex[3]; + uint8_t u8_flex[6]; + uint32_t u32_flex2[1]; +}; + +struct tcp_log_uint64 { + uint64_t u64_flex[13]; +}; + +struct tcp_log_sendfile { + uint64_t offset; + uint64_t length; + uint32_t flags; +}; + +/* + * tcp_log_stackspecific is currently being used as "event specific" log + * info by all stacks (i.e. struct tcp_log_bbr is used for generic event + * logging). Until this is cleaned up more generically and throughout, + * allow events to use the same space in the union. + */ union tcp_log_stackspecific { struct tcp_log_rack u_rack; struct tcp_log_bbr u_bbr; + struct tcp_log_sendfile u_sf; + struct tcp_log_raw u_raw; /* "raw" log access */ + struct tcp_log_uint64 u64_raw; /* just u64's - used by process info */ }; +typedef union tcp_log_stackspecific tcp_log_eventspecific_t; + struct tcp_log_buffer { /* Event basics */ @@ -156,7 +185,6 @@ struct tcp_log_buffer uint8_t tlb_snd_scale:4, /* TCPCB snd_scale */ tlb_rcv_scale:4; /* TCPCB rcv_scale */ uint8_t _pad[3]; /* Padding */ - /* Per-stack info */ union tcp_log_stackspecific tlb_stackinfo; #define tlb_rack tlb_stackinfo.u_rack @@ -245,8 +273,14 @@ enum tcp_log_events { }; enum tcp_log_states { - TCP_LOG_STATE_CLEAR = -1, /* Deactivate and clear tracing */ + TCP_LOG_STATE_RATIO_OFF = -2, /* Log ratio evaluation yielded an OFF + result. Only used for tlb_logstate */ + TCP_LOG_STATE_CLEAR = -1, /* Deactivate and clear tracing. Passed + to tcp_log_state_change() but never + stored in any logstate variable */ TCP_LOG_STATE_OFF = 0, /* Pause */ + + /* Positively numbered states represent active logging modes */ TCP_LOG_STATE_TAIL=1, /* Keep the trailing events */ TCP_LOG_STATE_HEAD=2, /* Keep the leading events */ TCP_LOG_STATE_HEAD_AUTO=3, /* Keep the leading events, and @@ -256,6 +290,7 @@ enum tcp_log_states { TCP_LOG_STATE_TAIL_AUTO=5, /* Keep the trailing events, and automatically dump them when the session ends */ + TCP_LOG_VIA_BBPOINTS=6 /* Log only if the BB point has been configured */ }; /* Use this if we don't know whether the operation succeeded. */ @@ -298,8 +333,136 @@ struct tcp_log_dev_log_queue { #endif /* _KERNEL */ #endif /* __tcp_log_dev_h__ */ +/* + * Defined BBPOINTS that can be used + * with TCP_LOG_VIA_BBPOINTS. + */ +#define TCP_BBPOINT_NONE 0 +#define TCP_BBPOINT_REQ_LEVEL_LOGGING 1 + +/*********************/ +/* TCP Trace points */ +/*********************/ +/* + * TCP trace points are interesting points within + * the TCP code that the author/debugger may want + * to have BB logging enabled if we hit that point. + * In order to enable a trace point you set the + * sysctl var net.inet.tcp.bb.tp.number to + * one of the numbers listed below. You also + * must make sure net.inet.tcp.bb.tp.bbmode is + * non-zero, the default is 4 for continuous tracing. + * You also set in the number of connections you want + * have get BB logs in net.inet.tcp.bb.tp.count. + * + * Count will decrement every time BB logging is assigned + * to a connection that hit your tracepoint. + * + * You can enable all trace points by setting the number + * to 0xffffffff. You can disable all trace points by + * setting number to zero (or count to 0). + * + * Below are the enumerated list of tracepoints that + * have currently been defined in the code. Add more + * as you add a call to rack_trace_point(rack, ); + * where is defined below. + */ +#define TCP_TP_HWENOBUF 0x00000001 /* When we are doing hardware pacing and hit enobufs */ +#define TCP_TP_ENOBUF 0x00000002 /* When we hit enobufs with software pacing */ +#define TCP_TP_COLLAPSED_WND 0x00000003 /* When a peer to collapses its rwnd on us */ +#define TCP_TP_COLLAPSED_RXT 0x00000004 /* When we actually retransmit a collapsed window rsm */ +#define TCP_TP_HTTP_LOG_FAIL 0x00000005 /* We tried to allocate a HTTP log but had no space */ +#define TCP_TP_RESET_RCV 0x00000006 /* Triggers when we receive a RST */ +#define TCP_TP_EXCESS_RXT 0x00000007 /* When we get excess RXT's clamping the cwnd */ +#define TCP_TP_SAD_TRIGGERED 0x00000008 /* Sack Attack Detection triggers */ + +#define TCP_TP_SAD_SUSPECT 0x0000000a /* A sack has supicious information in it */ + #ifdef _KERNEL +extern uint32_t tcp_trace_point_config; +extern uint32_t tcp_trace_point_bb_mode; +extern int32_t tcp_trace_point_count; + +/* + * Returns true if any sort of BB logging is enabled, + * commonly used throughout the codebase. + */ +static inline int +tcp_bblogging_on(struct tcpcb *tp) +{ + if (tp->_t_logstate <= TCP_LOG_STATE_OFF) + return (0); + if (tp->_t_logstate == TCP_LOG_VIA_BBPOINTS) + return (0); + return (1); +} + +/* + * Returns true if we match a specific bbpoint when + * in TCP_LOG_VIA_BBPOINTS, but also returns true + * for all the other logging states. + */ +static inline int +tcp_bblogging_point_on(struct tcpcb *tp, uint8_t bbpoint) +{ + if (tp->_t_logstate <= TCP_LOG_STATE_OFF) + return (0); + if ((tp->_t_logstate == TCP_LOG_VIA_BBPOINTS) && + (tp->_t_logpoint == bbpoint)) + return (1); + else if (tp->_t_logstate == TCP_LOG_VIA_BBPOINTS) + return (0); + return (1); +} + +static inline void +tcp_set_bblog_state(struct tcpcb *tp, uint8_t ls, uint8_t bbpoint) +{ + if ((ls == TCP_LOG_VIA_BBPOINTS) && + (tp->_t_logstate <= TCP_LOG_STATE_OFF)){ + /* + * We don't allow a BBPOINTS set to override + * other types of BB logging set by other means such + * as the bb_ratio/bb_state URL parameters. In other + * words BBlogging must be *off* in order to turn on + * a BBpoint. + */ + tp->_t_logpoint = bbpoint; + tp->_t_logstate = ls; + } else if (ls != TCP_LOG_VIA_BBPOINTS) { + tp->_t_logpoint = 0; + if ((ls >= TCP_LOG_STATE_OFF) && + (ls < TCP_LOG_VIA_BBPOINTS)) + tp->_t_logstate = ls; + } +} + +static inline uint32_t +tcp_get_bblog_state(struct tcpcb *tp) +{ + return (tp->_t_logstate); +} + +static inline void +tcp_trace_point(struct tcpcb *tp, int num) +{ + if (((tcp_trace_point_config == num) || + (tcp_trace_point_config == 0xffffffff)) && + (tcp_trace_point_bb_mode != 0) && + (tcp_trace_point_count > 0) && + (tcp_bblogging_on(tp) == 0)) { + int res; + res = atomic_fetchadd_int(&tcp_trace_point_count, -1); + if (res > 0) { + tcp_set_bblog_state(tp, tcp_trace_point_bb_mode, TCP_BBPOINT_NONE); + } else { + /* Loss a race assure its zero now */ + tcp_trace_point_count = 0; + } + } +} + #define TCP_LOG_BUF_DEFAULT_SESSION_LIMIT 5000 #define TCP_LOG_BUF_DEFAULT_GLOBAL_LIMIT 5000000 @@ -309,15 +472,51 @@ struct tcp_log_dev_log_queue { */ #define TCP_LOG_EVENT_VERBOSE(tp, th, rxbuf, txbuf, eventid, errornum, len, stackinfo, th_hostorder, tv) \ do { \ - if (tp->t_logstate != TCP_LOG_STATE_OFF) \ - tcp_log_event_(tp, th, rxbuf, txbuf, eventid, \ + if (tcp_bblogging_on(tp)) \ + tcp_log_event(tp, th, rxbuf, txbuf, eventid, \ errornum, len, stackinfo, th_hostorder, \ tp->t_output_caller, __func__, __LINE__, tv);\ } while (0) *** 1563 LINES SKIPPED *** From nobody Thu Mar 16 16:44:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctQw3c2kz3yK6w; Thu, 16 Mar 2023 16:44: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 4PctQw33Ryz3lZt; Thu, 16 Mar 2023 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OKd9TMSsSIY+xLSbk3c/Snjm/sDuvuULpDPjD784eHg=; b=PYi9sGpiCaaHRd83Q2nNdA35pMWWDhyEnWLosvXapKpbtLCpDl0NTbyA20VGZgwSR0Nk56 5yRch3ZszLENF3FkCAmnupvVG33q8Rva9S3frC6Azsj01Q/R3MV85UXz+aBCxKPrre1s6p PU9YLj9q6XngcaWUrFJ3mOG/oaB/CmKdojSVWUVyeYERZcu+YftQ+xiIePSM5swencaRMG kJQyOC6dL6gxtEJwL+C2zbqR+j/48kU0s18CYyw8FGR/fLmghHhAysgQm59nr7T+0H+0wQ C7G7Zk8BhZCueEufY7DlvtPfCldSVhl774tGA1jwhZf+aO1xmmg4nDj4sSDTmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OKd9TMSsSIY+xLSbk3c/Snjm/sDuvuULpDPjD784eHg=; b=l0QhAheifHcGWf5EknBNSbqiH8S7BXEQmEpB9tti3DUaY1hi9Up/Ars6IgvFIk5ZRuERHF ZSrlBwuvL8Nuq2wmRVnOlRr+XKktxgqPYx/S9b+rH/mK6fcsT2bZoCQWSV9Q+sQ7WIXAwR h4Km/pzrrmuHkyF1/ESmbcBwjDKwse1A44bXdIlhw4LTg/Bu4eDgaMQzHvp6dek4vwaUht bBZYxrS1+eSWBTwbnG4bEWNonTzYuDaAoDzW+nf4hVsip4QCoFGXTpi6l+XalZTha3yfV8 WGJuAzgkxei3sj09SSxqNHi5rVtN4fownX1h4XJdbwZCvwphtglNMcyWFHF9HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985096; a=rsa-sha256; cv=none; b=FzYI2BNBToD9FYjvQwxz5O/GJQJlTnCLS2iWXZLwNYXeWxonp1mVJ0wPzWhAtbuzyGy7FC /wx4ZXVTJm6IN3Uhh0uXYtBdKl2JwZIKGMCZz3Mxwz+h0ZH2OPtPs9chb0sjdDGGzZ76ti 5W4xrnuG6wB6ydKcuUmScIci92PWoDHhLPjhRXVai9ziPWMXIsrFOZ/Juc3bF4FGJOYrIg LfHgm70bRz0qnSKGRXNVXnwp3U6BlMFrFP6hfLl+cMzGKEDdPALlMZX7xUasiEbneI50r3 rGsTIiqeXdB4ObVVnFEh/7JAA4DjguHyXpIbjF6wtOGnPD9K8XWoUHik4I5nyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctQw26Q3zqg2; Thu, 16 Mar 2023 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGiuvU021905; Thu, 16 Mar 2023 16:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGiuX5021904; Thu, 16 Mar 2023 16:44:56 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:44:56 GMT Message-Id: <202303161644.32GGiuX5021904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 8ed1e2c88012 - main - sctp: enforce Kahn's rule during the handshake List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ed1e2c88012cfca9fc4131a2637452cc9106b81 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed1e2c88012cfca9fc4131a2637452cc9106b81 commit 8ed1e2c88012cfca9fc4131a2637452cc9106b81 Author: Michael Tuexen AuthorDate: 2023-03-16 16:40:40 +0000 Commit: Michael Tuexen CommitDate: 2023-03-16 16:40:40 +0000 sctp: enforce Kahn's rule during the handshake Don't take RTT measurements on packets containing INIT or COOKIE-ECHO chunks, when they were retransmitted. MFC after: 1 week --- sys/netinet/sctp_input.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 3da483bdf37a..f01c1fe710e4 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -508,8 +508,6 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, SCTP_FROM_SCTP_INPUT, __LINE__); } - stcb->asoc.overall_error_count = 0; - net->error_count = 0; /* * Cancel the INIT timer, We do this first before queueing the @@ -521,8 +519,12 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); /* calculate the RTO */ - sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, - SCTP_RTT_FROM_NON_DATA); + if (asoc->overall_error_count == 0) { + sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, + SCTP_RTT_FROM_NON_DATA); + } + stcb->asoc.overall_error_count = 0; + net->error_count = 0; retval = sctp_send_cookie_echo(m, offset, initack_limit, stcb, net); return (retval); } @@ -2758,7 +2760,6 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp SCTP_UNUSED, SCTP_FROM_SCTP_INPUT, __LINE__); } - asoc->overall_error_count = 0; sctp_stop_all_cookie_timers(stcb); /* process according to association state */ if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { @@ -2777,6 +2778,12 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp SCTP_UNUSED, sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); } + /* + * Since we did not send a HB make sure we don't double + * things. + */ + asoc->overall_error_count = 0; + net->hb_responded = 1; (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || @@ -2786,11 +2793,6 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp SCTP_UNUSED, soisconnected(stcb->sctp_socket); } } - /* - * since we did not send a HB make sure we don't double - * things - */ - net->hb_responded = 1; if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { /* From nobody Thu Mar 16 16:46:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctSG3sJYz3yK7W; Thu, 16 Mar 2023 16:46: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 4PctSG28tqz3n4y; Thu, 16 Mar 2023 16:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXyX2jCaNGMMysY4BrHx6BOk81R+FsAC/P0MyWX4VBc=; b=M61DacWH9D7WKHUV18pT8hsQDFfIj4YY7ODARjuiqXB+aKyc4RKuKtWCa2GpedeY6RnA72 rL7jcis5fJ09lhcGmJdzKJdOMTsIUinw7bqBPZjCFFlWVDl+yuRm+7zWX/BIJif2l/ud3w M7aYK1Ro5yFLFaW6gh2tsWpjl62pWv2oJDCEmf7gJBLtmpsQynkeLaR+k/eDMr/J/DrUXg UUkNcBTr9xFZlUDOio7hgRubctYS9tRPaejNEdrQsCSMnyjWjeGDSdmtpzowpSDXZiH9Ul UWBc+jU0PpnfY0Oy8Pz6yUXZnr29YM0bonVSnCLziCufi8VhCbGeQyHal2CPPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXyX2jCaNGMMysY4BrHx6BOk81R+FsAC/P0MyWX4VBc=; b=X816o9d9Iy+Q6aAVXjzowePhKWgabh9MBl42wuwObNQLSoLRbLhRjKujecQtlBt1MxDTIY Kw15m/yoND/lBbPvMdbRfrsmJ1Ou2LkF1TTDsERt393sr+QCpbHXYIu151Uci6BClFSbmC AqKlvF7TqAKT4l8qDEZ6Q8hKhsgyyb+igJMf1iO+J8udIwmlgv6wlb0IJdzBUnbqCwK4hV 3NHl754/N/EO6/Sw62e0iumyObpPoecWIEaaHp92VuQQlZxe7axHqfjIPFiqodY1xTRzhh 5Czj6NHbMJUVsfWfgQJ4EM+gbc3Xtc49F/5UQLpQw4UjOlErGN+0lmn0nFDmIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985166; a=rsa-sha256; cv=none; b=Y6+nW+a9iVYtuhxC5r9EgMA09S25J3BkKa5becA1AhE/WIZCe9fU7SE0rMhm6YaYq9bA3m Yx9COA566Z+F4VKbt1P5F8Lcpl7MdGPfTn4mCfE2QwUTl2lRzkfpvz6+a5bfiSTcCz32zK qv1Tei/upGNiuehN2SW2b6OBLPxZjEVVO12sHQAGE1OAbuzA2a/dMMXh5CLvLE5FyYwIjM 3f+rcxgvArnYmj5Fu51vjfwUv99PxUjoz1oyCZK8CbiHQEGq4gPM+7etH4m843LErNiJ64 mCXq4U0btiQQ8clLjLlxN+MgRyYI1ujsHULNkNKULJYZ4mRKS4G1cUnotmi/tQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctSG1Fxnzr6F; Thu, 16 Mar 2023 16:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGk64e022168; Thu, 16 Mar 2023 16:46:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGk69O022167; Thu, 16 Mar 2023 16:46:06 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:46:06 GMT Message-Id: <202303161646.32GGk69O022167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 83fb1bdbfe53 - main - Rename smmu pmap functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83fb1bdbfe539973ee08662d140f453aa9218847 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=83fb1bdbfe539973ee08662d140f453aa9218847 commit 83fb1bdbfe539973ee08662d140f453aa9218847 Author: Andrew Turner AuthorDate: 2023-03-16 15:34:48 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 16:45:42 +0000 Rename smmu pmap functions These are SMMU (and MALI GPU) specific. Give them a SMMU specific name. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38948 --- sys/arm64/iommu/iommu_pmap.c | 231 ++++++++++++++++++++++--------------------- sys/arm64/iommu/iommu_pmap.h | 10 +- sys/arm64/iommu/iommu_pte.h | 5 - sys/arm64/iommu/smmu.c | 10 +- 4 files changed, 129 insertions(+), 127 deletions(-) diff --git a/sys/arm64/iommu/iommu_pmap.c b/sys/arm64/iommu/iommu_pmap.c index 5f3873044f02..80a0515a0c2c 100644 --- a/sys/arm64/iommu/iommu_pmap.c +++ b/sys/arm64/iommu/iommu_pmap.c @@ -71,16 +71,21 @@ __FBSDID("$FreeBSD$"); #define NUL1E (NUL0E * NL1PG) #define NUL2E (NUL1E * NL2PG) -#define iommu_l0_pindex(v) (NUL2E + NUL1E + ((v) >> IOMMU_L0_SHIFT)) -#define iommu_l1_pindex(v) (NUL2E + ((v) >> IOMMU_L1_SHIFT)) -#define iommu_l2_pindex(v) ((v) >> IOMMU_L2_SHIFT) +#define smmu_l0_pindex(v) (NUL2E + NUL1E + ((v) >> IOMMU_L0_SHIFT)) +#define smmu_l1_pindex(v) (NUL2E + ((v) >> IOMMU_L1_SHIFT)) +#define smmu_l2_pindex(v) ((v) >> IOMMU_L2_SHIFT) + +#define smmu_l0_index(va) (((va) >> IOMMU_L0_SHIFT) & IOMMU_L0_ADDR_MASK) +#define smmu_l1_index(va) (((va) >> IOMMU_L1_SHIFT) & IOMMU_Ln_ADDR_MASK) +#define smmu_l2_index(va) (((va) >> IOMMU_L2_SHIFT) & IOMMU_Ln_ADDR_MASK) +#define smmu_l3_index(va) (((va) >> IOMMU_L3_SHIFT) & IOMMU_Ln_ADDR_MASK) /* This code assumes all L1 DMAP entries will be used */ CTASSERT((DMAP_MIN_ADDRESS & ~IOMMU_L0_OFFSET) == DMAP_MIN_ADDRESS); CTASSERT((DMAP_MAX_ADDRESS & ~IOMMU_L0_OFFSET) == DMAP_MAX_ADDRESS); static vm_page_t _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex); -static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, +static void _smmu_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); /* @@ -88,48 +93,48 @@ static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, * They need to be atomic as the System MMU may write to the table at * the same time as the CPU. */ -#define pmap_load(table) (*table) -#define pmap_clear(table) atomic_store_64(table, 0) -#define pmap_store(table, entry) atomic_store_64(table, entry) +#define smmu_pmap_load(table) (*table) +#define smmu_pmap_clear(table) atomic_store_64(table, 0) +#define smmu_pmap_store(table, entry) atomic_store_64(table, entry) /********************/ /* Inline functions */ /********************/ static __inline pd_entry_t * -pmap_l0(pmap_t pmap, vm_offset_t va) +smmu_pmap_l0(pmap_t pmap, vm_offset_t va) { - return (&pmap->pm_l0[iommu_l0_index(va)]); + return (&pmap->pm_l0[smmu_l0_index(va)]); } static __inline pd_entry_t * -pmap_l0_to_l1(pd_entry_t *l0, vm_offset_t va) +smmu_pmap_l0_to_l1(pd_entry_t *l0, vm_offset_t va) { pd_entry_t *l1; - l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); - return (&l1[iommu_l1_index(va)]); + l1 = (pd_entry_t *)PHYS_TO_DMAP(smmu_pmap_load(l0) & ~ATTR_MASK); + return (&l1[smmu_l1_index(va)]); } static __inline pd_entry_t * -pmap_l1(pmap_t pmap, vm_offset_t va) +smmu_pmap_l1(pmap_t pmap, vm_offset_t va) { pd_entry_t *l0; - l0 = pmap_l0(pmap, va); - if ((pmap_load(l0) & ATTR_DESCR_MASK) != IOMMU_L0_TABLE) + l0 = smmu_pmap_l0(pmap, va); + if ((smmu_pmap_load(l0) & ATTR_DESCR_MASK) != IOMMU_L0_TABLE) return (NULL); - return (pmap_l0_to_l1(l0, va)); + return (smmu_pmap_l0_to_l1(l0, va)); } static __inline pd_entry_t * -pmap_l1_to_l2(pd_entry_t *l1p, vm_offset_t va) +smmu_pmap_l1_to_l2(pd_entry_t *l1p, vm_offset_t va) { pd_entry_t l1, *l2p; - l1 = pmap_load(l1p); + l1 = smmu_pmap_load(l1p); /* * The valid bit may be clear if pmap_update_entry() is concurrently @@ -140,28 +145,28 @@ pmap_l1_to_l2(pd_entry_t *l1p, vm_offset_t va) KASSERT((l1 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE, ("%s: L1 entry %#lx for %#lx is a leaf", __func__, l1, va)); l2p = (pd_entry_t *)PHYS_TO_DMAP(l1 & ~ATTR_MASK); - return (&l2p[iommu_l2_index(va)]); + return (&l2p[smmu_l2_index(va)]); } static __inline pd_entry_t * -pmap_l2(pmap_t pmap, vm_offset_t va) +smmu_pmap_l2(pmap_t pmap, vm_offset_t va) { pd_entry_t *l1; - l1 = pmap_l1(pmap, va); - if ((pmap_load(l1) & ATTR_DESCR_MASK) != IOMMU_L1_TABLE) + l1 = smmu_pmap_l1(pmap, va); + if ((smmu_pmap_load(l1) & ATTR_DESCR_MASK) != IOMMU_L1_TABLE) return (NULL); - return (pmap_l1_to_l2(l1, va)); + return (smmu_pmap_l1_to_l2(l1, va)); } static __inline pt_entry_t * -pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va) +smmu_pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va) { pd_entry_t l2; pt_entry_t *l3p; - l2 = pmap_load(l2p); + l2 = smmu_pmap_load(l2p); /* * The valid bit may be clear if pmap_update_entry() is concurrently @@ -172,7 +177,7 @@ pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va) KASSERT((l2 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE, ("%s: L2 entry %#lx for %#lx is a leaf", __func__, l2, va)); l3p = (pt_entry_t *)PHYS_TO_DMAP(l2 & ~ATTR_MASK); - return (&l3p[iommu_l3_index(va)]); + return (&l3p[smmu_l3_index(va)]); } /* @@ -180,26 +185,26 @@ pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va) * The next level may or may not point to a valid page or block. */ static __inline pd_entry_t * -pmap_pde(pmap_t pmap, vm_offset_t va, int *level) +smmu_pmap_pde(pmap_t pmap, vm_offset_t va, int *level) { pd_entry_t *l0, *l1, *l2, desc; - l0 = pmap_l0(pmap, va); - desc = pmap_load(l0) & ATTR_DESCR_MASK; + l0 = smmu_pmap_l0(pmap, va); + desc = smmu_pmap_load(l0) & ATTR_DESCR_MASK; if (desc != IOMMU_L0_TABLE) { *level = -1; return (NULL); } - l1 = pmap_l0_to_l1(l0, va); - desc = pmap_load(l1) & ATTR_DESCR_MASK; + l1 = smmu_pmap_l0_to_l1(l0, va); + desc = smmu_pmap_load(l1) & ATTR_DESCR_MASK; if (desc != IOMMU_L1_TABLE) { *level = 0; return (l0); } - l2 = pmap_l1_to_l2(l1, va); - desc = pmap_load(l2) & ATTR_DESCR_MASK; + l2 = smmu_pmap_l1_to_l2(l1, va); + desc = smmu_pmap_load(l2) & ATTR_DESCR_MASK; if (desc != IOMMU_L2_TABLE) { *level = 1; return (l1); @@ -215,17 +220,17 @@ pmap_pde(pmap_t pmap, vm_offset_t va, int *level) * the first invalid level. */ static __inline pt_entry_t * -pmap_pte(pmap_t pmap, vm_offset_t va, int *level) +smmu_pmap_pte(pmap_t pmap, vm_offset_t va, int *level) { pd_entry_t *l1, *l2, desc; pt_entry_t *l3; - l1 = pmap_l1(pmap, va); + l1 = smmu_pmap_l1(pmap, va); if (l1 == NULL) { *level = 0; return (NULL); } - desc = pmap_load(l1) & ATTR_DESCR_MASK; + desc = smmu_pmap_load(l1) & ATTR_DESCR_MASK; if (desc == IOMMU_L1_BLOCK) { *level = 1; return (l1); @@ -236,8 +241,8 @@ pmap_pte(pmap_t pmap, vm_offset_t va, int *level) return (NULL); } - l2 = pmap_l1_to_l2(l1, va); - desc = pmap_load(l2) & ATTR_DESCR_MASK; + l2 = smmu_pmap_l1_to_l2(l1, va); + desc = smmu_pmap_load(l2) & ATTR_DESCR_MASK; if (desc == IOMMU_L2_BLOCK) { *level = 2; return (l2); @@ -249,15 +254,15 @@ pmap_pte(pmap_t pmap, vm_offset_t va, int *level) } *level = 3; - l3 = pmap_l2_to_l3(l2, va); - if ((pmap_load(l3) & ATTR_DESCR_MASK) != IOMMU_L3_PAGE) + l3 = smmu_pmap_l2_to_l3(l2, va); + if ((smmu_pmap_load(l3) & ATTR_DESCR_MASK) != IOMMU_L3_PAGE) return (NULL); return (l3); } static __inline int -pmap_l3_valid(pt_entry_t l3) +smmu_pmap_l3_valid(pt_entry_t l3) { return ((l3 & ATTR_DESCR_MASK) == IOMMU_L3_PAGE); @@ -266,7 +271,7 @@ pmap_l3_valid(pt_entry_t l3) CTASSERT(IOMMU_L1_BLOCK == IOMMU_L2_BLOCK); static __inline void -pmap_resident_count_inc(pmap_t pmap, int count) +smmu_pmap_resident_count_inc(pmap_t pmap, int count) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -274,7 +279,7 @@ pmap_resident_count_inc(pmap_t pmap, int count) } static __inline void -pmap_resident_count_dec(pmap_t pmap, int count) +smmu_pmap_resident_count_dec(pmap_t pmap, int count) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -293,7 +298,7 @@ pmap_resident_count_dec(pmap_t pmap, int count) * physical memory manager after the TLB has been updated. */ static __inline void -pmap_add_delayed_free_list(vm_page_t m, struct spglist *free, +smmu_pmap_add_delayed_free_list(vm_page_t m, struct spglist *free, boolean_t set_PG_ZERO) { @@ -315,19 +320,21 @@ pmap_add_delayed_free_list(vm_page_t m, struct spglist *free, * page table page was unmapped and FALSE otherwise. */ static inline boolean_t -pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) +smmu_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, + struct spglist *free) { --m->ref_count; if (m->ref_count == 0) { - _pmap_unwire_l3(pmap, va, m, free); + _smmu_pmap_unwire_l3(pmap, va, m, free); return (TRUE); } else return (FALSE); } static void -_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) +_smmu_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, + struct spglist *free) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -338,51 +345,51 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) /* l1 page */ pd_entry_t *l0; - l0 = pmap_l0(pmap, va); - pmap_clear(l0); + l0 = smmu_pmap_l0(pmap, va); + smmu_pmap_clear(l0); } else if (m->pindex >= NUL2E) { /* l2 page */ pd_entry_t *l1; - l1 = pmap_l1(pmap, va); - pmap_clear(l1); + l1 = smmu_pmap_l1(pmap, va); + smmu_pmap_clear(l1); } else { /* l3 page */ pd_entry_t *l2; - l2 = pmap_l2(pmap, va); - pmap_clear(l2); + l2 = smmu_pmap_l2(pmap, va); + smmu_pmap_clear(l2); } - pmap_resident_count_dec(pmap, 1); + smmu_pmap_resident_count_dec(pmap, 1); if (m->pindex < NUL2E) { /* We just released an l3, unhold the matching l2 */ pd_entry_t *l1, tl1; vm_page_t l2pg; - l1 = pmap_l1(pmap, va); - tl1 = pmap_load(l1); + l1 = smmu_pmap_l1(pmap, va); + tl1 = smmu_pmap_load(l1); l2pg = PHYS_TO_VM_PAGE(tl1 & ~ATTR_MASK); - pmap_unwire_l3(pmap, va, l2pg, free); + smmu_pmap_unwire_l3(pmap, va, l2pg, free); } else if (m->pindex < (NUL2E + NUL1E)) { /* We just released an l2, unhold the matching l1 */ pd_entry_t *l0, tl0; vm_page_t l1pg; - l0 = pmap_l0(pmap, va); - tl0 = pmap_load(l0); + l0 = smmu_pmap_l0(pmap, va); + tl0 = smmu_pmap_load(l0); l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); - pmap_unwire_l3(pmap, va, l1pg, free); + smmu_pmap_unwire_l3(pmap, va, l1pg, free); } /* * Put page on a list so that it is released after * *ALL* TLB shootdown is done */ - pmap_add_delayed_free_list(m, free, TRUE); + smmu_pmap_add_delayed_free_list(m, free, TRUE); } static int -iommu_pmap_pinit_levels(pmap_t pmap, int levels) +smmu_pmap_pinit_levels(pmap_t pmap, int levels) { vm_page_t m; @@ -416,10 +423,10 @@ iommu_pmap_pinit_levels(pmap_t pmap, int levels) } int -iommu_pmap_pinit(pmap_t pmap) +smmu_pmap_pinit(pmap_t pmap) { - return (iommu_pmap_pinit_levels(pmap, 4)); + return (smmu_pmap_pinit_levels(pmap, 4)); } /* @@ -473,7 +480,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) l0index = ptepindex - (NUL2E + NUL1E); l0 = &pmap->pm_l0[l0index]; - pmap_store(l0, VM_PAGE_TO_PHYS(m) | IOMMU_L0_TABLE); + smmu_pmap_store(l0, VM_PAGE_TO_PHYS(m) | IOMMU_L0_TABLE); } else if (ptepindex >= NUL2E) { vm_pindex_t l0index, l1index; pd_entry_t *l0, *l1; @@ -483,7 +490,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) l0index = l1index >> IOMMU_L0_ENTRIES_SHIFT; l0 = &pmap->pm_l0[l0index]; - tl0 = pmap_load(l0); + tl0 = smmu_pmap_load(l0); if (tl0 == 0) { /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + NUL1E + l0index) @@ -497,9 +504,9 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) l1pg->ref_count++; } - l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); + l1 = (pd_entry_t *)PHYS_TO_DMAP(smmu_pmap_load(l0) &~ATTR_MASK); l1 = &l1[ptepindex & Ln_ADDR_MASK]; - pmap_store(l1, VM_PAGE_TO_PHYS(m) | IOMMU_L1_TABLE); + smmu_pmap_store(l1, VM_PAGE_TO_PHYS(m) | IOMMU_L1_TABLE); } else { vm_pindex_t l0index, l1index; pd_entry_t *l0, *l1, *l2; @@ -509,7 +516,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) l0index = l1index >> IOMMU_L0_ENTRIES_SHIFT; l0 = &pmap->pm_l0[l0index]; - tl0 = pmap_load(l0); + tl0 = smmu_pmap_load(l0); if (tl0 == 0) { /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + l1index) == NULL) { @@ -517,13 +524,13 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) vm_page_free_zero(m); return (NULL); } - tl0 = pmap_load(l0); + tl0 = smmu_pmap_load(l0); l1 = (pd_entry_t *)PHYS_TO_DMAP(tl0 & ~ATTR_MASK); l1 = &l1[l1index & Ln_ADDR_MASK]; } else { l1 = (pd_entry_t *)PHYS_TO_DMAP(tl0 & ~ATTR_MASK); l1 = &l1[l1index & Ln_ADDR_MASK]; - tl1 = pmap_load(l1); + tl1 = smmu_pmap_load(l1); if (tl1 == 0) { /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + l1index) @@ -538,12 +545,12 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) } } - l2 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l1) & ~ATTR_MASK); + l2 = (pd_entry_t *)PHYS_TO_DMAP(smmu_pmap_load(l1) &~ATTR_MASK); l2 = &l2[ptepindex & Ln_ADDR_MASK]; - pmap_store(l2, VM_PAGE_TO_PHYS(m) | IOMMU_L2_TABLE); + smmu_pmap_store(l2, VM_PAGE_TO_PHYS(m) | IOMMU_L2_TABLE); } - pmap_resident_count_inc(pmap, 1); + smmu_pmap_resident_count_inc(pmap, 1); return (m); } @@ -558,7 +565,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) * Should only be called if the map contains no valid mappings. */ void -iommu_pmap_release(pmap_t pmap) +smmu_pmap_release(pmap_t pmap) { boolean_t rv __diagused; struct spglist free; @@ -574,7 +581,7 @@ iommu_pmap_release(pmap_t pmap) SLIST_INIT(&free); m = PHYS_TO_VM_PAGE(pmap->pm_ttbr); PMAP_LOCK(pmap); - rv = pmap_unwire_l3(pmap, 0, m, &free); + rv = smmu_pmap_unwire_l3(pmap, 0, m, &free); PMAP_UNLOCK(pmap); MPASS(rv == TRUE); vm_page_free_pages_toq(&free, true); @@ -635,11 +642,11 @@ pmap_gpu_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, * resident, we are creating it here. */ retry: - pde = pmap_pde(pmap, va, &lvl); + pde = smmu_pmap_pde(pmap, va, &lvl); if (pde != NULL && lvl == 2) { - l3 = pmap_l2_to_l3(pde, va); + l3 = smmu_pmap_l2_to_l3(pde, va); } else { - mpte = _pmap_alloc_l3(pmap, iommu_l2_pindex(va)); + mpte = _pmap_alloc_l3(pmap, smmu_l2_pindex(va)); if (mpte == NULL) { CTR0(KTR_PMAP, "pmap_enter: mpte == NULL"); rv = KERN_RESOURCE_SHORTAGE; @@ -652,23 +659,23 @@ retry: * The cache entry for l3 handled below. */ - l1p = pmap_l1(pmap, va); - l2p = pmap_l2(pmap, va); + l1p = smmu_pmap_l1(pmap, va); + l2p = smmu_pmap_l2(pmap, va); cpu_dcache_wb_range((vm_offset_t)l1p, sizeof(pd_entry_t)); cpu_dcache_wb_range((vm_offset_t)l2p, sizeof(pd_entry_t)); goto retry; } - orig_l3 = pmap_load(l3); - KASSERT(!pmap_l3_valid(orig_l3), ("l3 is valid")); + orig_l3 = smmu_pmap_load(l3); + KASSERT(!smmu_pmap_l3_valid(orig_l3), ("l3 is valid")); /* New mapping */ - pmap_store(l3, new_l3); + smmu_pmap_store(l3, new_l3); cpu_dcache_wb_range((vm_offset_t)l3, sizeof(pt_entry_t)); - pmap_resident_count_inc(pmap, 1); + smmu_pmap_resident_count_inc(pmap, 1); dsb(ishst); rv = KERN_SUCCESS; @@ -694,16 +701,16 @@ pmap_gpu_remove(pmap_t pmap, vm_offset_t va) PMAP_LOCK(pmap); - pde = pmap_pde(pmap, va, &lvl); + pde = smmu_pmap_pde(pmap, va, &lvl); if (pde == NULL || lvl != 2) { rc = KERN_FAILURE; goto out; } - pte = pmap_l2_to_l3(pde, va); + pte = smmu_pmap_l2_to_l3(pde, va); - pmap_resident_count_dec(pmap, 1); - pmap_clear(pte); + smmu_pmap_resident_count_dec(pmap, 1); + smmu_pmap_clear(pte); cpu_dcache_wb_range((vm_offset_t)pte, sizeof(pt_entry_t)); rc = KERN_SUCCESS; @@ -717,7 +724,7 @@ out: * Add a single SMMU entry. This function does not sleep. */ int -pmap_smmu_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, +smmu_pmap_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, vm_prot_t prot, u_int flags) { pd_entry_t *pde; @@ -748,11 +755,11 @@ pmap_smmu_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, * resident, we are creating it here. */ retry: - pde = pmap_pde(pmap, va, &lvl); + pde = smmu_pmap_pde(pmap, va, &lvl); if (pde != NULL && lvl == 2) { - l3 = pmap_l2_to_l3(pde, va); + l3 = smmu_pmap_l2_to_l3(pde, va); } else { - mpte = _pmap_alloc_l3(pmap, iommu_l2_pindex(va)); + mpte = _pmap_alloc_l3(pmap, smmu_l2_pindex(va)); if (mpte == NULL) { CTR0(KTR_PMAP, "pmap_enter: mpte == NULL"); rv = KERN_RESOURCE_SHORTAGE; @@ -761,12 +768,12 @@ retry: goto retry; } - orig_l3 = pmap_load(l3); - KASSERT(!pmap_l3_valid(orig_l3), ("l3 is valid")); + orig_l3 = smmu_pmap_load(l3); + KASSERT(!smmu_pmap_l3_valid(orig_l3), ("l3 is valid")); /* New mapping */ - pmap_store(l3, new_l3); - pmap_resident_count_inc(pmap, 1); + smmu_pmap_store(l3, new_l3); + smmu_pmap_resident_count_inc(pmap, 1); dsb(ishst); rv = KERN_SUCCESS; @@ -780,7 +787,7 @@ out: * Remove a single SMMU entry. */ int -pmap_smmu_remove(pmap_t pmap, vm_offset_t va) +smmu_pmap_remove(pmap_t pmap, vm_offset_t va) { pt_entry_t *pte; int lvl; @@ -788,13 +795,13 @@ pmap_smmu_remove(pmap_t pmap, vm_offset_t va) PMAP_LOCK(pmap); - pte = pmap_pte(pmap, va, &lvl); + pte = smmu_pmap_pte(pmap, va, &lvl); KASSERT(lvl == 3, ("Invalid SMMU pagetable level: %d != 3", lvl)); if (pte != NULL) { - pmap_resident_count_dec(pmap, 1); - pmap_clear(pte); + smmu_pmap_resident_count_dec(pmap, 1); + smmu_pmap_clear(pte); rc = KERN_SUCCESS; } else rc = KERN_FAILURE; @@ -810,7 +817,7 @@ pmap_smmu_remove(pmap_t pmap, vm_offset_t va) * this function panics. */ void -iommu_pmap_remove_pages(pmap_t pmap) +smmu_pmap_remove_pages(pmap_t pmap) { pd_entry_t l0e, *l1, l1e, *l2, l2e; pt_entry_t *l3, l3e; @@ -823,7 +830,7 @@ iommu_pmap_remove_pages(pmap_t pmap) PMAP_LOCK(pmap); - for (sva = VM_MINUSER_ADDRESS, i = iommu_l0_index(sva); + for (sva = VM_MINUSER_ADDRESS, i = smmu_l0_index(sva); (i < Ln_ENTRIES && sva < VM_MAXUSER_ADDRESS); i++) { l0e = pmap->pm_l0[i]; if ((l0e & ATTR_DESCR_VALID) == 0) { @@ -834,7 +841,7 @@ iommu_pmap_remove_pages(pmap_t pmap) m0 = PHYS_TO_VM_PAGE(pa0); l1 = (pd_entry_t *)PHYS_TO_DMAP(pa0); - for (j = iommu_l1_index(sva); j < Ln_ENTRIES; j++) { + for (j = smmu_l1_index(sva); j < Ln_ENTRIES; j++) { l1e = l1[j]; if ((l1e & ATTR_DESCR_VALID) == 0) { sva += IOMMU_L1_SIZE; @@ -848,7 +855,7 @@ iommu_pmap_remove_pages(pmap_t pmap) m1 = PHYS_TO_VM_PAGE(pa1); l2 = (pd_entry_t *)PHYS_TO_DMAP(pa1); - for (k = iommu_l2_index(sva); k < Ln_ENTRIES; k++) { + for (k = smmu_l2_index(sva); k < Ln_ENTRIES; k++) { l2e = l2[k]; if ((l2e & ATTR_DESCR_VALID) == 0) { sva += IOMMU_L2_SIZE; @@ -858,7 +865,7 @@ iommu_pmap_remove_pages(pmap_t pmap) m = PHYS_TO_VM_PAGE(pa); l3 = (pt_entry_t *)PHYS_TO_DMAP(pa); - for (l = iommu_l3_index(sva); l < Ln_ENTRIES; + for (l = smmu_l3_index(sva); l < Ln_ENTRIES; l++, sva += IOMMU_L3_SIZE) { l3e = l3[l]; if ((l3e & ATTR_DESCR_VALID) == 0) @@ -869,20 +876,20 @@ iommu_pmap_remove_pages(pmap_t pmap) vm_page_unwire_noq(m1); vm_page_unwire_noq(m); - pmap_resident_count_dec(pmap, 1); + smmu_pmap_resident_count_dec(pmap, 1); vm_page_free(m); - pmap_clear(&l2[k]); + smmu_pmap_clear(&l2[k]); } vm_page_unwire_noq(m0); - pmap_resident_count_dec(pmap, 1); + smmu_pmap_resident_count_dec(pmap, 1); vm_page_free(m1); - pmap_clear(&l1[j]); + smmu_pmap_clear(&l1[j]); } - pmap_resident_count_dec(pmap, 1); + smmu_pmap_resident_count_dec(pmap, 1); vm_page_free(m0); - pmap_clear(&pmap->pm_l0[i]); + smmu_pmap_clear(&pmap->pm_l0[i]); } KASSERT(pmap->pm_stats.resident_count == 0, diff --git a/sys/arm64/iommu/iommu_pmap.h b/sys/arm64/iommu/iommu_pmap.h index 98fb04971787..1b7027337242 100644 --- a/sys/arm64/iommu/iommu_pmap.h +++ b/sys/arm64/iommu/iommu_pmap.h @@ -34,9 +34,9 @@ #define _ARM64_IOMMU_IOMMU_PMAP_H_ /* System MMU (SMMU). */ -int pmap_smmu_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, vm_prot_t prot, +int smmu_pmap_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, vm_prot_t prot, u_int flags); -int pmap_smmu_remove(pmap_t pmap, vm_offset_t va); +int smmu_pmap_remove(pmap_t pmap, vm_offset_t va); /* Mali GPU */ int pmap_gpu_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, @@ -44,8 +44,8 @@ int pmap_gpu_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, int pmap_gpu_remove(pmap_t pmap, vm_offset_t va); /* Common */ -void iommu_pmap_remove_pages(pmap_t pmap); -void iommu_pmap_release(pmap_t pmap); -int iommu_pmap_pinit(pmap_t); +void smmu_pmap_remove_pages(pmap_t pmap); +void smmu_pmap_release(pmap_t pmap); +int smmu_pmap_pinit(pmap_t); #endif /* !_ARM64_IOMMU_IOMMU_PMAP_H_ */ diff --git a/sys/arm64/iommu/iommu_pte.h b/sys/arm64/iommu/iommu_pte.h index 814fb23df507..99f1ca30ec55 100644 --- a/sys/arm64/iommu/iommu_pte.h +++ b/sys/arm64/iommu/iommu_pte.h @@ -80,9 +80,4 @@ #define IOMMU_Ln_ADDR_MASK (IOMMU_Ln_ENTRIES - 1) #define IOMMU_Ln_TABLE_MASK ((1 << 12) - 1) -#define iommu_l0_index(va) (((va) >> IOMMU_L0_SHIFT) & IOMMU_L0_ADDR_MASK) -#define iommu_l1_index(va) (((va) >> IOMMU_L1_SHIFT) & IOMMU_Ln_ADDR_MASK) -#define iommu_l2_index(va) (((va) >> IOMMU_L2_SHIFT) & IOMMU_Ln_ADDR_MASK) -#define iommu_l3_index(va) (((va) >> IOMMU_L3_SHIFT) & IOMMU_Ln_ADDR_MASK) - #endif /* !_ARM64_IOMMU_IOMMU_PTE_H_ */ diff --git a/sys/arm64/iommu/smmu.c b/sys/arm64/iommu/smmu.c index e307440e725e..35c529ef5de6 100644 --- a/sys/arm64/iommu/smmu.c +++ b/sys/arm64/iommu/smmu.c @@ -1655,7 +1655,7 @@ smmu_unmap(device_t dev, struct iommu_domain *iodom, dprintf("%s: %lx, %ld, domain %d\n", __func__, va, size, domain->asid); for (i = 0; i < size; i += PAGE_SIZE) { - if (pmap_smmu_remove(&domain->p, va) == 0) { + if (smmu_pmap_remove(&domain->p, va) == 0) { /* pmap entry removed, invalidate TLB. */ smmu_tlbi_va(sc, va, domain->asid); } else { @@ -1690,7 +1690,7 @@ smmu_map(device_t dev, struct iommu_domain *iodom, for (i = 0; size > 0; size -= PAGE_SIZE) { pa = VM_PAGE_TO_PHYS(ma[i++]); - error = pmap_smmu_enter(&domain->p, va, pa, prot, 0); + error = smmu_pmap_enter(&domain->p, va, pa, prot, 0); if (error) return (error); smmu_tlbi_va(sc, va, domain->asid); @@ -1728,7 +1728,7 @@ smmu_domain_alloc(device_t dev, struct iommu_unit *iommu) domain->asid = (uint16_t)new_asid; - iommu_pmap_pinit(&domain->p); + smmu_pmap_pinit(&domain->p); PMAP_LOCK_INIT(&domain->p); error = smmu_init_cd(sc, domain); @@ -1772,8 +1772,8 @@ smmu_domain_free(device_t dev, struct iommu_domain *iodom) cd = domain->cd; - iommu_pmap_remove_pages(&domain->p); - iommu_pmap_release(&domain->p); + smmu_pmap_remove_pages(&domain->p); + smmu_pmap_release(&domain->p); smmu_tlbi_asid(sc, domain->asid); smmu_asid_free(sc, domain->asid); From nobody Thu Mar 16 16:46:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctSH6GhJz3yKVV; Thu, 16 Mar 2023 16:46: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 4PctSH31Grz3mq0; Thu, 16 Mar 2023 16:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PlsKz+O1CGUxl9EJ/4PTPOlV1mmb3HV07DrLU0gPniM=; b=C8jIiFQMUpI2+uvEu8W0UJ0ZLqzVnAP09iQD26ZOwv0qVybqd1X6IpeLpq12P0cQL9Owf9 8oKZCGsIPnaqjaSOBYdRbi3dzRdlpjxLAyCa5Eew3jkD8mF2mNnYclbltebAavlzyrplix 5NAy3wpQss9EkHiPqePNALZ8lScxtQpbKqBzF6ZJSU4GdSSXfWvvp1U3QKLNz64cWiewxb VcpJ5VkxsFbYF5Qi7edazb4zhq/vHOEurROo+/aJZxtPlOIEYTV/4ei1HVf0vQTnsnNeF+ Xd8S/Ln5fgFBnsN800C+9VwK6tYgHgFXd0BHFF22OogZThL9JQXE3ThNjzs9kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PlsKz+O1CGUxl9EJ/4PTPOlV1mmb3HV07DrLU0gPniM=; b=cAkrv8qLmpb6B7Zdhqxx7jtm0gq/ii3hoo+DU3Cvgpl5CmbY0GhSMlqGZcZewgakR9hfdu cI/98sNo00dk9UulESn2AVBhB4tUfS1kWPPshgzDPF90XClIU/hZTZa0PKLFz3MkG08rWK +q1A1QmLt0Yq2EETMVlKTsFRuYE+W73vLnYwJq2joer//5e2zNZEMcoZrubuBSrQDgbsqO muUihXlW1VM7YJqcXJ0uBC6ratqtYLe1h5cDV/o2s66zMkXCIu3OKnK3maVaqZKl1Gvjbb is88cISZ7SRYvgFvupMVEBKqD2c1jPGLi8k+2jl1nm+QvZwwXEVqnxCBceYH+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985167; a=rsa-sha256; cv=none; b=T2KqHI7diCE0ipXqu8wtThFXR+g/KGK1UAqgaNESVTus2W0uSl+vg9p/FhrWyMNyWJ5edh BumQgxtBhtgDCkMtlmBzFWL/Wee8dj0+HJGy5LIcC5r6zW4aMkP9fR4hVKlfQt/hx6PveQ wFlwjKJUHqwDRjx97+qpjbPw+xRR+DeEuldSUDDFnBxuZNvw5JqW24dK6zGoP4+i79MAJD 3LHBTxE3apllIMLLbIzPDvT1oTFWpUA/ZgP8i486lt6TtD8gUj+xWQo3eqdu6V6700Cerm 2FPAJp+skuidyjNapbAkipBuP7fPzxxxMb3Qcq/Z1dN6i7t3bCbHP5QAwAQOFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctSH1l0wzqmW; Thu, 16 Mar 2023 16:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGk7WF022190; Thu, 16 Mar 2023 16:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGk7FW022189; Thu, 16 Mar 2023 16:46:07 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:46:07 GMT Message-Id: <202303161646.32GGk7FW022189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 5f2070adb943 - main - Only support a 4 level smmu page table List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f2070adb943b64a286e140f3ebd00da43001845 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5f2070adb943b64a286e140f3ebd00da43001845 commit 5f2070adb943b64a286e140f3ebd00da43001845 Author: Andrew Turner AuthorDate: 2023-03-16 15:34:54 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 16:45:42 +0000 Only support a 4 level smmu page table We only ever build a 4 level page table for the Arm SMMU. Remove the support for a 3 level table. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38949 --- sys/arm64/iommu/iommu_pmap.c | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/sys/arm64/iommu/iommu_pmap.c b/sys/arm64/iommu/iommu_pmap.c index 80a0515a0c2c..acef3d8d3368 100644 --- a/sys/arm64/iommu/iommu_pmap.c +++ b/sys/arm64/iommu/iommu_pmap.c @@ -388,8 +388,8 @@ _smmu_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, smmu_pmap_add_delayed_free_list(m, free, TRUE); } -static int -smmu_pmap_pinit_levels(pmap_t pmap, int levels) +int +smmu_pmap_pinit(pmap_t pmap) { vm_page_t m; @@ -404,31 +404,12 @@ smmu_pmap_pinit_levels(pmap_t pmap, int levels) vm_radix_init(&pmap->pm_root); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); - MPASS(levels == 3 || levels == 4); - pmap->pm_levels = levels; - - /* - * Allocate the level 1 entry to use as the root. This will increase - * the refcount on the level 1 page so it won't be removed until - * pmap_release() is called. - */ - if (pmap->pm_levels == 3) { - PMAP_LOCK(pmap); - m = _pmap_alloc_l3(pmap, NUL2E + NUL1E); - PMAP_UNLOCK(pmap); - } + pmap->pm_levels = 4; pmap->pm_ttbr = VM_PAGE_TO_PHYS(m); return (1); } -int -smmu_pmap_pinit(pmap_t pmap) -{ - - return (smmu_pmap_pinit_levels(pmap, 4)); -} - /* * This routine is called if the desired page table page does not exist. * @@ -567,26 +548,8 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) void smmu_pmap_release(pmap_t pmap) { - boolean_t rv __diagused; - struct spglist free; vm_page_t m; - if (pmap->pm_levels != 4) { - KASSERT(pmap->pm_stats.resident_count == 1, - ("pmap_release: pmap resident count %ld != 0", - pmap->pm_stats.resident_count)); - KASSERT((pmap->pm_l0[0] & ATTR_DESCR_VALID) == ATTR_DESCR_VALID, - ("pmap_release: Invalid l0 entry: %lx", pmap->pm_l0[0])); - - SLIST_INIT(&free); - m = PHYS_TO_VM_PAGE(pmap->pm_ttbr); - PMAP_LOCK(pmap); - rv = smmu_pmap_unwire_l3(pmap, 0, m, &free); - PMAP_UNLOCK(pmap); - MPASS(rv == TRUE); - vm_page_free_pages_toq(&free, true); - } - KASSERT(pmap->pm_stats.resident_count == 0, ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); From nobody Thu Mar 16 16:46:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctSJ4phnz3yK8P; Thu, 16 Mar 2023 16:46: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 4PctSJ4Jmmz3n2w; Thu, 16 Mar 2023 16:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ao0ljGAmdL07Uvnj7bFspwsZh6rw/LbMYcWubE/7ndc=; b=p4FmhF99OzAmG2Yv4eUxrDRIJw1n8LWFGHK8ggCacSFGA3pWad9WDqaEoOChafyoPe0fp/ W7OmcyYcxrzaL59H513ULCDLhl7eCZ1yB4Kzibp8RXGzcaJnO/9W5ibXKqUuERQX1r5Aml oF73wRG7ZeB+5GX6urtnEgWXEKoP++DfIauuUIORfJNmbQlPPUuJVK5A+Qa44F3oOW1rMz ObpQnGo410RsLSP6yYuUqXOjnP0oF32tyihEyKUIK1B+AkACne5n0DsrzQ9HTkfMLZOwsd JI9tr5Mb6KNz3crnJiYDALH6gXSlt8tu0VZ2kclALbXWjp3Aw2S6ANZzRlp6zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ao0ljGAmdL07Uvnj7bFspwsZh6rw/LbMYcWubE/7ndc=; b=VQXEKqzwK6SlJwTydtrnLIeEsLYde5sv7pWLgdQ1yE/h98G/gskOAHFmncZLKKvm0YSm1h LwkUcq8amITFa5i1S0oJhFOm/MVRvf8y4F/n+S7pjLkGuHYWaROjjPv5Qohmb39cyk/V1Z JUu6XJxA5D6RbLRvd+38Qn2G+jUgNJFldboUFgTCfPqRbLCXfZ8P4yOz6Y/6BVPunTd6GZ sMQ97IKZE9QfTrRvep5g5eeiJVS9aO16JN3If9VUQIFn3NblQUyLEfdyVru3l4niACMfoJ A/q+T5P/zVkor96W/VZsiJFgVCWEIhauN/CR5PCTUifw2O6H1WqeaLdj1DJJmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985168; a=rsa-sha256; cv=none; b=HIx1GGgG4CWfSzahKcQQ2MsKyrwwUcq190DOgEcTZ4UEV9YUmB149DqpWabowlmIyT25nV d54uR548io7mDF8izok3HLAXma2qt1TJXtYdj86JQ7KqCXceG2rM4VC4j6LpuM5P2wx4Qn qYm33hDtD2vLIDUnP4N6lFkKqpeGnQJPm5q0ulUvaf2wzM2uXSPA73cIKwLmcIXbvavWvR 4O9KS4788xHfcmXanvi+4kHnI2eYgqu8IMzlqhnc6esdfoWJWdgchLa2I9C62qOFb8xB0N Y1O+arj3SanQEuXZwekK/cJ0MYJws3qREAe5wLznvCvV0DKMZJQ6JAzkeg1q4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctSJ2z4XzrHx; Thu, 16 Mar 2023 16:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGk87p022216; Thu, 16 Mar 2023 16:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGk80T022215; Thu, 16 Mar 2023 16:46:08 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:46:08 GMT Message-Id: <202303161646.32GGk80T022215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 9a5dddc94f5c - main - Remove unneeded arm64 smmu macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a5dddc94f5cc5bd3c213f4afe2b147078e3bb6c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9a5dddc94f5cc5bd3c213f4afe2b147078e3bb6c commit 9a5dddc94f5cc5bd3c213f4afe2b147078e3bb6c Author: Andrew Turner AuthorDate: 2023-03-16 15:34:59 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 16:45:42 +0000 Remove unneeded arm64 smmu macros These aren't used by the driver so can be removed. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38950 --- sys/arm64/iommu/iommu_pte.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/arm64/iommu/iommu_pte.h b/sys/arm64/iommu/iommu_pte.h index 99f1ca30ec55..88800c15ba42 100644 --- a/sys/arm64/iommu/iommu_pte.h +++ b/sys/arm64/iommu/iommu_pte.h @@ -45,7 +45,6 @@ /* Level 1 table, 1GiB per entry */ #define IOMMU_L1_SHIFT 30 #define IOMMU_L1_SIZE (1 << IOMMU_L1_SHIFT) -#define IOMMU_L1_OFFSET (IOMMU_L1_SIZE - 1) #define IOMMU_L1_INVAL IOMMU_L0_INVAL #define IOMMU_L1_BLOCK 0x1 #define IOMMU_L1_TABLE IOMMU_L0_TABLE @@ -53,17 +52,13 @@ /* Level 2 table, 2MiB per entry */ #define IOMMU_L2_SHIFT 21 #define IOMMU_L2_SIZE (1 << IOMMU_L2_SHIFT) -#define IOMMU_L2_OFFSET (IOMMU_L2_SIZE - 1) #define IOMMU_L2_INVAL IOMMU_L1_INVAL #define IOMMU_L2_BLOCK IOMMU_L1_BLOCK #define IOMMU_L2_TABLE IOMMU_L1_TABLE -#define IOMMU_L2_BLOCK_MASK UINT64_C(0xffffffe00000) - /* Level 3 table, 4KiB per entry */ #define IOMMU_L3_SHIFT 12 #define IOMMU_L3_SIZE (1 << IOMMU_L3_SHIFT) -#define IOMMU_L3_OFFSET (IOMMU_L3_SIZE - 1) #define IOMMU_L3_SHIFT 12 #define IOMMU_L3_INVAL 0x0 /* 0x1 is reserved */ From nobody Thu Mar 16 16:46:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctSK527fz3yKVd; Thu, 16 Mar 2023 16:46: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 4PctSK4XQZz3n3Z; Thu, 16 Mar 2023 16:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYLk2phH3PZRPAkeqWrOtCpPz+1c7lOYdWoq061zcXc=; b=Sdp69cYoYMWT1b5itq6Xt41bUyFXDfJh05fSQcX6DaaLE5mEWofz8gV18Vt/3RbNEc0UC+ FJI87OjetwCcfZgWz7T92Zrwu7xmda3Tjd3nzocHVX2plOiPyetCP8ij+S+ACYCviE2ObT r6XpXLgTd0okUiok+GmgEmOEJ2Mv4V/FOWBBWyEoBfC+EXjIQGcU+AXUblTPIc7+wL5bYR r9pYHYwG89zknxO4YcNksfHjZxkuBtOVQGXLbZFslJ0TiKqjp/hBUw3kWbpz5Fo1Yq8yNd I8QvEBlv20Q3UnGCgffPdPYP5qH4bnDnJX1F3uGZ8KCmksAtglDmu7BY0vahlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYLk2phH3PZRPAkeqWrOtCpPz+1c7lOYdWoq061zcXc=; b=Gp0xaXTNCKwAaPj6B6tYQnhVaDUFtqo3JYQQIOb2aSum2PSWOQGqW2QsfYBp/TUjnLmbXy CMrqaFFGPjRhceFAA3NdPD199gOOUdU6/3NrElHLnQepBZ1Y94Cu9QixcYHQp613Ko2Q19 Pj/oQM4X8QwpXCm9/dPn8Zm4YBAoTcrjMoj5qw1SrthRVTqC30rBMt6xzJp25E5g1hAO3t lPkW7sB7/+9Fv3diDR/tMlHAj07DcJxaX8hXArj7gSliahO3VToL9i5oVmnxw8n9vThKKr EJpBcLG4JZ/ZJ7Ys+aQflOx7VEZmoYyH44Iebd9iL3ILg3jt8DSSBAGET5W8GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985169; a=rsa-sha256; cv=none; b=E6JK94Uq9TekedJrLsJmBuJBjPg6ul63m7k+9ObC/5WEJBAymmBpZO5if6hPRT3uD2MLtn loUUGNMYhK6g7S0JdRyx21bOFfE01U/nAnFfD6NEwmNRhgB3bwn7aY1/vusmLmh0hiuvI/ miZbPK0DFX171M76hc7z7w+7LgUoLiq9lbndAgPqIh9Vf5i8oPBkh93OBxp8GOn1fWCWIQ PTTBCsDPjmxYnxj5bxPamZkV4/iwPKD4xCY/Ek03RXfc7HUuXcqAyj/x7pCjGM3RBa5ceK 3fm9Uh0feqLGSKUhsqIxlY6QaFai2lKM5Y2tTcMDCE8tbSGBH1h480lNn7W0lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctSK3YpCzrN4; Thu, 16 Mar 2023 16:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGk9Jl022235; Thu, 16 Mar 2023 16:46:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGk9le022234; Thu, 16 Mar 2023 16:46:09 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:46:09 GMT Message-Id: <202303161646.32GGk9le022234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: bc108947579e - main - Remove an unneeded CTASSERT in the smmu driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc108947579ede209e49dfc38791705aca962fef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=bc108947579ede209e49dfc38791705aca962fef commit bc108947579ede209e49dfc38791705aca962fef Author: Andrew Turner AuthorDate: 2023-03-16 15:35:04 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 16:45:42 +0000 Remove an unneeded CTASSERT in the smmu driver We don't map the DMAP here Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38951 --- sys/arm64/iommu/iommu_pmap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/arm64/iommu/iommu_pmap.c b/sys/arm64/iommu/iommu_pmap.c index acef3d8d3368..6319d97ff763 100644 --- a/sys/arm64/iommu/iommu_pmap.c +++ b/sys/arm64/iommu/iommu_pmap.c @@ -80,10 +80,6 @@ __FBSDID("$FreeBSD$"); #define smmu_l2_index(va) (((va) >> IOMMU_L2_SHIFT) & IOMMU_Ln_ADDR_MASK) #define smmu_l3_index(va) (((va) >> IOMMU_L3_SHIFT) & IOMMU_Ln_ADDR_MASK) -/* This code assumes all L1 DMAP entries will be used */ -CTASSERT((DMAP_MIN_ADDRESS & ~IOMMU_L0_OFFSET) == DMAP_MIN_ADDRESS); -CTASSERT((DMAP_MAX_ADDRESS & ~IOMMU_L0_OFFSET) == DMAP_MAX_ADDRESS); - static vm_page_t _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex); static void _smmu_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); From nobody Thu Mar 16 16:46:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctSL6KGQz3yK7p; Thu, 16 Mar 2023 16:46: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 4PctSL5XK9z3n6N; Thu, 16 Mar 2023 16:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2eDpvQtpj62hLYuTonkgZBHTdsKl8c2cRWPcp2ItLqA=; b=J+urz2mSRFa2hEouuyhvOJ2YVqQ+CzQvljxzh+afDwXDRiWtpdoje/crZIykSI8dqHK/hP aTCzhOB60aQQBSPCvEtwddi1clgPCBHj2egGqAtH5l26T4Q7fKJt5cCCmN9PlPNWvFfIvI DSDzLeMpOvpEZ055z6/ALA5aLMCasAYjpVwKAoxW/oM4/6+P+rneIRZCs9g0IN6rxpSHVn 4hz/MIlCE6BRTYKLA1hRoBjcn265sN9lKv3pTL88O/7BjaFRgTy77lKTAWRymWvI0LAiwe 9TxV2gPnykss9zbUoH41Y1CROc1bBr6KZB2gWVQKzMdP6k32umtaNJcw26tCqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2eDpvQtpj62hLYuTonkgZBHTdsKl8c2cRWPcp2ItLqA=; b=GoS1omgjeiAVZuGsa39DieQ00MIh92UQEZn+mnMTI+ppscrFN96zLZUa1QhKDhNQD4nn8G ZCtVIt4k5Aeep7H7Uoyv7er+DAUikOVuTXjaGUutBWBcl+1Ypa5L80kjEPdoD3Jb3xo0rk vs2u7CRsQTo7e/Z88J7Ypcg5inN7VcvcM2SeZh7JR32yBh1Rh5Nm0N1s4+s2dbR42zaqNs eQGA+HuGMSAQTXBTywcj0+WonziC33KVNWPLINRnoyghnx8Gl9zN0VabznJ5fAYODmxc3i MRKBJ6bvc2143jrb29xNf1yvnkpv5DQ6bqaWhsiAMIIwNxPDOmaGK9N6G6EYdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985170; a=rsa-sha256; cv=none; b=WsTWXAIS1LZguukqVI0TsWnh9+yhF4yLmsEkSZ0w485c6r3+Bf2rUvPM53zZ1skUPr/LL9 Tdvv5kZl+D26amFEBV8wh9JHcsVI9Deq8bb0cNRp8M9hVwBMVpxKQ3ZkVWxXxhHhIgCl3X VyU2x6RJAX1rpZszmvjWqo8tbDsQ9hUoviKOQiVhZaGul1grsRjuUmIt3+3h4Pd8KlQyer 43vRYPYAlJOEskhyZ1oJrts1ZhU+5ZOK+JzDMBRncqodH83c9BoLcZwJC8mwjxHWrTgRID ph40SEmMl58mDNAEQBA0mObVxx1x50YFc0JESRzDQ7iSK5hWk8Yvo4VRY2GuIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctSL4V63zr6G; Thu, 16 Mar 2023 16:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGkAGo022255; Thu, 16 Mar 2023 16:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGkArS022254; Thu, 16 Mar 2023 16:46:10 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:46:10 GMT Message-Id: <202303161646.32GGkArS022254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f7acb7ed41f2 - main - Allow forcing non-posted memory on arm64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7acb7ed41f229a050b2d5e35e04791ba5ceaf13 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f7acb7ed41f229a050b2d5e35e04791ba5ceaf13 commit f7acb7ed41f229a050b2d5e35e04791ba5ceaf13 Author: Andrew Turner AuthorDate: 2023-03-16 15:35:59 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 16:45:42 +0000 Allow forcing non-posted memory on arm64 To allow for debugging after changing the arm64 VM_MEMATTR_DEVICE memory type add a new set of tunables to tell the kernel to use non-posted memory. This adds the following tunables: - kern.force_nonposted: When set to non-zero the kernel will use non-posted memory for all device allocations. - hint...force_nonposted: As above, however only forces non-posted memory on the named device. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38944 --- sys/arm64/arm64/nexus.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 3d6519f5fedd..0c06736f4e66 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -83,6 +83,10 @@ struct nexus_device { struct resource_list nx_resources; }; +static int force_np; +SYSCTL_INT(_kern, OID_AUTO, force_nonposted, CTLFLAG_RDTUN, &force_np, 0, + "Force all devices to use non-posted device memory"); + #define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev)) static struct rman mem_rman; @@ -373,7 +377,7 @@ nexus_activate_resource_flags(device_t bus, device_t child, int type, int rid, { struct resource_map_request args; struct resource_map map; - int err; + int err, use_np; if ((err = rman_activate_resource(r)) != 0) return (err); @@ -386,7 +390,13 @@ nexus_activate_resource_flags(device_t bus, device_t child, int type, int rid, case SYS_RES_MEMORY: if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { resource_init_map_request(&args); - if ((flags & BUS_SPACE_MAP_NONPOSTED) != 0) + use_np = (flags & BUS_SPACE_MAP_NONPOSTED) != 0 || + force_np; + if (!use_np) + resource_int_value(device_get_name(child), + device_get_unit(child), "force_nonposted", + &use_np); + if (use_np) args.memattr = VM_MEMATTR_DEVICE_NP; err = nexus_map_resource(bus, child, type, r, &args, &map); From nobody Thu Mar 16 16:46:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctSN1zmNz3yKDR; Thu, 16 Mar 2023 16:46: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 4PctSM6CQNz3nH3; Thu, 16 Mar 2023 16:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IWkdJGd7f3WSAs9tTFGQOykuIDa1E0bMtz9QSnzuJbM=; b=WRCShI92G15DAFKtWrjO8rA+iuFKSmb+lhn86kF/lNgKqp6kfnIeMCLvEgcJYE2M7z3p7u /nBwDVwdHb2eddkp5hNW3o3Q9qbSQofg7EI8iPU+y2x8qyg/kck6WLJ1QcFt7Cwch2/tbK JIhgwZKDncnJjFliMT8iqrpGjB8JsTkBiVv5pyP5Eyq7P1GoPA+1XTrq/y6n0zv0p1Ka0c 3KJrb7z31rtkL1kf+CqXqNUD0RWXS/zkFiREb9cFfJIQ4M1h0F0qg6d7LlGDNdsJHcimfS RrLZifcsGcrtfieUrNBtqK3SyYbMXWOtyk6n7Lt6+yrKB5N/hA8NxiCqgY9lZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IWkdJGd7f3WSAs9tTFGQOykuIDa1E0bMtz9QSnzuJbM=; b=ozzMUK/v/b730/uZBUg3VmhF4O8zDhpUsMPsNepkQG6b9dQeWWo1VKQ0Dbz1EvTgaajX0E 3j1UajZBsPhvB5dJGwcl6tJRiEMoBNpoKL2CNh79GB8qovY4h1NzHq4tmC3kQyc7GgDJtB rNhaM2podVyASUyKTz+BsMvQkqxiP1GCpDGDIoRhTph8r7NDjf2MOzmKIZzmY3Xuy5Mwmu BiXVp1jKlSn3eUY/kq1+BivyK2TOBQc7SMO/nejRAMli0VO1huWdbC8Atn8CzM5wE0LaB1 7cmPWUD4c8Kk38ST3m77TLNxFiy+fHG7aCmRQYTjWlgwCrNiHlpwSS2IKAKI7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985171; a=rsa-sha256; cv=none; b=ZEnXjQAkcgZVYTZH3pjKg6KYZBLv601bm0RrOPdJWkgbuz3zXn3Wb/72vUjNqif2XzPnHd rUtRga4nhyPwowo6Wnp3kshYkfDKWiCcUssdQASnR6Y1d0XPnTBm+WfKxuEcqpfv2ANvl0 v1ckOP+tCTRCNNLt+lc/IrBGMLcrEq9GHxe3ZkhRSE3BK7d8L1DwzPNeWqpkNi0HjJ45c0 1uswUNT47i2PPM3vPqHv29um8cT/K8MhgBYBZcxaTAmZZmW4OTErHEkZKc14ffdTXAZX9S zBHIa0m3TxFJ6rpM4yVJgrCNSFaNAGE16HflJtWTMYoHmXKiyGWSPnpMmelEFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctSM58DtzqmX; Thu, 16 Mar 2023 16:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGkBYu022274; Thu, 16 Mar 2023 16:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGkB3A022273; Thu, 16 Mar 2023 16:46:11 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:46:11 GMT Message-Id: <202303161646.32GGkB3A022273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3473f2832284 - main - Switch the arm64 VM_MEMATTR_DEVICE to nGnRE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3473f283228401ba585044ac6dea8c8eb27237a5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3473f283228401ba585044ac6dea8c8eb27237a5 commit 3473f283228401ba585044ac6dea8c8eb27237a5 Author: Andrew Turner AuthorDate: 2023-03-16 15:36:06 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 16:45:42 +0000 Switch the arm64 VM_MEMATTR_DEVICE to nGnRE Move device memory to a weaker type. The new device memory type allows the system to acknowledge a write to a device before the write has completed. This is inline with VM_MEMATTR_DEVICE on armv6/armv7. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38945 --- sys/arm64/include/vm.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/arm64/include/vm.h b/sys/arm64/include/vm.h index e479aab52e26..a8c1ea97b513 100644 --- a/sys/arm64/include/vm.h +++ b/sys/arm64/include/vm.h @@ -36,11 +36,7 @@ #define VM_MEMATTR_WRITE_THROUGH 3 #define VM_MEMATTR_DEVICE_nGnRE 4 -/* - * VM_MEMATTR_DEVICE can be changed to VM_MEMATTR_DEVICE_nGnRE when - * the PCI drivers use VM_MEMATTR_DEVICE_NP for their config space. - */ -#define VM_MEMATTR_DEVICE VM_MEMATTR_DEVICE_nGnRnE +#define VM_MEMATTR_DEVICE VM_MEMATTR_DEVICE_nGnRE #define VM_MEMATTR_DEVICE_NP VM_MEMATTR_DEVICE_nGnRnE #ifdef _KERNEL From nobody Thu Mar 16 16:46:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctSP1YJwz3yKZ6; Thu, 16 Mar 2023 16:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PctSP08KJz3n4X; Thu, 16 Mar 2023 16:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TYo4Hf7my/rkQ3c2KqikJ2WN7C9GPRtwLcA6aTnCPMc=; b=doN+23sFXPOHe1TP7CeUzyLDk4Px4kq9mZxnoHC0p7CK6nIpBDBWeDrdVF6YSvETAu2tN8 akju/UYlamoJOkiBbPSs2k8weJj0XgztlGWU7WTyLVCBW92zp87sIsRa/phCcSP/ggul5M mBjPIqEX2HmUrDxCp1PxfX3c/wxDHBTrEnRC0uV+A9T4umSHyxVvlzZZkydFtVgliD6ZZ8 /eIEqCoLT2N6riYKaysAlU1dNAvXIg3xkQdkml0B+U81/ewLQXlzryBqQ7PjrMllQ5tqiv aKDF/Yk4wDw/imxSOHEyC82gKJDfdE+0rqwaFwzWw6+UlmKEEijrCTcEAvJV1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TYo4Hf7my/rkQ3c2KqikJ2WN7C9GPRtwLcA6aTnCPMc=; b=ay3tzYKUZAmvpLtaAAhOcsdEQ2Y2+jcQ07csyJn/BTgOF+hzrtlkvclOL7kNTmxs4GyJcl QoYoWKxjmWn+kkal56hdev4yuL8GeB/mg/vhkiB2xlr/HbJPkXcwh9Q8SSdwD+9nUPmV4t FuCNftWOgR1UO07O8J6d/f4ill1tn7EvruprDeowJinJNj2zcJXjDJZCTJV/QqcfV/8iFl bb15GehQ8ixtcookKW0R8uehU/vARAcTS3141BJPchbRxNtWFKe5z5Sfda409PNoDR2T32 mTQFv2P0EpuP7qigCKyfJHuUm48lYaJl+wuYPeobrDU55E01lkSq3Pj3uYqdRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985173; a=rsa-sha256; cv=none; b=xrsS2Toh5CUoCuvgPH/vK8+W54289gdKalljtU90UrP8pdcyVlyW64vm9y4dyEYgzNWl/g jjZChyIlHXlf1gUaZMbHW1yj4oAnWYafiaQxcAxg5Wndelb+Z4BiBMHAUdn2ktE81IpMA1 LDiBgQYtQ7vmQp/wcudI7x8B0i4y7z3e/oZVB0HsMiFyGi5QhmRoDJbUpWkiSt4/fG7hMC FAlrEvWwhKDKybGYDQyxinWSGwhJjWmFWy0HiHf/h7puATs/2l+Cz/G+t8y8F2PbzQ+hfA Yt7HE0LfoNV7ICLf8DNwIM0iiWvh9rfkHuqyNuKwqteVTS0SRyMHZPhbBFW2DA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctSN65nDzqjd; Thu, 16 Mar 2023 16:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGkC9V022293; Thu, 16 Mar 2023 16:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGkCv3022292; Thu, 16 Mar 2023 16:46:12 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:46:12 GMT Message-Id: <202303161646.32GGkCv3022292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a671f96d9319 - main - Mark arm64 mair_el1 fields as unsigned long List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a671f96d9319d63e4a634f88ae277c4d682bba69 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a671f96d9319d63e4a634f88ae277c4d682bba69 commit a671f96d9319d63e4a634f88ae277c4d682bba69 Author: Andrew Turner AuthorDate: 2023-03-16 16:19:21 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 16:45:42 +0000 Mark arm64 mair_el1 fields as unsigned long The register is 64-bit so the upper bits could be shifted past the signed 32-bit size of an int the values were before. Sponsored by: Arm Ltd --- sys/arm64/include/armreg.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index b24c6ec94c65..6ecd791fd87b 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -1155,13 +1155,13 @@ #define ID_ISAR5_VCMA_IMPL (UL(0x1) << ID_ISAR5_VCMA_SHIFT) /* MAIR_EL1 - Memory Attribute Indirection Register */ -#define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) +#define MAIR_ATTR_MASK(idx) (UL(0xff) << ((n)* 8)) #define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8)) -#define MAIR_DEVICE_nGnRnE 0x00 -#define MAIR_DEVICE_nGnRE 0x04 -#define MAIR_NORMAL_NC 0x44 -#define MAIR_NORMAL_WT 0xbb -#define MAIR_NORMAL_WB 0xff +#define MAIR_DEVICE_nGnRnE UL(0x00) +#define MAIR_DEVICE_nGnRE UL(0x04) +#define MAIR_NORMAL_NC UL(0x44) +#define MAIR_NORMAL_WT UL(0xbb) +#define MAIR_NORMAL_WB UL(0xff) /* MDCCINT_EL1 */ #define MDCCINT_EL1 MRS_REG(MDCCINT_EL1) From nobody Thu Mar 16 17:45:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcvmv6KtCz3yNZP; Thu, 16 Mar 2023 17:45: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 4Pcvmv5ckwz3wBN; Thu, 16 Mar 2023 17:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678988735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=clYQFCPMIJe32NCgI43hupWFY62LIkp2cmgYKqDlWy0=; b=ROPEiii2eMyNLXhRH78OF/BwpSx55NIr4vq3J4D4dRq3GCYwDT7ivNSBYMekv1i+vC5feI 1gpmzTIFDTyRsJydt4BHK5BmUriBT/9mgMNaBCAV8lsRo1MYrnEQiH2NGeXwPdY3VMuruN sK5W9YkHt0OH6OEDVIpIndKZAE9DhQsKxDaR8aBUyJx0b6FdGzG5HJkJNfTx6PsM1ZbwjH JRS5T76LJBl2/UD9iCHcSsQ5REzQZRVtnZvQdqu9fiRUAWujEjG/wfqN3nZJb+VugZDhSO 0rs3jwfJN7PhLAXOJhGKK8sGc5Er06hez37l+BN03mIYe9JVQp9Z5npy2QeuhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678988735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=clYQFCPMIJe32NCgI43hupWFY62LIkp2cmgYKqDlWy0=; b=x9E6VP+bC1xs7ryZcuZj0luvQdmMXKKYJUy8XrWY5pSbF2pq2aTiMEnmDghKD1rbB5qmQz P4+oWLoywEggE0/OnjXsrdsGwLV08HfC0yAWXCwIfwWC4t54ghw3ZKG+4HeLHeU76PcjXU 6llc24/pa9LJhF8iDXNTW2dqeaiTRBCpHlOjlbZIiqWpn9x9ve2u4x4y3PtZjZNwnQNQcp eWU3YS2XXBGH8S4KqUEQuz/Mf1JraPD8UlwwiMg9kDyZSOHSVZVtgJYC7zgXYFERf/aO6W 3pKcgvjkwPxo+MdNT6+JgrvDzoDFjPmRjs6G+tvlNA90Rl11++F9vD0IgoN07Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678988735; a=rsa-sha256; cv=none; b=jwGpp5qLL+TVlfpOi7kgpOVg5mVLCB+QEJoztQwgb7Pxvo/BkBGRao3uSF95nW7VAWqSKV J8/PFoQt32Mle4XiPNcj5AbBGhw59s7kvWiGSq72Fkm7TcKhtZ7uyn44s6+KB6K+fYH4pP N8GVnJSzBCyeePN07sEwxrR6hBTGoWk2S2oE+zOepiESXrK/5kA9YsSWhtmNyR8Zap+I0a kbjjNtdt+q0X+PmE6YApY7zJ7A8KGwRkXuFRs+VjpW2bVSF4Dggx621WLJNpaRPoQ4qscu 8UKZnoDeP/2k1z8PfXbTQM4Wn8pswSfGvVRdMqRtxMYF/A8JoyWTdHoo/ap5eg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcvmv4gtFzsRc; Thu, 16 Mar 2023 17:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GHjZg4020610; Thu, 16 Mar 2023 17:45:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GHjZAV020609; Thu, 16 Mar 2023 17:45:35 GMT (envelope-from git) Date: Thu, 16 Mar 2023 17:45:35 GMT Message-Id: <202303161745.32GHjZAV020609@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: 08ffa93d9f0e - releng/13.2 - heimdal: Fix CVE-2022-4152, signature validation error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 08ffa93d9f0e5c03b15e6f3326d5a0056bfc4a52 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=08ffa93d9f0e5c03b15e6f3326d5a0056bfc4a52 commit 08ffa93d9f0e5c03b15e6f3326d5a0056bfc4a52 Author: Cy Schubert AuthorDate: 2023-03-10 01:03:52 +0000 Commit: Ed Maste CommitDate: 2023-03-16 17:44:41 +0000 heimdal: Fix CVE-2022-4152, signature validation error When CVE-2022-3437 was fixed by changing memcmp to be a constant time and the workaround for th e compiler was to add "!=0". However the logic implmented was inverted resulting in CVE-2022-4152. Reported by: Timothy E Zingelman Security: CVE-2022-4152 Security: https://www.cve.org/CVERecord?id=CVE-2022-45142 Security: https://nvd.nist.gov/vuln/detail/CVE-2022-45142 Security: https://security-tracker.debian.org/tracker/CVE-2022-45142 Security: https://bugs.gentoo.org/show_bug.cgi?id=CVE-2022-45142 Security: https://bugzilla.samba.org/show_bug.cgi?id=15296 Security: https://www.openwall.com/lists/oss-security/2023/02/08/1 Approved by: re (cperciva) (cherry picked from commit 5abaf0866445a61c11665fffc148ecd13a7bb9ac) (cherry picked from commit 59c26d1a95a00418892e08341e3eae074c238680) --- crypto/heimdal/lib/gssapi/krb5/arcfour.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/heimdal/lib/gssapi/krb5/arcfour.c b/crypto/heimdal/lib/gssapi/krb5/arcfour.c index 3b8d452877dd..7d1143c95d83 100644 --- a/crypto/heimdal/lib/gssapi/krb5/arcfour.c +++ b/crypto/heimdal/lib/gssapi/krb5/arcfour.c @@ -307,7 +307,7 @@ _gssapi_verify_mic_arcfour(OM_uint32 * minor_status, return GSS_S_FAILURE; } - cmp = (ct_memcmp(cksum_data, p + 8, 8) == 0); + cmp = (ct_memcmp(cksum_data, p + 8, 8) != 0); if (cmp) { *minor_status = 0; return GSS_S_BAD_MIC; @@ -695,7 +695,7 @@ OM_uint32 _gssapi_unwrap_arcfour(OM_uint32 *minor_status, return GSS_S_FAILURE; } - cmp = (ct_memcmp(cksum_data, p0 + 16, 8) == 0); /* SGN_CKSUM */ + cmp = (ct_memcmp(cksum_data, p0 + 16, 8) != 0); /* SGN_CKSUM */ if (cmp) { _gsskrb5_release_buffer(minor_status, output_message_buffer); *minor_status = 0; From nobody Thu Mar 16 17:45:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcvmw6zlVz3yNjD; Thu, 16 Mar 2023 17:45: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 4Pcvmw6V4lz3wHF; Thu, 16 Mar 2023 17:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678988736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Np3PuO9GLChkUd1uAd/owebFSK+1hk0HfoIvx7a2xQs=; b=ytzkKLuRg6b4rtKh+m/ZAe95o1JLPJ8TcBBRxzO7dZqjX4cwo0D/WB3Q9ecnOoTOmKRq1d 5NqKmoj8/zD3igPklzEg0oJ3kZ/g7VpTP5coafI1VSnNOFYDu4QnC3Yw1Hu+fr8q1zCEQz 9a4+NErzx+E/wgn/heSkt8qTTOOW00k3XB8zWz8cPN5fEZmDQHgS8kcMwedG/vOuMsYiiL h2/Pf/dGFfdtite1V6MSB/3JG626bZAYwUdu0es41apYF/TQGfXZEx6K7iSp++p+j8CR6M 49fFdJARi5WpQEm+whT/bBFOaH63cBoSOCOFXZcqG/xg2DoY9/BrWu6ag7ksPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678988736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Np3PuO9GLChkUd1uAd/owebFSK+1hk0HfoIvx7a2xQs=; b=R0yfir7b9Y7oQRxInG5ZNIUzGoFpP0NGUnCYe4Vuid9Ck6725k9OSb7swaT2sMm6OHKAoV a1PEYNfK37RvoanShJaxjsHeWtNrDiRwb5pjr4YUcdqNOIEEgZhC273F19LRwTuezT1K6X 3lA7H8A3ZX3qC09Q2Sxf9yBCOd589G70r8yK3bDxmSwM61hLA5sKvzB6kePqrL2fVrvey/ TbMfN1Qi1eR7zFiDRfA19S1sb9dYFjZe942LeF+yLQv4R0+Z1ffNSsC5LcNZWe6+IATcX5 u6awbuT10+MY8ZbeT6lMXj6RYBHrNq1e9BPHFHbBDVaWPbwREzMBQMDTlxWaWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678988736; a=rsa-sha256; cv=none; b=yBuUH0JLvm1cXotZig1AMz3XfS/g7Xogcv9C2rV/r64tlq8af1XporqnKO5aXuUPRmSHc0 PvlqlOMP5PUfvyNX4zFGTxvFl3EIrZ80pcLOwnsTOnukqROvgjkjKbYGPaOXVGuxTwzZXM UT22I5XB9a2AGmnBCsW69qizKBpmZ5I/2XdXInVEeK/vlgB7LslQstf1b00Se0RNp1NwPd gImEokWWuXO3TGhusGjn6GCOHbuyks6SNWGTn/rla/L86+iVDIo6PfqBt2h7s9ni9VL3TK RslrwFEkPU9qfKaolQ5uxv+D5c/ss1VIduVfDsVI9wHh+EPiEEbf0IyM9o+T1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcvmw5bhYzsrp; Thu, 16 Mar 2023 17:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GHja5w020629; Thu, 16 Mar 2023 17:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GHjaFm020628; Thu, 16 Mar 2023 17:45:36 GMT (envelope-from git) Date: Thu, 16 Mar 2023 17:45:36 GMT Message-Id: <202303161745.32GHjaFm020628@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: 0c0c89736597 - releng/13.2 - heimdal: Resolve hdb_free_entry() SIGSEGV/SIGILL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0c0c89736597709fec9cffd5b3b2703470995674 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0c0c89736597709fec9cffd5b3b2703470995674 commit 0c0c89736597709fec9cffd5b3b2703470995674 Author: Cy Schubert AuthorDate: 2023-02-07 15:46:59 +0000 Commit: Ed Maste CommitDate: 2023-03-16 17:44:57 +0000 heimdal: Resolve hdb_free_entry() SIGSEGV/SIGILL When the client sends kadmind a create principal (kadm_create) request kadm_s_create_principal() returns an error before zeroing out ent (an hdb entry structure wrapper -- hdb_entry_ex), resulting in a NULL reference. Fix obtained from upstream commit 35ea4955a. PR: 268059 Reported by: Robert Morris Obtained from: Heimdal commit 35ea4955a Approved by: re (cperciva) (cherry picked from commit 6a70e0b4cdc606931555cdc59dc6c8d4a3ab4e3e) (cherry picked from commit 75b5693ed73e4abb6dbb90affbf3ba56c4cdfdc4) --- crypto/heimdal/lib/kadm5/create_s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/heimdal/lib/kadm5/create_s.c b/crypto/heimdal/lib/kadm5/create_s.c index 04312c024ed3..1033ca103239 100644 --- a/crypto/heimdal/lib/kadm5/create_s.c +++ b/crypto/heimdal/lib/kadm5/create_s.c @@ -65,6 +65,7 @@ create_principal(kadm5_server_context *context, kadm5_principal_ent_rec defrec, *defent; uint32_t def_mask; + memset(ent, 0, sizeof(*ent)); if((mask & required_mask) != required_mask) return KADM5_BAD_MASK; if((mask & forbidden_mask)) @@ -72,7 +73,6 @@ create_principal(kadm5_server_context *context, if((mask & KADM5_POLICY) && strcmp(princ->policy, "default")) /* XXX no real policies for now */ return KADM5_UNK_POLICY; - memset(ent, 0, sizeof(*ent)); ret = krb5_copy_principal(context->context, princ->principal, &ent->entry.principal); if(ret) From nobody Thu Mar 16 17:51:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcvw81NrFz3yP6W; Thu, 16 Mar 2023 17:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pcvw80rzmz3x1F; Thu, 16 Mar 2023 17:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678989112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l9FaI4YfGPUEBA6I2X7oQ55zc2oXRPi3gRgXVpiLfMI=; b=Uk0Dqswp1pobkz/7WDumlze2ZjZrEp5gRsARJGkMtwbnYnqr0NNpNgfl6M9c78urCVkcq7 27+R73YchZJwQhbbHe58p0cLH1dPhZ4/eH3UXX7ZNgwYmSN+4epeC2lYtPfsVaN5u110bo aHz2sEL1uGs7V5JYc+NsOy2YXZP2xHBeMFoxovgOVFfjNvkjKe4Q7F63vfwS3wYYNeJ6Dy DCq8/nHHp9Un1ryVlWDf5rkB6oFmOpEwszxHCK6TD0zsBpCi+U7iMNCUZaHHOfhLJxtGP5 86F2qv0oP57nbCptP9CU88ht93ptPd9YRK/9yfQ2CKJiz145FLylu5ov9pCQog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678989112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l9FaI4YfGPUEBA6I2X7oQ55zc2oXRPi3gRgXVpiLfMI=; b=po4f+drobZ1S9pRImFj9IHzPAcDLQrQH+gvZ3jTqUxVLpTsbrjyaoWjwWwH1t6TxPtMAb9 NtOboNPwDJANwzvSptX3toesZpJ2bt7PMwDe6syV+0PHDwOYoD59ANvt5SrN4DgXKuqI89 vQV7YdmG2kVqYu0xqrduLAiH/fItb5nsQnP2xKPyV5Vtnb7Gcca9fE7uuCikJkquBlrHm8 0sI6cIyHjRSnM1umI6rXoqRgBEXTwHoMOW1Xcr+b+XhWmvHAQPiaMsM4+HR/u/0hseDk6u L+UxTy72QK+90HBH87G53PKHWK4eM5Bicz53fxaz+DwRy1KR4odOo/H8z0LDLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678989112; a=rsa-sha256; cv=none; b=eoBHxtRZld/eRCpoRz9sIUbwZsimGyR3GLU1B4Up8UOFvupszyE0rbHG4W/TIoXz1CVVb0 sZbT1gtBW01Qhit96OLG/4frLc8T27MWtj9ROVZ6/ayK7pcDAu6vVLIkUxKfx5NnudLtYJ nhkrDuwOkxrStZ4KdCCExaf4PaHoCt1St1swlnSQIpJiZxbQimHv38FwqiSLlwI7wUblyj j3NjhTw5aewrHNhiayuhMAoMmVY9qUKoBgQtMdpQ6iAO7qLRu1OU4zWDAF9z94bOAVAXYC WsLQFicNj87P0QOLp/rJNmCnp2NsopBpJde0HxaYBMT7PFg61kmUIGV2E9joIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcvw772llzsTW; Thu, 16 Mar 2023 17:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GHpp87035278; Thu, 16 Mar 2023 17:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GHppdk035265; Thu, 16 Mar 2023 17:51:51 GMT (envelope-from git) Date: Thu, 16 Mar 2023 17:51:51 GMT Message-Id: <202303161751.32GHppdk035265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a7ba32e6bcb9 - main - tun tests: Fix cleanup definitions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7ba32e6bcb99176fdb042b9f26b2e1158d33d12 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a7ba32e6bcb99176fdb042b9f26b2e1158d33d12 commit a7ba32e6bcb99176fdb042b9f26b2e1158d33d12 Author: Mark Johnston AuthorDate: 2023-03-16 16:52:54 +0000 Commit: Mark Johnston CommitDate: 2023-03-16 17:27:24 +0000 tun tests: Fix cleanup definitions Without this, vnet jails for the tests don't get torn down. Fixes: fe701c39e8aa ("if_tun: Add basic connectivity test with nc tun support") --- tests/sys/net/if_tun_test.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/sys/net/if_tun_test.sh b/tests/sys/net/if_tun_test.sh index 5f05ac7c5eff..0e9812efddb3 100755 --- a/tests/sys/net/if_tun_test.sh +++ b/tests/sys/net/if_tun_test.sh @@ -2,13 +2,12 @@ . $(atf_get_srcdir)/../common/vnet.subr -atf_test_case "235704" "basic" "cleanup" +atf_test_case "235704" "cleanup" 235704_head() { atf_set descr "Test PR #235704" atf_set require.user root } - 235704_body() { vnet_init @@ -18,18 +17,17 @@ atf_test_case "235704" "basic" "cleanup" jexec one ifconfig ${tun} name foo atf_check -s exit:0 jexec one ifconfig foo destroy } - 235704_cleanup() { vnet_cleanup } +atf_test_case "basic" "cleanup" basic_head() { atf_set descr "Test if_tun using nc" atf_set require.user root } - basic_body() { vnet_init @@ -54,8 +52,7 @@ basic_body() atf_check -s exit:0 -o ignore \ jexec bass ping -c 1 10.100.0.1 } - -basic_clean() +basic_cleanup() { vnet_cleanup } From nobody Thu Mar 16 18:19:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcwWc2yDJz3yQlp; Thu, 16 Mar 2023 18:19: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 4PcwWc2JHbz419y; Thu, 16 Mar 2023 18:19:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678990748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HpiopvjRvGPN6KOtGWYCe00z5r/SnB66CpDbtDL0pKc=; b=tpA+KT48J6kzS/694j0eeA6U2CALEXLsFmC+TdQDO0oNrzdIv/QXKCjIhO+pcprT73t5GU wZM0B/tsXnbvkUsCvj1pH/VccqPiStS28uYnbYD7L6xwXomyf+SUCl5Uay9xzz5lNTtaJH IDASfECFadH2BgJ2ohNgn13PKrZuiyNCvu0cmnNFqEobW/eGxRd1GeO6jKMvEBEXAE3Aoo 06xiKsSLswaxSnQUZqDzzub9VFjQqaTSNvRQkRnFbDHd4NranF01Ho/NsKHCzUEflO3osh 0u6J3aMuqOC4Jn2hSXTfZAkVW/1QrItm7CT+hlEat43doZOmOVjepnX/Rs3z3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678990748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HpiopvjRvGPN6KOtGWYCe00z5r/SnB66CpDbtDL0pKc=; b=ZLy4PD2sQq0E57rS8zBqmdGciUyeCxIp55uMUtn8quXL+1E6eagfgjMFCL59PZAKYsfs3O XFpuBJ7MEuEor4z73VzL1EAEUtGonojVXwf7KMTN/m7gKK38n+1FMYRoKP2CQ9lzHXQ/5z lfxITYGWubEs7NzNwV3dnfomA8rRa3VTgMtWnIlgSQ7pAnuvNGxeogRNbTiRSkebAoJ7WK wMfhR1RZxCP5Zsg0dsICVFLVUC2uJlP4Je+Spt5+J68nhCOfoLKPagIfi2gtv4M/NNjzVd bJWLMbE0NxTIYJzfoD6+A0WRZibd/YGdmKiGXDCzDFQl/kq8YXzYt5RwQ8UNfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678990748; a=rsa-sha256; cv=none; b=LbISRRz5D+59SQwy7g6UrmiGZsWzWdmdALesJANnV9w9J5Fg8SFe8S3r189ORmkPdWvhSI fu37KyOAgS6cQCMXwdtFnFnUTOfj+vpxi+rrZT98XAFDoukeLPiVk975Z32jryGBNcksov 2g8j86TbOF9i1GdgBQsN/3FDI0jBZBPFRsmvJsKAVj6VBZD00aSWh1Vsj5f2+DD0Ybc4Ko nVNomvgQuW07qLLf/byLAS/spV8P1qklAfqm/3x8X1yOSEqC61HlfnindJeOdpKndt0odB xd3gyJH7avZbfTIXe2JqukuMgHy4h76zxFlqvnogN9Pk9PkDsI/3IHun4DTC2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcwWc1Lpkztdr; Thu, 16 Mar 2023 18:19:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GIJ8u7071237; Thu, 16 Mar 2023 18:19:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GIJ86N071236; Thu, 16 Mar 2023 18:19:08 GMT (envelope-from git) Date: Thu, 16 Mar 2023 18:19:08 GMT Message-Id: <202303161819.32GIJ86N071236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 95a2b4d17234 - main - sendmail: silence K&R warns List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95a2b4d17234fb78177add37c8882d133855c3d0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=95a2b4d17234fb78177add37c8882d133855c3d0 commit 95a2b4d17234fb78177add37c8882d133855c3d0 Author: Mateusz Guzik AuthorDate: 2023-03-16 18:18:48 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-16 18:18:48 +0000 sendmail: silence K&R warns Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/sendmail/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/sendmail/Makefile b/usr.sbin/sendmail/Makefile index 3a74a200f2ed..12e58ac3df5e 100644 --- a/usr.sbin/sendmail/Makefile +++ b/usr.sbin/sendmail/Makefile @@ -62,6 +62,8 @@ CFLAGS+= -DTCPWRAPPERS LIBADD+= wrap .endif +CFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} + # User customizations to the sendmail build environment CFLAGS+=${SENDMAIL_CFLAGS} DPADD+=${SENDMAIL_DPADD} From nobody Thu Mar 16 18:22:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcwbh2z9wz3yQq2; Thu, 16 Mar 2023 18:22: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 4Pcwbh2Swwz427b; Thu, 16 Mar 2023 18:22:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678990960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uvn62ZRodZkWftp5JLsu/VruhIl7eH3QI6zpnsks8OI=; b=jy/YZZZRqneQlr1wkHJA1gqSjBpa13tQy8X6V0sb7Sn+mUea3W7ReS6uNKKI0QY7xWJnpQ jl0nK1OPsJ2t3F8FCL6+ZwQ99BMttt/K0qo8AcmBliBi9kgaXANR5O880hOIzgCKiEqFyL s8hW1ouKEU8gyCCbz2bieTJ5+WoTeYqGB2Gd1iB6xlwkzAPGm4maxS5fk+AZrrpsxp6Kap Gv/vaVUxUKdQYcKczYacJyEWldXAf3yvCT8jxAK2i4cQgxhMjqQ8Rd6JWqSTdyiC3+/XxK lOLFxYTDKe6Aun25KmMZOE4dD4QzGVccYP2X3JPBCVOeIjPj33dI2gqRH1Ja3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678990960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uvn62ZRodZkWftp5JLsu/VruhIl7eH3QI6zpnsks8OI=; b=tcFQ1hGPrWjgchn+UqQ30XIfVUmR/nbf0QhgOuTNNE9C3vDe+e44bCQnvyU3HQ4pobByaR krq+RwXZsn1vtcXoLt7pTRzSNutaFLgkfgGoZj4N2qAv9kcDZP8Jt6EaoJ0LG3nlvK4CAx G5fiO/Y9rVLAvfzXdk6kA+3RGZG33LbJYPsS1uPbmX/IKeljCk67QjxjS+nhS4Sj/kK2Ga nI6uc5mwrSjPDe4SRNq+19SltNlRAfNrJkp41CeXyd/nZDej6FDhiv50u2iDsDChbTijoK wKFQZFK9siHR51EWbws2XoJHeNweGMDRtc6s/tUBUe9uRqrPc9IO/AV06TuDSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678990960; a=rsa-sha256; cv=none; b=Lt/t7I+broLYolv6R9raWCmmnWTkNk5YhDhQ+DhbBoT6cCVe2rwwTDTEToBayAS4P7v0jk e6NKWKArK6uml6+uIVJ1ORtvC1XuSf+zVoSIe2eQJ9MbtcqvCt8EKWpSd0r/M4RHR6/NQ8 Fjlf8JBxP3O1NLpVOLu0lz3YAugs/MOYYW8pcNOL6PdyFKJQCZ8+ZVDEe17WEJlL2G1p15 jSLCxmo0snHSSf3qLpjUE6tWntoQ5grzPJW2nA7I0rc5nDXJlfnkUFtH0SDr2kli7TBNX7 pVm+OL+ugVfyyf7jKfhUIZ7ahF4snL1DMG4snk1UqV6C0LSJ79xg2jDFlMsCSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcwbh1XFPztpv; Thu, 16 Mar 2023 18:22:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GIMeOR086778; Thu, 16 Mar 2023 18:22:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GIMeEj086777; Thu, 16 Mar 2023 18:22:40 GMT (envelope-from git) Date: Thu, 16 Mar 2023 18:22:40 GMT Message-Id: <202303161822.32GIMeEj086777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: de0009f001c2 - main - libz: silence K&R warns List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de0009f001c2aa0bfb9349d9e08199c46b1af707 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=de0009f001c2aa0bfb9349d9e08199c46b1af707 commit de0009f001c2aa0bfb9349d9e08199c46b1af707 Author: Mateusz Guzik AuthorDate: 2023-03-16 18:22:24 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-16 18:22:24 +0000 libz: silence K&R warns Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libz/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libz/Makefile b/lib/libz/Makefile index d8d466805649..4a6e3c91a828 100644 --- a/lib/libz/Makefile +++ b/lib/libz/Makefile @@ -53,6 +53,7 @@ CFLAGS+= -DUNALIGNED_OK VERSION_DEF= ${.CURDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map CFLAGS+= -DSYMBOL_VERSIONING +CFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} INCS= zconf.h zlib.h From nobody Thu Mar 16 18:24:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcwdv6GWQz3yR5r; Thu, 16 Mar 2023 18:24: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 4Pcwdv5lpCz42D2; Thu, 16 Mar 2023 18:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678991075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5nw8LaqidjGYhzzKh1/3F2f35UVfVlpuf6GSjyGZgrQ=; b=HukEoId6lJeACqv9RsDhK+WE8cMJEm224mRku2faewspOvuGYUf+PwgnGkatta77X8kyoH VJKgQrRfQHsZp+1e9aDHBcpuC1sA973QDV4CCa8+NWKm//1EC49pNoX9Ib8uyM0pzSMpj1 XYcDRHrSFz4fnOqNXTTtW3WVnhA2IZ6ZrmPUF8JR6yrBa1yMDO/O4Zei5klpqBPkKu/T8a G8qkw9GGRmZKtUlGwk35kiVRtNgD4ZUAB6p+zPri4kAB2vvb/vZHwwBKuclaCCi5TWJM1Y fovA10xjvQXWGYnTkkpgboIbjK7kVIhg4wFmhV6HsJyDPC7Sk7PwNQk9uaiLkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678991075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5nw8LaqidjGYhzzKh1/3F2f35UVfVlpuf6GSjyGZgrQ=; b=DGIGT9iZLr7SYVUtQcu/9CPTCnedeoRZdPPiKuK2d7o1/B23yRa06zOuY3KajdwiOBY092 F9HfiEH0f1+JUPP4r2PVo5zHU3CEUcSI/gnDuVTRBZMvwc9kxF9GlASyezjqbU3ZpaCo27 Xl7gyuXxMhGVEe4oVoZFyqVpWymoF5x2+9p42rjBM6C5woIriTjhP1ZqbAkYuVq7Q/GF1L gsPA/injNGsngQYEawosxyCz9Ht/CZVNFAFP2GH2FyN1Rx1B3MC5i0o4IXvsPRkgV72nsh u+uysM+M3TRb6jqHUsQQJ+rVfXXV9T5Kbwj2/+gZmd+BPV8P4rzLeGfu2X59+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678991075; a=rsa-sha256; cv=none; b=NH84VuJL1E/vospvSAgwp6JWWQiE1ffpnfC0sewilWF9J5uUE5G/aJoc+eiGGhXBn72btb QDTl90Uen22ev27kNdPvsIc1ejSMs3UXueg/JmCReVVFk9tR4z/qKTzc4kswKW8q1drVo2 mlss7D1V/I+tw11cOAqYRZhseZGkaBfPP+t5+aPcBLEOlfczYLhx0CMA9QgEfbR5KXwrV6 yEG4NprSLl9RMj0jytFylkvZALK2BY4QEZFqKXFYgvJkxQaN1rJMZL6l2Duvex2H5A95h1 x1iwiVlmPM/VDUdx/DOrQifVVY1VliMy0v5RCopc6qBdYs4w5SkfSO8sg7M8Gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcwdv4jkMztcR; Thu, 16 Mar 2023 18:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GIOZkd087139; Thu, 16 Mar 2023 18:24:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GIOZ0C087138; Thu, 16 Mar 2023 18:24:35 GMT (envelope-from git) Date: Thu, 16 Mar 2023 18:24:35 GMT Message-Id: <202303161824.32GIOZ0C087138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 3451ed888e75 - main - less: silence K&R warns List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3451ed888e7519ba620e7372ba620500c47bdc8a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3451ed888e7519ba620e7372ba620500c47bdc8a commit 3451ed888e7519ba620e7372ba620500c47bdc8a Author: Mateusz Guzik AuthorDate: 2023-03-16 18:24:12 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-16 18:24:12 +0000 less: silence K&R warns Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.bin/less/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/less/Makefile b/usr.bin/less/Makefile index 27415573a8ee..ca9d948e1e4f 100644 --- a/usr.bin/less/Makefile +++ b/usr.bin/less/Makefile @@ -19,5 +19,7 @@ LINKS= ${BINDIR}/less ${BINDIR}/more \ MLINKS= less.1 more.1 CLEANFILES= less.1 +CFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} + .include "Makefile.common" .include From nobody Thu Mar 16 18:57:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcxMZ07cSz3ySt2; Thu, 16 Mar 2023 18:57: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 4PcxMY6fdGz450Z; Thu, 16 Mar 2023 18:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678993033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0fZ/ekfjtsneufXy2EHDWuPCBX4OkHiEhanD0K50BM=; b=FEI8MCrwJM2dD0sEKTHngAlUuQeIlD2oqU7btUiYE7PALhXlmSZd9k/L7FTLkvAudPhFvD JgX3F0Riv5Ql+ONcog037SF0GZ3VDDgQoCeO9RmhFuQFjuntRP2YTvzCCYbAD+qa7F93ab Y7S/MfYlTkH3GrJMzc1DtYR4pPdFImiSOlsKviREZxqEqcSD8sv9wDzFDcYheOGrBkskCB a9tfSvLrn9KoiqUZWtlOUJJ6joxWGkzJeGnux2nP9uoVkpaXuGAOyxob0Jzx04h8iloz9+ UK0VIMiLFSyMQ5oNSs9l+lEm5PIoNc1V5b79smMGbiGhUo+y4Bd5QjlOoSQhHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678993033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0fZ/ekfjtsneufXy2EHDWuPCBX4OkHiEhanD0K50BM=; b=JzWhpYowMGyGnSmg4CetSmMZnB/sITZdvIOjK4K4nDLs23D3p5z2XemC9k2VQ8Cj8wPXt+ qcbIDrnxL8YiEim9IRDKm23XvdseShI8WD/CEZ+Gwg5V1sVj3fYtJ4iKbatlFUzRaimWTK rwcBryNci92L+m4W86BOuDT2LcO+4wHFrAoP3ouoXAiQiU8GEAfEtFRCcA+h9iQBj+vlti DRVTLV4P73E8cHbj6CFxK5BBQZhg/Nw70FvrSbmrH5ndtJDjW9GxJ0z9gcAosYph6VEviO 6jlFUinuRy8KMQTOiLRV9Kdvyuu113/QJl/5fFx5fQnCmfxpe35peoC2rC6drw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678993033; a=rsa-sha256; cv=none; b=J6W6Aqgti3aejclLmM/3KfpOJbRw7eALZTt1J8RGClPUeABj8dvSf7deRaapBKC2+P5tgU DCTrrazPZGN3gs7mmvliKAHbfo98uMIYDlZkRfHzM8y1ttqVsgb6JHMkxi8onVa6QvwepJ bo3XV+DzVltcrJ4WL9Bgvu8p+BCCVxHnWaNrMxccSkucMs7l1yGD5VOhp/hNuQNuNNzADW wiI0kJcDMWOW9n4hEubmc8cw7vIFCzauUV7T9DdXvrVldxEY2B4Mlu7Br2iCsk8cY2Aly/ YOsFvSne0JXn+aq5T0a2bWNNZ2MtwH+o8ZvG5cdEHtG2X17t1H1AI+mz40ylGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcxMY5j4bzvZ8; Thu, 16 Mar 2023 18:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GIvDqN036080; Thu, 16 Mar 2023 18:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GIvDiG036079; Thu, 16 Mar 2023 18:57:13 GMT (envelope-from git) Date: Thu, 16 Mar 2023 18:57:13 GMT Message-Id: <202303161857.32GIvDiG036079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: ba5070ab441f - main - libc/yp: sort out warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba5070ab441f1ad901c0412f531bd646d0bd0616 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ba5070ab441f1ad901c0412f531bd646d0bd0616 commit ba5070ab441f1ad901c0412f531bd646d0bd0616 Author: Mateusz Guzik AuthorDate: 2023-03-16 18:56:47 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-16 18:56:47 +0000 libc/yp: sort out warnings .. in least-effort manner Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libc/yp/xdryp.c | 2 +- lib/libc/yp/yplib.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/libc/yp/xdryp.c b/lib/libc/yp/xdryp.c index aa7c7123a04b..da996276aaf8 100644 --- a/lib/libc/yp/xdryp.c +++ b/lib/libc/yp/xdryp.c @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -extern int (*ypresp_allfn)(); +extern int (*ypresp_allfn)(u_long, char *, int, char *, int, void *); extern void *ypresp_data; /* diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index 92b57c2512db..c6a30bee1d72 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -92,11 +92,7 @@ struct dom_binding { #endif #define MAX_RETRIES 20 -extern bool_t xdr_domainname(), xdr_ypbind_resp(); -extern bool_t xdr_ypreq_key(), xdr_ypresp_val(); -extern bool_t xdr_ypreq_nokey(), xdr_ypresp_key_val(); -extern bool_t xdr_ypresp_all(), xdr_ypresp_all_seq(); -extern bool_t xdr_ypresp_master(); +bool_t xdr_ypresp_all_seq(XDR *xdrs, u_long *objp); int (*ypresp_allfn)(); void *ypresp_data; From nobody Thu Mar 16 19:03:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcxVM37JDz3ySxp; Thu, 16 Mar 2023 19:03: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 4PcxVM2Gmdz45Sq; Thu, 16 Mar 2023 19:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678993387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wtTo6KLwRud39xn82HDnxAbKaWvPh2Fc4Q58qIjXqs8=; b=k+BiF7YU0zRdREIusI7uIjWRNCbSYu5QPJ8a0Aant1NfBNiwKkAbYcoyrpi0S7cn2SDa4S 80QxkiUtreRHIJ79DfpHyhecTRFGLRtKIoJjHhuekT+6Qv+BG0h4yMXrQsMBYGnBgjpuAA 0kxyNTpG9v6Spjfg8kSNBd/BnS9veqlcwzp3Favu4N0JKI3E1F3J6KlCcIMYBscBM7ryce fInt/Zs3n9hysJvGruS12olUwiBHmSVpxApEsaqDGQj0u9ebJ6DMvq9Elvi91jxrfk9aas ZjCdpMaPNyxkrWDyS/0pntBJKyaqI1/815T7dajMHzfGwUJLa76B+feYPImZwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678993387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wtTo6KLwRud39xn82HDnxAbKaWvPh2Fc4Q58qIjXqs8=; b=cuJ7Rc9PAjIRDKIB5NVLBZMmaL7ewAKi1AF8NExFts3MFBIDE1vg/Wskia3ZULOD0zYPvz J9PZZHg/S1p2n7X2p7aj55kxFUvLZXIec38t3phsgo/f8nH1y1jqQa/XWqmviRHqueOdUK ZDPnMcRHz6KGlr2rT02qFbjyMg5pV6tG/9JKx95YLbZorF4FZMcQCgr/U5jdsE4jW2yc1P /i2ZDmhhMySWhPRv0Xo+hfKtsltD/0xDO8/Jv0TE9toztvIVgwaM6iqn1vPOwDjIXsNOTg im3vYGGC+I3W8Dn1sqkbXCQkShljNLr7zCIVJKyBUhTe9KREHGfq+4/YqjjuNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678993387; a=rsa-sha256; cv=none; b=F4JZfmoIyx+D3DGRRhSMijtel5E1iWG5fnMu4y87viRRLgRPcbnemWI33OBy/P2OzL2iyr z8U/5wnlQ8Ipbu/vuf6+0kOJqnBa8rC2+2KzKfXStmdzitTMq1MUm52JtAw3iWz4Dq88MQ 8fvXffd08iJEt3EiK3vGOoKaegDeVpzQuWJMawDzy0NcpQb4mXEvMyygLgmIr9kWTsP70a ukqKzRHVLdz3y378hGhz/jHvEKI6b/InVsWnffAwYwNujTgqMlDgCtHee1Qi1aIwR3XI8b B/02ycbBGEGBCWVvvziqSIoKjn0tYvjpJ5vcUUEPebHRbDx4eA5Gmf1RXBXw4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcxVM1LkdzvP7; Thu, 16 Mar 2023 19:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GJ37J9053054; Thu, 16 Mar 2023 19:03:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GJ37H1053053; Thu, 16 Mar 2023 19:03:07 GMT (envelope-from git) Date: Thu, 16 Mar 2023 19:03:07 GMT Message-Id: <202303161903.32GJ37H1053053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: b38688df1d0c - main - libmd: ansify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b38688df1d0c653ef0596ed5ca02ddb77f73c46c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b38688df1d0c653ef0596ed5ca02ddb77f73c46c commit b38688df1d0c653ef0596ed5ca02ddb77f73c46c Author: Mateusz Guzik AuthorDate: 2023-03-16 19:02:56 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-16 19:02:56 +0000 libmd: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libmd/rmd160c.c | 24 ++++++------------------ lib/libmd/sha0c.c | 21 +++++---------------- lib/libmd/sha1c.c | 21 +++++---------------- 3 files changed, 16 insertions(+), 50 deletions(-) diff --git a/lib/libmd/rmd160c.c b/lib/libmd/rmd160c.c index fa58b7b8735f..d48f2677142f 100644 --- a/lib/libmd/rmd160c.c +++ b/lib/libmd/rmd160c.c @@ -88,8 +88,7 @@ void ripemd160_block_x86(RIPEMD160_CTX *c, const u_int32_t *p,int num); void ripemd160_block(RIPEMD160_CTX *c, const u_int32_t *p,int num); #endif -void RIPEMD160_Init(c) -RIPEMD160_CTX *c; +void RIPEMD160_Init(RIPEMD160_CTX *c) { c->A=RIPEMD160_A; c->B=RIPEMD160_B; @@ -101,10 +100,7 @@ RIPEMD160_CTX *c; c->num=0; } -void RIPEMD160_Update(c, in, len) -RIPEMD160_CTX *c; -const void *in; -size_t len; +void RIPEMD160_Update(RIPEMD160_CTX *c, const void *in, size_t len) { u_int32_t *p; int sw,sc; @@ -233,9 +229,7 @@ size_t len; } } -void RIPEMD160_Transform(c,b) -RIPEMD160_CTX *c; -unsigned char *b; +void RIPEMD160_Transform(RIPEMD160_CTX *c, unsigned char *b) { u_int32_t p[16]; #if BYTE_ORDER != LITTLE_ENDIAN @@ -272,10 +266,7 @@ unsigned char *b; #ifndef RMD160_ASM -void ripemd160_block(ctx, X, num) -RIPEMD160_CTX *ctx; -const u_int32_t *X; -int num; +void ripemd160_block(RIPEMD160_CTX *ctx, const u_int32_t *X, int num) { u_int32_t A,B,C,D,E; u_int32_t a,b,c,d,e; @@ -472,9 +463,7 @@ int num; } #endif -void RIPEMD160_Final(md, c) -unsigned char *md; -RIPEMD160_CTX *c; +void RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c) { int i,j; u_int32_t l; @@ -528,8 +517,7 @@ RIPEMD160_CTX *c; } #ifdef undef -int printit(l) -unsigned long *l; +int printit(unsigned long *l) { int i,ii; diff --git a/lib/libmd/sha0c.c b/lib/libmd/sha0c.c index 438c3a4852ff..e9f83fbd4e19 100644 --- a/lib/libmd/sha0c.c +++ b/lib/libmd/sha0c.c @@ -102,8 +102,7 @@ char *SHA_version="SHA part of SSLeay 0.9.0b 11-Oct-1998"; #define M_p_c2nl_p p_c2nl_p #define M_nl2c nl2c -void SHA_Init(c) -SHA_CTX *c; +void SHA_Init(SHA_CTX *c) { c->h0=INIT_DATA_h0; c->h1=INIT_DATA_h1; @@ -115,10 +114,7 @@ SHA_CTX *c; c->num=0; } -void SHA_Update(c, in, len) -SHA_CTX *c; -const void *in; -size_t len; +void SHA_Update(SHA_CTX *c, const void *in, size_t len) { u_int32_t *p; int ew,ec,sw,sc; @@ -249,9 +245,7 @@ size_t len; p[sw]=l; } -void SHA_Transform(c,b) -SHA_CTX *c; -unsigned char *b; +void SHA_Transform(SHA_CTX *c, unsigned char *b) { u_int32_t p[16]; #if BYTE_ORDER == LITTLE_ENDIAN @@ -286,10 +280,7 @@ unsigned char *b; sha_block(c,p,64); } -void sha_block(c, W, num) -SHA_CTX *c; -const u_int32_t *W; -int num; +void sha_block(SHA_CTX *c, const u_int32_t *W, int num) { u_int32_t A,B,C,D,E,T; u_int32_t X[16]; @@ -405,9 +396,7 @@ int num; } } -void SHA_Final(md, c) -unsigned char *md; -SHA_CTX *c; +void SHA_Final(unsigned char *md, SHA_CTX *c) { int i,j; u_int32_t l; diff --git a/lib/libmd/sha1c.c b/lib/libmd/sha1c.c index 870af2ab1556..871b7a8012dc 100644 --- a/lib/libmd/sha1c.c +++ b/lib/libmd/sha1c.c @@ -129,8 +129,7 @@ char *SHA1_version="SHA1 part of SSLeay 0.9.0b 11-Oct-1998"; # define M_nl2c nl2c #endif -void SHA1_Init(c) -SHA_CTX *c; +void SHA1_Init(SHA_CTX *c) { c->h0=INIT_DATA_h0; c->h1=INIT_DATA_h1; @@ -143,10 +142,7 @@ SHA_CTX *c; } void -SHA1_Update(c, in, len) - SHA_CTX *c; - const void *in; - size_t len; +SHA1_Update(SHA_CTX *c, const void *in, size_t len) { u_int32_t *p; int ew,ec,sw,sc; @@ -277,9 +273,7 @@ SHA1_Update(c, in, len) p[sw]=l; } -void SHA1_Transform(c,b) -SHA_CTX *c; -unsigned char *b; +void SHA1_Transform(SHA_CTX *c, unsigned char *b) { u_int32_t p[16]; #if BYTE_ORDER != BIG_ENDIAN @@ -317,10 +311,7 @@ unsigned char *b; #ifndef SHA1_ASM void -sha1_block(c, W, num) - SHA_CTX *c; - const u_int32_t *W; - int num; +sha1_block(SHA_CTX *c, const u_int32_t *W, int num) { u_int32_t A,B,C,D,E,T; u_int32_t X[16]; @@ -437,9 +428,7 @@ sha1_block(c, W, num) } #endif -void SHA1_Final(md, c) -unsigned char *md; -SHA_CTX *c; +void SHA1_Final(unsigned char *md, SHA_CTX *c) { int i,j; u_int32_t l; From nobody Thu Mar 16 19:10:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcxg736sjz3yTRQ; Thu, 16 Mar 2023 19:10: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 4Pcxg72p3Rz46F7; Thu, 16 Mar 2023 19:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678993843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S45Eaq9Gm5InFxP4eAXEWJ+Ss3ZGYDL5rV65swuIANs=; b=iDkJ1Evn5edg//DBbkQxmBoXmnfxeR69qFPC4iftEPC03Do47zJWEbFxNMWYPXjRHLurTO JCTMG3Iks9CsUlFJa8ptm/aIiVkQyMIk5jERFeY0gpWUmMWUU7HAYKrlOuFtaP3sL+eKLM ZGVIJV9FYp4cfgLxnTFnFeSy4cjIBxZzO4OXaRzx0wjvJOAA/mk+p5lFpN7wRDnkjztXIe G1kGUg3zPRaKqNFM2AB6zNp3C5gCTjJOA5TquNFzt8MMJ0wsCEYAj9ELEIZN0yhXmZaTEQ d5C5/EsBZS6/t9+R0/YQhTlug6RwA71Y24a7JfVK7ffHdJeFJuTfs+JAzTz4SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678993843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S45Eaq9Gm5InFxP4eAXEWJ+Ss3ZGYDL5rV65swuIANs=; b=GbkR7tE/a3UUeJ3rR+ZlZ6/8pBp8OQiuQoxEVRxRjqmovFZHisSsFZQa5ltZT/yllg/Baw t5zrWVGL/1xpChEEjCBS8yKO1bOjsCzst9NPc3t4H8WUUfJZRdweyWMCCXZ6Dq2Yr/B1vB zob7SuKm+D5DbVw1AB93DGigMtYvAKR6Toh2FrES/mvVYQKSootV2iHQSou8M4QjPfVIx5 hidbW0Uap3Hpz4lcaYmTdrHy+7Laxi/bfe+7dfRZnDUxDoVEnCWtgY6weo2xl7lzx1zL6/ 1pJTDwBKSferBzQ8tOKd4D1b7kgPVK6OrN7e1fxYqx+wlx5WNrMywBWMTBLBtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678993843; a=rsa-sha256; cv=none; b=K03YV3rLgSDGoLFazfA1tzVY6rjh0TAsYgtHeME59AWy3Lh7gFAKAwpF3wuH1IAb/qqb1s V5YNIgtehWcBkEcK9xcR8BMU6dlwSTv7mySekVLooYHi6+Zkq3kObxKomYzNCO/qyY3Suj RyBlj1AOzkXYxu+EoOxCL2yJSs0RV15CTfnDIqGlOIEAgyrGs0o3hLuBoh9wfw0/39+QOP H7cmt6YG7GXo0t8waBtCiQ9EV3teuUnsJE+fchpcSC9mebJaTyoqihEEYLbCwinq0CPIc9 TJrw7Mrh6B3nAZWTCcXl/ZAlckY5fQC32ijzPsViVZbW/YZUcVpJTlNL/8sNhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pcxg71qkszvhD; Thu, 16 Mar 2023 19:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GJAhrp062513; Thu, 16 Mar 2023 19:10:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GJAgt0062512; Thu, 16 Mar 2023 19:10:42 GMT (envelope-from git) Date: Thu, 16 Mar 2023 19:10:42 GMT Message-Id: <202303161910.32GJAgt0062512@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: 802b48363097 - stable/13 - ssh: Update to OpenSSH 9.3p1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 802b483630974c2ccf2bfbc90b39102b9e47d22b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=802b483630974c2ccf2bfbc90b39102b9e47d22b commit 802b483630974c2ccf2bfbc90b39102b9e47d22b Author: Ed Maste AuthorDate: 2023-03-16 14:29:55 +0000 Commit: Ed Maste CommitDate: 2023-03-16 19:08:54 +0000 ssh: Update to OpenSSH 9.3p1 This release fixes a number of security bugs and has minor new features and bug fixes. Security fixes, from the release notes (https://www.openssh.com/txt/release-9.3): This release contains fixes for a security problem and a memory safety problem. The memory safety problem is not believed to be exploitable, but we report most network-reachable memory faults as security bugs. * ssh-add(1): when adding smartcard keys to ssh-agent(1) with the per-hop destination constraints (ssh-add -h ...) added in OpenSSH 8.9, a logic error prevented the constraints from being communicated to the agent. This resulted in the keys being added without constraints. The common cases of non-smartcard keys and keys without destination constraints are unaffected. This problem was reported by Luci Stanescu. * ssh(1): Portable OpenSSH provides an implementation of the getrrsetbyname(3) function if the standard library does not provide it, for use by the VerifyHostKeyDNS feature. A specifically crafted DNS response could cause this function to perform an out-of-bounds read of adjacent stack data, but this condition does not appear to be exploitable beyond denial-of- service to the ssh(1) client. The getrrsetbyname(3) replacement is only included if the system's standard library lacks this function and portable OpenSSH was not compiled with the ldns library (--with-ldns). getrrsetbyname(3) is only invoked if using VerifyHostKeyDNS to fetch SSHFP records. This problem was found by the Coverity static analyzer. Accelerated MFC to prepare for inclusion in 13.2-RELEASE. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4d3fc8b0570b29fb0d6ee9525f104d52176ff0d4) --- crypto/openssh/.depend | 51 +- crypto/openssh/.github/ci-status.md | 7 +- crypto/openssh/.github/configs | 2 +- crypto/openssh/.github/run_test.sh | 2 +- crypto/openssh/.github/setup_ci.sh | 6 +- crypto/openssh/.github/workflows/c-cpp.yml | 1 + crypto/openssh/.github/workflows/selfhosted.yml | 3 + crypto/openssh/.github/workflows/upstream.yml | 1 + crypto/openssh/ChangeLog | 15098 ++++++++++--------- crypto/openssh/Makefile.in | 5 + crypto/openssh/README | 3 +- crypto/openssh/README.md | 1 + crypto/openssh/auth-pam.c | 15 +- crypto/openssh/auth-shadow.c | 14 +- crypto/openssh/auth.c | 3 +- crypto/openssh/auth2-hostbased.c | 9 +- crypto/openssh/auth2-none.c | 3 +- crypto/openssh/auth2-pubkey.c | 8 +- crypto/openssh/auth2-pubkeyfile.c | 3 +- crypto/openssh/auth2.c | 5 +- crypto/openssh/authfd.c | 9 +- crypto/openssh/authfile.c | 4 +- crypto/openssh/canohost.c | 5 +- crypto/openssh/channels.c | 42 +- crypto/openssh/channels.h | 4 +- crypto/openssh/clientloop.c | 14 +- crypto/openssh/compat.c | 53 +- crypto/openssh/compat.h | 14 +- crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/dispatch.c | 3 +- crypto/openssh/dns.c | 8 +- crypto/openssh/dns.h | 4 +- crypto/openssh/hostfile.c | 15 +- crypto/openssh/kex.c | 72 +- crypto/openssh/kex.h | 5 +- crypto/openssh/kexgexs.c | 3 +- crypto/openssh/krl.c | 3 +- crypto/openssh/misc.c | 5 +- crypto/openssh/misc.h | 5 +- crypto/openssh/moduli.c | 13 +- crypto/openssh/monitor.c | 11 +- crypto/openssh/mux.c | 4 +- crypto/openssh/openbsd-compat/bsd-getentropy.c | 2 +- crypto/openssh/openbsd-compat/bsd-snprintf.c | 90 +- crypto/openssh/openbsd-compat/getopt.h | 3 + crypto/openssh/openbsd-compat/getopt_long.c | 14 + crypto/openssh/openbsd-compat/getrrsetbyname.c | 47 +- .../openssh/openbsd-compat/libressl-api-compat.c | 14 +- crypto/openssh/openbsd-compat/mktemp.c | 23 + crypto/openssh/openbsd-compat/openbsd-compat.h | 3 + crypto/openssh/packet.c | 4 +- crypto/openssh/progressmeter.c | 95 +- crypto/openssh/readconf.c | 11 +- crypto/openssh/regress/Makefile | 6 +- crypto/openssh/regress/agent-getpeereid.sh | 3 +- crypto/openssh/regress/agent-restrict.sh | 6 +- crypto/openssh/regress/agent.sh | 4 +- crypto/openssh/regress/dhgex.sh | 6 +- crypto/openssh/regress/integrity.sh | 4 +- crypto/openssh/regress/keygen-sshfp.sh | 22 +- crypto/openssh/regress/knownhosts.sh | 20 +- crypto/openssh/regress/multiplex.sh | 4 +- crypto/openssh/regress/sshd-log-wrapper.sh | 12 - crypto/openssh/regress/test-exec.sh | 88 +- crypto/openssh/regress/timestamp.c | 46 + .../openssh/regress/unittests/kex/test_proposal.c | 47 +- crypto/openssh/regress/unittests/kex/tests.c | 8 +- .../openssh/regress/unittests/misc/test_ptimeout.c | 6 +- crypto/openssh/sandbox-seccomp-filter.c | 93 +- crypto/openssh/scp.c | 8 +- crypto/openssh/servconf.c | 15 +- crypto/openssh/serverloop.c | 5 +- crypto/openssh/session.c | 4 +- crypto/openssh/sftp-client.c | 3 +- crypto/openssh/sftp-server.c | 4 +- crypto/openssh/sftp.c | 14 +- crypto/openssh/ssh-add.c | 9 +- crypto/openssh/ssh-agent.c | 8 +- crypto/openssh/ssh-dss.c | 3 +- crypto/openssh/ssh-ecdsa-sk.c | 3 +- crypto/openssh/ssh-ecdsa.c | 4 +- crypto/openssh/ssh-keygen.1 | 19 +- crypto/openssh/ssh-keygen.c | 42 +- crypto/openssh/ssh-keyscan.1 | 19 +- crypto/openssh/ssh-keyscan.c | 22 +- crypto/openssh/ssh-pkcs11.c | 8 +- crypto/openssh/ssh-rsa.c | 3 +- crypto/openssh/ssh.c | 3 +- crypto/openssh/ssh_config | 2 +- crypto/openssh/ssh_config.5 | 8 +- crypto/openssh/ssh_namespace.h | 4 +- crypto/openssh/sshconnect.c | 5 +- crypto/openssh/sshconnect2.c | 81 +- crypto/openssh/sshd.8 | 20 +- crypto/openssh/sshd.c | 92 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 20 +- crypto/openssh/umac.c | 5 +- crypto/openssh/version.h | 6 +- secure/lib/libssh/Makefile | 1 + 101 files changed, 8558 insertions(+), 8105 deletions(-) diff --git a/crypto/openssh/.depend b/crypto/openssh/.depend index 5226523aa2ad..259bf3b2f136 100644 --- a/crypto/openssh/.depend +++ b/crypto/openssh/.depend @@ -16,21 +16,20 @@ auth-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-c auth-rhosts.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h uidswap.h pathnames.h log.h ssherr.h misc.h xmalloc.h sshbuf.h sshkey.h servconf.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-shadow.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h auth-sia.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth.o: authfile.h monitor_wrap.h compat.h channels.h +auth.o: authfile.h monitor_wrap.h channels.h auth.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h groupaccess.h log.h ssherr.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h canohost.h uidswap.h packet.h dispatch.h auth2-chall.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h ssherr.h log.h misc.h servconf.h auth2-gss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth2-hostbased.o: canohost.h monitor_wrap.h pathnames.h match.h -auth2-hostbased.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth2-hostbased.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h canohost.h +auth2-hostbased.o: monitor_wrap.h pathnames.h match.h auth2-kbdint.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h log.h ssherr.h misc.h servconf.h -auth2-none.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h misc.h servconf.h compat.h ssh2.h monitor_wrap.h +auth2-none.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h misc.h servconf.h ssh2.h monitor_wrap.h auth2-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h ssherr.h log.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h monitor_wrap.h misc.h servconf.h auth2-pubkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth2-pubkey.o: pathnames.h uidswap.h auth-options.h canohost.h monitor_wrap.h authfile.h match.h channels.h session.h sk-api.h -auth2-pubkeyfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h log.h ssherr.h misc.h compat.h sshkey.h digest.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfile.h match.h -auth2.o: digest.h -auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h -authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h compat.h log.h ssherr.h atomicio.h misc.h +auth2-pubkeyfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h log.h ssherr.h misc.h sshkey.h digest.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfile.h match.h +auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h digest.h +authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h log.h ssherr.h atomicio.h misc.h authfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh.h log.h ssherr.h authfile.h misc.h atomicio.h sshkey.h sshbuf.h krl.h bitmap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h bitmap.h canohost.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h canohost.h misc.h @@ -44,11 +43,11 @@ cipher.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat cleanup.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h clientloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h packet.h dispatch.h sshbuf.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h clientloop.o: myproposal.h log.h ssherr.h misc.h readconf.h clientloop.h sshconnect.h authfd.h atomicio.h sshpty.h match.h msg.h hostfile.h -compat.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h log.h ssherr.h match.h kex.h mac.h crypto_api.h +compat.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h log.h ssherr.h match.h dh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h digest-libc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h digest.h digest-openssl.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -dispatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh2.h log.h ssherr.h dispatch.h packet.h openbsd-compat/sys-queue.h compat.h +dispatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh2.h log.h ssherr.h dispatch.h packet.h openbsd-compat/sys-queue.h dns.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h ssherr.h dns.h log.h digest.h ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h entropy.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h @@ -61,7 +60,7 @@ hash.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h hmac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshbuf.h digest.h hmac.h hostfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h sshkey.h hostfile.h log.h ssherr.h misc.h pathnames.h digest.h hmac.h sshbuf.h kex.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h ssh2.h atomicio.h version.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h log.h ssherr.h -kex.o: match.h misc.h monitor.h sshbuf.h digest.h +kex.o: match.h misc.h monitor.h myproposal.h sshbuf.h digest.h xmalloc.h kexc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h sshbuf.h digest.h ssherr.h ssh2.h kexdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h kexecdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h @@ -94,8 +93,8 @@ platform-tracing.o: includes.h config.h defines.h platform.h openbsd-compat/open platform.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h poly1305.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h poly1305.h progressmeter.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h progressmeter.h atomicio.h misc.h utf8.h -readconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h ssherr.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h pathnames.h log.h sshkey.h misc.h readconf.h match.h kex.h mac.h crypto_api.h -readconf.o: uidswap.h myproposal.h digest.h +readconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h ssherr.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h pathnames.h log.h sshkey.h misc.h readconf.h match.h kex.h mac.h crypto_api.h uidswap.h +readconf.o: myproposal.h digest.h readpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h pathnames.h log.h ssherr.h ssh.h uidswap.h rijndael.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h rijndael.h sandbox-capsicum.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h @@ -107,12 +106,12 @@ sandbox-seccomp-filter.o: includes.h config.h defines.h platform.h openbsd-compa sandbox-solaris.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sandbox-systrace.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h scp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h atomicio.h pathnames.h log.h ssherr.h misc.h progressmeter.h utf8.h sftp.h sftp-common.h sftp-client.h -servconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h openbsd-compat/sys-queue.h xmalloc.h ssh.h log.h ssherr.h sshbuf.h misc.h servconf.h compat.h pathnames.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey .h -servconf.o: kex.h mac.h crypto_api.h match.h channels.h groupaccess.h canohost.h packet.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h myproposal.h digest.h -serverloop.o: cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h loginrec.h session.h auth-options.h serverloop.h -serverloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h packet.h dispatch.h sshbuf.h log.h ssherr.h misc.h servconf.h canohost.h sshpty.h channels.h compat.h ssh2.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h -session.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h sshbuf.h ssherr.h match.h uidswap.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h -session.o: rijndael.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfd.h pathnames.h log.h misc.h servconf.h sshlogin.h serverloop.h canohost.h session.h kex.h mac.h crypto_api.h monitor_wrap.h sftp.h atomicio.h +servconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h openbsd-compat/sys-queue.h xmalloc.h ssh.h log.h ssherr.h sshbuf.h misc.h servconf.h pathnames.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h +servconf.o: mac.h crypto_api.h match.h channels.h groupaccess.h canohost.h packet.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h myproposal.h digest.h +serverloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h packet.h dispatch.h sshbuf.h log.h ssherr.h misc.h servconf.h canohost.h sshpty.h channels.h ssh2.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr .h +serverloop.o: rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h loginrec.h session.h auth-options.h serverloop.h +session.o: hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfd.h pathnames.h log.h misc.h servconf.h sshlogin.h serverloop.h canohost.h session.h kex.h mac.h crypto_api.h monitor_wrap.h sftp.h atomicio.h +session.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h sshbuf.h ssherr.h match.h uidswap.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sftp-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssherr.h sshbuf.h log.h atomicio.h progressmeter.h misc.h utf8.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h sftp-common.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssherr.h sshbuf.h log.h misc.h sftp.h sftp-common.h sftp-glob.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h @@ -125,7 +124,7 @@ sk-usbhid.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-com sntrup761.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h srclimit.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h canohost.h log.h ssherr.h misc.h srclimit.h xmalloc.h ssh-add.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h log.h ssherr.h sshkey.h sshbuf.h authfd.h authfile.h pathnames.h misc.h digest.h ssh-sk.h sk-api.h hostfile.h -ssh-agent.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h sshkey.h authfd.h compat.h log.h ssherr.h misc.h digest.h match.h msg.h pathnames.h ssh-pkcs11.h sk-api.h myproposal.h +ssh-agent.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h sshkey.h authfd.h log.h ssherr.h misc.h digest.h match.h msg.h pathnames.h ssh-pkcs11.h sk-api.h myproposal.h ssh-dss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh-ecdsa-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h sshbuf.h ssherr.h digest.h sshkey.h ssh-ecdsa.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h @@ -133,8 +132,8 @@ ssh-ed25519-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbs ssh-ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h ssherr.h sshbuf.h sshkey.h ssh.h ssh-keygen.o: cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh-keygen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h authfile.h sshbuf.h pathnames.h log.h ssherr.h misc.h match.h hostfile.h dns.h ssh.h ssh2.h ssh-pkcs11.h atomicio.h krl.h digest.h utf8.h authfd.h sshsig.h ssh-sk.h sk-api.h cipher.h -ssh-keyscan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h sshbuf.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h compat.h myproposal.h packet.h dispatch.h log .h -ssh-keyscan.o: ssherr.h atomicio.h misc.h hostfile.h ssh_api.h ssh2.h dns.h addr.h +ssh-keyscan.o: dispatch.h log.h ssherr.h atomicio.h misc.h hostfile.h ssh_api.h ssh2.h dns.h addr.h +ssh-keyscan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h sshbuf.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h digest.h kex.h mac.h crypto_api.h compat.h myproposal.h packet.h ssh-keysign.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ssherr.h sshkey.h ssh.h ssh2.h misc.h sshbuf.h authfile.h msg.h canohost.h pathnames.h readconf.h uidswap.h ssh-pkcs11-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh-pkcs11-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h sshbuf.h log.h ssherr.h misc.h sshkey.h authfd.h ssh-pkcs11.h @@ -153,12 +152,12 @@ sshbuf-getput-crypto.o: includes.h config.h defines.h platform.h openbsd-compat/ sshbuf-io.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h atomicio.h sshbuf-misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h sshbuf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h misc.h -sshconnect.o: authfd.h kex.h mac.h crypto_api.h -sshconnect.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h hostfile.h ssh.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h sshkey.h sshconnect.h log.h ssherr.h misc.h readconf.h atomicio.h dns.h monitor_fdpass.h ssh2.h version.h authfile.h +sshconnect.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h hostfile.h ssh.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h sshkey.h sshconnect.h log.h ssherr.h misc.h readconf.h atomicio.h dns.h monitor_fdpass.h ssh2.h version.h authfile.h authfd.h +sshconnect.o: kex.h mac.h crypto_api.h sshconnect2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h packet.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h -sshconnect2.o: myproposal.h sshconnect.h authfile.h dh.h authfd.h log.h ssherr.h misc.h readconf.h match.h canohost.h msg.h pathnames.h uidswap.h hostfile.h utf8.h ssh-sk.h sk-api.h +sshconnect2.o: sshconnect.h authfile.h dh.h authfd.h log.h ssherr.h misc.h readconf.h match.h canohost.h msg.h pathnames.h uidswap.h hostfile.h utf8.h ssh-sk.h sk-api.h sshd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h log.h ssherr.h sshbuf.h misc.h match.h servconf.h uidswap.h compat.h cipher.h cipher-chachapoly.h chacha.h -sshd.o: poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h kex.h mac.h crypto_api.h myproposal.h authfile.h pathnames.h atomicio.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h authfd.h msg.h channels.h session.h monitor.h monitor_wrap.h ssh-sandbox.h auth-options.h version.h sk-api.h srclimit.h dh.h +sshd.o: poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h kex.h mac.h crypto_api.h authfile.h pathnames.h atomicio.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h authfd.h msg.h channels.h session.h monitor.h monitor_wrap.h ssh-sandbox.h auth-options.h version.h sk-api.h srclimit.h dh.h ssherr.o: ssherr.h sshkey-xmss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h ssh2.h ssherr.h misc.h sshbuf.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h match.h ssh-sk.h openbsd-compat/openssl-compat.h diff --git a/crypto/openssh/.github/ci-status.md b/crypto/openssh/.github/ci-status.md index d13bbfa8c038..c57c3d83d11a 100644 --- a/crypto/openssh/.github/ci-status.md +++ b/crypto/openssh/.github/ci-status.md @@ -4,7 +4,8 @@ master : [![Upstream self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/upstream.yml/badge.svg)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/upstream.yml?query=branch:master) [![CIFuzz](https://github.com/openssh/openssh-portable/actions/workflows/cifuzz.yml/badge.svg)](https://github.com/openssh/openssh-portable/actions/workflows/cifuzz.yml) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/openssh.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:openssh) +[![Coverity Status](https://scan.coverity.com/projects/21341/badge.svg)](https://scan.coverity.com/projects/openssh-portable) -9.1 : -[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_1)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_1) -[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_1)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_1) +9.2 : +[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_2)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_2) +[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_2)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_2) diff --git a/crypto/openssh/.github/configs b/crypto/openssh/.github/configs index bdd5ddbdfaf0..8f21fc54a268 100755 --- a/crypto/openssh/.github/configs +++ b/crypto/openssh/.github/configs @@ -221,7 +221,7 @@ case "${TARGET_HOST}" in # test run does not time out. # The agent-restrict test fails due to some quoting issue when run # with sh or ksh so specify bash for now. - TEST_TARGET="t-exec TEST_SHELL=bash" + TEST_TARGET="t-exec unit TEST_SHELL=bash" SKIP_LTESTS="rekey sftp" ;; debian-riscv64) diff --git a/crypto/openssh/.github/run_test.sh b/crypto/openssh/.github/run_test.sh index 8eeaf5e9b09d..d5fd487d9009 100755 --- a/crypto/openssh/.github/run_test.sh +++ b/crypto/openssh/.github/run_test.sh @@ -21,7 +21,7 @@ if [ ! -z "$SUDO" ] && [ ! -z "$TEST_SSH_HOSTBASED_AUTH" ]; then fi output_failed_logs() { - for i in regress/failed*; do + for i in regress/failed*.log; do if [ -f "$i" ]; then echo ------------------------------------------------------------------------- echo LOGFILE $i diff --git a/crypto/openssh/.github/setup_ci.sh b/crypto/openssh/.github/setup_ci.sh index e4480e614f31..691c70dd7ed6 100755 --- a/crypto/openssh/.github/setup_ci.sh +++ b/crypto/openssh/.github/setup_ci.sh @@ -7,10 +7,10 @@ PACKAGES="" case "`./config.guess`" in *cygwin) PACKAGER=setup - echo Setting CYGWIN sustem environment variable. + echo Setting CYGWIN system environment variable. setx CYGWIN "binmode" - chmod -R go-rw /cygdrive/d/a - umask 077 + echo Removing extended ACLs so umask works as expected. + setfacl -b . regress PACKAGES="$PACKAGES,autoconf,automake,cygwin-devel,gcc-core" PACKAGES="$PACKAGES,make,openssl-devel,zlib-devel" ;; diff --git a/crypto/openssh/.github/workflows/c-cpp.yml b/crypto/openssh/.github/workflows/c-cpp.yml index e6ea49550f71..f3163884a037 100644 --- a/crypto/openssh/.github/workflows/c-cpp.yml +++ b/crypto/openssh/.github/workflows/c-cpp.yml @@ -123,3 +123,4 @@ jobs: regress/valgrind-out/ regress/asan.log.* regress/msan.log.* + regress/log/* diff --git a/crypto/openssh/.github/workflows/selfhosted.yml b/crypto/openssh/.github/workflows/selfhosted.yml index 50bc9fffb723..d38cba520500 100644 --- a/crypto/openssh/.github/workflows/selfhosted.yml +++ b/crypto/openssh/.github/workflows/selfhosted.yml @@ -21,6 +21,7 @@ jobs: matrix: target: - alpine + - centos7 - debian-i386 - dfly30 - dfly48 @@ -51,6 +52,7 @@ jobs: include: # Then we include extra libvirt test configs. - { target: aix51, config: default, host: libvirt } + - { target: centos7, config: pam, host: libvirt } - { target: debian-i386, config: pam, host: libvirt } - { target: dfly30, config: without-openssl, host: libvirt} - { target: dfly48, config: pam ,host: libvirt } @@ -109,6 +111,7 @@ jobs: config.h config.log regress/*.log + regress/log/* regress/valgrind-out/ - name: shutdown VM if: always() diff --git a/crypto/openssh/.github/workflows/upstream.yml b/crypto/openssh/.github/workflows/upstream.yml index 1e2c2acb7ac0..b280793d31f3 100644 --- a/crypto/openssh/.github/workflows/upstream.yml +++ b/crypto/openssh/.github/workflows/upstream.yml @@ -46,6 +46,7 @@ jobs: name: ${{ matrix.target }}-${{ matrix.config }}-logs path: | /usr/obj/regress/usr.bin/ssh/obj/*.log + /usr/obj/regress/usr.bin/ssh/obj/log/* - name: shutdown VM if: always() run: vmshutdown diff --git a/crypto/openssh/ChangeLog b/crypto/openssh/ChangeLog index 4251831a1732..f1d1b37d583c 100644 --- a/crypto/openssh/ChangeLog +++ b/crypto/openssh/ChangeLog @@ -1,11196 +1,11238 @@ -commit 6dfb65de949cdd0a5d198edee9a118f265924f33 +commit cb30fbdbee869f1ce11f06aa97e1cb8717a0b645 Author: Damien Miller -Date: Thu Feb 2 23:21:54 2023 +1100 +Date: Thu Mar 16 08:28:19 2023 +1100 - crank versions in RPM specs + depend -commit d07cfb11a0ca574eb68a3931d8c46fbe862a2021 +commit 1dba63eb10c40b6fda9f5012ed6ae87e2d3d028e Author: Damien Miller -Date: Thu Feb 2 23:21:45 2023 +1100 +Date: Thu Mar 16 08:27:54 2023 +1100 - update version in README + crank version -commit 9fe207565b4ab0fe5d1ac5bb85e39188d96fb214 -Author: Damien Miller -Date: Thu Feb 2 23:17:49 2023 +1100 +commit ba7532d0dac9aaf0ad7270664c43837fc9f64a5f +Author: djm@openbsd.org +Date: Wed Mar 15 21:19:57 2023 +0000 - adapt compat_kex_proposal() test to portable + upstream: openssh-9.3 + + OpenBSD-Commit-ID: 8011495f2449c1029bb316bd015eab2e00509848 -commit 903c556b938fff2d7bff8da2cc460254430963c5 -Author: djm@openbsd.org -Date: Thu Feb 2 12:12:52 2023 +0000 +commit 6fd4daafb949b66bf555f3100f715a9ec64c3390 +Author: dtucker@openbsd.org +Date: Tue Mar 14 07:28:47 2023 +0000 - upstream: test compat_kex_proposal(); by dtucker@ + upstream: Free KRL ptr in addition to its contents. - OpenBSD-Regress-ID: 0e404ee264db546f9fdbf53390689ab5f8d38bf2 + From Coverity CID 291841, ok djm@ + + OpenBSD-Commit-ID: f146ba08b1b43af4e0d7ad8c4dae3748b4fa31b6 -commit 405fba71962dec8409c0c962408e09049e5624b5 +commit 1d270bd303afaf6d94e9098cbbf18e5e539e2088 Author: dtucker@openbsd.org -Date: Thu Jan 19 07:53:45 2023 +0000 +Date: Tue Mar 14 07:26:25 2023 +0000 - upstream: Check if we can copy sshd or need to use sudo to do so + upstream: Check pointer for NULL before deref. - during reexec test. Skip test if neither can work. Patch from anton@, tweaks - from me. + None of the existing callers seem to do that, but it's worth checking. + From Coverity CID 291834, ok djm@ - OpenBSD-Regress-ID: 731b96ae74d02d5744e1f1a8e51d09877ffd9b6d + OpenBSD-Commit-ID: a0a97113f192a7cb1a2c97b932f677f573cda7a4 -commit b2a2a8f69fd7737ea17dc044353c514f2f962f35 -Author: djm@openbsd.org -Date: Thu Feb 2 12:10:22 2023 +0000 +commit d95af508e78c0cd3dce56b83853baaa59ae295cf +Author: dtucker@openbsd.org +Date: Sun Mar 12 10:40:39 2023 +0000 - upstream: openssh-9.2 + upstream: Limit number of entries in SSH2_MSG_EXT_INFO - OpenBSD-Commit-ID: f7389f32413c74d6e2055f05cf65e7082de03923 + request. This is already constrained by the maximum SSH packet size but this + makes it explicit. Prompted by Coverity CID 291868, ok djm@ markus@ + + OpenBSD-Commit-ID: aea023819aa44a2dcb9dd0fbec10561896fc3a09 -commit 12da7823336434a403f25c7cc0c2c6aed0737a35 -Author: djm@openbsd.org -Date: Thu Feb 2 12:10:05 2023 +0000 +commit 8f287ba60d342b3e2f750e7332d2131e3ec7ecd0 +Author: dtucker@openbsd.org +Date: Sun Mar 12 09:41:18 2023 +0000 - upstream: fix double-free caused by compat_kex_proposal(); bz3522 + upstream: calloc can return NULL but xcalloc can't. - by dtucker@, ok me + From Coverity CID 291881, ok djm@ - OpenBSD-Commit-ID: 2bfc37cd2d41f67dad64c17a64cf2cd3806a5c80 + OpenBSD-Commit-ID: 50204b755f66b2ec7ac3cfe379d07d85ca161d2b -commit 79efd95ab5ff99f4cb3a955e2d713b3f54fb807e -Author: Darren Tucker -Date: Wed Feb 1 17:17:26 2023 +1100 +commit 83a56a49fd50f4acf900f934279482e4ef329715 +Author: dtucker@openbsd.org +Date: Fri Mar 10 07:17:08 2023 +0000 - Skip connection-timeout test on minix3. + upstream: Explicitly ignore return from fcntl - Minix 3's Unix domain sockets don't seem to work the way we expect, so - skip connection-timeout test on that platform. While there, group - together all similarly skipped tests and explicitly comment. + (... FD_CLOEXEC) here too. Coverity CID 291853. + + OpenBSD-Commit-ID: 99d8b3da9d0be1d07ca8dd8e98800a890349e9b5 -commit 6b508c4e039619842bcf5a16f8a6b08dd6bec44a +commit 0fda9d704d3bbf54a5e64ce02a6fecb11fe7f047 Author: Damien Miller -Date: Wed Feb 1 12:12:05 2023 +1100 +Date: Fri Mar 10 15:59:46 2023 +1100 - fix libfido2 detection without pkg-config + bounds checking for getrrsetbyname() replacement; - Place libfido2 before additional libraries (that it may depend upon) - and not after. bz3530 from James Zhang; ok dtucker@ + Spotted by Coverity in CID 405033; ok millert@ -commit 358e300fed5e6def233a2c06326e51e20ebed621 -Author: deraadt@openbsd.org -Date: Wed Jan 18 20:56:36 2023 +0000 +commit 89b8df518f21677045599df0ad3e5dd0f39909b5 +Author: dtucker@openbsd.org +Date: Fri Mar 10 04:06:21 2023 +0000 - upstream: delete useless dependency + upstream: Plug mem leak on error path. Coverity CID 405026, ok djm@. - OpenBSD-Commit-ID: e1dc11143f83082e3154d6094f9136d0dc2637ad + OpenBSD-Commit-ID: 8212ca05d01966fb5e72205c592b2257708a2aac -commit a4cb9be1b021b511e281ee55c356f964487d9e82 -Author: deraadt@openbsd.org -Date: Wed Jan 18 20:43:15 2023 +0000 +commit bf4dae0ad192c3e2f03f7223834b00d88ace3d3e +Author: Darren Tucker +Date: Fri Mar 10 14:46:57 2023 +1100 - upstream: Create and install sshd random relink kit. + Add prototypes for mkstemp replacements. - ../Makefile.inc and Makfile are concatenated for reuse, which hopefully won't - be too fragile, we'll see if we need a different approach. The resulting sshd - binary is tested with the new sshd -V option before installation. As the - binary layout is now semi-unknown (meaning relative, fixed, and gadget - offsets are not precisely known), change the filesystem permissions to 511 to - prevent what I call "logged in BROP". I have ideas for improving this further - but this is a first step ok djm + Should prevent warnings due to our wrapper function. + +commit 4e04d68d6a33cdc73b831fd4b5e6124175555d3d +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:01:51 2023 +0000 + + upstream: Expliticly ignore return code from fcntl(.. FD_CLOEXEC) since - OpenBSD-Commit-ID: 1e0a2692b7e20b126dda60bf04999d1d30d959d8 + there's not much we can do anyway. From Coverity CID 291857, ok djm@ + + OpenBSD-Commit-ID: 051429dd07af8db3fec10d82cdc78d90bb051729 -commit bc7de6f91a9a0ae2f148a9d31a4027d441a51999 -Author: jmc@openbsd.org -Date: Wed Jan 18 06:55:32 2023 +0000 +commit d6d38fd77cbe091c59e1bb720c3a494df4990640 +Author: djm@openbsd.org +Date: Fri Mar 10 02:32:04 2023 +0000 - upstream: tweak previous; ok djm + upstream: Like sshd_config, some ssh_config options are not - OpenBSD-Commit-ID: df71ce4180c58202dfdc1d92626cfe900b91b7c3 + first-match-wins. sshd_config.5 was fixed in r1.348, this is the same for + this file + + OpenBSD-Commit-ID: 7be55b9351cde449b136afcc52d07aa4113b215e -commit a20b7e999773e6333c8aa9b0a7fa41966e63b037 -Author: Darren Tucker -Date: Tue Jan 31 19:35:44 2023 +1100 +commit 7187d3f86bf8f2066cc9941f217d23b0cacae25e +Author: dtucker@openbsd.org +Date: Fri Mar 10 02:24:56 2023 +0000 - Skip connection-timeout test under Valgrind. + upstream: Remove no-op (int) > INT_MAX checks - Valgrind slows things down so much that the timeout test fails. Skip - this test until we figure out if we can make it work. + since they can never be true. From Coverity CID 405031, ok djm@ + + OpenBSD-Commit-ID: 9df3783b181e056595e2bb9edf7ed41d61cf8e84 -commit c3ffb54b4fc5e608206037921db6ccbc2f5ab25f +commit 77adde4305542ebe3005dd456122624fe2347b01 Author: Darren Tucker -Date: Wed Jan 25 21:58:40 2023 +1100 +Date: Fri Mar 10 13:27:29 2023 +1100 - Skip connection-timeout when missing FD passing. + Wrap mkstemp calls with umask set/restore. - This tests uses multiplexing which uses file descriptor passing, so - skip it if we don't have that. Fixes test failures on Cygwin. + glibc versions 2.06 and earlier did not set a umask on files created by + mkstemp created the world-writable. Wrap mkstemp to set and restore + the umask. From Coverity (CIDs 291826 291886 291891), ok djm@ -commit 35253af01d8c0ab444c8377402121816e71c71f5 -Author: djm@openbsd.org -Date: Wed Jan 18 02:00:10 2023 +0000 +commit 633d3dc2a1e9e2a013d019a0576a0771c8423713 +Author: jcs@openbsd.org +Date: Thu Mar 9 21:06:24 2023 +0000 - upstream: when restoring non-blocking mode to stdio fds, restore + upstream: modify parentheses in conditionals to make it clearer what is - exactly the flags that ssh started with and don't just clobber them with - zero, as this could also remove the append flag from the set; + being assigned and what is being checked - bz3523; ok dtucker@ + ok djm dtucker - OpenBSD-Commit-ID: 1336b03e881db7564a4b66014eb24c5230e9a0c0 + OpenBSD-Commit-ID: 19c10baa46ae559474409f75a5cb3d0eade7a9b8 -commit 7d17ea151c0b2519f023bd9cc7f141128833ac47 -Author: millert@openbsd.org -Date: Wed Jan 18 01:50:21 2023 +0000 +commit 733030840c4772f858de95d5940ec0c37663e8b0 +Author: dtucker@openbsd.org +Date: Thu Mar 9 07:11:05 2023 +0000 - upstream: Add a -V (version) option to sshd like the ssh client + upstream: Re-split the merge of the reorder-hostkeys test. - has. OK markus@ deraadt@ + In the kex_proposal_populate_entries change I merged the the check for + reordering hostkeys with the actual reordering, but kex_assemble_names + mutates options.hostkeyalgorithms which renders the check ineffective. + Put the check back where it was. Spotted and tested by jsg@, ok djm@ - OpenBSD-Commit-ID: abe990ec3e636fb040132aab8cbbede98f0c413e + OpenBSD-Commit-ID: a7469f25a738db5567395d1881e32479a7ffc9de -commit 62360feb7f08f2a4c6fc36f3b3449309203c42c9 -Author: millert@openbsd.org -Date: Tue Jan 17 18:52:44 2023 +0000 +commit 54ac4ab2b53ce9fcb66b8250dee91c070e4167ed +Author: djm@openbsd.org +Date: Thu Mar 9 06:58:26 2023 +0000 - upstream: For "ssh -V" always exit 0, there is no need to check opt + upstream: include destination constraints for smartcard keys too. - again. This was missed when the fallthrough in the switch case above it was - removed. OK deraadt@ + Spotted by Luci Stanescu; ok deraadt@ markus@ - OpenBSD-Commit-ID: 5583e5d8f6d62a8a4215cfa95a69932f344c8120 + OpenBSD-Commit-ID: add879fac6903a1cb1d1e42c4309e5359c3d870f -commit 12492c0abf1eb415d08a897cc1d8b9e789888230 -Author: djm@openbsd.org -Date: Tue Jan 17 10:15:10 2023 +0000 +commit bfd1ad01d974a316b60622759ad17537fa2d92b4 +Author: Darren Tucker +Date: Thu Mar 9 18:24:54 2023 +1100 - upstream: also check that an active session inhibits + Limit the number of PAM environment variables. - UnusedConnectionTimeout idea markus@ + xcalloc has its own limits, but these are specific to PAM. From + Coverity CID 405198, ok djm@ + +commit a231414970e01a35f45a295d5f93698fa1249b28 +Author: Darren Tucker +Date: Thu Mar 9 18:19:44 2023 +1100 + + Limit the number of PAM environment variables. - OpenBSD-Regress-ID: 55c0fb61f3bf9e092b0a53f9041d3d2012f14003 + From Coverity CID 405194, tweaks and ok djm@ -commit cef2593c33ac46a58238ff998818754eabdf64ff -Author: djm@openbsd.org -Date: Tue Jan 17 10:02:34 2023 +0000 +commit 36c6c3eff5e4a669ff414b9daf85f919666e8e03 +Author: dtucker@openbsd.org +Date: Wed Mar 8 06:21:32 2023 +0000 - upstream: regression test for UnusedConnectionTimeout + upstream: Plug mem leak. Coverity CID 405196, ok djm@ - OpenBSD-Regress-ID: 7f29001374a68e71e5e078f69e4520cf4bcca084 + OpenBSD-Commit-ID: 175f09349387c292f626da68f65f334faaa085f2 -commit aff9493a89c71d6a080419b49ac64eead9730491 -Author: djm@openbsd.org -Date: Mon Jan 16 04:11:29 2023 +0000 +commit dfb9b736e1ccf9e6b03eea21cd961f4fd0634c98 +Author: tb@openbsd.org +Date: Wed Mar 8 05:33:53 2023 +0000 - upstream: unbreak test: cannot access shell positional parameters + upstream: ssh-pkcs11: synchronize error messages with errors - past $9 without wrapping the position in braces (i.e. need ${10}, etc.) + A handful of error messages contained incorrect function names or + otherwise inaccurate descriptions. Fix them to match reality. - OpenBSD-Regress-ID: 3750ec98d5d409ce6a93406fedde6f220d2ea2ac + input/ok djm + + OpenBSD-Commit-ID: 165a15db52f75b31e1804b043480c36af09f3411 -commit 0293c19807f83141cdf33b443154459f9ee471f6 -Author: djm@openbsd.org -Date: Tue Jan 17 09:44:48 2023 +0000 +commit 51875897b81b5c21b80c256a29597916edbde454 +Author: guenther@openbsd.org +Date: Wed Mar 8 04:43:12 2023 +0000 - upstream: Add a sshd_config UnusedConnectionTimeout option to terminate - - client connections that have no open channels for some length of time. This - complements the recently-added ChannelTimeout option that terminates inactive - channels after a timeout. + upstream: Delete obsolete /* ARGSUSED */ lint comments. - ok markus@ + ok miod@ millert@ - OpenBSD-Commit-ID: ca983be74c0350364c11f8ba3bd692f6f24f5da9 + OpenBSD-Commit-ID: 7be168a570264d59e96a7d2d22e927d45fee0e4c -commit 8ec2e3123802d2beeca06c1644b0b647f6d36dab +commit a76085bda883c2104afb33ab0334eca190927362 +Author: Darren Tucker +Date: Wed Mar 8 17:25:37 2023 +1100 + + Extra brackets to prevent warning. + +commit 147ae57d4dfa0508109f93b78a7d8b92819e1f83 Author: djm@openbsd.org -Date: Sun Jan 15 23:35:10 2023 +0000 +Date: Wed Mar 8 00:05:58 2023 +0000 - upstream: adapt to ed25519 changes in src/usr.bin/ssh + upstream: use RSA/SHA256 when testing usability of private key in - OpenBSD-Regress-ID: 4b3e7ba7ee486ae8a0b4790f8112eded2bb7dcd5 + agent; with/ok dtucker + + OpenBSD-Commit-ID: fe1382e2fdf23fcae631308e72342bad56066a56 -commit 9fbbfeca1ce4c7ec0001c827bbf4189a3ba0964b +commit 27fd251bc906a763e70ce0f27c8abdf8bbd1e416 Author: djm@openbsd.org -Date: Sun Jan 15 23:05:32 2023 +0000 +Date: Wed Mar 8 00:05:37 2023 +0000 - upstream: update OpenSSH's Ed25519 code to the last version of SUPERCOP + upstream: use RSA/SHA256 when testing usability of private key; - (20221122) and change the import approach to the same one we use for - Streamlined NTRUPrime: use a shell script to extract the bits we need from - SUPERCOP, make some minor adjustments and squish them all into a single file. + based on fix in bz3546 by Dmitry Belyavskiy; with/ok dtucker - ok tb@ tobhe@ + OpenBSD-Commit-ID: 0ef414cc363a832f9fab92a5da0234448bce2eba + +commit eee9f3fc3d52ae7d2106929bb06b7f291fb0b81a +Author: djm@openbsd.org +Date: Tue Mar 7 21:47:42 2023 +0000 + + upstream: refactor to be more readable top to bottom. Prompted by - OpenBSD-Commit-ID: 1bc0fd624cb6af440905b8ba74ac7c03311b8e3b + Coverity CID 405048 which was a false-positive fd leak; ok dtucker@ + + OpenBSD-Commit-ID: fc55ec2af622a017defb9b768bf26faefc792c00 -commit 6283f4bd83eee714d0f5fc55802eff836b06fea8 +commit 42a06b29a4c99272bf690f9b3be520b08b448dc5 Author: Darren Tucker -Date: Sat Jan 14 22:02:44 2023 +1100 +Date: Tue Mar 7 18:34:41 2023 +1100 - Allow writev is seccomp sandbox. - - This seems to be used by recent glibcs at least in some configurations. - From bz#3512, ok djm@ + Add header changes missed in previous. -commit 923c3f437f439cfca238fba37e97a7041782f615 +commit 4710077096edff2e6926dd5b15bf586491d317db Author: dtucker@openbsd.org -Date: Sat Jan 14 10:05:54 2023 +0000 +Date: Tue Mar 7 06:09:14 2023 +0000 - upstream: Shell syntax fix. From ren mingshuai vi github PR#369. + upstream: Fix mem leak in environment setup. - OpenBSD-Regress-ID: 6696b2eeefe128099fc3d7ea9f23252cc35156f9 + From jjelen at redhat.com via bz#2687, ok djm@ + + OpenBSD-Commit-ID: 9f9e4ba3cac003e6f81da3bcebd1b9ec43e7f353 -commit 4d87a00f704e0365e11c3c38b170c1275ec461fc +commit 03acc50d0ccb78fc91d1570de1cd0fdfea646028 Author: dtucker@openbsd.org -Date: Sat Jan 14 09:57:08 2023 +0000 +Date: Mon Mar 6 12:15:47 2023 +0000 - upstream: Instead of skipping the all-tokens test if we don't have + upstream: Unit test for kex_proposal_populate_entries. - OpenSSL (since we use it to compute the hash), put the hash at the end and - just omit it if we don't have it. Prompted by bz#3521. + OpenBSD-Regress-ID: bdb211d80d572a08bf14b49fe2a58b9ff265c006 + +commit 3f9231c2e1f374ebb08016ba00ea97b47c0ed20b +Author: djm@openbsd.org +Date: Tue Mar 7 05:37:26 2023 +0000 + + upstream: fix memory leak in process_read() path; Spotted by James - OpenBSD-Regress-ID: c79ecba64250ed3b6417294b6c965e6b12ca5eea + Robinson in GHPR363; ok markus@ + + OpenBSD-Commit-ID: cdc2d98e6478b7e7f3a36976845adae3820429d8 -commit b05406d6f93b8c8ec11ec8b27e7c76cc7a5a55fb -Author: jmc@openbsd.org -Date: Fri Jan 13 07:13:40 2023 +0000 +commit c5e6e890839ec520ab9301a92cba56303749dea2 +Author: djm@openbsd.org +Date: Tue Mar 7 01:30:52 2023 +0000 - upstream: fix double phrase in previous; + upstream: correct size for array argument when changing - OpenBSD-Commit-ID: 671e6c8dc5e9230518b2bbfa143daaa88adc66c2 + UMAC_OUTPUT_LEN Coverity CID 291845; ok dtucker@ + + OpenBSD-Commit-ID: 2eb017d10705bb623d4418691f961c930eafaec0 -commit 40564812b659c530eb1f4b62d09e85612aef3107 +commit 9641753e0fd146204d57b2a4165f552a81afade4 Author: dtucker@openbsd.org -Date: Fri Jan 13 03:16:29 2023 +0000 +Date: Mon Mar 6 12:14:48 2023 +0000 - upstream: Document "UserKnownHostsFile none". ok djm@ + upstream: Refactor creation of KEX proposal. - OpenBSD-Commit-ID: f695742d39e34ecdcc3c861c3739a84648a4bce5 + This adds kex_proposal_populate_entries (and corresponding free) which + populates the KEX proposal array with dynamically allocated strings. + This replaces the previous mix of static and dynamic that has been the + source of previous leaks and bugs. Remove unused compat functions. + With & ok djm@. + + OpenBSD-Commit-ID: f2f99da4aae2233cb18bf9c749320c5e040a9c7b -commit d03e245e034019a37388f6f5f893ce848ab6d2e2 -Author: Darren Tucker -Date: Fri Jan 13 23:02:34 2023 +1100 +commit aa59d6a489fb20973fa461d0fdb1110db412947b +Author: dtucker@openbsd.org +Date: Sun Mar 5 09:24:35 2023 +0000 - Retry package installation 3 times. + upstream: Fix mem and FILE leaks in moduli screening. - When setting up the CI environment, retry package installation 3 times - before going up. Should help prevent spurious failures during - infrastructure issues. + If multiple -Ocheckpoint= options are passed, the earlier ones would + be overwritten and leaked. If we use an input file that wasn't stdin, + close that. From Coverity CIDs 291884 and 291894. + + OpenBSD-Commit-ID: a4d9d15f572926f841788912e2b282485ad09e8b -commit 625f6bc39840167dafb3bf5b6a3e18503ac986e8 +commit 23b8cb41767af99a1aac24589d1882d9c8c2c205 Author: dtucker@openbsd.org -Date: Fri Jan 13 04:47:34 2023 +0000 +Date: Sun Mar 5 08:18:58 2023 +0000 - upstream: Move scp path setting to a helper function. The previous + upstream: Plug mem leak in moduli checkpoint option parsing. - commit to add scp to the test sshd's path causes the t-envpass test to fail - when the test scp is given using a fully qualified path. Put this in a - helper function and only call it from the scp tests. + From Coverity CID 291894. - OpenBSD-Regress-ID: 7533dc1c4265c1de716abb062957994195b36df4 + OpenBSD-Commit-ID: 9b1aba2d049741ae21c8dc4560a7e29ab17310f4 -commit 6e6f88647042b3cde54a628545c2f5fb656a9327 +commit fc7f8f2188d4a4fc8ba77eddbe863c7665666db5 Author: dtucker@openbsd.org -Date: Fri Jan 13 04:23:00 2023 +0000 +Date: Sun Mar 5 05:34:09 2023 +0000 - upstream: Add scp's path to test sshd's PATH. + upstream: Remove unused compat.h includes. - If the scp we're testing is fully qualified (eg it's not in the system - PATH) then add its path to the under-test sshd's PATH so we can find - it. Prompted by bz#3518. + We've previously removed a lot of the really old compatibility code, + and with it went the need to include compat.h in most of the files that + have it. - OpenBSD-Regress-ID: 7df4f5a0be3aa135495b7e5a6719d3cbc26cc4c0 + OpenBSD-Commit-ID: 5af8baa194be00a3092d17598e88a5b29f7ea2b4 -commit 8a5e99a70fcf9b022a8aa175ebf6a71f58511da3 -Author: Darren Tucker -Date: Fri Jan 13 15:49:48 2023 +1100 +commit 6c165c36246d8004c20e1df5cec4961a5ac422d6 +Author: dtucker@openbsd.org +Date: Sat Mar 4 03:22:59 2023 +0000 - Remove skipping test when scp not in path. + upstream: Use time_t for x11 timeout. - An upcoming change renders this obsolete by adding scp's path to the - test sshd's PATH, and removing this first will make the subsequent sync - easier. + Use time_t instead of u_int for remaining x11 timeout checks for 64bit + time_t safety. From Coverity CIDs 405197 and 405028, ok djm@ + + OpenBSD-Commit-ID: 356685bfa1fc3d81bd95722d3fc47101cc1a4972 -commit 41f36dd896c8fb8337d403fcf476762986976e9d +commit 4a3918f51bd2d968387e7aa87e33b32c78077fb4 Author: dtucker@openbsd.org -Date: Fri Jan 13 02:58:20 2023 +0000 +Date: Fri Mar 3 10:23:42 2023 +0000 - upstream: Add a "Host" line to the output of ssh -G showing the + upstream: Ensure ms_remain is always initialized - original host arg. Inspired by patch from vincent at bernat.ch via bz#3343, - ok djm@ + similar to what we do in ssh_packet_write_wait. bz#2687, from jjelen + at redhat.com. - OpenBSD-Commit-ID: 59c0f60a222113a44d0650cd394376e3beecc883 + OpenBSD-Commit-ID: a50e0541cf823f8d1c72f71ccde925d3dbe6dfac -commit f673b49f3be3eb51074fbb8a405beb6cd0f7d93e -Author: djm@openbsd.org -Date: Fri Jan 13 02:44:02 2023 +0000 +commit e44846a4487d2885ac7f2610be09b1e2bf52249b +Author: dtucker@openbsd.org +Date: Fri Mar 3 09:48:51 2023 +0000 - upstream: avoid printf("%s", NULL) if using ssh + upstream: Check for non-NULL before string - -oUserKnownHostsFile=none and a hostkey in one of the system known hosts file - changes; ok dtucker@ + comparison. From jjelen at redhat.com via bz#2687. - OpenBSD-Commit-ID: 7ca87614bfc6da491315536a7f2301434a9fe614 + OpenBSD-Commit-ID: 0d9b2e0cac88a311b5766b1aef737082583c285f -commit 93fc7c576563e3d88a1dc019dd213f65607784cc +commit 1842d523fae63b862ce8e60725c9b606cddb86a6 Author: djm@openbsd.org -Date: Wed Jan 11 05:39:38 2023 +0000 +Date: Fri Mar 3 05:00:34 2023 +0000 - upstream: clamp the minimum buffer lengths and number of inflight + upstream: guard against getsockname(-1, ...) from Coverity CID - requests too + 291832 - OpenBSD-Commit-ID: c4965f62fa0ba850940fd66ae3f60cf516bbcd56 + OpenBSD-Commit-ID: e58d5227327917d189229b7f0b37d2780f360d5f *** 22346 LINES SKIPPED *** From nobody Thu Mar 16 19:19:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcxsb0Tgfz3yV08; Thu, 16 Mar 2023 19:19: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 4PcxsZ7364z46b0; Thu, 16 Mar 2023 19:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678994387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KdqVxaEVmu9x2DePdm8ajg2tEG3irGC/SJzP3qAHmSg=; b=quwHrEPHAov5JV5gTxK8IokdyWpl/iVxdw3g+FAKmNBqMvD85gcqeS5ueUZW0IoQPrSAJx uV4a4aJHc8pKBuDOPXg7lVSWDNf3pbQZJUw99agiRwnteaQ7RMsvWSgDK5h/aqh/c7bBLe ofb58WA/QxVxAWehfT3E8Hxjh5uBL/hXlzhCTrlh8pWsAiiP7R6r5xR+cgy69hy+IM42jf cfBUyvfl5WdCxbo0rdRasc1yZtfDrnbGxDg6cxRw7KDQ+mFOJhU9kJeTGrdxJwoqVx8QYB RCOOFIFez6+AwnZcqjrN4CiSS+BTbmfN87FROvhqAeHNybcyRyuHtO8zNl46fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678994387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KdqVxaEVmu9x2DePdm8ajg2tEG3irGC/SJzP3qAHmSg=; b=ASjKPsg1qM206TSWfUn2bqL5j99zP0VrMv5TU6IFX/1Jqs73s+eksanWb+mOhkv7FFekfP ubpHwu0LvSHdD5va7jIKN2xxiO1KxnFDp047phzAtY4FKDJKmbAfnVjShu26f8KEngjMW9 GuxImUQECrffKVgsjDuCH0S5MCSY58UJxC3ozohcYwyTd2rjkO5cQ7uETiBAnN/ZKy1ueC OIoalT47ej8eMXAD6WOs8mluDIEURGy13vA8/kGZV8OR4AZJHUSiGmh1hmzZLdi0vfrUBc PRWBfUT3iY8gO46rTY/HsEMLU1NOZyG44xoSILzpx1XzmBHpXGe5MEfvQH/oWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678994387; a=rsa-sha256; cv=none; b=NnkLTyPTX+VJPiLwfeZWSZpDsMovRxdVpPwy+SMfu/NtteYCz5S4iWGoqQn40+0DahXhp3 PKwBMOVB+KCpU/TR5TVOY7JjNXHpMmUfvzPa4Pjzrx3NvnPeiEoCGRao/orprWdBgYqtbG CC5F68jVfplA7C9qVCkREFafEbCd3cv1u8TKh0c4VrEIJ4CME37fX9J5wWnEpm8MKiroP/ yezR/yEQ9tDEw3aZwFX1oE26LeMG9Z2fwuh593infsdIHL0ULJBf2aFnBp+AjxY1PJecMm b8w5wi2KWtiS2F+gKJhgCbKPDtdwhprr2lSGE8HuoVAyCI/6lKJbbYjS58Hlpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcxsZ64lTzvYB; Thu, 16 Mar 2023 19:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GJJkqI070565; Thu, 16 Mar 2023 19:19:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GJJkrK070564; Thu, 16 Mar 2023 19:19:46 GMT (envelope-from git) Date: Thu, 16 Mar 2023 19:19:46 GMT Message-Id: <202303161919.32GJJkrK070564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 58436df347de - main - libipsec: ansify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58436df347de665f6bc635a0e3018fc6f3d0a656 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=58436df347de665f6bc635a0e3018fc6f3d0a656 commit 58436df347de665f6bc635a0e3018fc6f3d0a656 Author: Mateusz Guzik AuthorDate: 2023-03-16 19:19:35 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-16 19:19:35 +0000 libipsec: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libipsec/ipsec_dump_policy.c | 22 +++++----------------- lib/libipsec/ipsec_get_policylen.c | 3 +-- lib/libipsec/policy_parse.y | 26 +++++++++----------------- lib/libipsec/policy_token.l | 5 ++--- 4 files changed, 17 insertions(+), 39 deletions(-) diff --git a/lib/libipsec/ipsec_dump_policy.c b/lib/libipsec/ipsec_dump_policy.c index 76848f3cb0a5..46c370f4f158 100644 --- a/lib/libipsec/ipsec_dump_policy.c +++ b/lib/libipsec/ipsec_dump_policy.c @@ -70,9 +70,7 @@ static char *set_address(char *, size_t, struct sockaddr *); * When delimiter == NULL, alternatively ' '(space) is applied. */ char * -ipsec_dump_policy(policy, delimiter) - caddr_t policy; - char *delimiter; +ipsec_dump_policy(caddr_t policy, char *delimiter) { struct sadb_x_policy *xpl = (struct sadb_x_policy *)policy; struct sadb_x_ipsecrequest *xisr; @@ -175,11 +173,8 @@ ipsec_dump_policy(policy, delimiter) } static char * -ipsec_dump_ipsecrequest(buf, len, xisr, bound) - char *buf; - size_t len; - struct sadb_x_ipsecrequest *xisr; - size_t bound; /* boundary */ +ipsec_dump_ipsecrequest(char *buf, size_t len, struct sadb_x_ipsecrequest *xisr, + size_t bound) { const char *proto, *mode, *level; char abuf[NI_MAXHOST * 2 + 2]; @@ -276,11 +271,7 @@ ipsec_dump_ipsecrequest(buf, len, xisr, bound) } static int -set_addresses(buf, len, sa1, sa2) - char *buf; - size_t len; - struct sockaddr *sa1; - struct sockaddr *sa2; +set_addresses(char *buf, size_t len, struct sockaddr *sa1, struct sockaddr *sa2) { char tmp1[NI_MAXHOST], tmp2[NI_MAXHOST]; @@ -294,10 +285,7 @@ set_addresses(buf, len, sa1, sa2) } static char * -set_address(buf, len, sa) - char *buf; - size_t len; - struct sockaddr *sa; +set_address(char *buf, size_t len, struct sockaddr *sa) { const int niflags = NI_NUMERICHOST; diff --git a/lib/libipsec/ipsec_get_policylen.c b/lib/libipsec/ipsec_get_policylen.c index 37e02778ef51..04f6e3abba94 100644 --- a/lib/libipsec/ipsec_get_policylen.c +++ b/lib/libipsec/ipsec_get_policylen.c @@ -44,8 +44,7 @@ __FBSDID("$FreeBSD$"); #include "ipsec_strerror.h" int -ipsec_get_policylen(policy) - caddr_t policy; +ipsec_get_policylen(caddr_t policy) { return policy ? PFKEY_EXTLEN(policy) : -1; } diff --git a/lib/libipsec/policy_parse.y b/lib/libipsec/policy_parse.y index a9c45804ab0d..ca9c8d0431d2 100644 --- a/lib/libipsec/policy_parse.y +++ b/lib/libipsec/policy_parse.y @@ -213,8 +213,7 @@ addresses %% void -yyerror(msg) - char *msg; +yyerror(char *msg) { fprintf(stderr, "libipsec: %s while parsing \"%s\"\n", msg, __libipsecyytext); @@ -223,8 +222,7 @@ yyerror(msg) } static struct sockaddr * -parse_sockaddr(buf) - struct _val *buf; +parse_sockaddr(struct _val *buf) { struct addrinfo hints, *res; char *serv = NULL; @@ -262,7 +260,7 @@ parse_sockaddr(buf) } static int -rule_check() +rule_check(void) { if (p_type == IPSEC_POLICY_IPSEC) { if (p_protocol == IPPROTO_IP) { @@ -293,7 +291,7 @@ rule_check() } static int -init_x_policy() +init_x_policy(void) { struct sadb_x_policy *p; @@ -319,8 +317,7 @@ init_x_policy() } static int -set_x_request(src, dst) - struct sockaddr *src, *dst; +set_x_request(struct sockaddr *src, struct sockaddr *dst) { struct sadb_x_ipsecrequest *p; int reqlen; @@ -351,8 +348,7 @@ set_x_request(src, dst) } static int -set_sockaddr(addr) - struct sockaddr *addr; +set_sockaddr(struct sockaddr *addr) { if (addr == NULL) { __ipsec_errcode = EIPSEC_NO_ERROR; @@ -370,7 +366,7 @@ set_sockaddr(addr) } static void -policy_parse_request_init() +policy_parse_request_init(void) { p_protocol = IPPROTO_IP; p_mode = IPSEC_MODE_ANY; @@ -389,9 +385,7 @@ policy_parse_request_init() } static caddr_t -policy_parse(msg, msglen) - char *msg; - int msglen; +policy_parse(char *msg, int msglen) { int error; pbuf = NULL; @@ -421,9 +415,7 @@ policy_parse(msg, msglen) } caddr_t -ipsec_set_policy(msg, msglen) - char *msg; - int msglen; +ipsec_set_policy(char *msg, int msglen) { caddr_t policy; diff --git a/lib/libipsec/policy_token.l b/lib/libipsec/policy_token.l index 81893912714d..c5e4d4765a5f 100644 --- a/lib/libipsec/policy_token.l +++ b/lib/libipsec/policy_token.l @@ -138,8 +138,7 @@ void __policy__strbuffer__free__(void); static YY_BUFFER_STATE strbuffer; void -__policy__strbuffer__init__(msg) - char *msg; +__policy__strbuffer__init__(char *msg) { if (YY_CURRENT_BUFFER) yy_delete_buffer(YY_CURRENT_BUFFER); @@ -150,7 +149,7 @@ __policy__strbuffer__init__(msg) } void -__policy__strbuffer__free__() +__policy__strbuffer__free__(void) { yy_delete_buffer(strbuffer); From nobody Thu Mar 16 22:59:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pd2lZ2zF7z3yjXK; Thu, 16 Mar 2023 22:59: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 4Pd2lZ2jqnz4YbR; Thu, 16 Mar 2023 22:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679007594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+2bF6FElfvnO3ZK/Vanx7eN9NtgT9ncdfK90n6moLlg=; b=dkVEy+AqrkPyR5rCw2WMQowIKOKeY9deti8C5aCt0Wnyz9KVxYI/Gjn6fO+SghtKXSjwV8 dGJsQBVu4hyiC9OuPl8jS00znZFxHBztOrHHckS9Kw8Ri872+qOBZE32wKlxiFEeeemGuB 6WAB6ArFwJ0hH4IjKCI8m8KYC+GDmOBhIFTrKPeS/3akSnuFbt1tRIIUvGujQUfRdlwHji DnzVBC+KIiyc2NZtKKXmkiuG0f7U1AQORzfnCRdEHW9ZmxiAL5EGnFpUOK9Lt+bv/2KujS DnB1gB7H3wnLWbrgXqScg9c1h8y4SBBMGRCWdgp7E3bB9VAjIUXU70GB14GgqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679007594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+2bF6FElfvnO3ZK/Vanx7eN9NtgT9ncdfK90n6moLlg=; b=T7VuIUzmCNbWYiYFzz8j5Crw0o9pS1PQaUcutsRY/5fgkAjIuAr5EedT9I90TzaGoRsoOI WDR4j4wJwh5eR2fRBh7lCEF7Aacya+NPrQWJ2Omh1VepdZbrpEo2olviqMDLwGkAtg8jAp LtR3JB4bhnnQoirkCKNr0Yrdn20miH7AO3/1c6PNW4KXxXlc+ntk+VJKBwR1CZ5H70oXP/ tPAdSB7A0i386mpGfMMG/T2F+uRyJWreCaOmJ3PSrFMVz119g3j5BcHe7/uTGdcw41Cfy1 pmAuo2dBpcreFT++d2aF6nmn8iSd7cXKTHOpUNKWsWouVclVJuGCPMfV9W4XmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679007594; a=rsa-sha256; cv=none; b=niDNFcOXt1kMxacvNo/CrVOTBSLWUdFG6cAfjl8SX8tygeUihobBb46Di7Yj8A0guVTdRz tSb4htjq9F3M5hZbL8Zf1JYoh5jSJTFVRtSKfvIGvPnNPcJEFNAvwO4W/uN/cXfynN6gei U4pSkD0aAzjy3ALNaus2EVNYV5AwD3h+4VV3VQMyPFqcMeGm7aThkRK9SwWd36dL6/iIHg tVCqvyFLB6ugF6yY87ZCk1PF8Ki+HpUYw+MRXdMRZxxjZUW8gq1bBetkpYC5TH7BtFHaCS 9u++W8hrbGMrc5bK0n4WscaGFoGa6EML1xB9E0pCIkTQKMWnk0Sa3deSF7QpfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pd2lZ1n36z12d4; Thu, 16 Mar 2023 22:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GMxs4K030489; Thu, 16 Mar 2023 22:59:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GMxs4t030488; Thu, 16 Mar 2023 22:59:54 GMT (envelope-from git) Date: Thu, 16 Mar 2023 22:59:54 GMT Message-Id: <202303162259.32GMxs4t030488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 896516e54a8c - main - nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 896516e54a8c39c1c8be3ad918f38fbf196b57ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=896516e54a8c39c1c8be3ad918f38fbf196b57ed commit 896516e54a8c39c1c8be3ad918f38fbf196b57ed Author: Rick Macklem AuthorDate: 2023-03-16 22:55:36 +0000 Commit: Rick Macklem CommitDate: 2023-03-16 22:55:36 +0000 nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts Without this patch, a Kerberized NFSv4.1/4.2 mount must provide a Kerberos credential for the client at mount time. This credential is typically referred to as a "machine credential". It can be created one of two ways: - The user (usually root) has a valid TGT at the time the mount is done and this becomes the machine credential. There are two problems with this. 1 - The user doing the mount must have a valid TGT for a user principal at mount time. As such, the mount cannot be put in fstab(5) or similar. 2 - When the TGT expires, the mount breaks. - The client machine has a service principal in its default keytab file and this service principal (typically called a host-based initiator credential) is used as the machine credential. There are problems with this approach as well: 1 - There is a certain amount of administrative overhead creating the service principal for the NFS client, creating a keytab entry for this principal and then copying the keytab entry into the client's default keytab file via some secure means. 2 - The NFS client must have a fixed, well known, DNS name, since that FQDN is in the service principal name as the instance. This patch uses a feature of NFSv4.1/4.2 called SP4_NONE, which allows the state maintenance operations to be performed by any authentication mechanism, to do these operations via AUTH_SYS instead of RPCSEC_GSS (Kerberos). As such, neither of the above mechanisms is needed. It is hoped that this option will encourage adoption of Kerberized NFS mounts using TLS, to provide a more secure NFS mount. This new NFSv4.1/4.2 mount option, called "syskrb5" must be used with "sec=krb5[ip]" to avoid the need for either of the above Kerberos setups to be done by the client. Note that all file access/modification operations still require users on the NFS client to have a valid TGT recognized by the NFSv4.1/4.2 server. As such, this option allows, at most, a malicious client to do some sort of DOS attack. Although not required, use of "tls" with this new option is encouraged, since it provides on-the-wire encryption plus, optionally, client identity verification via a X.509 certificate provided to the server during TLS handshake. Alternately, "sec=krb5p" does provide on-the-wire encryption of file data. A mount_nfs(8) man page update will be done in a separate commit. Discussed on: freebsd-current@ MFC after: 3 months --- sys/fs/nfs/nfs.h | 7 ++ sys/fs/nfs/nfs_commonkrpc.c | 86 ++++++++++++++++++++++++- sys/fs/nfs/nfs_commonsubs.c | 17 +++-- sys/fs/nfs/nfs_var.h | 5 +- sys/fs/nfs/nfsport.h | 1 + sys/fs/nfsclient/nfs_clnode.c | 4 +- sys/fs/nfsclient/nfs_clport.c | 26 +++++++- sys/fs/nfsclient/nfs_clrpcops.c | 121 +++++++++++++++++++++++++++++------ sys/fs/nfsclient/nfs_clvfsops.c | 134 +++++++++++++++++++++++++++++++++++---- sys/fs/nfsclient/nfs_clvnops.c | 6 +- sys/fs/nfsclient/nfsmount.h | 2 + sys/fs/nfsserver/nfs_nfsdport.c | 3 +- sys/fs/nfsserver/nfs_nfsdserv.c | 18 +++--- sys/fs/nfsserver/nfs_nfsdstate.c | 6 +- 14 files changed, 377 insertions(+), 59 deletions(-) diff --git a/sys/fs/nfs/nfs.h b/sys/fs/nfs/nfs.h index ffd612331c1f..eac318512a35 100644 --- a/sys/fs/nfs/nfs.h +++ b/sys/fs/nfs/nfs.h @@ -522,6 +522,13 @@ typedef struct { (b)->bits[2] = NFSGETATTRBIT_STATFS2; \ } while (0) +#define NFSROOTFS_GETATTRBIT(b) do { \ + (b)->bits[0] = NFSGETATTRBIT_STATFS0 | NFSATTRBIT_GETATTR0 | \ + NFSATTRBM_LEASETIME; \ + (b)->bits[1] = NFSGETATTRBIT_STATFS1 | NFSATTRBIT_GETATTR1; \ + (b)->bits[2] = NFSGETATTRBIT_STATFS2 | NFSATTRBIT_GETATTR2; \ +} while (0) + #define NFSISSETSTATFS_ATTRBIT(b) \ (((b)->bits[0] & NFSATTRBIT_STATFS0) || \ ((b)->bits[1] & NFSATTRBIT_STATFS1) || \ diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 9badd8be47d4..f98d9f8df99a 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -162,6 +162,87 @@ static int nfsv2_procid[NFS_V3NPROCS] = { NFSV2PROC_NOOP, }; +/* + * This static array indicates that a NFSv4 RPC should use + * RPCSEC_GSS, if the mount indicates that via sec=krb5[ip]. + * System RPCs that do not use file handles will be false + * in this array so that they will use AUTH_SYS when the + * "syskrb5" mount option is specified, along with + * "sec=krb5[ip]". + */ +static bool nfscl_use_gss[NFSV42_NPROCS] = { + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, /* SetClientID */ + false, /* SetClientIDConfirm */ + true, + true, + true, + true, + true, + true, + true, + false, /* Renew */ + true, + false, /* ReleaseLockOwn */ + true, + true, + true, + true, + true, + true, + false, /* ExchangeID */ + false, /* CreateSession */ + false, /* DestroySession */ + false, /* DestroyClientID */ + false, /* FreeStateID */ + true, + true, + true, + true, + false, /* ReclaimComplete */ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, /* BindConnectionToSession */ + true, + true, + true, + true, +}; + /* * Initialize sockets and congestion for a new NFS connection. * We do not free the sockaddr if error. @@ -679,7 +760,8 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, } NFSUNLOCKSTATE(); } else if (nmp != NULL && NFSHASKERB(nmp) && - nd->nd_procnum != NFSPROC_NULL) { + nd->nd_procnum != NFSPROC_NULL && (!NFSHASSYSKRB5(nmp) || + nfscl_use_gss[nd->nd_procnum])) { if (NFSHASALLGSSNAME(nmp) && nmp->nm_krbnamelen > 0) nd->nd_flag |= ND_USEGSSNAME; if ((nd->nd_flag & ND_USEGSSNAME) != 0) { @@ -720,7 +802,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, else secflavour = RPCSEC_GSS_KRB5; srv_principal = NFSMNT_SRVKRBNAME(nmp); - } else if (nmp != NULL && !NFSHASKERB(nmp) && + } else if (nmp != NULL && (!NFSHASKERB(nmp) || NFSHASSYSKRB5(nmp)) && nd->nd_procnum != NFSPROC_NULL && (nd->nd_flag & ND_USEGSSNAME) != 0) { /* diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index e2e15063cf99..9e70eea522c4 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include @@ -436,7 +437,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh > 0) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); - (void) nfsm_fhtom(nd, nfhp, fhlen, 0); + nfsm_fhtom(nmp, nd, nfhp, fhlen, 0); if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh == 2 && procnum != NFSPROC_WRITEDS && procnum != NFSPROC_COMMITDS) { @@ -467,7 +468,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, *tl = txdr_unsigned(nfsv4_opmap[procnum].op); } } else { - (void) nfsm_fhtom(nd, nfhp, fhlen, 0); + nfsm_fhtom(NULL, nd, nfhp, fhlen, 0); } if (procnum < NFSV42_NPROCS) NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); @@ -953,12 +954,15 @@ newnfs_init(void) * Return the number of bytes output, including XDR overhead. */ int -nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true) +nfsm_fhtom(struct nfsmount *nmp, struct nfsrv_descript *nd, u_int8_t *fhp, + int size, int set_true) { u_int32_t *tl; u_int8_t *cp; int fullsiz, bytesize = 0; + KASSERT(nmp == NULL || nmp->nm_fhsize > 0, + ("nfsm_fhtom: 0 length fh")); if (size == 0) size = NFSX_MYFH; switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) { @@ -973,6 +977,11 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true) break; case ND_NFSV3: case ND_NFSV4: + if (size == NFSX_FHMAX + 1 && nmp != NULL && + (nmp->nm_privflag & NFSMNTP_FAKEROOTFH) != 0) { + fhp = nmp->nm_fh; + size = nmp->nm_fhsize; + } fullsiz = NFSM_RNDUP(size); if (set_true) { bytesize = 2 * NFSX_UNSIGNED + fullsiz; @@ -2737,7 +2746,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, retnum += NFSX_UNSIGNED; break; case NFSATTRBIT_FILEHANDLE: - retnum += nfsm_fhtom(nd, (u_int8_t *)fhp, 0, 0); + retnum += nfsm_fhtom(NULL, nd, (u_int8_t *)fhp, 0, 0); break; case NFSATTRBIT_FILEID: NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER); diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 0a6d46964ffd..55396bfb0902 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -327,7 +327,8 @@ int nfsaddr_match(int, union nethostaddr *, NFSSOCKADDR_T); int nfsaddr2_match(NFSSOCKADDR_T, NFSSOCKADDR_T); int nfsm_strtom(struct nfsrv_descript *, const char *, int); int nfsm_mbufuio(struct nfsrv_descript *, struct uio *, int); -int nfsm_fhtom(struct nfsrv_descript *, u_int8_t *, int, int); +int nfsm_fhtom(struct nfsmount *, struct nfsrv_descript *, u_int8_t *, int, + int); int nfsm_advance(struct nfsrv_descript *, int, int); void *nfsm_dissct(struct nfsrv_descript *, int, int); void newnfs_copycred(struct nfscred *, struct ucred *); @@ -510,7 +511,7 @@ int nfsrpc_lockt(struct nfsrv_descript *, vnode_t, int nfsrpc_lock(struct nfsrv_descript *, struct nfsmount *, vnode_t, u_int8_t *, int, struct nfscllockowner *, int, int, u_int64_t, u_int64_t, short, struct ucred *, NFSPROC_T *, int); -int nfsrpc_statfs(vnode_t, struct nfsstatfs *, struct nfsfsinfo *, +int nfsrpc_statfs(vnode_t, struct nfsstatfs *, struct nfsfsinfo *, uint32_t *, struct ucred *, NFSPROC_T *, struct nfsvattr *, int *); int nfsrpc_fsinfo(vnode_t, struct nfsfsinfo *, struct ucred *, NFSPROC_T *, struct nfsvattr *, int *); diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 3a07d140950c..23e806ab8c47 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -1085,6 +1085,7 @@ void ncl_copy_vattr(struct vattr *dst, struct vattr *src); #define NFSHASONEOPENOWN(n) (((n)->nm_flag & NFSMNT_ONEOPENOWN) != 0 && \ (n)->nm_minorvers > 0) #define NFSHASTLS(n) (((n)->nm_newflag & NFSMNT_TLS) != 0) +#define NFSHASSYSKRB5(n) (((n)->nm_newflag & NFSMNT_SYSKRB5) != 0) /* * Set boottime. diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index bc38739ce04c..1fcd243d11d6 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -156,8 +156,8 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp, * Are we getting the root? If so, make sure the vnode flags * are correct */ - if ((fhsize == nmp->nm_fhsize) && - !bcmp(fhp, nmp->nm_fh, fhsize)) { + if (fhsize == NFSX_FHMAX + 1 || (fhsize == nmp->nm_fhsize && + !bcmp(fhp, nmp->nm_fh, fhsize))) { if (vp->v_type == VNON) vp->v_type = VDIR; vp->v_vflag |= VV_ROOT; diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 7a47da3c07bf..495ff3d3c6d1 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -140,6 +140,19 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp, dnp = VTONFS(dvp); *npp = NULL; + /* + * If this is the mount point fh and NFSMNTP_FAKEROOT is set, replace + * it with the fake fh. + */ + if ((nmp->nm_privflag & NFSMNTP_FAKEROOTFH) != 0 && + nmp->nm_fhsize > 0 && nmp->nm_fhsize == nfhp->nfh_len && + !NFSBCMP(nmp->nm_fh, nfhp->nfh_fh, nmp->nm_fhsize)) { + free(nfhp, M_NFSFH); + nfhp = malloc(sizeof(struct nfsfh) + NFSX_FHMAX + 1, + M_NFSFH, M_WAITOK | M_ZERO); + nfhp->nfh_len = NFSX_FHMAX + 1; + } + hash = fnv_32_buf(nfhp->nfh_fh, nfhp->nfh_len, FNV1_32_INIT); error = vfs_hash_get(mntp, hash, lkflags, @@ -241,8 +254,9 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp, * Are we getting the root? If so, make sure the vnode flags * are correct */ - if ((nfhp->nfh_len == nmp->nm_fhsize) && - !bcmp(nfhp->nfh_fh, nmp->nm_fh, nfhp->nfh_len)) { + if (nfhp->nfh_len == NFSX_FHMAX + 1 || + (nfhp->nfh_len == nmp->nm_fhsize && + !bcmp(nfhp->nfh_fh, nmp->nm_fh, nfhp->nfh_len))) { if (vp->v_type == VNON) vp->v_type = VDIR; vp->v_vflag |= VV_ROOT; @@ -493,9 +507,15 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, * this reliably with Clang and .c files during parallel build. * A pcap revealed packet fragmentation and GETATTR RPC * responses with wholly wrong fileids. + * For the case where the file handle is a fake one + * generated via the "syskrb5" mount option and + * the old fileid is 2, ignore the test, since this might + * be replacing the fake attributes with correct ones. */ if ((np->n_vattr.na_fileid != 0 && - np->n_vattr.na_fileid != nap->na_fileid) || + np->n_vattr.na_fileid != nap->na_fileid && + (np->n_vattr.na_fileid != 2 || !NFSHASSYSKRB5(nmp) || + np->n_fhp->nfh_len != NFSX_FHMAX + 1)) || force_fid_err) { nfscl_warn_fileid(nmp, &np->n_vattr, nap); error = EIDRM; diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index a26345cb362f..559bf8646625 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -229,6 +229,7 @@ static int nfsrpc_copyrpc(vnode_t, off_t, vnode_t, off_t, size_t *, static int nfsrpc_seekrpc(vnode_t, off_t *, nfsv4stateid_t *, bool *, int, struct nfsvattr *, int *, struct ucred *); static struct mbuf *nfsm_split(struct mbuf *, uint64_t); +static void nfscl_statfs(struct vnode *, struct ucred *, NFSPROC_T *); int nfs_pnfsio(task_fn_t *, void *); @@ -305,9 +306,22 @@ nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred, int error; struct nfsrv_descript nfsd, *nd = &nfsd; nfsattrbit_t attrbits; + struct nfsmount *nmp; + struct nfsnode *np; *attrflagp = 0; supported = mode; + nmp = VFSTONFS(vp->v_mount); + np = VTONFS(vp); + if ((nmp->nm_privflag & NFSMNTP_FAKEROOTFH) != 0 && + nmp->nm_fhsize == 0) { + /* Attempt to get the actual root file handle. */ + error = nfsrpc_getdirpath(nmp, NFSMNT_DIRPATH(nmp), cred, p); + if (error != 0) + return (EACCES); + if (np->n_fhp->nfh_len == NFSX_FHMAX + 1) + nfscl_statfs(vp, cred, p); + } NFSCL_REQSTART(nd, NFSPROC_ACCESS, vp, cred); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(mode); @@ -1207,7 +1221,20 @@ nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsrv_descript nfsd, *nd = &nfsd; int error; nfsattrbit_t attrbits; + struct nfsnode *np; + struct nfsmount *nmp; + nmp = VFSTONFS(vp->v_mount); + np = VTONFS(vp); + if ((nmp->nm_privflag & NFSMNTP_FAKEROOTFH) != 0 && + nmp->nm_fhsize == 0) { + /* Attempt to get the actual root file handle. */ + error = nfsrpc_getdirpath(nmp, NFSMNT_DIRPATH(nmp), cred, p); + if (error != 0) + return (EACCES); + if (np->n_fhp->nfh_len == NFSX_FHMAX + 1) + nfscl_statfs(vp, cred, p); + } NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); if (nd->nd_flag & ND_NFSV4) { NFSGETATTR_ATTRBIT(&attrbits); @@ -2558,7 +2585,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, /* Get the directory's post-op attributes. */ NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); - (void) nfsm_fhtom(nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); + nfsm_fhtom(nmp, nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); (void) nfsrv_putattrbit(nd, &attrbits); @@ -2758,7 +2785,7 @@ tryagain: *tl++ = dstateid.other[2]; *tl = txdr_unsigned(NFSV4OP_PUTFH); np = VTONFS(dvp); - (void) nfsm_fhtom(nd, np->n_fhp->nfh_fh, + nfsm_fhtom(nmp, nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_REMOVE); @@ -2846,7 +2873,7 @@ tryagain: NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); np = VTONFS(tvp); - (void) nfsm_fhtom(nd, np->n_fhp->nfh_fh, + nfsm_fhtom(nmp, nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_DELEGRETURN); @@ -2866,7 +2893,7 @@ tryagain: NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); np = VTONFS(fdvp); - (void) nfsm_fhtom(nd, np->n_fhp->nfh_fh, + nfsm_fhtom(nmp, nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_SAVEFH); @@ -2883,7 +2910,7 @@ tryagain: (void) nfsrv_putattrbit(nd, &attrbits); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); - (void) nfsm_fhtom(nd, VTONFS(tdvp)->n_fhp->nfh_fh, + nfsm_fhtom(nmp, nd, VTONFS(tdvp)->n_fhp->nfh_fh, VTONFS(tdvp)->n_fhp->nfh_len, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); @@ -2894,7 +2921,7 @@ tryagain: } (void) nfsm_strtom(nd, fnameptr, fnamelen); if (!(nd->nd_flag & ND_NFSV4)) - (void) nfsm_fhtom(nd, VTONFS(tdvp)->n_fhp->nfh_fh, + nfsm_fhtom(nmp, nd, VTONFS(tdvp)->n_fhp->nfh_fh, VTONFS(tdvp)->n_fhp->nfh_len, 0); (void) nfsm_strtom(nd, tnameptr, tnamelen); error = nfscl_request(nd, fdvp, p, cred); @@ -2979,7 +3006,7 @@ nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen, NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); } - (void) nfsm_fhtom(nd, VTONFS(dvp)->n_fhp->nfh_fh, + nfsm_fhtom(VFSTONFS(dvp->v_mount), nd, VTONFS(dvp)->n_fhp->nfh_fh, VTONFS(dvp)->n_fhp->nfh_len, 0); if (nd->nd_flag & ND_NFSV4) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); @@ -3119,7 +3146,7 @@ nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap, (void) nfsrv_putattrbit(nd, &attrbits); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); - (void) nfsm_fhtom(nd, fhp->nfh_fh, fhp->nfh_len, 0); + nfsm_fhtom(nmp, nd, fhp->nfh_fh, fhp->nfh_len, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); (void) nfsrv_putattrbit(nd, &attrbits); @@ -4634,7 +4661,8 @@ nfsmout: */ int nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, - struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp) + uint32_t *leasep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, + int *attrflagp) { u_int32_t *tl = NULL; struct nfsrv_descript nfsd, *nd = &nfsd; @@ -4649,7 +4677,10 @@ nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, * For V4, you actually do a getattr. */ NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); - NFSSTATFS_GETATTRBIT(&attrbits); + if (leasep != NULL) + NFSROOTFS_GETATTRBIT(&attrbits); + else + NFSSTATFS_GETATTRBIT(&attrbits); (void) nfsrv_putattrbit(nd, &attrbits); nd->nd_flag |= ND_USEGSSNAME; error = nfscl_request(nd, vp, p, cred); @@ -4657,8 +4688,8 @@ nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, return (error); if (nd->nd_repstat == 0) { error = nfsv4_loadattr(nd, NULL, nap, NULL, NULL, 0, - NULL, NULL, sbp, fsp, NULL, 0, NULL, NULL, NULL, p, - cred); + NULL, NULL, sbp, fsp, NULL, 0, NULL, leasep, NULL, + p, cred); if (!error) { nmp->nm_fsid[0] = nap->na_filesid[0]; nmp->nm_fsid[1] = nap->na_filesid[1]; @@ -4719,10 +4750,22 @@ nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, u_int32_t *tl; nfsattrbit_t attrbits; int error; + struct nfsnode *np; *attrflagp = 0; nmp = VFSTONFS(vp->v_mount); if (NFSHASNFSV4(nmp)) { + np = VTONFS(vp); + if ((nmp->nm_privflag & NFSMNTP_FAKEROOTFH) != 0 && + nmp->nm_fhsize == 0) { + /* Attempt to get the actual root file handle. */ + error = nfsrpc_getdirpath(nmp, NFSMNT_DIRPATH(nmp), + cred, p); + if (error != 0) + return (EACCES); + if (np->n_fhp->nfh_len == NFSX_FHMAX + 1) + nfscl_statfs(vp, cred, p); + } /* * For V4, you actually do a getattr. */ @@ -4909,7 +4952,7 @@ nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred, u_int32_t *tl; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; - u_char *cp, *cp2; + u_char *cp, *cp2, *fhp; int error, cnt, len, setnil; u_int32_t *opcntp; @@ -4957,9 +5000,17 @@ nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred, len > NFSX_FHMAX) { nd->nd_repstat = NFSERR_BADXDR; } else { - nd->nd_repstat = nfsrv_mtostr(nd, nmp->nm_fh, len); - if (nd->nd_repstat == 0) - nmp->nm_fhsize = len; + fhp = malloc(len + 1, M_TEMP, M_WAITOK); + nd->nd_repstat = nfsrv_mtostr(nd, fhp, len); + if (nd->nd_repstat == 0) { + NFSLOCKMNT(nmp); + if (nmp->nm_fhsize == 0) { + NFSBCOPY(fhp, nmp->nm_fh, len); + nmp->nm_fhsize = len; + } + NFSUNLOCKMNT(nmp); + } + free(fhp, M_TEMP); } } error = nd->nd_repstat; @@ -8179,7 +8230,7 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap, /* Get the directory's post-op attributes. */ NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); - nfsm_fhtom(nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); + nfsm_fhtom(nmp, nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); nfsrv_putattrbit(nd, &attrbits); @@ -8584,7 +8635,7 @@ nfsrpc_copyrpc(vnode_t invp, off_t inoff, vnode_t outvp, off_t outoff, nfsrv_putattrbit(nd, &attrbits); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); - nfsm_fhtom(nd, VTONFS(outvp)->n_fhp->nfh_fh, + nfsm_fhtom(nmp, nd, VTONFS(outvp)->n_fhp->nfh_fh, VTONFS(outvp)->n_fhp->nfh_len, 0); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_COPY); @@ -9173,3 +9224,37 @@ nfsmout: printf("nfsrpc_bindconnsess: reply bad xdr\n"); m_freem(nd->nd_mrep); } + +/* + * Do roughly what nfs_statfs() does for NFSv4, but when called with a shared + * locked vnode. + */ +static void +nfscl_statfs(struct vnode *vp, struct ucred *cred, NFSPROC_T *td) +{ + struct nfsvattr nfsva; + struct nfsfsinfo fs; + struct nfsstatfs sb; + struct mount *mp; + struct nfsmount *nmp; + uint32_t lease; + int attrflag, error; + + mp = vp->v_mount; + nmp = VFSTONFS(mp); + error = nfsrpc_statfs(vp, &sb, &fs, &lease, cred, td, &nfsva, + &attrflag); + if (attrflag != 0) + nfscl_loadattrcache(&vp, &nfsva, NULL, 0, 1); + if (error == 0) { + NFSLOCKCLSTATE(); + if (nmp->nm_clp != NULL) + nmp->nm_clp->nfsc_renew = NFSCL_RENEW(lease); + NFSUNLOCKCLSTATE(); + mtx_lock(&nmp->nm_mtx); + nfscl_loadfsinfo(nmp, &fs); + nfscl_loadsbinfo(nmp, &sb, &mp->mnt_stat); + mp->mnt_stat.f_iosize = newnfs_iosize(nmp); + mtx_unlock(&nmp->nm_mtx); + } +} diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index efc92f6e7e19..53f3e7bb1864 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -293,13 +293,37 @@ nfs_statfs(struct mount *mp, struct statfs *sbp) struct nfsstatfs sb; int error = 0, attrflag, gotfsinfo = 0, ret; struct nfsnode *np; + char *fakefh; td = curthread; error = vfs_busy(mp, MBF_NOWAIT); if (error) return (error); - error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np, LK_EXCLUSIVE); + if ((nmp->nm_privflag & NFSMNTP_FAKEROOTFH) != 0) { + if (nmp->nm_fhsize == 0) { + error = nfsrpc_getdirpath(nmp, NFSMNT_DIRPATH(nmp), + td->td_ucred, td); + if (error != 0) { + /* + * We cannot do anything yet. Hopefully what + * is in mnt_stat is sufficient. + */ + if (sbp != &mp->mnt_stat) + *sbp = mp->mnt_stat; + strncpy(&sbp->f_fstypename[0], + mp->mnt_vfc->vfc_name, MFSNAMELEN); + vfs_unbusy(mp); + return (0); + } + } + fakefh = malloc(NFSX_FHMAX + 1, M_TEMP, M_WAITOK | M_ZERO); + error = ncl_nget(mp, fakefh, NFSX_FHMAX + 1, &np, LK_EXCLUSIVE); + free(fakefh, M_TEMP); + } else { + error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np, + LK_EXCLUSIVE); + } if (error) { vfs_unbusy(mp); return (error); @@ -315,8 +339,19 @@ nfs_statfs(struct mount *mp, struct statfs *sbp) } else mtx_unlock(&nmp->nm_mtx); if (!error) - error = nfsrpc_statfs(vp, &sb, &fs, td->td_ucred, td, &nfsva, - &attrflag); + error = nfsrpc_statfs(vp, &sb, &fs, NULL, td->td_ucred, td, + &nfsva, &attrflag); + if ((nmp->nm_privflag & NFSMNTP_FAKEROOTFH) != 0 && + error == NFSERR_WRONGSEC) { + /* Cannot get new stats, so return what is in mnt_stat. */ + if (sbp != &mp->mnt_stat) + *sbp = mp->mnt_stat; + strncpy(&sbp->f_fstypename[0], mp->mnt_vfc->vfc_name, + MFSNAMELEN); + vput(vp); + vfs_unbusy(mp); + return (0); + } if (error != 0) NFSCL_DEBUG(2, "statfs=%d\n", error); if (attrflag == 0) { @@ -750,7 +785,7 @@ static const char *nfs_opts[] = { "from", "nfs_args", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", "minorversion", "nametimeo", "negnametimeo", "nocto", "noncontigwr", "pnfs", "wcommitsize", "oneopenown", "tls", "tlscertname", "nconnect", - NULL }; + "syskrb5", NULL }; /* * Parse the "from" mountarg, passed by the generic mount(8) program @@ -1206,6 +1241,8 @@ nfs_mount(struct mount *mp) */ aconn--; } + if (vfs_getopt(mp->mnt_optnew, "syskrb5", NULL, NULL) == 0) + newflag |= NFSMNT_SYSKRB5; if (vfs_getopt(mp->mnt_optnew, "sec", (void **) &secname, NULL) == 0) nfs_sec_name(secname, &args.flags); @@ -1388,6 +1425,39 @@ nfs_mount(struct mount *mp) goto out; } + if ((newflag & NFSMNT_SYSKRB5) != 0 && + ((args.flags & NFSMNT_NFSV4) == 0 || minvers == 0)) { + /* + * This option requires the use of SP4_NONE, which + * is only in NFSv4.1/4.2. + */ + vfs_mount_error(mp, "syskrb5 should only be used " + "for NFSv4.1/4.2 mounts"); + error = EINVAL; + goto out; + } + + if ((newflag & NFSMNT_SYSKRB5) != 0 && + (args.flags & NFSMNT_KERB) == 0) { + /* + * This option modifies the behaviour of sec=krb5[ip]. + */ + vfs_mount_error(mp, "syskrb5 should only be used " + "for sec=krb5[ip] mounts"); + error = EINVAL; + goto out; + } + + if ((newflag & NFSMNT_SYSKRB5) != 0 && krbname[0] != '\0') { + /* + * This option is used as an alternative to "gssname". + */ + vfs_mount_error(mp, "syskrb5 should not be used " + "with the gssname option"); + error = EINVAL; + goto out; + } + args.fh = nfh; error = mountnfs(&args, mp, nam, hst, krbname, krbnamelen, dirpath, dirlen, srvkrbname, srvkrbnamelen, &vp, td->td_ucred, td, @@ -1449,6 +1519,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, struct nfsclds *dsp, *tdsp; uint32_t lease; bool tryminvers; + char *fakefh; static u_int64_t clval = 0; #ifdef KERN_TLS u_int maxlen; @@ -1622,6 +1693,12 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, error = EINVAL; goto bad; } + if (NFSHASSYSKRB5(nmp) && nmp->nm_minorvers == 0) { + vfs_mount_error(mp, "syskrb5 should only be used " + "for NFSv4.1/4.2 mounts"); + error = EINVAL; + goto bad; + } } if (nmp->nm_fhsize == 0 && (nmp->nm_flag & NFSMNT_NFSV4) && @@ -1636,10 +1713,13 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, error = nfsrpc_getdirpath(nmp, NFSMNT_DIRPATH(nmp), cred, td); NFSCL_DEBUG(3, "aft dirp=%d\n", error); - if (error) + if (error != 0 && (!NFSHASSYSKRB5(nmp) || + error != NFSERR_WRONGSEC)) (void) nfs_catnap(PZERO, error, "nfsgetdirp"); - } while (error && --trycnt > 0); - if (error) + } while (error != 0 && --trycnt > 0 && + (!NFSHASSYSKRB5(nmp) || error != NFSERR_WRONGSEC)); + if (error != 0 && (!NFSHASSYSKRB5(nmp) || + error != NFSERR_WRONGSEC)) goto bad; } @@ -1650,16 +1730,27 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, * the nfsnode gets flushed out of the cache. Ufs does not have * this problem, because one can identify root inodes by their * number == UFS_ROOTINO (2). + * For the "syskrb5" mount, the file handle might not have + * been acquired. As such, use a "fake" file handle which + * can never be returned by a server for the root vnode. */ - if (nmp->nm_fhsize > 0) { + if (nmp->nm_fhsize > 0 || NFSHASSYSKRB5(nmp)) { /* * Set f_iosize to NFS_DIRBLKSIZ so that bo_bsize gets set * non-zero for the root vnode. f_iosize will be set correctly * by nfs_statfs() before any I/O occurs. */ mp->mnt_stat.f_iosize = NFS_DIRBLKSIZ; - error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np, - LK_EXCLUSIVE); + if (nmp->nm_fhsize == 0) { + fakefh = malloc(NFSX_FHMAX + 1, M_TEMP, M_WAITOK | + M_ZERO); + error = ncl_nget(mp, fakefh, NFSX_FHMAX + 1, &np, + LK_EXCLUSIVE); + free(fakefh, M_TEMP); + nmp->nm_privflag |= NFSMNTP_FAKEROOTFH; + } else + error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np, + LK_EXCLUSIVE); if (error) goto bad; *vpp = NFSTOV(np); @@ -1669,8 +1760,10 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, * mountpoint. This has the side effect of filling in * (*vpp)->v_type with the correct value. */ - ret = nfsrpc_getattrnovp(nmp, nmp->nm_fh, nmp->nm_fhsize, 1, - cred, td, &nfsva, NULL, &lease); + ret = ENXIO; + if (nmp->nm_fhsize > 0) + ret = nfsrpc_getattrnovp(nmp, nmp->nm_fh, + nmp->nm_fhsize, 1, cred, td, &nfsva, NULL, &lease); if (ret) { /* * Just set default values to get things going. @@ -1685,7 +1778,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, nfsva.na_vattr.va_gen = 1; nfsva.na_vattr.va_blocksize = NFS_FABLKSIZE; nfsva.na_vattr.va_size = 512 * 1024; - lease = 60; + lease = 20; } (void) nfscl_loadattrcache(vpp, &nfsva, NULL, 0, 1); if ((argp->flags & NFSMNT_NFSV4) != 0) { @@ -1871,9 +1964,20 @@ nfs_root(struct mount *mp, int flags, struct vnode **vpp) struct nfsmount *nmp; struct nfsnode *np; int error; + char *fakefh; nmp = VFSTONFS(mp); - error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np, flags); + if ((nmp->nm_privflag & NFSMNTP_FAKEROOTFH) != 0) { + /* Attempt to get the actual root file handle. */ + if (nmp->nm_fhsize == 0) + error = nfsrpc_getdirpath(nmp, NFSMNT_DIRPATH(nmp), + curthread->td_ucred, curthread); + fakefh = malloc(NFSX_FHMAX + 1, M_TEMP, M_WAITOK | M_ZERO); + error = ncl_nget(mp, fakefh, NFSX_FHMAX + 1, &np, flags); + free(fakefh, M_TEMP); + } else { + error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np, flags); + } if (error) return error; vp = NFSTOV(np); @@ -2116,6 +2220,8 @@ void nfscl_retopts(struct nfsmount *nmp, char *buffer, size_t buflen) &buf, &blen); nfscl_printopt(nmp, (nmp->nm_newflag & NFSMNT_TLS) != 0, ",tls", &buf, &blen); + nfscl_printopt(nmp, (nmp->nm_newflag & NFSMNT_SYSKRB5) != 0, + ",syskrb5", &buf, &blen); nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_NOCONN) != 0, ",noconn", &buf, &blen); nfscl_printoptval(nmp, nmp->nm_aconnect + 1, ",nconnect", &buf, &blen); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 3e9cf7e3a475..39409852e86f 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -997,7 +997,9 @@ nfs_getattr(struct vop_getattr_args *ap) struct nfsvattr nfsva; struct vattr *vap = ap->a_vap; struct vattr vattr; + struct nfsmount *nmp; + nmp = VFSTONFS(vp->v_mount); /* * Update local times for special files. */ @@ -1007,8 +1009,10 @@ nfs_getattr(struct vop_getattr_args *ap) NFSUNLOCKNODE(np); /* * First look in the cache. + * For "syskrb5" mounts, nm_fhsize might still be zero and + * cached attributes should be ignored. */ - if (ncl_getattrcache(vp, &vattr) == 0) { + if (nmp->nm_fhsize > 0 && ncl_getattrcache(vp, &vattr) == 0) { ncl_copy_vattr(vap, &vattr); /* diff --git a/sys/fs/nfsclient/nfsmount.h b/sys/fs/nfsclient/nfsmount.h index d5771f157034..c9183ebe919f 100644 --- a/sys/fs/nfsclient/nfsmount.h +++ b/sys/fs/nfsclient/nfsmount.h @@ -125,9 +125,11 @@ struct nfsmount { #define NFSMNTP_NOALLOCATE 0x00000200 #define NFSMNTP_DELEGISSUED 0x00000400 #define NFSMNTP_NODEALLOCATE 0x00000800 +#define NFSMNTP_FAKEROOTFH 0x00001000 /* New mount flags only used by the kernel via nmount(2). */ #define NFSMNT_TLS 0x00000001 +#define NFSMNT_SYSKRB5 0x00000002 #define NFSMNT_DIRPATH(m) (&((m)->nm_name[(m)->nm_krbnamelen + 1])) #define NFSMNT_SRVKRBNAME(m) \ diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 9c7169d7daac..56f5c00d0aed 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2759,7 +2759,8 @@ again: NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); txdr_hyper(*cookiep, tl); nfsrv_postopattr(nd, 0, nvap); - dirlen += nfsm_fhtom(nd,(u_int8_t *)&nfh,0,1); + dirlen += nfsm_fhtom(NULL, nd, (u_int8_t *)&nfh, + 0, 1); dirlen += (5*NFSX_UNSIGNED+NFSX_V3POSTOPATTR); if (nvp != NULL) vput(nvp); diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 569ddc9141bb..cf88e5ea4ebe 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -672,10 +672,10 @@ nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram, goto out; } if (nd->nd_flag & ND_NFSV2) { - (void) nfsm_fhtom(nd, (u_int8_t *)fhp, 0, 0); + nfsm_fhtom(NULL, nd, (u_int8_t *)fhp, 0, 0); nfsrv_fillattr(nd, &nva); } else if (nd->nd_flag & ND_NFSV3) { - (void) nfsm_fhtom(nd, (u_int8_t *)fhp, 0, 0); + nfsm_fhtom(NULL, nd, (u_int8_t *)fhp, 0, 0); nfsrv_postopattr(nd, 0, &nva); nfsrv_postopattr(nd, dattr_ret, &dattr); } @@ -1282,7 +1282,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram, } if (nd->nd_flag & ND_NFSV2) { if (!nd->nd_repstat) { - (void) nfsm_fhtom(nd, (u_int8_t *)&fh, 0, 0); + nfsm_fhtom(NULL, nd, (u_int8_t *)&fh, 0, 0); nfsrv_fillattr(nd, &nva); } } else { @@ -1292,7 +1292,7 @@ nfsrvd_create(struct nfsrv_descript *nd, __unused int isdgram, diraft_ret = nfsvno_getattr(dirp, &diraft, nd, p, 0, NULL); vrele(dirp); if (!nd->nd_repstat) { - (void) nfsm_fhtom(nd, (u_int8_t *)&fh, 0, 1); + nfsm_fhtom(NULL, nd, (u_int8_t *)&fh, 0, 1); nfsrv_postopattr(nd, 0, &nva); } nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -1492,7 +1492,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram, *** 72 LINES SKIPPED *** From nobody Fri Mar 17 01:38:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pd6Gp5Cgcz3yt8S; Fri, 17 Mar 2023 01:38: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 4Pd6Gp4hv2z3jVn; Fri, 17 Mar 2023 01:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679017122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TWOBfxRDzAJ2xOmM8FyCjA7uMVWtl07ry2l1AVoyg2s=; b=MYcyvQ/efu5kEmpNvthfOXPA3CA6Ls1qzWFqAwUM7/EtY2HvGc7J36kiKvGztVCYIq7KNk Pt79rG7S1oGiOhehp24L0kGISIzk9XS73iJhgvdTAYYST+E4LjzLomXVUyRRKFlSkt+Cwe 4woccTBizxET7PUX2DQF2583Pxz+yr0fZ2vAmJGcQIkAtTvzVg83PqPwlLGbIdZxvI/RMr GS79l5ACKOQNtfTCMviQvFr0sDLBklRysIaNsW/Hi2V4WOxN04fy3gUoTWqI/0sySRH3BC i4At/a97K+66QmXwX3VqpYVADV4tTcSH4H+oihkORsb0gPG0EVjKlH1jwJdzsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679017122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TWOBfxRDzAJ2xOmM8FyCjA7uMVWtl07ry2l1AVoyg2s=; b=TRejUJ0sGiTuZOyhiG9E9wFDYIhJo6NgXunOLr9N9nhh3QquGBMvmDjrb+/Y9vBbTXqt1/ vERYtv3ymNLz2hzwWYt9kbCGG5P5OzGRM1jzxP9zhmOo2S4nQxBK8m5DGWVFsPtZNGfOEC DtlOEVOvqbRJvOY0bYAY+D2Dt6fgNjmblzXdEBR0ZiYswk/fFhk9pje4DyevOUkj+XtB6y WxwidcEql9C17wiKvC4rFyAQs33ZNh/UZDL7y24Q7hOvDLfmwnRHgLs57YYHryYXggjpG1 m71lvyIjozN1wn+EL5B9SgS/OEXUYNXQC+WeD7t/2L5KOEUn2FuTxuUABcySbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679017122; a=rsa-sha256; cv=none; b=EXcOWWTVEOUgtBEpgQbGQLoM7qPYj9w9Bscq3QXgxpQIESYekAzg+JCxRh4511cunPnHX8 FJMmX87U1tTTwjW4xIAqho24Ok+FK3GXY+dCQKds9ghwM+wl3/XxRERQImkqA9WZmCiCUi lUu5uHGPdVVNek43qg3CcXGFpWUkjxDTh0OCbfpkO79PwMaPlbGzAPg1PmbIFUkS5Nrhwt n1wgP55YmTONIqEMFiEd5ysMiRCVyR5ocbE0z/TxHDUqVXjeUAOVe6a7e6Xn0aTyWnZTDq XHQ+peHcGhWnYBVgsfrwlH5olMdcX33HSxFoBUDgsNboKvXZVhR+3snsAHRDTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pd6Gp3hJPz15nf; Fri, 17 Mar 2023 01:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H1cgHp094022; Fri, 17 Mar 2023 01:38:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H1cgtU094021; Fri, 17 Mar 2023 01:38:42 GMT (envelope-from git) Date: Fri, 17 Mar 2023 01:38:42 GMT Message-Id: <202303170138.32H1cgtU094021@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: 43ad40718af1 - releng/13.2 - ssh: Update to OpenSSH 9.3p1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 43ad40718af1a94abc2fb3fb932b08a91a56f291 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=43ad40718af1a94abc2fb3fb932b08a91a56f291 commit 43ad40718af1a94abc2fb3fb932b08a91a56f291 Author: Ed Maste AuthorDate: 2023-03-16 14:29:55 +0000 Commit: Ed Maste CommitDate: 2023-03-17 01:38:16 +0000 ssh: Update to OpenSSH 9.3p1 This release fixes a number of security bugs and has minor new features and bug fixes. Security fixes, from the release notes (https://www.openssh.com/txt/release-9.3): This release contains fixes for a security problem and a memory safety problem. The memory safety problem is not believed to be exploitable, but we report most network-reachable memory faults as security bugs. * ssh-add(1): when adding smartcard keys to ssh-agent(1) with the per-hop destination constraints (ssh-add -h ...) added in OpenSSH 8.9, a logic error prevented the constraints from being communicated to the agent. This resulted in the keys being added without constraints. The common cases of non-smartcard keys and keys without destination constraints are unaffected. This problem was reported by Luci Stanescu. * ssh(1): Portable OpenSSH provides an implementation of the getrrsetbyname(3) function if the standard library does not provide it, for use by the VerifyHostKeyDNS feature. A specifically crafted DNS response could cause this function to perform an out-of-bounds read of adjacent stack data, but this condition does not appear to be exploitable beyond denial-of- service to the ssh(1) client. The getrrsetbyname(3) replacement is only included if the system's standard library lacks this function and portable OpenSSH was not compiled with the ldns library (--with-ldns). getrrsetbyname(3) is only invoked if using VerifyHostKeyDNS to fetch SSHFP records. This problem was found by the Coverity static analyzer. Approved by: re (cperciva) Sponsored by: The FreeBSD Foundation (cherry picked from commit 4d3fc8b0570b29fb0d6ee9525f104d52176ff0d4) (cherry picked from commit 802b483630974c2ccf2bfbc90b39102b9e47d22b) --- crypto/openssh/.depend | 51 +- crypto/openssh/.github/ci-status.md | 7 +- crypto/openssh/.github/configs | 2 +- crypto/openssh/.github/run_test.sh | 2 +- crypto/openssh/.github/setup_ci.sh | 6 +- crypto/openssh/.github/workflows/c-cpp.yml | 1 + crypto/openssh/.github/workflows/selfhosted.yml | 3 + crypto/openssh/.github/workflows/upstream.yml | 1 + crypto/openssh/ChangeLog | 15098 ++++++++++--------- crypto/openssh/Makefile.in | 5 + crypto/openssh/README | 3 +- crypto/openssh/README.md | 1 + crypto/openssh/auth-pam.c | 15 +- crypto/openssh/auth-shadow.c | 14 +- crypto/openssh/auth.c | 3 +- crypto/openssh/auth2-hostbased.c | 9 +- crypto/openssh/auth2-none.c | 3 +- crypto/openssh/auth2-pubkey.c | 8 +- crypto/openssh/auth2-pubkeyfile.c | 3 +- crypto/openssh/auth2.c | 5 +- crypto/openssh/authfd.c | 9 +- crypto/openssh/authfile.c | 4 +- crypto/openssh/canohost.c | 5 +- crypto/openssh/channels.c | 42 +- crypto/openssh/channels.h | 4 +- crypto/openssh/clientloop.c | 14 +- crypto/openssh/compat.c | 53 +- crypto/openssh/compat.h | 14 +- crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/dispatch.c | 3 +- crypto/openssh/dns.c | 8 +- crypto/openssh/dns.h | 4 +- crypto/openssh/hostfile.c | 15 +- crypto/openssh/kex.c | 72 +- crypto/openssh/kex.h | 5 +- crypto/openssh/kexgexs.c | 3 +- crypto/openssh/krl.c | 3 +- crypto/openssh/misc.c | 5 +- crypto/openssh/misc.h | 5 +- crypto/openssh/moduli.c | 13 +- crypto/openssh/monitor.c | 11 +- crypto/openssh/mux.c | 4 +- crypto/openssh/openbsd-compat/bsd-getentropy.c | 2 +- crypto/openssh/openbsd-compat/bsd-snprintf.c | 90 +- crypto/openssh/openbsd-compat/getopt.h | 3 + crypto/openssh/openbsd-compat/getopt_long.c | 14 + crypto/openssh/openbsd-compat/getrrsetbyname.c | 47 +- .../openssh/openbsd-compat/libressl-api-compat.c | 14 +- crypto/openssh/openbsd-compat/mktemp.c | 23 + crypto/openssh/openbsd-compat/openbsd-compat.h | 3 + crypto/openssh/packet.c | 4 +- crypto/openssh/progressmeter.c | 95 +- crypto/openssh/readconf.c | 11 +- crypto/openssh/regress/Makefile | 6 +- crypto/openssh/regress/agent-getpeereid.sh | 3 +- crypto/openssh/regress/agent-restrict.sh | 6 +- crypto/openssh/regress/agent.sh | 4 +- crypto/openssh/regress/dhgex.sh | 6 +- crypto/openssh/regress/integrity.sh | 4 +- crypto/openssh/regress/keygen-sshfp.sh | 22 +- crypto/openssh/regress/knownhosts.sh | 20 +- crypto/openssh/regress/multiplex.sh | 4 +- crypto/openssh/regress/sshd-log-wrapper.sh | 12 - crypto/openssh/regress/test-exec.sh | 88 +- crypto/openssh/regress/timestamp.c | 46 + .../openssh/regress/unittests/kex/test_proposal.c | 47 +- crypto/openssh/regress/unittests/kex/tests.c | 8 +- .../openssh/regress/unittests/misc/test_ptimeout.c | 6 +- crypto/openssh/sandbox-seccomp-filter.c | 93 +- crypto/openssh/scp.c | 8 +- crypto/openssh/servconf.c | 15 +- crypto/openssh/serverloop.c | 5 +- crypto/openssh/session.c | 4 +- crypto/openssh/sftp-client.c | 3 +- crypto/openssh/sftp-server.c | 4 +- crypto/openssh/sftp.c | 14 +- crypto/openssh/ssh-add.c | 9 +- crypto/openssh/ssh-agent.c | 8 +- crypto/openssh/ssh-dss.c | 3 +- crypto/openssh/ssh-ecdsa-sk.c | 3 +- crypto/openssh/ssh-ecdsa.c | 4 +- crypto/openssh/ssh-keygen.1 | 19 +- crypto/openssh/ssh-keygen.c | 42 +- crypto/openssh/ssh-keyscan.1 | 19 +- crypto/openssh/ssh-keyscan.c | 22 +- crypto/openssh/ssh-pkcs11.c | 8 +- crypto/openssh/ssh-rsa.c | 3 +- crypto/openssh/ssh.c | 3 +- crypto/openssh/ssh_config | 2 +- crypto/openssh/ssh_config.5 | 8 +- crypto/openssh/ssh_namespace.h | 4 +- crypto/openssh/sshconnect.c | 5 +- crypto/openssh/sshconnect2.c | 81 +- crypto/openssh/sshd.8 | 20 +- crypto/openssh/sshd.c | 92 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 20 +- crypto/openssh/umac.c | 5 +- crypto/openssh/version.h | 6 +- secure/lib/libssh/Makefile | 1 + 101 files changed, 8558 insertions(+), 8105 deletions(-) diff --git a/crypto/openssh/.depend b/crypto/openssh/.depend index 5226523aa2ad..259bf3b2f136 100644 --- a/crypto/openssh/.depend +++ b/crypto/openssh/.depend @@ -16,21 +16,20 @@ auth-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-c auth-rhosts.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h uidswap.h pathnames.h log.h ssherr.h misc.h xmalloc.h sshbuf.h sshkey.h servconf.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-shadow.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h auth-sia.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth.o: authfile.h monitor_wrap.h compat.h channels.h +auth.o: authfile.h monitor_wrap.h channels.h auth.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h groupaccess.h log.h ssherr.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h canohost.h uidswap.h packet.h dispatch.h auth2-chall.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h ssherr.h log.h misc.h servconf.h auth2-gss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth2-hostbased.o: canohost.h monitor_wrap.h pathnames.h match.h -auth2-hostbased.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth2-hostbased.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h canohost.h +auth2-hostbased.o: monitor_wrap.h pathnames.h match.h auth2-kbdint.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h log.h ssherr.h misc.h servconf.h -auth2-none.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h misc.h servconf.h compat.h ssh2.h monitor_wrap.h +auth2-none.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h misc.h servconf.h ssh2.h monitor_wrap.h auth2-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h ssherr.h log.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h monitor_wrap.h misc.h servconf.h auth2-pubkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth2-pubkey.o: pathnames.h uidswap.h auth-options.h canohost.h monitor_wrap.h authfile.h match.h channels.h session.h sk-api.h -auth2-pubkeyfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h log.h ssherr.h misc.h compat.h sshkey.h digest.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfile.h match.h -auth2.o: digest.h -auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h -authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h compat.h log.h ssherr.h atomicio.h misc.h +auth2-pubkeyfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h log.h ssherr.h misc.h sshkey.h digest.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfile.h match.h +auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h digest.h +authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h log.h ssherr.h atomicio.h misc.h authfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh.h log.h ssherr.h authfile.h misc.h atomicio.h sshkey.h sshbuf.h krl.h bitmap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h bitmap.h canohost.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h canohost.h misc.h @@ -44,11 +43,11 @@ cipher.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat cleanup.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h clientloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h packet.h dispatch.h sshbuf.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h clientloop.o: myproposal.h log.h ssherr.h misc.h readconf.h clientloop.h sshconnect.h authfd.h atomicio.h sshpty.h match.h msg.h hostfile.h -compat.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h log.h ssherr.h match.h kex.h mac.h crypto_api.h +compat.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h log.h ssherr.h match.h dh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h digest-libc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h digest.h digest-openssl.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -dispatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh2.h log.h ssherr.h dispatch.h packet.h openbsd-compat/sys-queue.h compat.h +dispatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh2.h log.h ssherr.h dispatch.h packet.h openbsd-compat/sys-queue.h dns.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h ssherr.h dns.h log.h digest.h ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h entropy.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h @@ -61,7 +60,7 @@ hash.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h hmac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshbuf.h digest.h hmac.h hostfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h sshkey.h hostfile.h log.h ssherr.h misc.h pathnames.h digest.h hmac.h sshbuf.h kex.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h ssh2.h atomicio.h version.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h log.h ssherr.h -kex.o: match.h misc.h monitor.h sshbuf.h digest.h +kex.o: match.h misc.h monitor.h myproposal.h sshbuf.h digest.h xmalloc.h kexc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h sshbuf.h digest.h ssherr.h ssh2.h kexdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h kexecdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h @@ -94,8 +93,8 @@ platform-tracing.o: includes.h config.h defines.h platform.h openbsd-compat/open platform.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h poly1305.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h poly1305.h progressmeter.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h progressmeter.h atomicio.h misc.h utf8.h -readconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h ssherr.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h pathnames.h log.h sshkey.h misc.h readconf.h match.h kex.h mac.h crypto_api.h -readconf.o: uidswap.h myproposal.h digest.h +readconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h ssherr.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h pathnames.h log.h sshkey.h misc.h readconf.h match.h kex.h mac.h crypto_api.h uidswap.h +readconf.o: myproposal.h digest.h readpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h pathnames.h log.h ssherr.h ssh.h uidswap.h rijndael.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h rijndael.h sandbox-capsicum.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h @@ -107,12 +106,12 @@ sandbox-seccomp-filter.o: includes.h config.h defines.h platform.h openbsd-compa sandbox-solaris.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sandbox-systrace.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h scp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h atomicio.h pathnames.h log.h ssherr.h misc.h progressmeter.h utf8.h sftp.h sftp-common.h sftp-client.h -servconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h openbsd-compat/sys-queue.h xmalloc.h ssh.h log.h ssherr.h sshbuf.h misc.h servconf.h compat.h pathnames.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey .h -servconf.o: kex.h mac.h crypto_api.h match.h channels.h groupaccess.h canohost.h packet.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h myproposal.h digest.h -serverloop.o: cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h loginrec.h session.h auth-options.h serverloop.h -serverloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h packet.h dispatch.h sshbuf.h log.h ssherr.h misc.h servconf.h canohost.h sshpty.h channels.h compat.h ssh2.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h -session.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h sshbuf.h ssherr.h match.h uidswap.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h -session.o: rijndael.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfd.h pathnames.h log.h misc.h servconf.h sshlogin.h serverloop.h canohost.h session.h kex.h mac.h crypto_api.h monitor_wrap.h sftp.h atomicio.h +servconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h openbsd-compat/sys-queue.h xmalloc.h ssh.h log.h ssherr.h sshbuf.h misc.h servconf.h pathnames.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h +servconf.o: mac.h crypto_api.h match.h channels.h groupaccess.h canohost.h packet.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h myproposal.h digest.h +serverloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h packet.h dispatch.h sshbuf.h log.h ssherr.h misc.h servconf.h canohost.h sshpty.h channels.h ssh2.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr .h +serverloop.o: rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h loginrec.h session.h auth-options.h serverloop.h +session.o: hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfd.h pathnames.h log.h misc.h servconf.h sshlogin.h serverloop.h canohost.h session.h kex.h mac.h crypto_api.h monitor_wrap.h sftp.h atomicio.h +session.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h sshbuf.h ssherr.h match.h uidswap.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sftp-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssherr.h sshbuf.h log.h atomicio.h progressmeter.h misc.h utf8.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h sftp-common.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssherr.h sshbuf.h log.h misc.h sftp.h sftp-common.h sftp-glob.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h @@ -125,7 +124,7 @@ sk-usbhid.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-com sntrup761.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h srclimit.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h canohost.h log.h ssherr.h misc.h srclimit.h xmalloc.h ssh-add.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h log.h ssherr.h sshkey.h sshbuf.h authfd.h authfile.h pathnames.h misc.h digest.h ssh-sk.h sk-api.h hostfile.h -ssh-agent.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h sshkey.h authfd.h compat.h log.h ssherr.h misc.h digest.h match.h msg.h pathnames.h ssh-pkcs11.h sk-api.h myproposal.h +ssh-agent.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h sshkey.h authfd.h log.h ssherr.h misc.h digest.h match.h msg.h pathnames.h ssh-pkcs11.h sk-api.h myproposal.h ssh-dss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh-ecdsa-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h sshbuf.h ssherr.h digest.h sshkey.h ssh-ecdsa.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h @@ -133,8 +132,8 @@ ssh-ed25519-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbs ssh-ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h ssherr.h sshbuf.h sshkey.h ssh.h ssh-keygen.o: cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh-keygen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h authfile.h sshbuf.h pathnames.h log.h ssherr.h misc.h match.h hostfile.h dns.h ssh.h ssh2.h ssh-pkcs11.h atomicio.h krl.h digest.h utf8.h authfd.h sshsig.h ssh-sk.h sk-api.h cipher.h -ssh-keyscan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h sshbuf.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h compat.h myproposal.h packet.h dispatch.h log .h -ssh-keyscan.o: ssherr.h atomicio.h misc.h hostfile.h ssh_api.h ssh2.h dns.h addr.h +ssh-keyscan.o: dispatch.h log.h ssherr.h atomicio.h misc.h hostfile.h ssh_api.h ssh2.h dns.h addr.h +ssh-keyscan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h sshbuf.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h digest.h kex.h mac.h crypto_api.h compat.h myproposal.h packet.h ssh-keysign.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ssherr.h sshkey.h ssh.h ssh2.h misc.h sshbuf.h authfile.h msg.h canohost.h pathnames.h readconf.h uidswap.h ssh-pkcs11-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh-pkcs11-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h sshbuf.h log.h ssherr.h misc.h sshkey.h authfd.h ssh-pkcs11.h @@ -153,12 +152,12 @@ sshbuf-getput-crypto.o: includes.h config.h defines.h platform.h openbsd-compat/ sshbuf-io.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h atomicio.h sshbuf-misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h sshbuf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h misc.h -sshconnect.o: authfd.h kex.h mac.h crypto_api.h -sshconnect.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h hostfile.h ssh.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h sshkey.h sshconnect.h log.h ssherr.h misc.h readconf.h atomicio.h dns.h monitor_fdpass.h ssh2.h version.h authfile.h +sshconnect.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h hostfile.h ssh.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h sshkey.h sshconnect.h log.h ssherr.h misc.h readconf.h atomicio.h dns.h monitor_fdpass.h ssh2.h version.h authfile.h authfd.h +sshconnect.o: kex.h mac.h crypto_api.h sshconnect2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h packet.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h -sshconnect2.o: myproposal.h sshconnect.h authfile.h dh.h authfd.h log.h ssherr.h misc.h readconf.h match.h canohost.h msg.h pathnames.h uidswap.h hostfile.h utf8.h ssh-sk.h sk-api.h +sshconnect2.o: sshconnect.h authfile.h dh.h authfd.h log.h ssherr.h misc.h readconf.h match.h canohost.h msg.h pathnames.h uidswap.h hostfile.h utf8.h ssh-sk.h sk-api.h sshd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h log.h ssherr.h sshbuf.h misc.h match.h servconf.h uidswap.h compat.h cipher.h cipher-chachapoly.h chacha.h -sshd.o: poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h kex.h mac.h crypto_api.h myproposal.h authfile.h pathnames.h atomicio.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h authfd.h msg.h channels.h session.h monitor.h monitor_wrap.h ssh-sandbox.h auth-options.h version.h sk-api.h srclimit.h dh.h +sshd.o: poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h kex.h mac.h crypto_api.h authfile.h pathnames.h atomicio.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h authfd.h msg.h channels.h session.h monitor.h monitor_wrap.h ssh-sandbox.h auth-options.h version.h sk-api.h srclimit.h dh.h ssherr.o: ssherr.h sshkey-xmss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h ssh2.h ssherr.h misc.h sshbuf.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h match.h ssh-sk.h openbsd-compat/openssl-compat.h diff --git a/crypto/openssh/.github/ci-status.md b/crypto/openssh/.github/ci-status.md index d13bbfa8c038..c57c3d83d11a 100644 --- a/crypto/openssh/.github/ci-status.md +++ b/crypto/openssh/.github/ci-status.md @@ -4,7 +4,8 @@ master : [![Upstream self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/upstream.yml/badge.svg)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/upstream.yml?query=branch:master) [![CIFuzz](https://github.com/openssh/openssh-portable/actions/workflows/cifuzz.yml/badge.svg)](https://github.com/openssh/openssh-portable/actions/workflows/cifuzz.yml) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/openssh.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:openssh) +[![Coverity Status](https://scan.coverity.com/projects/21341/badge.svg)](https://scan.coverity.com/projects/openssh-portable) -9.1 : -[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_1)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_1) -[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_1)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_1) +9.2 : +[![C/C++ CI](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml/badge.svg?branch=V_9_2)](https://github.com/openssh/openssh-portable/actions/workflows/c-cpp.yml?query=branch:V_9_2) +[![C/C++ CI self-hosted](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml/badge.svg?branch=V_9_2)](https://github.com/openssh/openssh-portable-selfhosted/actions/workflows/selfhosted.yml?query=branch:V_9_2) diff --git a/crypto/openssh/.github/configs b/crypto/openssh/.github/configs index bdd5ddbdfaf0..8f21fc54a268 100755 --- a/crypto/openssh/.github/configs +++ b/crypto/openssh/.github/configs @@ -221,7 +221,7 @@ case "${TARGET_HOST}" in # test run does not time out. # The agent-restrict test fails due to some quoting issue when run # with sh or ksh so specify bash for now. - TEST_TARGET="t-exec TEST_SHELL=bash" + TEST_TARGET="t-exec unit TEST_SHELL=bash" SKIP_LTESTS="rekey sftp" ;; debian-riscv64) diff --git a/crypto/openssh/.github/run_test.sh b/crypto/openssh/.github/run_test.sh index 8eeaf5e9b09d..d5fd487d9009 100755 --- a/crypto/openssh/.github/run_test.sh +++ b/crypto/openssh/.github/run_test.sh @@ -21,7 +21,7 @@ if [ ! -z "$SUDO" ] && [ ! -z "$TEST_SSH_HOSTBASED_AUTH" ]; then fi output_failed_logs() { - for i in regress/failed*; do + for i in regress/failed*.log; do if [ -f "$i" ]; then echo ------------------------------------------------------------------------- echo LOGFILE $i diff --git a/crypto/openssh/.github/setup_ci.sh b/crypto/openssh/.github/setup_ci.sh index e4480e614f31..691c70dd7ed6 100755 --- a/crypto/openssh/.github/setup_ci.sh +++ b/crypto/openssh/.github/setup_ci.sh @@ -7,10 +7,10 @@ PACKAGES="" case "`./config.guess`" in *cygwin) PACKAGER=setup - echo Setting CYGWIN sustem environment variable. + echo Setting CYGWIN system environment variable. setx CYGWIN "binmode" - chmod -R go-rw /cygdrive/d/a - umask 077 + echo Removing extended ACLs so umask works as expected. + setfacl -b . regress PACKAGES="$PACKAGES,autoconf,automake,cygwin-devel,gcc-core" PACKAGES="$PACKAGES,make,openssl-devel,zlib-devel" ;; diff --git a/crypto/openssh/.github/workflows/c-cpp.yml b/crypto/openssh/.github/workflows/c-cpp.yml index e6ea49550f71..f3163884a037 100644 --- a/crypto/openssh/.github/workflows/c-cpp.yml +++ b/crypto/openssh/.github/workflows/c-cpp.yml @@ -123,3 +123,4 @@ jobs: regress/valgrind-out/ regress/asan.log.* regress/msan.log.* + regress/log/* diff --git a/crypto/openssh/.github/workflows/selfhosted.yml b/crypto/openssh/.github/workflows/selfhosted.yml index 50bc9fffb723..d38cba520500 100644 --- a/crypto/openssh/.github/workflows/selfhosted.yml +++ b/crypto/openssh/.github/workflows/selfhosted.yml @@ -21,6 +21,7 @@ jobs: matrix: target: - alpine + - centos7 - debian-i386 - dfly30 - dfly48 @@ -51,6 +52,7 @@ jobs: include: # Then we include extra libvirt test configs. - { target: aix51, config: default, host: libvirt } + - { target: centos7, config: pam, host: libvirt } - { target: debian-i386, config: pam, host: libvirt } - { target: dfly30, config: without-openssl, host: libvirt} - { target: dfly48, config: pam ,host: libvirt } @@ -109,6 +111,7 @@ jobs: config.h config.log regress/*.log + regress/log/* regress/valgrind-out/ - name: shutdown VM if: always() diff --git a/crypto/openssh/.github/workflows/upstream.yml b/crypto/openssh/.github/workflows/upstream.yml index 1e2c2acb7ac0..b280793d31f3 100644 --- a/crypto/openssh/.github/workflows/upstream.yml +++ b/crypto/openssh/.github/workflows/upstream.yml @@ -46,6 +46,7 @@ jobs: name: ${{ matrix.target }}-${{ matrix.config }}-logs path: | /usr/obj/regress/usr.bin/ssh/obj/*.log + /usr/obj/regress/usr.bin/ssh/obj/log/* - name: shutdown VM if: always() run: vmshutdown diff --git a/crypto/openssh/ChangeLog b/crypto/openssh/ChangeLog index 4251831a1732..f1d1b37d583c 100644 --- a/crypto/openssh/ChangeLog +++ b/crypto/openssh/ChangeLog @@ -1,11196 +1,11238 @@ -commit 6dfb65de949cdd0a5d198edee9a118f265924f33 +commit cb30fbdbee869f1ce11f06aa97e1cb8717a0b645 Author: Damien Miller -Date: Thu Feb 2 23:21:54 2023 +1100 +Date: Thu Mar 16 08:28:19 2023 +1100 - crank versions in RPM specs + depend -commit d07cfb11a0ca574eb68a3931d8c46fbe862a2021 +commit 1dba63eb10c40b6fda9f5012ed6ae87e2d3d028e Author: Damien Miller -Date: Thu Feb 2 23:21:45 2023 +1100 +Date: Thu Mar 16 08:27:54 2023 +1100 - update version in README + crank version -commit 9fe207565b4ab0fe5d1ac5bb85e39188d96fb214 -Author: Damien Miller -Date: Thu Feb 2 23:17:49 2023 +1100 +commit ba7532d0dac9aaf0ad7270664c43837fc9f64a5f +Author: djm@openbsd.org +Date: Wed Mar 15 21:19:57 2023 +0000 - adapt compat_kex_proposal() test to portable + upstream: openssh-9.3 + + OpenBSD-Commit-ID: 8011495f2449c1029bb316bd015eab2e00509848 -commit 903c556b938fff2d7bff8da2cc460254430963c5 -Author: djm@openbsd.org -Date: Thu Feb 2 12:12:52 2023 +0000 +commit 6fd4daafb949b66bf555f3100f715a9ec64c3390 +Author: dtucker@openbsd.org +Date: Tue Mar 14 07:28:47 2023 +0000 - upstream: test compat_kex_proposal(); by dtucker@ + upstream: Free KRL ptr in addition to its contents. - OpenBSD-Regress-ID: 0e404ee264db546f9fdbf53390689ab5f8d38bf2 + From Coverity CID 291841, ok djm@ + + OpenBSD-Commit-ID: f146ba08b1b43af4e0d7ad8c4dae3748b4fa31b6 -commit 405fba71962dec8409c0c962408e09049e5624b5 +commit 1d270bd303afaf6d94e9098cbbf18e5e539e2088 Author: dtucker@openbsd.org -Date: Thu Jan 19 07:53:45 2023 +0000 +Date: Tue Mar 14 07:26:25 2023 +0000 - upstream: Check if we can copy sshd or need to use sudo to do so + upstream: Check pointer for NULL before deref. - during reexec test. Skip test if neither can work. Patch from anton@, tweaks - from me. + None of the existing callers seem to do that, but it's worth checking. + From Coverity CID 291834, ok djm@ - OpenBSD-Regress-ID: 731b96ae74d02d5744e1f1a8e51d09877ffd9b6d + OpenBSD-Commit-ID: a0a97113f192a7cb1a2c97b932f677f573cda7a4 -commit b2a2a8f69fd7737ea17dc044353c514f2f962f35 -Author: djm@openbsd.org -Date: Thu Feb 2 12:10:22 2023 +0000 +commit d95af508e78c0cd3dce56b83853baaa59ae295cf +Author: dtucker@openbsd.org +Date: Sun Mar 12 10:40:39 2023 +0000 - upstream: openssh-9.2 + upstream: Limit number of entries in SSH2_MSG_EXT_INFO - OpenBSD-Commit-ID: f7389f32413c74d6e2055f05cf65e7082de03923 + request. This is already constrained by the maximum SSH packet size but this + makes it explicit. Prompted by Coverity CID 291868, ok djm@ markus@ + + OpenBSD-Commit-ID: aea023819aa44a2dcb9dd0fbec10561896fc3a09 -commit 12da7823336434a403f25c7cc0c2c6aed0737a35 -Author: djm@openbsd.org -Date: Thu Feb 2 12:10:05 2023 +0000 +commit 8f287ba60d342b3e2f750e7332d2131e3ec7ecd0 +Author: dtucker@openbsd.org +Date: Sun Mar 12 09:41:18 2023 +0000 - upstream: fix double-free caused by compat_kex_proposal(); bz3522 + upstream: calloc can return NULL but xcalloc can't. - by dtucker@, ok me + From Coverity CID 291881, ok djm@ - OpenBSD-Commit-ID: 2bfc37cd2d41f67dad64c17a64cf2cd3806a5c80 + OpenBSD-Commit-ID: 50204b755f66b2ec7ac3cfe379d07d85ca161d2b -commit 79efd95ab5ff99f4cb3a955e2d713b3f54fb807e -Author: Darren Tucker -Date: Wed Feb 1 17:17:26 2023 +1100 +commit 83a56a49fd50f4acf900f934279482e4ef329715 +Author: dtucker@openbsd.org +Date: Fri Mar 10 07:17:08 2023 +0000 - Skip connection-timeout test on minix3. + upstream: Explicitly ignore return from fcntl - Minix 3's Unix domain sockets don't seem to work the way we expect, so - skip connection-timeout test on that platform. While there, group - together all similarly skipped tests and explicitly comment. + (... FD_CLOEXEC) here too. Coverity CID 291853. + + OpenBSD-Commit-ID: 99d8b3da9d0be1d07ca8dd8e98800a890349e9b5 -commit 6b508c4e039619842bcf5a16f8a6b08dd6bec44a +commit 0fda9d704d3bbf54a5e64ce02a6fecb11fe7f047 Author: Damien Miller -Date: Wed Feb 1 12:12:05 2023 +1100 +Date: Fri Mar 10 15:59:46 2023 +1100 - fix libfido2 detection without pkg-config + bounds checking for getrrsetbyname() replacement; - Place libfido2 before additional libraries (that it may depend upon) - and not after. bz3530 from James Zhang; ok dtucker@ + Spotted by Coverity in CID 405033; ok millert@ -commit 358e300fed5e6def233a2c06326e51e20ebed621 -Author: deraadt@openbsd.org -Date: Wed Jan 18 20:56:36 2023 +0000 +commit 89b8df518f21677045599df0ad3e5dd0f39909b5 +Author: dtucker@openbsd.org +Date: Fri Mar 10 04:06:21 2023 +0000 - upstream: delete useless dependency + upstream: Plug mem leak on error path. Coverity CID 405026, ok djm@. - OpenBSD-Commit-ID: e1dc11143f83082e3154d6094f9136d0dc2637ad + OpenBSD-Commit-ID: 8212ca05d01966fb5e72205c592b2257708a2aac -commit a4cb9be1b021b511e281ee55c356f964487d9e82 -Author: deraadt@openbsd.org -Date: Wed Jan 18 20:43:15 2023 +0000 +commit bf4dae0ad192c3e2f03f7223834b00d88ace3d3e +Author: Darren Tucker +Date: Fri Mar 10 14:46:57 2023 +1100 - upstream: Create and install sshd random relink kit. + Add prototypes for mkstemp replacements. - ../Makefile.inc and Makfile are concatenated for reuse, which hopefully won't - be too fragile, we'll see if we need a different approach. The resulting sshd - binary is tested with the new sshd -V option before installation. As the - binary layout is now semi-unknown (meaning relative, fixed, and gadget - offsets are not precisely known), change the filesystem permissions to 511 to - prevent what I call "logged in BROP". I have ideas for improving this further - but this is a first step ok djm + Should prevent warnings due to our wrapper function. + +commit 4e04d68d6a33cdc73b831fd4b5e6124175555d3d +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:01:51 2023 +0000 + + upstream: Expliticly ignore return code from fcntl(.. FD_CLOEXEC) since - OpenBSD-Commit-ID: 1e0a2692b7e20b126dda60bf04999d1d30d959d8 + there's not much we can do anyway. From Coverity CID 291857, ok djm@ + + OpenBSD-Commit-ID: 051429dd07af8db3fec10d82cdc78d90bb051729 -commit bc7de6f91a9a0ae2f148a9d31a4027d441a51999 -Author: jmc@openbsd.org -Date: Wed Jan 18 06:55:32 2023 +0000 +commit d6d38fd77cbe091c59e1bb720c3a494df4990640 +Author: djm@openbsd.org +Date: Fri Mar 10 02:32:04 2023 +0000 - upstream: tweak previous; ok djm + upstream: Like sshd_config, some ssh_config options are not - OpenBSD-Commit-ID: df71ce4180c58202dfdc1d92626cfe900b91b7c3 + first-match-wins. sshd_config.5 was fixed in r1.348, this is the same for + this file + + OpenBSD-Commit-ID: 7be55b9351cde449b136afcc52d07aa4113b215e -commit a20b7e999773e6333c8aa9b0a7fa41966e63b037 -Author: Darren Tucker -Date: Tue Jan 31 19:35:44 2023 +1100 +commit 7187d3f86bf8f2066cc9941f217d23b0cacae25e +Author: dtucker@openbsd.org +Date: Fri Mar 10 02:24:56 2023 +0000 - Skip connection-timeout test under Valgrind. + upstream: Remove no-op (int) > INT_MAX checks - Valgrind slows things down so much that the timeout test fails. Skip - this test until we figure out if we can make it work. + since they can never be true. From Coverity CID 405031, ok djm@ + + OpenBSD-Commit-ID: 9df3783b181e056595e2bb9edf7ed41d61cf8e84 -commit c3ffb54b4fc5e608206037921db6ccbc2f5ab25f +commit 77adde4305542ebe3005dd456122624fe2347b01 Author: Darren Tucker -Date: Wed Jan 25 21:58:40 2023 +1100 +Date: Fri Mar 10 13:27:29 2023 +1100 - Skip connection-timeout when missing FD passing. + Wrap mkstemp calls with umask set/restore. - This tests uses multiplexing which uses file descriptor passing, so - skip it if we don't have that. Fixes test failures on Cygwin. + glibc versions 2.06 and earlier did not set a umask on files created by + mkstemp created the world-writable. Wrap mkstemp to set and restore + the umask. From Coverity (CIDs 291826 291886 291891), ok djm@ -commit 35253af01d8c0ab444c8377402121816e71c71f5 -Author: djm@openbsd.org -Date: Wed Jan 18 02:00:10 2023 +0000 +commit 633d3dc2a1e9e2a013d019a0576a0771c8423713 +Author: jcs@openbsd.org +Date: Thu Mar 9 21:06:24 2023 +0000 - upstream: when restoring non-blocking mode to stdio fds, restore + upstream: modify parentheses in conditionals to make it clearer what is - exactly the flags that ssh started with and don't just clobber them with - zero, as this could also remove the append flag from the set; + being assigned and what is being checked - bz3523; ok dtucker@ + ok djm dtucker - OpenBSD-Commit-ID: 1336b03e881db7564a4b66014eb24c5230e9a0c0 + OpenBSD-Commit-ID: 19c10baa46ae559474409f75a5cb3d0eade7a9b8 -commit 7d17ea151c0b2519f023bd9cc7f141128833ac47 -Author: millert@openbsd.org -Date: Wed Jan 18 01:50:21 2023 +0000 +commit 733030840c4772f858de95d5940ec0c37663e8b0 +Author: dtucker@openbsd.org +Date: Thu Mar 9 07:11:05 2023 +0000 - upstream: Add a -V (version) option to sshd like the ssh client + upstream: Re-split the merge of the reorder-hostkeys test. - has. OK markus@ deraadt@ + In the kex_proposal_populate_entries change I merged the the check for + reordering hostkeys with the actual reordering, but kex_assemble_names + mutates options.hostkeyalgorithms which renders the check ineffective. + Put the check back where it was. Spotted and tested by jsg@, ok djm@ - OpenBSD-Commit-ID: abe990ec3e636fb040132aab8cbbede98f0c413e + OpenBSD-Commit-ID: a7469f25a738db5567395d1881e32479a7ffc9de -commit 62360feb7f08f2a4c6fc36f3b3449309203c42c9 -Author: millert@openbsd.org -Date: Tue Jan 17 18:52:44 2023 +0000 +commit 54ac4ab2b53ce9fcb66b8250dee91c070e4167ed +Author: djm@openbsd.org +Date: Thu Mar 9 06:58:26 2023 +0000 - upstream: For "ssh -V" always exit 0, there is no need to check opt + upstream: include destination constraints for smartcard keys too. - again. This was missed when the fallthrough in the switch case above it was - removed. OK deraadt@ + Spotted by Luci Stanescu; ok deraadt@ markus@ - OpenBSD-Commit-ID: 5583e5d8f6d62a8a4215cfa95a69932f344c8120 + OpenBSD-Commit-ID: add879fac6903a1cb1d1e42c4309e5359c3d870f -commit 12492c0abf1eb415d08a897cc1d8b9e789888230 -Author: djm@openbsd.org -Date: Tue Jan 17 10:15:10 2023 +0000 +commit bfd1ad01d974a316b60622759ad17537fa2d92b4 +Author: Darren Tucker +Date: Thu Mar 9 18:24:54 2023 +1100 - upstream: also check that an active session inhibits + Limit the number of PAM environment variables. - UnusedConnectionTimeout idea markus@ + xcalloc has its own limits, but these are specific to PAM. From + Coverity CID 405198, ok djm@ + +commit a231414970e01a35f45a295d5f93698fa1249b28 +Author: Darren Tucker +Date: Thu Mar 9 18:19:44 2023 +1100 + + Limit the number of PAM environment variables. - OpenBSD-Regress-ID: 55c0fb61f3bf9e092b0a53f9041d3d2012f14003 + From Coverity CID 405194, tweaks and ok djm@ -commit cef2593c33ac46a58238ff998818754eabdf64ff -Author: djm@openbsd.org -Date: Tue Jan 17 10:02:34 2023 +0000 +commit 36c6c3eff5e4a669ff414b9daf85f919666e8e03 +Author: dtucker@openbsd.org +Date: Wed Mar 8 06:21:32 2023 +0000 - upstream: regression test for UnusedConnectionTimeout + upstream: Plug mem leak. Coverity CID 405196, ok djm@ - OpenBSD-Regress-ID: 7f29001374a68e71e5e078f69e4520cf4bcca084 + OpenBSD-Commit-ID: 175f09349387c292f626da68f65f334faaa085f2 -commit aff9493a89c71d6a080419b49ac64eead9730491 -Author: djm@openbsd.org -Date: Mon Jan 16 04:11:29 2023 +0000 +commit dfb9b736e1ccf9e6b03eea21cd961f4fd0634c98 +Author: tb@openbsd.org +Date: Wed Mar 8 05:33:53 2023 +0000 - upstream: unbreak test: cannot access shell positional parameters + upstream: ssh-pkcs11: synchronize error messages with errors - past $9 without wrapping the position in braces (i.e. need ${10}, etc.) + A handful of error messages contained incorrect function names or + otherwise inaccurate descriptions. Fix them to match reality. - OpenBSD-Regress-ID: 3750ec98d5d409ce6a93406fedde6f220d2ea2ac + input/ok djm + + OpenBSD-Commit-ID: 165a15db52f75b31e1804b043480c36af09f3411 -commit 0293c19807f83141cdf33b443154459f9ee471f6 -Author: djm@openbsd.org -Date: Tue Jan 17 09:44:48 2023 +0000 +commit 51875897b81b5c21b80c256a29597916edbde454 +Author: guenther@openbsd.org +Date: Wed Mar 8 04:43:12 2023 +0000 - upstream: Add a sshd_config UnusedConnectionTimeout option to terminate - - client connections that have no open channels for some length of time. This - complements the recently-added ChannelTimeout option that terminates inactive - channels after a timeout. + upstream: Delete obsolete /* ARGSUSED */ lint comments. - ok markus@ + ok miod@ millert@ - OpenBSD-Commit-ID: ca983be74c0350364c11f8ba3bd692f6f24f5da9 + OpenBSD-Commit-ID: 7be168a570264d59e96a7d2d22e927d45fee0e4c -commit 8ec2e3123802d2beeca06c1644b0b647f6d36dab +commit a76085bda883c2104afb33ab0334eca190927362 +Author: Darren Tucker +Date: Wed Mar 8 17:25:37 2023 +1100 + + Extra brackets to prevent warning. + +commit 147ae57d4dfa0508109f93b78a7d8b92819e1f83 Author: djm@openbsd.org -Date: Sun Jan 15 23:35:10 2023 +0000 +Date: Wed Mar 8 00:05:58 2023 +0000 - upstream: adapt to ed25519 changes in src/usr.bin/ssh + upstream: use RSA/SHA256 when testing usability of private key in - OpenBSD-Regress-ID: 4b3e7ba7ee486ae8a0b4790f8112eded2bb7dcd5 + agent; with/ok dtucker + + OpenBSD-Commit-ID: fe1382e2fdf23fcae631308e72342bad56066a56 -commit 9fbbfeca1ce4c7ec0001c827bbf4189a3ba0964b +commit 27fd251bc906a763e70ce0f27c8abdf8bbd1e416 Author: djm@openbsd.org -Date: Sun Jan 15 23:05:32 2023 +0000 +Date: Wed Mar 8 00:05:37 2023 +0000 - upstream: update OpenSSH's Ed25519 code to the last version of SUPERCOP + upstream: use RSA/SHA256 when testing usability of private key; - (20221122) and change the import approach to the same one we use for - Streamlined NTRUPrime: use a shell script to extract the bits we need from - SUPERCOP, make some minor adjustments and squish them all into a single file. + based on fix in bz3546 by Dmitry Belyavskiy; with/ok dtucker - ok tb@ tobhe@ + OpenBSD-Commit-ID: 0ef414cc363a832f9fab92a5da0234448bce2eba + +commit eee9f3fc3d52ae7d2106929bb06b7f291fb0b81a +Author: djm@openbsd.org +Date: Tue Mar 7 21:47:42 2023 +0000 + + upstream: refactor to be more readable top to bottom. Prompted by - OpenBSD-Commit-ID: 1bc0fd624cb6af440905b8ba74ac7c03311b8e3b + Coverity CID 405048 which was a false-positive fd leak; ok dtucker@ + + OpenBSD-Commit-ID: fc55ec2af622a017defb9b768bf26faefc792c00 -commit 6283f4bd83eee714d0f5fc55802eff836b06fea8 +commit 42a06b29a4c99272bf690f9b3be520b08b448dc5 Author: Darren Tucker -Date: Sat Jan 14 22:02:44 2023 +1100 +Date: Tue Mar 7 18:34:41 2023 +1100 - Allow writev is seccomp sandbox. - - This seems to be used by recent glibcs at least in some configurations. - From bz#3512, ok djm@ + Add header changes missed in previous. -commit 923c3f437f439cfca238fba37e97a7041782f615 +commit 4710077096edff2e6926dd5b15bf586491d317db Author: dtucker@openbsd.org -Date: Sat Jan 14 10:05:54 2023 +0000 +Date: Tue Mar 7 06:09:14 2023 +0000 - upstream: Shell syntax fix. From ren mingshuai vi github PR#369. + upstream: Fix mem leak in environment setup. - OpenBSD-Regress-ID: 6696b2eeefe128099fc3d7ea9f23252cc35156f9 + From jjelen at redhat.com via bz#2687, ok djm@ + + OpenBSD-Commit-ID: 9f9e4ba3cac003e6f81da3bcebd1b9ec43e7f353 -commit 4d87a00f704e0365e11c3c38b170c1275ec461fc +commit 03acc50d0ccb78fc91d1570de1cd0fdfea646028 Author: dtucker@openbsd.org -Date: Sat Jan 14 09:57:08 2023 +0000 +Date: Mon Mar 6 12:15:47 2023 +0000 - upstream: Instead of skipping the all-tokens test if we don't have + upstream: Unit test for kex_proposal_populate_entries. - OpenSSL (since we use it to compute the hash), put the hash at the end and - just omit it if we don't have it. Prompted by bz#3521. + OpenBSD-Regress-ID: bdb211d80d572a08bf14b49fe2a58b9ff265c006 + +commit 3f9231c2e1f374ebb08016ba00ea97b47c0ed20b +Author: djm@openbsd.org +Date: Tue Mar 7 05:37:26 2023 +0000 + + upstream: fix memory leak in process_read() path; Spotted by James - OpenBSD-Regress-ID: c79ecba64250ed3b6417294b6c965e6b12ca5eea + Robinson in GHPR363; ok markus@ + + OpenBSD-Commit-ID: cdc2d98e6478b7e7f3a36976845adae3820429d8 -commit b05406d6f93b8c8ec11ec8b27e7c76cc7a5a55fb -Author: jmc@openbsd.org -Date: Fri Jan 13 07:13:40 2023 +0000 +commit c5e6e890839ec520ab9301a92cba56303749dea2 +Author: djm@openbsd.org +Date: Tue Mar 7 01:30:52 2023 +0000 - upstream: fix double phrase in previous; + upstream: correct size for array argument when changing - OpenBSD-Commit-ID: 671e6c8dc5e9230518b2bbfa143daaa88adc66c2 + UMAC_OUTPUT_LEN Coverity CID 291845; ok dtucker@ + + OpenBSD-Commit-ID: 2eb017d10705bb623d4418691f961c930eafaec0 -commit 40564812b659c530eb1f4b62d09e85612aef3107 +commit 9641753e0fd146204d57b2a4165f552a81afade4 Author: dtucker@openbsd.org -Date: Fri Jan 13 03:16:29 2023 +0000 +Date: Mon Mar 6 12:14:48 2023 +0000 - upstream: Document "UserKnownHostsFile none". ok djm@ + upstream: Refactor creation of KEX proposal. - OpenBSD-Commit-ID: f695742d39e34ecdcc3c861c3739a84648a4bce5 + This adds kex_proposal_populate_entries (and corresponding free) which + populates the KEX proposal array with dynamically allocated strings. + This replaces the previous mix of static and dynamic that has been the + source of previous leaks and bugs. Remove unused compat functions. + With & ok djm@. + + OpenBSD-Commit-ID: f2f99da4aae2233cb18bf9c749320c5e040a9c7b -commit d03e245e034019a37388f6f5f893ce848ab6d2e2 -Author: Darren Tucker -Date: Fri Jan 13 23:02:34 2023 +1100 +commit aa59d6a489fb20973fa461d0fdb1110db412947b +Author: dtucker@openbsd.org +Date: Sun Mar 5 09:24:35 2023 +0000 - Retry package installation 3 times. + upstream: Fix mem and FILE leaks in moduli screening. - When setting up the CI environment, retry package installation 3 times - before going up. Should help prevent spurious failures during - infrastructure issues. + If multiple -Ocheckpoint= options are passed, the earlier ones would + be overwritten and leaked. If we use an input file that wasn't stdin, + close that. From Coverity CIDs 291884 and 291894. + + OpenBSD-Commit-ID: a4d9d15f572926f841788912e2b282485ad09e8b -commit 625f6bc39840167dafb3bf5b6a3e18503ac986e8 +commit 23b8cb41767af99a1aac24589d1882d9c8c2c205 Author: dtucker@openbsd.org -Date: Fri Jan 13 04:47:34 2023 +0000 +Date: Sun Mar 5 08:18:58 2023 +0000 - upstream: Move scp path setting to a helper function. The previous + upstream: Plug mem leak in moduli checkpoint option parsing. - commit to add scp to the test sshd's path causes the t-envpass test to fail - when the test scp is given using a fully qualified path. Put this in a - helper function and only call it from the scp tests. + From Coverity CID 291894. - OpenBSD-Regress-ID: 7533dc1c4265c1de716abb062957994195b36df4 + OpenBSD-Commit-ID: 9b1aba2d049741ae21c8dc4560a7e29ab17310f4 -commit 6e6f88647042b3cde54a628545c2f5fb656a9327 +commit fc7f8f2188d4a4fc8ba77eddbe863c7665666db5 Author: dtucker@openbsd.org -Date: Fri Jan 13 04:23:00 2023 +0000 +Date: Sun Mar 5 05:34:09 2023 +0000 - upstream: Add scp's path to test sshd's PATH. + upstream: Remove unused compat.h includes. - If the scp we're testing is fully qualified (eg it's not in the system - PATH) then add its path to the under-test sshd's PATH so we can find - it. Prompted by bz#3518. + We've previously removed a lot of the really old compatibility code, + and with it went the need to include compat.h in most of the files that + have it. - OpenBSD-Regress-ID: 7df4f5a0be3aa135495b7e5a6719d3cbc26cc4c0 + OpenBSD-Commit-ID: 5af8baa194be00a3092d17598e88a5b29f7ea2b4 -commit 8a5e99a70fcf9b022a8aa175ebf6a71f58511da3 -Author: Darren Tucker -Date: Fri Jan 13 15:49:48 2023 +1100 +commit 6c165c36246d8004c20e1df5cec4961a5ac422d6 +Author: dtucker@openbsd.org +Date: Sat Mar 4 03:22:59 2023 +0000 - Remove skipping test when scp not in path. + upstream: Use time_t for x11 timeout. - An upcoming change renders this obsolete by adding scp's path to the - test sshd's PATH, and removing this first will make the subsequent sync - easier. + Use time_t instead of u_int for remaining x11 timeout checks for 64bit + time_t safety. From Coverity CIDs 405197 and 405028, ok djm@ + + OpenBSD-Commit-ID: 356685bfa1fc3d81bd95722d3fc47101cc1a4972 -commit 41f36dd896c8fb8337d403fcf476762986976e9d +commit 4a3918f51bd2d968387e7aa87e33b32c78077fb4 Author: dtucker@openbsd.org -Date: Fri Jan 13 02:58:20 2023 +0000 +Date: Fri Mar 3 10:23:42 2023 +0000 - upstream: Add a "Host" line to the output of ssh -G showing the + upstream: Ensure ms_remain is always initialized - original host arg. Inspired by patch from vincent at bernat.ch via bz#3343, - ok djm@ + similar to what we do in ssh_packet_write_wait. bz#2687, from jjelen + at redhat.com. - OpenBSD-Commit-ID: 59c0f60a222113a44d0650cd394376e3beecc883 + OpenBSD-Commit-ID: a50e0541cf823f8d1c72f71ccde925d3dbe6dfac -commit f673b49f3be3eb51074fbb8a405beb6cd0f7d93e -Author: djm@openbsd.org -Date: Fri Jan 13 02:44:02 2023 +0000 +commit e44846a4487d2885ac7f2610be09b1e2bf52249b +Author: dtucker@openbsd.org +Date: Fri Mar 3 09:48:51 2023 +0000 - upstream: avoid printf("%s", NULL) if using ssh + upstream: Check for non-NULL before string - -oUserKnownHostsFile=none and a hostkey in one of the system known hosts file - changes; ok dtucker@ + comparison. From jjelen at redhat.com via bz#2687. - OpenBSD-Commit-ID: 7ca87614bfc6da491315536a7f2301434a9fe614 + OpenBSD-Commit-ID: 0d9b2e0cac88a311b5766b1aef737082583c285f -commit 93fc7c576563e3d88a1dc019dd213f65607784cc +commit 1842d523fae63b862ce8e60725c9b606cddb86a6 Author: djm@openbsd.org -Date: Wed Jan 11 05:39:38 2023 +0000 +Date: Fri Mar 3 05:00:34 2023 +0000 - upstream: clamp the minimum buffer lengths and number of inflight + upstream: guard against getsockname(-1, ...) from Coverity CID - requests too + 291832 - OpenBSD-Commit-ID: c4965f62fa0ba850940fd66ae3f60cf516bbcd56 + OpenBSD-Commit-ID: e58d5227327917d189229b7f0b37d2780f360d5f *** 22346 LINES SKIPPED *** From nobody Fri Mar 17 03:28:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pd8jr5LNyz400bk; Fri, 17 Mar 2023 03:28: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 4Pd8jr4SVNz3pxt; Fri, 17 Mar 2023 03:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679023728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AGLo5HU8aj/IxIcalF0lRWJTTESKz+3zVp+ILPwJmNM=; b=PQQUTRkhcUuUNJ8W8b/X5m98JFQAvTSXiHIJDPqw2Av/gqJbYQgzo0o9tVV3+pMV0hkch0 rzO2XJcrqsNUgOY6txfe+tm7dowfKfatJjhfGXn9UlDZbFV8k80ywZRM5cUHELjjQaPFmr YcpjaC4vV4XmfIWHfyTJJOsnWxhv/RvWDbd4NwzsXhVouEtC0tooQFwkuc3PCopKhdJdBY BDFFup51JhdirHH0tDvNErQMWWRbii5dIip0qc4yPdag1xPPUVz6vvB2IJYpDHAgGI5iix MKtGEbXjKAgntS9mLSoNQuJi80aXy96Ga+flfCh7nRwjB8Jy8iSiidyAl0iSLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679023728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AGLo5HU8aj/IxIcalF0lRWJTTESKz+3zVp+ILPwJmNM=; b=i+kmBH7OtjECcfFoj04U3iyIKntHcDqqLPvEuCRcRFjOpnzWwvlcCDf8RLpWtWJCBAT5z+ BOTg1KQibUs77PVx2zWe/u42FsZunw6bbsLhSyY9UOfD5tNjJGC85AQI0coLSE8+2n6RsW VXMnuGhu17vy+TnBxNZdv9ViZmXqu2TqQe8kTNku5TvryGRQ7oNenEIyqMCNUbFSrfErzH VslEr6JLinOCHjj0RWs3K3dsglrx7d+hnZLDvaF14dflBtHf0thGc4+nwcf+m58T+qtuO1 T0V0D2r16e+dsagj/VLVMLyZ4mXJzXVRAPGYfG9nq1i40R9H23+Qptf4YKEFYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679023728; a=rsa-sha256; cv=none; b=voXfjy0d8AnKpdLtcYYKt9/dYSaAE/6xrlUfOiPAoqJQ9ro5s7m08Z57yrfOZhNV5pFCgY nrLVcCAZZOA0rKPhDl+P5AZpUiVoCachZRqQ1GmsWABxWqX7NPWqGpliihK/siAoqAwka4 4eE+FIdol60vWc1dZ+IUCWbtYTWy3ex2bMZy4NG9unZo+Ad/4kUigZ0s0vXZ+wgQ2wDtJG tSudDrIvQ3OjWAAvBxvdmPlYsZweZI6y++o8k57np81aqBCFZaZZUb2lc3OZ4DBw4USjne GzFzHy44flZ3JYIX4cB3fm5pDyK0dj17Hjyan85V44neaJk36nCMwnOTsc0KxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pd8jr3Vzqz18TD; Fri, 17 Mar 2023 03:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H3Sm4f076089; Fri, 17 Mar 2023 03:28:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H3Smjk076088; Fri, 17 Mar 2023 03:28:48 GMT (envelope-from git) Date: Fri, 17 Mar 2023 03:28:48 GMT Message-Id: <202303170328.32H3Smjk076088@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: d9bf9d73203f - releng/13.2 - 13.2: update to RC3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/13.2 X-Git-Reftype: branch X-Git-Commit: d9bf9d73203ff8a246f91f13ad298837093f1945 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=d9bf9d73203ff8a246f91f13ad298837093f1945 commit d9bf9d73203ff8a246f91f13ad298837093f1945 Author: Colin Percival AuthorDate: 2023-03-17 03:28:20 +0000 Commit: Colin Percival CommitDate: 2023-03-17 03:28:43 +0000 13.2: update to RC3 Approved by: re (implicit) --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 34a957021c62..69dd746101f2 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.2" -BRANCH="RC2" +BRANCH="RC3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Mar 17 05:48:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdCq82H53z407Wq; Fri, 17 Mar 2023 05:48: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 4PdCq81YQ3z40y2; Fri, 17 Mar 2023 05:48:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XdkmOEnAVcbcpdy1u+XKsvGihUoN2HSDlgCFwf+sZDk=; b=P0eHX51os68RP2gIcSAA1oySMb9gdT9j90rOJH9QLx9lqPQsphOflCglaB1LLgSWju4tUb LyHvXwPE8nlrgavkCWiCypsqMP3fQUnN3NkmLx/8rrkDxHfvApjtcsAm/Da8JFAOTXRU4L wEy1jbLuIKCii2xZCfWe5UXG6LFp5MacyFAJDuSbxdlzYKIJwCL07/jx0ZaSRC69MkukMW bPEUUNmK/Fa7FgIavgi6N9AzSXVxb9n0UtsnbCacyUV1chN20NCLB+koRZW6eBPrIni3ip SkJrJYqrgyp1273nMzlK9DYJlVmvTqKIjemfPQ8z9iCxb4Hk8hqbfKZszhtxlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XdkmOEnAVcbcpdy1u+XKsvGihUoN2HSDlgCFwf+sZDk=; b=ojbt3+M9pkrn5eJufj/4lcBPOpZAsp4BpXscTH0KLK373ScTVsJn7hUG5lpzLF5HMlV6sf yOT4VmMkEgsqy/eFjt0S/jUpGKW8B8vpMoTCUvAF4pdmTAYbu/DM6IIHgR1N1smGvjkAk2 3Ca7gdmM181QlmTHLUAKBB43xzzSGPUzbg27kNllb//z4d5FvXsEt+72SrRHqxUQAOq18t BXkaUzDDRm0nPmyFETuy6cfvtohwiV3EffvNoaP+pnCoD0foG+/dNtMBmcWi4bE9mk+Rbe OevrdQtRQqDG7UCTUnMYy/st3DSVtwEQ2ZcBAdk9IXsT8Ze7OI89kOqqTBFoVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679032116; a=rsa-sha256; cv=none; b=NC8vp9nav0BBjL0PB4QKfQMavEjOKVArTxP/g5vJ90+vrc/Yw3h86UovPmtbYBLy+X36mi WAmeAgV+54rJy+l/MNpvofOdcqqhf1t+JQxad4gD5s5UQhqQdNcgmkp+aNfKuKSSXlJ85z DQ/yrn5IUCtIV4gGBVn/JYAxp1B+ArH/+N91ssAuLgKfSy0fVsV+pVhfHixvzT0HqEIReg 9vsdlqynDlP5WxbiDn/yZfVKXld4hI6VzMBM4h8LZJGh2AH69DvuNreyv9e819ZbZdLwiF QxIUnQ3A6VEK13NJZ6hJr7r54aAPe818lEXnrE5sVVHvokHuvOCKx43EJa9dJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdCq80XCBz1ClV; Fri, 17 Mar 2023 05:48:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H5mZmm006267; Fri, 17 Mar 2023 05:48:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H5mZ67006266; Fri, 17 Mar 2023 05:48:35 GMT (envelope-from git) Date: Fri, 17 Mar 2023 05:48:35 GMT Message-Id: <202303170548.32H5mZ67006266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 7c0cbba1d51d - stable/13 - kern: physmem: don't truncate addresses in DEBUG output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7c0cbba1d51d87dacb98806a2cb026c8733615ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7c0cbba1d51d87dacb98806a2cb026c8733615ed commit 7c0cbba1d51d87dacb98806a2cb026c8733615ed Author: Kyle Evans AuthorDate: 2023-02-20 18:54:00 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 05:01:36 +0000 kern: physmem: don't truncate addresses in DEBUG output Make it consistent with the above region printing, otherwise it appears to be somewhat confusing. (cherry picked from commit cd73914b01a1f2300e587f802383cc563f2e7103) (cherry picked from commit 7b5cb32fca26428b8c0df98f9c58444557f808ae) (cherry picked from commit c32946d8bee0d82042165c5d78b4d339d1268a2a) --- sys/kern/subr_physmem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index 2c7837019ea2..7cb45621a155 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -116,7 +116,7 @@ panic(const char *fmt, ...) * db_printf). */ static void -physmem_dump_tables(int (*prfunc)(const char *, ...)) +physmem_dump_tables(int (*prfunc)(const char *, ...) __printflike(1, 2)) { size_t i; int flags; @@ -145,10 +145,12 @@ physmem_dump_tables(int (*prfunc)(const char *, ...)) #ifdef DEBUG prfunc("Avail lists:\n"); for (i = 0; phys_avail[i] != 0; ++i) { - prfunc(" phys_avail[%d] 0x%08x\n", i, phys_avail[i]); + prfunc(" phys_avail[%zu] 0x%08jx\n", i, + (uintmax_t)phys_avail[i]); } for (i = 0; dump_avail[i] != 0; ++i) { - prfunc(" dump_avail[%d] 0x%08x\n", i, dump_avail[i]); + prfunc(" dump_avail[%zu] 0x%08jx\n", i, + (uintmax_t)dump_avail[i]); } #endif } From nobody Fri Mar 17 05:48:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdCq93PYvz407F5; Fri, 17 Mar 2023 05:48: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 4PdCq92Zbwz416M; Fri, 17 Mar 2023 05:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jq3CsPjwquPQnk4wyfsYWdekB0fdLEj97K6NyYpbOoE=; b=qfJ6JMIu+Kc6IdRSc7KTp/sOSjmmV8Yw/kUxy+4yu6ixQDd1MSjaCbn67edmMEQYjN1lHM LQdMbwXI4V6qsVORJovvuIsANdzIkgRAjZGhCsk3M9zrIekUTkrADiiNtQe3dywUJfUCsk 0kc9sClHWtJlZB2Xo7S1TN3OYZtJcUSdMGul89K9eAtlRfzHmxcMV/O1oSiyuObtV79hT4 W4uHOihraBit1mEVzKpuBXQTR96gXUG4wAhJY3/NEd+XHTzE2osziEV723OIjJBAErDF6W MbaMgxwsqL1J1LV8A6vWbFWIwunB3wWJSM78sFzK7WGpA5seil2vfudQ0usgoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jq3CsPjwquPQnk4wyfsYWdekB0fdLEj97K6NyYpbOoE=; b=Znd8rXZxzuyrnKNLJR/mNMSPgic+i9yp6zIv0yciVyDqiOOSJc7IMBtvimHS4od5ohgcBd yiVsMVaNyMr1yu+Sc60lFEq1+rmOgMF3AnJo2T/obKXSx64aIzenDyH+VVyoKo4syNZ4Y0 NIVidebWTEh5iQ95xExZ8+wZs3ztrXfGm/zsByWgrdbyQ6ud8NE2jGTZfwGNmzQz1m+88G eZjcEAnhSabJ6YhKFbinBVQZJPpIgPOLn5yHXalm4dN4i+1CHDEcDBtjZTqU7xE7KeJ62d SzydkmymhpPi4CgzgXf6lNOyzdm6y7LRpQtPkuSEAV7dDBV13ynz6cwPF+FNQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679032117; a=rsa-sha256; cv=none; b=X1K5ly5wE7eX+Ra2eA/6Xho2e/2P9V+dwL7xwBe8Sqxez4DaCIl+0OndFCRH3c/cFkdF8n VGu4jEnTzeB8XQ+ZvyQ95FDYA7SHMwLo2bXyzQ2eOj94IqMpx7eQUDdklJzlKxayYbT00G S1nGizHV6zqxD1p73+C970fvtOchQ3C6edCBmRY6P4bX9tdyTK8PGDOjdd058Q/TkIeO20 X9wd5gDr84YZvuUZXgpb4Sv3EIciIu4XGWueKbhjBu2PJ1wBHlvBubqIVpUuxMZQsfBcNg o37MQn5czHQ53pTbkkqxFZED11az5yQ6p+NFMteItLqER8Jmp3B6pzB1XzKqvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdCq91FWdz1CpL; Fri, 17 Mar 2023 05:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H5mbgS006292; Fri, 17 Mar 2023 05:48:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H5mbPq006291; Fri, 17 Mar 2023 05:48:37 GMT (envelope-from git) Date: Fri, 17 Mar 2023 05:48:37 GMT Message-Id: <202303170548.32H5mbPq006291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: cda391fe2207 - stable/13 - iconvlist(3): fix count argument type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cda391fe2207e7c4a8d91e88713c58bea362d828 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=cda391fe2207e7c4a8d91e88713c58bea362d828 commit cda391fe2207e7c4a8d91e88713c58bea362d828 Author: Kyle Evans AuthorDate: 2023-02-23 21:22:12 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 05:01:45 +0000 iconvlist(3): fix count argument type count is just an unsigned int, not a pointer. Sponsored by: Klara, Inc. (cherry picked from commit 4e696aff69090da046817a6339d01f4675728b95) --- lib/libc/iconv/iconvlist.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/iconv/iconvlist.3 b/lib/libc/iconv/iconvlist.3 index b1a6e0564341..2e9f585534c6 100644 --- a/lib/libc/iconv/iconvlist.3 +++ b/lib/libc/iconv/iconvlist.3 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2009 +.Dd February 23, 2023 .Dt ICONVLIST 3 .Os .Sh NAME @@ -47,7 +47,7 @@ .In iconv.h .Ft void .Fo iconvlist -.Fa "int \*[lp]*do_one\*[rp]\*[lp]unsigned int *count, const char * const *names, void *arg\*[rp]" +.Fa "int \*[lp]*do_one\*[rp]\*[lp]unsigned int count, const char * const *names, void *arg\*[rp]" .Fa "void *arg" .Fc .Sh DESCRIPTION From nobody Fri Mar 17 05:48:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdCqB46mxz407dp; Fri, 17 Mar 2023 05:48: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 4PdCqB3LrWz40yj; Fri, 17 Mar 2023 05:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6fX7RnIJZoH73BlL4qLW0xtEcWmhxpg6vcHT3uFg/N8=; b=D6TM08qVjT01JyrrYNQsUFDGJKxMtuKWuGnJ3HGp93hPs7jz6WuQZ9R2OrwM8KE+T2V3nd 34bbk2N8U2fpSM56JN3Xv6vkJY0+JR8duM4Y2w/ne84AOUPN7upHKjWjZ4s69A/OoVX9tB U2A+QAthehJEZySk80uuF2X2F+SanpHUA5eHZwbWGySFzmEDImQYKqiSz3heAIlnXtzzN0 BqsA5DQi/Xa+w7t8ov7fhJhlDnIDU0dFqJt1dzhBX4yHw7yPE0j3i3uQBhTe4G2QeSpzpk ou4Ocv7U33Y12Q5NTMBgLpnD92OvGnWD0gCcfOErdoUaBHNasQ35lNHDyrRCcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6fX7RnIJZoH73BlL4qLW0xtEcWmhxpg6vcHT3uFg/N8=; b=mrNoUocvv2xqCoC2kpRuJRKTPFFh0ZpjQ5Ej7pO+bz510OT8Q+l0feVtiBQ0G3vkLU7cQh Aj34etnLVvH68z2eUknWbah+pQgk2s0HakUg9bN3MtwsqFST4oLdfCXCltyR2mcI3KdEpX tPxNRM5IDyxHwUEGowbOniD7WcDKbx6fivwd/dd9MScdb4WC31yf5Zj1K62BKQmv/6sl6Z ta+zHux8cfvMPqeXdwMLuzC8UWVDDL0SUSoOb3gkLevZCAffYJSsvvqWidD7i4wCm3qjuL rETd8SiQFX3Ie94LW8yOq5Q+DobszNe3gbrzOdO/NJdtZ0n7aEV2p4avSU1SiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679032118; a=rsa-sha256; cv=none; b=VV7uQ1sEix1wfnkMPTZlKY7SxTXH6q18mmfE1e/p6igop6fhEAItqN6HN8SBo+3TkqWRx/ dd/q6uLMbusmWFCvF0b7f43OMWzWXOI+L6FJj7oWc5TnrzUizOGGY2PREiwsg+hWNqBe10 5zuwO4HxjLpNC/dQejiVmjxm85N2Nhi3zZB/ocCc54MABs91SgLb9E+9ZV3xAbpEeCYDsq E36kG2S5TIKNEp+GrAtijvMlEfgKIzF7L4gE7kt0OIrsrjEwP2srR56WF8VrtJaeC3ofd5 Lh1U8v+BePbi3R8dZXRGLjypbhqoKCGBbZ3EZdzfCC/u8MhGPOLdVWssSC2V1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdCqB2P6jzDvW; Fri, 17 Mar 2023 05:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H5mcov006312; Fri, 17 Mar 2023 05:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H5mcDp006311; Fri, 17 Mar 2023 05:48:38 GMT (envelope-from git) Date: Fri, 17 Mar 2023 05:48:38 GMT Message-Id: <202303170548.32H5mcDp006311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 04accaacd45a - stable/13 - i18n: csmapper: hook up the top-level .src files to the build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04accaacd45a4594aceb3589d05ca6da59acb4dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=04accaacd45a4594aceb3589d05ca6da59acb4dd commit 04accaacd45a4594aceb3589d05ca6da59acb4dd Author: Kyle Evans AuthorDate: 2023-03-01 04:24:54 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 05:01:45 +0000 i18n: csmapper: hook up the top-level .src files to the build The top-level charset.pivot.src may be empty, but the top-level mapper.dir.src is not -- it contains some definitions for supplementary UCS planes. The SMP/SSP definitions aren't actually used at the moment, but the inclusion of the SIP definitions fixes conversions involving JISX0213-1/JISX0213-2 to be possible. Sponsored by: Klara, Inc. (cherry picked from commit dc6df546be29a468ae21b1b7604e85b703ad6779) --- share/i18n/csmapper/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/i18n/csmapper/Makefile b/share/i18n/csmapper/Makefile index 7c6aca31c019..22c6d9014930 100644 --- a/share/i18n/csmapper/Makefile +++ b/share/i18n/csmapper/Makefile @@ -10,7 +10,7 @@ SUBDIR_PARALLEL= mapper.dir: ${SUBDIR} newfile=$$(for i in ${SUBDIR}; do \ cat $$i/mapper.dir.$$i; \ - done); \ + done; cat ${.CURDIR}/mapper.dir.src); \ [ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \ printf '%s\n' "$$newfile" >${.TARGET} mapper.dir.db: mapper.dir @@ -22,7 +22,7 @@ CLEANFILES+= mapper.dir mapper.dir.db charset.pivot: ${SUBDIR} newfile=$$(for i in ${SUBDIR}; do \ cat $$i/charset.pivot.$$i; \ - done); \ + done; cat ${.CURDIR}/charset.pivot.src); \ [ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \ printf '%s\n' "$$newfile" >${.TARGET} charset.pivot.pvdb: charset.pivot From nobody Fri Mar 17 05:48:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdCqC4m6dz407St; Fri, 17 Mar 2023 05:48: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 4PdCqC4HQ6z412t; Fri, 17 Mar 2023 05:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aOjab3x2PZjtWGbh33Tqz+1Myy16nlwxXLkUGdkQzrc=; b=TS/LQbz/n8YMWNv2Q6GPGcq6B1Gmz6ZJIJlov8OtliUgxAywlFhdYE2sLH0Wv7u+ITaWco AnC8wbok22DiRVG+vV4Nb+7JXTmfvLrt0EHpVR6UYadyKoEobdI5C0+5jVeO2aGtBUKOP+ 9Gv7df601br/PXb7kWCAn7AumdTFYWaLrIJ532le/PFedFD5ClV5e4cCFiffe3tfBl9TPl BzVpHzjT4Olm/QdJU3ImFHR4GxY2MeYWcAACvkc6NWADE5HlFBzF2mZDBIBIwnR2zfwIkE cweqjIN18OlPaPyPzP2LZlI0Oj6tQOoQ8RuUiWI/g51MdZXdBWDhGcyXmiG9rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aOjab3x2PZjtWGbh33Tqz+1Myy16nlwxXLkUGdkQzrc=; b=D3bvii21N9cmjgBGnKRMZOc5mG2RslRfGLiYlNc7pp1Of1HvXRwJevyv2OYTRlYzxNn3hH Vo96cCyCWMQ0BKUxZMIHAzkl3HQiIMiA9JdAp02JHTSSNU9J82XCdnhzVEyQzHNK38QizB lpPRqg5g6JCSWijuL2cGUX8LBDmvryl9W7qLxfXEWarhU2QvO2gCZQgOqDZOEMvSk9GW6B 21Vo5RZkuMkD5LzdyT2YJ3+mv2dYwGlDYePegQuHQsoj+p/r/GlnBj75o9M9CACQzbtsNh ilG2L7iSBJM1FZSeHEVk/B57jRyoFam94tVxls063MateRKgJ7U+8kPMpUvxSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679032119; a=rsa-sha256; cv=none; b=JI2RnS/sD2c+apXARmYl0iu/HkiuL4CoaaxY0k1BoRPxurgifg9sfRxKB+B0QZyUIfMpXy 38CH5paeZp2Cy8tFn4Ry7DhcW4jDiTmODqZyHSCBkMG9e4Lg2LqO22RlHJQ/UxpMnxkgGI CUefpN3HXLGhtzagWByHNIiWdL92CeHmECo0m19S9EfPXKjfW/AI4Yd0gyJ9jaM+oFWLsd 3Trnvl+BC32oHSg916VM3+LViZzrkZz0RcKEax3aWDuIP5MH9qsj+z9Izo/eY07CDlBtbr zbYylDSXQsmh9HTV4uvtgrtzYgepwjEUcwCQubAqaNmQE1kmF4E+oTICJCaHXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdCqC3Kflz1Cqt; Fri, 17 Mar 2023 05:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H5mdsQ006334; Fri, 17 Mar 2023 05:48:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H5mdjE006333; Fri, 17 Mar 2023 05:48:39 GMT (envelope-from git) Date: Fri, 17 Mar 2023 05:48:39 GMT Message-Id: <202303170548.32H5mdjE006333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 6fdb5daba679 - stable/13 - efifb: add a tunable to select the framebuffer cache attribute List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6fdb5daba679128b11b6ce3a401fb74d0db07fd8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6fdb5daba679128b11b6ce3a401fb74d0db07fd8 commit 6fdb5daba679128b11b6ce3a401fb74d0db07fd8 Author: Kyle Evans AuthorDate: 2023-03-01 06:04:49 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 05:01:45 +0000 efifb: add a tunable to select the framebuffer cache attribute Mapping the framebuffer with WC (Write Combined) memory type can, in practice, cause some memory transactions to be rate-limited at a fraction of the fb write rate. WC allows one core to queue up many globally visible write transactions, and in the process some unrelated transactions may end up having to wait for all of the queued up PCI writes to be flushed. Add an hw.efifb.cache_attr tunable to allow mapping the framebuffer as uncacheable instead. We should likely be taking a more careful approach of checking the memory map to determine which cacheability attributes are feasible, but the knob lets us use our historically functional behavior while offering a convenient way to switch on a stock kernel. The only valid values for hw.efifb.cache_attr at this time are "uc" and "wc". Original patch by Marc De La Gueronniere along with previous testing. Reviewed by: imp Sponsored by: Verisign, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 8dff0b6761407357c5bb42ee799c5c9f465557a3) --- sys/dev/vt/hw/efifb/efifb.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/sys/dev/vt/hw/efifb/efifb.c b/sys/dev/vt/hw/efifb/efifb.c index 3aaeebcb1b5e..20822629d0c5 100644 --- a/sys/dev/vt/hw/efifb/efifb.c +++ b/sys/dev/vt/hw/efifb/efifb.c @@ -103,7 +103,32 @@ vt_efifb_init(struct vt_device *vd) struct fb_info *info; struct efi_fb *efifb; caddr_t kmdp; + int memattr; int roff, goff, boff; + char attr[16]; + + /* + * XXX TODO: I think there's more nuance here than we're acknowledging, + * and we should look into it. It may be that the framebuffer lives in + * a segment of memory that doesn't support one or both of these. We + * should likely be consulting the memory map for any applicable + * cacheability attributes before making a final decision. + */ + memattr = VM_MEMATTR_WRITE_COMBINING; + if (TUNABLE_STR_FETCH("hw.efifb.cache_attr", attr, sizeof(attr))) { + /* + * We'll allow WC but it's currently the default, UC is the only + * other tested one at this time. + */ + if (strcasecmp(attr, "wc") != 0 && + strcasecmp(attr, "uc") != 0) { + printf("efifb: unsupported cache attr specified: %s\n", + attr); + printf("efifb: expected \"wc\" or \"uc\"\n"); + } else if (strcasecmp(attr, "uc") == 0) { + memattr = VM_MEMATTR_UNCACHEABLE; + } + } info = vd->vd_softc; if (info == NULL) @@ -141,7 +166,7 @@ vt_efifb_init(struct vt_device *vd) info->fb_size = info->fb_height * info->fb_stride; info->fb_pbase = efifb->fb_addr; info->fb_vbase = (intptr_t)pmap_mapdev_attr(info->fb_pbase, - info->fb_size, VM_MEMATTR_WRITE_COMBINING); + info->fb_size, memattr); vt_fb_init(vd); From nobody Fri Mar 17 05:48:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdCqD5y69z407h1; Fri, 17 Mar 2023 05:48: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 4PdCqD5BPCz41Ld; Fri, 17 Mar 2023 05:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kqs89ladUzWqH8g3XGJtXzMqlsNDNnKloMTRJ2HNi2A=; b=WEGO4LBfhVw6OQ6EY9eyfCJDDMUgBF1afBaPfnzhiE005RcdzTPUNJKQb3qV4nQVp6yyZY o62B4bzimbrogJqJrBOvgdUrmbwiBFhLwDjxZj/lUjXXszcK68zV4GRyIqJbg6bHnKhkix ZPpJ6VNm/YeIK+7kcnTtiK9BSph87h900jK+JWOvdGqzfbux/xfxBad52cs3XDontpAFRH aFxOgIaEY/dpC3ib/gZqe7f/kN+SAbFdCicohBSGPVw/dFXhLSRZkWUxONBNNy/yvLSHj/ pFHYqAv1VtWnzwX4xT88hhIWQUPn5i83KGh+37OVd++Nx6s2RaAJ5DCO2xXd7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kqs89ladUzWqH8g3XGJtXzMqlsNDNnKloMTRJ2HNi2A=; b=XraA18zrg0mY9WATAVPMXlK8QWXqk2abdR9yvsNQEPvYx6DtW//SFruZsranUsGi27IN87 jaxwyYqa4+xaqvbU/BWydz+2so9rUENNM7RTWJiZYPEoVHKOJFX5INNylIkaYsJ6d/WgT4 XTr2r0VtXa/RKoywvMemxqYkLKbakNEYa6kpjFvYmc9qK27lzZbofTUU95cL0t8lm56ETe ruOrBJyubz47zlVolK0qF1UcV2+i7QnTHgPkmMXUm2kohc836hpPR9JAdwaXC03v6QcDow txlSgY7eBc/7GMSRhhSnb89GSKGt7Pvx/rvn+qLsdMze1P7KCTDLWt7qIR4hYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679032120; a=rsa-sha256; cv=none; b=R7au9Uexetd99sdbW3ZQvIx8KUAHOdZaYwupynw/4va0/TBnN3Bbt0sXNeR6yy/VBgw7Gx tO+YmqObG4kLRAdVOdzERqk0dAWTm6tYM2V8UC/LKAR3SU/MejzJinbngvj9ksuzC74syv hrV8GTSXOHK2pJWcSyMiqz4LWtDePjGUDM+RpR4v6Ba9xZ7Z/646BEnuW+Ww7ZqEAI6qMs IyWdTipM4bhVjSXWVwAsGfXsbDUxG+FaRfnSOShL75Hcxs9KUlp2Z2Tyd7ZS3AIE/GJ1xl jvYA0JnIzu7OaMcf5uJxX3AKmB25R/nHnr2ajtbuevkF/R4FdCHbq69RNieuwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdCqD4HT8z1Cth; Fri, 17 Mar 2023 05:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H5me0u006353; Fri, 17 Mar 2023 05:48:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H5meBg006352; Fri, 17 Mar 2023 05:48:40 GMT (envelope-from git) Date: Fri, 17 Mar 2023 05:48:40 GMT Message-Id: <202303170548.32H5meBg006352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: d18524b6f720 - stable/13 - grep: remove tautological condition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d18524b6f7205e3d31b76227ddc850ab65d352e3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d18524b6f7205e3d31b76227ddc850ab65d352e3 commit d18524b6f7205e3d31b76227ddc850ab65d352e3 Author: Kyle Evans AuthorDate: 2023-03-09 05:29:30 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 05:04:11 +0000 grep: remove tautological condition st_size is an off_t, it cannot hold values larger than OFF_MAX. CID: 1008931 (cherry picked from commit f6d6c66889001208aee7b0c46efe1c8ddffda57c) (cherry picked from commit c816aea7abcf7a6e9471907dcb7ee3d7969a0ab3) (cherry picked from commit b61758494286db075d5c6b68a5f2e7522e7be394) --- usr.bin/grep/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c index 8577572c2887..787e8fbe03bb 100644 --- a/usr.bin/grep/file.c +++ b/usr.bin/grep/file.c @@ -186,8 +186,7 @@ grep_open(const char *path) if (filebehave == FILE_MMAP) { struct stat st; - if ((fstat(f->fd, &st) == -1) || (st.st_size > OFF_MAX) || - (!S_ISREG(st.st_mode))) + if (fstat(f->fd, &st) == -1 || !S_ISREG(st.st_mode)) filebehave = FILE_STDIO; else { int flags = MAP_PRIVATE | MAP_NOCORE | MAP_NOSYNC; From nobody Fri Mar 17 05:48:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdCqG0wfxz407dv; Fri, 17 Mar 2023 05:48: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 4PdCqF65h9z41PK; Fri, 17 Mar 2023 05:48:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C6ito8DSvucL0hFf0ftHCcR25Qfla5UKO82XD0MyYio=; b=SBfNLiZGmYxb5qZrljXjEH+QzAIA3Xk6et9mO1XcnFpYDL4QMV4bVPoUJyFLj4OVPUbog6 urT2iJkSDBSNLEJ3TZ+cbqk7Eq6/I81c1pwgUv7+ZdEXm+XsXpbDfFlh3qyA7WUbUgE6t6 8znCLYdUjcW/3ZV+xSKB5LZ/lhy8k+OvqtZyNDg/Yc2jyOvHuE+trLXBxwOm2BPXL0ldsm trPkzNNi9MQt92UIVsFimG2oAkD5G6EKzjjQxWwRw+yFv5E+0/6N2ogFqik6qPkymWL0aP tcOkYAVKkLlet2M2Q8AP6TouucxovTR1+Xtz3gTF/yB+0ETrI2LBJSy7yXKZag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C6ito8DSvucL0hFf0ftHCcR25Qfla5UKO82XD0MyYio=; b=EyxqIOaphghdTUrElXCY1UAlqXuLNrewM8S4jGpLxzHaZgEaKF8SjMEIBNW1thJtErhA9d V75Gob+7vXrAwIPAXmwLPKgu8UPs1tNZ6XYXS0Ol+WoGRzVSkZq166VGcogZLhbL2lFGeY 1P2HvDo92SEbkTtvUU8I3ToSNxCBpBcJHqdQRt2Z4AHT0uzrhJ1AdRvjW+Nk2KOdo7su3K tthcZXsJtneDyGBBt1UownHPelDx8/m0J8b3ozvPstaRthTG09KeT52aseHC2zO8xYNbo8 QVwJKFm1sv7R3yn3eG0mRWyktl4vtYLRWGeh7qpMD4vR4loW8IP7wP7/qYmgQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679032121; a=rsa-sha256; cv=none; b=rGly/qyfXud7bQCVgUvoLuLc8yobqTk2wpJUzrNp6+Prd4avrXgzLAx60ceRdJk0VOiV6j gzEC+wlW4cncXjjNs+1Yalr+tW0045kxKHLndacet+W0QNWvedkVRf6OrQl3GSg2W2PscB /bSf+h3NWRNHFlkMQoz1Wo5ipoJsO6Wlf6pg+xC4oRcE9ZRuJL6VEsfkEBlwD1BKu7rtJr eIA02G5UPubsVlbaZRoDQ70bfrrpKvFVPxJSaD3r3khCd0SMgu8szrdgXOSNAHDAPz+iOp O2Wcd/wmscz/D892kLsU1r4IizfpdxRhJn7yhU83CA2mzUPKH9grLQS1zwTU+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdCqF5CPvz1CpM; Fri, 17 Mar 2023 05:48:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H5mfpS006372; Fri, 17 Mar 2023 05:48:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H5mfj3006371; Fri, 17 Mar 2023 05:48:41 GMT (envelope-from git) Date: Fri, 17 Mar 2023 05:48:41 GMT Message-Id: <202303170548.32H5mfj3006371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 1e6d266d70e9 - stable/13 - kern: physmem: don't create a new exregion for different flags... List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1e6d266d70e969c87f5da229cc82b3d53ae7c2a5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1e6d266d70e969c87f5da229cc82b3d53ae7c2a5 commit 1e6d266d70e969c87f5da229cc82b3d53ae7c2a5 Author: Kyle Evans AuthorDate: 2023-03-10 05:27:39 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 05:04:22 +0000 kern: physmem: don't create a new exregion for different flags... ... if the region we're adding is an exact match to one that we already have. Simply extend the flags of the existing entry as needed so that we don't end up with duplicate regions. It could be that we got the exclusion through two different means, e.g., FDT memreserve and the EFI memory map, and we may derive different characteristics from each. Apply the most restrictive set to the region. Reported by: Mark Millard Reviewed by: mhorne (cherry picked from commit cc0fe048ec39636216ed59fa47eb311b2537cfc5) --- sys/kern/subr_physmem.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index 7cb45621a155..450b891cb8a1 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -372,8 +372,8 @@ insert_region(struct region *regions, size_t rcnt, vm_paddr_t addr, nend = addr + size; ep = regions + rcnt; for (i = 0, rp = regions; i < rcnt; ++i, ++rp) { + rend = rp->addr + rp->size; if (flags == rp->flags) { - rend = rp->addr + rp->size; if (addr <= rp->addr && nend >= rp->addr) { /* * New mapping overlaps at the beginning, shift @@ -400,7 +400,20 @@ insert_region(struct region *regions, size_t rcnt, vm_paddr_t addr, } return (rcnt); } + } else if ((flags != 0) && (rp->flags != 0)) { + /* + * If we're duplicating an entry that already exists + * exactly, just upgrade its flags as needed. We could + * do more if we find that we have differently specified + * flags clipping existing excluding regions, but that's + * probably rare. + */ + if (addr == rp->addr && nend == rend) { + rp->flags |= flags; + return (rcnt); + } } + if (addr < rp->addr) { bcopy(rp, rp + 1, (ep - rp) * sizeof(*rp)); break; From nobody Fri Mar 17 05:56:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdD0p6C27z4086H; Fri, 17 Mar 2023 05:56: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 4PdD0p5lgnz42ln; Fri, 17 Mar 2023 05:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v4RLjxVMffZofr13PryE2Rzlzh/O2UnzLUiByNTpxXk=; b=dc5iAsQlJvl685UU84u4wZpzYduNZw2BGCijcptQIIoO1vmi5uf2S+UwVjl4E/8dEUa9Ri pp1BlIh4+lhBRh+pDWbFahDdnmB3vPEiZI+u5LyqimD8FnuJKQ2iyT4zl8CtzG+2vdFrUZ WHC27g6G/pX3++clERO6pCYax4bIkS4ubh1MIeC47ARgkgtnwKqDGBv1xMmU0nvhsFjeY1 zogEou5M3wLPlXs84WtcMBwXmsE6tSOwIuCxoJqQgUWNXYvimAl5kHOxNn1izxXZeWzFB+ Yd5/uzQdhAIiycgfGVz0f+RJzN+gqUhbE1MkNJfDeRE1y6pPalwdUSkcypwKrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v4RLjxVMffZofr13PryE2Rzlzh/O2UnzLUiByNTpxXk=; b=xKFP2KGK5vWpLSimMHHW8Ld0oaavObQzpqzV1fNcZjQHlnZQMCNrsVmdYIwPhbCjxqBPhL 15Q/XFWEkBfeqgZhbnh+qp/0x1HiN0eoD/t7yZExRnS32ZNf3XnOsxiWaMNlwuvenOmHVU OJfM2p8+xXtNXm5OOPbxduaBpSReYk8XbYvpGXB1MEUm7MNshjRCzIFx97XVx2od8JILYW Vy0l4bdbhpz1yhnzyPYaoPZbrJcRtgpAhDDeFvxsXe7Ti3v01uyJ5K4PGNdPQxgXqXpn0p 3RINoOaes2tGaf7juiy/PK6wSasPCIfhNVTwjuA3ykgUuY0BAHXRdipzoivB8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679032618; a=rsa-sha256; cv=none; b=G58LBtzajZAoH4ZPmidPFD8HW4yiioZFPcrEq/Sg2zZaYmPnrVkNzxZYEDEd+Oq9Vdrqz0 ZazDlSxk+z944Maw/rA/KEK2fS6rvZpbXQkYo5gXa1Rx5faGSqcyd5RAIynNWipiU4zxSN LUWCIMhB8spy+bdshUvuZv93O4vu668Mj4IkfFpPeyKzkF8sHuuBZdjkvb5pHCAzSebcHm 6kLQPbc4N3DcPuHg+djJv4m5PjozG0Lc4j4b1r38ZtVP0q1DPB3GvEvdCWaVTn+pjGWy5C umCwsamaxpI+wN1Rs/w/YFZiFmben1mybh1z4pJEt+UpWecskOfvpdzGpwtc8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdD0p4p0gzF9c; Fri, 17 Mar 2023 05:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H5uw9s022081; Fri, 17 Mar 2023 05:56:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H5uw27022080; Fri, 17 Mar 2023 05:56:58 GMT (envelope-from git) Date: Fri, 17 Mar 2023 05:56:58 GMT Message-Id: <202303170556.32H5uw27022080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f7a884cb017f - main - x86: gate smbios hypervisor identification behind vm_guest List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7a884cb017f6618ae872f8d52e80a147daf3f59 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f7a884cb017f6618ae872f8d52e80a147daf3f59 commit f7a884cb017f6618ae872f8d52e80a147daf3f59 Author: Kyle Evans AuthorDate: 2023-03-16 19:26:28 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 05:54:32 +0000 x86: gate smbios hypervisor identification behind vm_guest cpuid detection may have picked up a more specific guest type already, and a follow-up check of smbios vendor/product may erroneously blow away the previously detected type. This reportedly fixes the boot under Hyper-V, which advertises an smbios.system.product of "Virtual Machine." PR: 270239 Reviewed by: imp, kib (both earlier version, same concept) Fixes: 2fee87562948 ("abstract out the vm detection via smbios..") Differential Revision: https://reviews.freebsd.org/D39140 --- sys/dev/smbios/smbios_subr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/smbios/smbios_subr.c b/sys/dev/smbios/smbios_subr.c index c28bf0e4983f..4e30751cd716 100644 --- a/sys/dev/smbios/smbios_subr.c +++ b/sys/dev/smbios/smbios_subr.c @@ -69,6 +69,14 @@ identify_hypervisor_smbios(void) char *p; int i; + /* + * Some platforms, e.g., amd64, have other ways of detecting what kind + * of hypervisor we may be running under. Make sure we don't clobber a + * more specific vm_guest that's been previously detected. + */ + if (vm_guest != VM_GUEST_NO && vm_guest != VM_GUEST_VM) + return; + /* * XXX: Some of these entries may not be needed since they were * added to FreeBSD before the checks above. From nobody Fri Mar 17 06:30:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdDlh1RNjz409ny; Fri, 17 Mar 2023 06:30: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 4PdDlh0z8lz46sx; Fri, 17 Mar 2023 06:30:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679034640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H9nJHifBd4aulVIBF6Df5RcvM34Yv+xwhEJRkxnrn4U=; b=cYEzWytLfV/maMkfxRUZPTHqknKw61krP3FLKA2jdLGQTD7tpFJV/zVCdzSJy3xH19sSjo wOK6Y66NyC+/gvA94YdeBXDK1ZMZZ7xuqooO314bj7mOq9orIW2x9HRvHOeFtGnsLO2KrS sjsN/p2jgSKxcj7WZqFRTZNZbqCAJXkbonRShTu76Y4zW0u5Kx4hS2PPOwzmuF4XBywV7w qIA38YWF/R6wmp+LCR0pg53P5GJ9Ud99cBRpHZKcebP3yo8224PBwdZXnrRr7ZFZ6LCixu nXtnNPzuyanedVlaxTXsbVh6Jr/Zrt/6/nTGboij3V1VhLSw1rjsJFAJTboPjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679034640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H9nJHifBd4aulVIBF6Df5RcvM34Yv+xwhEJRkxnrn4U=; b=KiJpzDFr1kEG8FpqTVJPmvoQDnpvnM1hLR+RcbB5h3KGZGENNWRyml24SMM8mXMxgBPAfX n9Xo1QnZncUzdV8bk8YBW37dMVA7u2/9uLKERXGBcddMD/Yb+1YpxYaShkEM/CMaxwDK9V b4lBNEZ9MMpIDywM7me3e/vkekADQsYEvOy5XK+dEfC88Anj6key6XPlG4C8SRZtMX6pYd 55yp4TBwVTUe1iFwuBUDb3NawC6YVAFWN+U4UnOazYJ7yzSsN3St0KlFd2/3XTxl+tWy4/ TBBSFAIdZXNzH1dnMipzvCsE9nh7Yvru1hVxdfUm5tD+qZcZrM1WFifLJ4H2RQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679034640; a=rsa-sha256; cv=none; b=ky/iYeleuVv9KhnAmt+uE3kKc8errOuxQ2SILYKSXnMmeHTx+BECXjJpoqLDoVjpkgCU2X YKaZmQAr2SA8KEDJ7jJVpkOwlwBW3J0TepRnBrdQ/zxotePCXWgQQ9k+iG8w2/zhghkZQs ksg5nX6nBPpSz9yrhCdxfILj8/bJgwr7rxuOx+zkvRD/DpZkZMzKHYg3IeMi0YU/3ob+j/ ueHR8xQlDyIQ6V+r1rzUgCgGr/50Z2yjZjAOl770NenIcnCLWO2CxKXpROXyU1aOneFL3Y 2ipAYqcSisd+psXvZbRFbvQsUtpyd0bCYq5BJK+N4cT396Fc9MJXY4pOOvjVyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdDlh01wpzFRq; Fri, 17 Mar 2023 06:30:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H6Ud7q080625; Fri, 17 Mar 2023 06:30:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H6UduN080624; Fri, 17 Mar 2023 06:30:39 GMT (envelope-from git) Date: Fri, 17 Mar 2023 06:30:39 GMT Message-Id: <202303170630.32H6UduN080624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 15d683c334f9 - stable/13 - route.8: Don't reference an external command in EXAMPLES List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 15d683c334f9434f7d3253ca4189f8e70f4fbf9a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=15d683c334f9434f7d3253ca4189f8e70f4fbf9a commit 15d683c334f9434f7d3253ca4189f8e70f4fbf9a Author: Gordon Bergling AuthorDate: 2023-03-14 13:55:28 +0000 Commit: Gordon Bergling CommitDate: 2023-03-17 06:30:26 +0000 route.8: Don't reference an external command in EXAMPLES It is better to mention the externel command for showing the routing table as using an explicit command. PR: 231579 Suggested by: karels Reviewed by: karles, gbe Differential Revision: https://reviews.freebsd.org/D39075 (cherry picked from commit 21f268182838f072f96234c727778d5603a580e3) --- sbin/route/route.8 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sbin/route/route.8 b/sbin/route/route.8 index 5b6e13281447..afcf55ab44c7 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd February 26, 2023 +.Dd March 14, 2023 .Dt ROUTE 8 .Os .Sh NAME @@ -488,9 +488,8 @@ Remove all routes from the routing table: .Pp .Dl route flush .Pp -List all routing tables: -.Pp -.Dl netstat -r +The routing table can be listed with +.Xr netstat 1 . .Sh DIAGNOSTICS .Bl -diag .It "add [host \&| network ] %s: gateway %s flags %x" From nobody Fri Mar 17 08:35:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdHWy4tG5z3y4N2; Fri, 17 Mar 2023 08:35: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 4PdHWy4P3dz4KL4; Fri, 17 Mar 2023 08:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679042142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IocvUlkA1/ZeLXzYD119+DWamTrQpsQjpY2IG9Ad4Bk=; b=uJYND+p2nxRIuIXEvwAaKwNqTy0dtTVASmkb0OdefaPaGOD3gca7zoK1EKo7TQxvocsJOP UDsqhej2S43Ds94xptDmak9dMLfx24JXDIH52cq+zLoQvjaowYrayldvYNMUuxJqUBCRSy KMcVxEHLpDY3nvZ8uo3J5FJEFN0VL5UjGi8g8bbjnbGg6ElM/xc8kf05aTsqzIFCuLRzGK rRBbOiQDQY1ZLsl0F1RaNXZN+NGwaXkEs3nKIQfa2b6oC54MzEA+OriBwGCj/cHRW8wHbq n/W8f11TiD6C07+gJfwsEtu3C7DyceEmjhTHuzVBEVKBh0wiVlbrjAQC4K/c9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679042142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IocvUlkA1/ZeLXzYD119+DWamTrQpsQjpY2IG9Ad4Bk=; b=N8g3pzAeX/dcsZnRuNj3SXlgMjAYNYZSyyL1Ec1DtN0/DZdDLDCGWrdD4OCeNAI4nyZqfr wEP4SIReFuNvlOWGGmg4CG335fDGU+mGXMZPt9MhT28enfs56vCngzW6RRfJccjI+YLlJt Nk2RbPhq/grHgKl2JbYh6O81fa6qK3uA7zyNxr0B/4+cteZBzIr500BEMWEpBNoN2mmqA/ HKi6GI5sX3uMh8H70nD9RgqLvz4PEK0AR7n3HjcoXde9IzjhCNE2yHsiEXc5Up6vlGALVd wLxsaQVv66dlyQZjH47EEJiwr4ucUcD7+x2fJ6fCyBYziZnPMBTBEn1u/yRPfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679042142; a=rsa-sha256; cv=none; b=NYO1kQ1Atjhn0Z0d1Z932QOMRxQEqYSWTMFvmxczILfPlzMl0qnh+aT+/2X/PXkmoKfyxk DSAZdMj0bRY7xe4DWgV7P2mEinNqpsZV6eNHWGKLC13W7B5lztmRT+sbGtmiwyD52vlsaa m2yU2CAsXF1tj3YEImkl/Grf6x2tBJ5ntdToFQv5Wja7i6037R89rOxrLkSZ8feX0TJAH0 4118j50Otp7pOoy6rh623lUR1yUUApUn6DIyp38bCpKQMLzfTmqWVyHOS33cE8LntT3EBI BFNPu2udBlCP/EbZ6lVmnA98j9Cd0zhgU/P+4h9f8RJNp+PnbYXxLP3ztSU6zA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdHWy3StfzJmT; Fri, 17 Mar 2023 08:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H8Zg9l085605; Fri, 17 Mar 2023 08:35:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H8ZgsS085604; Fri, 17 Mar 2023 08:35:42 GMT (envelope-from git) Date: Fri, 17 Mar 2023 08:35:42 GMT Message-Id: <202303170835.32H8ZgsS085604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 6f9ebb3d0fed - main - bhyve: add helper for adding fwcfg files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f9ebb3d0fed2b0ae604dd6daf17f1fe1d8df216 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=6f9ebb3d0fed2b0ae604dd6daf17f1fe1d8df216 commit 6f9ebb3d0fed2b0ae604dd6daf17f1fe1d8df216 Author: Corvin Köhne AuthorDate: 2021-08-11 08:04:36 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 08:35:32 +0000 bhyve: add helper for adding fwcfg files Fwcfg items without a fixed index are reported by the file_dir. They have an index of 0x20 and above. This helper simplifies the addition of such fwcfg items. It selects a new free index, assigns it to the fwcfg items and creates an proper entry in the file_dir. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38336 --- usr.sbin/bhyve/qemu_fwcfg.c | 90 +++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/qemu_fwcfg.h | 2 + 2 files changed, 92 insertions(+) diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c index e1a67fd0d8ef..5ee35d6764e6 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -43,6 +43,8 @@ #define QEMU_FWCFG_INDEX_ID 0x01 #define QEMU_FWCFG_INDEX_FILE_DIR 0x19 +#define QEMU_FWCFG_FIRST_FILE_INDEX 0x20 + #define QEMU_FWCFG_MIN_FILES 10 #pragma pack(1) @@ -87,6 +89,7 @@ struct qemu_fwcfg_softc { union qemu_fwcfg_selector selector; struct qemu_fwcfg_item items[QEMU_FWCFG_MAX_ARCHS] [QEMU_FWCFG_MAX_ENTRIES]; + struct qemu_fwcfg_directory *directory; }; static struct qemu_fwcfg_softc fwcfg_sc; @@ -256,6 +259,93 @@ qemu_fwcfg_register_port(const char *const name, const int port, const int size, return (register_inout(&iop)); } +int +qemu_fwcfg_add_file(const uint8_t name[QEMU_FWCFG_MAX_NAME], + const uint32_t size, void *const data) +{ + /* + * QEMU specifies count as big endian. + * Convert it to host endian to work with it. + */ + const uint32_t count = be32toh(fwcfg_sc.directory->be_count) + 1; + + /* add file to items list */ + const uint32_t index = QEMU_FWCFG_FIRST_FILE_INDEX + count - 1; + const int error = qemu_fwcfg_add_item(QEMU_FWCFG_ARCHITECTURE_GENERIC, + index, size, data); + if (error != 0) { + return (error); + } + + /* + * files should be sorted alphabetical, get index for new file + */ + uint32_t file_index; + for (file_index = 0; file_index < count - 1; ++file_index) { + if (strcmp(name, fwcfg_sc.directory->files[file_index].name) < + 0) + break; + } + + if (count > QEMU_FWCFG_MIN_FILES) { + /* alloc new file directory */ + const uint64_t new_size = sizeof(struct qemu_fwcfg_directory) + + count * sizeof(struct qemu_fwcfg_file); + struct qemu_fwcfg_directory *const new_directory = calloc(1, + new_size); + if (new_directory == NULL) { + warnx( + "%s: Unable to allocate a new qemu fwcfg files directory (count %d)", + __func__, count); + return (-ENOMEM); + } + + /* copy files below file_index to new directory */ + memcpy(new_directory->files, fwcfg_sc.directory->files, + file_index * sizeof(struct qemu_fwcfg_file)); + + /* copy files above file_index to directory */ + memcpy(&new_directory->files[file_index + 1], + &fwcfg_sc.directory->files[file_index], + (count - file_index) * sizeof(struct qemu_fwcfg_file)); + + /* free old directory */ + free(fwcfg_sc.directory); + + /* set directory pointer to new directory */ + fwcfg_sc.directory = new_directory; + + /* adjust directory pointer */ + fwcfg_sc.items[0][QEMU_FWCFG_INDEX_FILE_DIR].data = + (uint8_t *)fwcfg_sc.directory; + } else { + /* shift files behind file_index */ + for (uint32_t i = QEMU_FWCFG_MIN_FILES - 1; i > file_index; + --i) { + memcpy(&fwcfg_sc.directory->files[i], + &fwcfg_sc.directory->files[i - 1], + sizeof(struct qemu_fwcfg_file)); + } + } + + /* + * QEMU specifies count, size and index as big endian. + * Save these values in big endian to simplify guest reads of these + * values. + */ + fwcfg_sc.directory->be_count = htobe32(count); + fwcfg_sc.directory->files[file_index].be_size = htobe32(size); + fwcfg_sc.directory->files[file_index].be_selector = htobe16(index); + strcpy(fwcfg_sc.directory->files[file_index].name, name); + + /* set new size for the fwcfg_file_directory */ + fwcfg_sc.items[0][QEMU_FWCFG_INDEX_FILE_DIR].size = + sizeof(struct qemu_fwcfg_directory) + + count * sizeof(struct qemu_fwcfg_file); + + return (0); +} + int qemu_fwcfg_init(struct vmctx *const ctx) { diff --git a/usr.sbin/bhyve/qemu_fwcfg.h b/usr.sbin/bhyve/qemu_fwcfg.h index b5454fa9977d..f59087250816 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.h +++ b/usr.sbin/bhyve/qemu_fwcfg.h @@ -18,4 +18,6 @@ struct qemu_fwcfg_item { uint8_t *data; }; +int qemu_fwcfg_add_file(const uint8_t name[QEMU_FWCFG_MAX_NAME], + const uint32_t size, void *const data); int qemu_fwcfg_init(struct vmctx *const ctx); From nobody Fri Mar 17 08:35:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdHWz5qxSz3y4N9; Fri, 17 Mar 2023 08:35: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 4PdHWz5NQVz4KTP; Fri, 17 Mar 2023 08:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679042143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JQnfd5nXZVdwOmhuDNL8cFvNWoJvLWJDjw6gwmkP8p8=; b=dK2jvMdsV1N1CI/RwcTTMvi6nLNWd+LA4hzA9dSvrQtfTD2qf0XmQlp8yvP1bDFm8f+fpQ sxwRlkyjOcsmbqM8r91nUbAenDTjhiHoaI5p9k6OICoxdXqE2JERqAY8cRL4+yBezpORRk RU92wymkGI+HwIsqB2pFNIMdOCcQyI/0pvgqJruWmx5prCCsYW+27D2P/yneaBZNUGqtyL W1vWDkNEZyGjnGPi864d29yOr3yxL6vdXqHjjxHQYm/Wc0w+othrhDnpK/ZHUJzjgc6kRW 9ywGjF1nPA0t2WiOk6xO5t4tDl3A834nASQpTWOeqGxL8hdBj5c/iCFdmQYUCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679042143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JQnfd5nXZVdwOmhuDNL8cFvNWoJvLWJDjw6gwmkP8p8=; b=OyYzCgI7iifvVVsWyl1+RR5Ccb3py+DSwHhb48/KGdmxPqgj3GA5K60F3u9njij7f0NVjN FifOgN5NELHVHrulH+eCQb+ob0xAPGqOHDMFqtleeCccbumzdx7asqHUgtGryuWXyG8cug 1+0k5fZv3jNxe3la+rrAUvhw4fNxeEQCeCpgK4XQP8OkrDwkw9DT/utr7bCcaibPL90sLU B56JKA+3tWMP+20n1F+VG4FzcTaw1cQX/3UCMUMibhcn5TWxnmJAX/ZNEJQoZwwGvZu4os ag01XlavXXdmnqXrUUkZeay89U4LYktrjJPguS3jISrHMeHzj+6i4cKH/9mjcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679042143; a=rsa-sha256; cv=none; b=jdRJ1wsD/4sgMRofkQQtaVEF8G2/qS1kTQ3SPjdhD3uJItdPmYca6myB1Oc0mISLl0dTBP E7PWKK1i+eXUCaxicaakh0/znxxguNZjmEqKhr/xf2an8mW6sOdvby/E2lHeEke65Vdf6y dkB3KIuNjq4/M2hz0/TLz9Bv2oPFLjQZEwFRo2AGWwvym1AZKJHifPei+X2qtaYy+1HoU0 nzNzw3SP5kfGfjPaUOweBcrXhEwE2Q9Io3B/y3kcKJBZAivUeam0smCf/wyKcaMz673VSz +RSoeTvXs2ntLe7dQrdrkQEqw4MXCQXKhxkGgl/GaNeoawdt6K/98ZPaqar7rA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdHWz4QSmzJsk; Fri, 17 Mar 2023 08:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H8Zhtq085630; Fri, 17 Mar 2023 08:35:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H8Zhjf085629; Fri, 17 Mar 2023 08:35:43 GMT (envelope-from git) Date: Fri, 17 Mar 2023 08:35:43 GMT Message-Id: <202303170835.32H8Zhjf085629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: d85147f3d681 - main - bhyve: add cmdline option to enable qemu's fwcfg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d85147f3d6811c04e250bfb4597783d8844de315 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=d85147f3d6811c04e250bfb4597783d8844de315 commit d85147f3d6811c04e250bfb4597783d8844de315 Author: Corvin Köhne AuthorDate: 2021-08-18 07:31:59 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 08:35:36 +0000 bhyve: add cmdline option to enable qemu's fwcfg Let the user decide if he wants to use bhyve's fwctl or qemu's fwcfg. He can set the interface by adding a fwcfg option to bootrom: -l bootrom,,fwcfg=bhyve -l bootrom,,fwcfg=qemu Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38337 --- usr.sbin/bhyve/Makefile | 1 + usr.sbin/bhyve/bhyve.8 | 29 ++++++++++++++++-- usr.sbin/bhyve/bhyve_config.5 | 8 +++++ usr.sbin/bhyve/bhyverun.c | 16 +++++++++- usr.sbin/bhyve/pci_lpc.c | 18 ++++++++++- usr.sbin/bhyve/pci_lpc.h | 1 + usr.sbin/bhyve/qemu_fwcfg.c | 71 +++++++++++++++++++++++++------------------ 7 files changed, 111 insertions(+), 33 deletions(-) diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile index 1c679a3c1578..a5a1dafebcd9 100644 --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -63,6 +63,7 @@ SRCS= \ post.c \ ps2kbd.c \ ps2mouse.c \ + qemu_fwcfg.c \ rfb.c \ rtc.c \ smbiostbl.c \ diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 84e031f1340c..72018912e2c5 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -200,7 +200,9 @@ and .Cm com4 , the boot ROM device .Cm bootrom , -and the debug/test device +the +.Cm fwcfg +type and the debug/test device .Cm pc-testdev . .Pp The possible values for the @@ -345,7 +347,7 @@ PCI 16550 serial device. .It Cm lpc LPC PCI-ISA bridge with COM1, COM2, COM3, and COM4 16550 serial ports, a boot ROM, and, -optionally, the debug/test device. +optionally, a fwcfg type and the debug/test device. The LPC bridge emulation can only be configured on bus 0. .It Cm fbuf Raw framebuffer device attached to VNC server. @@ -520,6 +522,29 @@ address space, and any modifications the guest makes will be saved to that file. .El .Pp +Fwcfg types: +.Bl -tag -width 10n +.It Ar fwcfg +The fwcfg interface is used to pass information such as the CPU count or ACPI tables to the guest firmware. +Supported values are +.Ql bhyve +and +.Ql qemu . +Due to backward compatibility reasons, +.Ql bhyve +is the default option. +When +.Ql bhyve +is used, bhyve's fwctl interface is used. +It currently reports only the CPU count to the guest firmware. +The +.Ql qemu +option uses QEMU's fwcfg interface. +This interface is widely used and allows user-defined information to be passed to the guest. +It is used for passing the CPU count, ACPI tables, a boot order and many other things to the guest. +Some operating systems such as Fedora CoreOS can be configured by qemu's fwcfg interface as well. +.El +.Pp Pass-through device backends: .Sm off .Bl -bullet diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index 94a8a4d5cb1d..32658c11f9e2 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -259,6 +259,7 @@ VGA framebuffer device attached to VNC server. .It Li lpc LPC PCI-ISA bridge with COM1-COM4 16550 serial ports, a boot ROM, +an optional fwcfg type, and an optional debug/test device. This device must be configured on bus 0. .It Li hda @@ -529,6 +530,13 @@ Settings for the COM2 serial port device. Settings for the COM3 serial port device. .It Va com4 Ta node Ta Ta Settings for the COM4 serial port device. +.It Va fwcfg Ta string Ta bhyve Ta +The fwcfg type to be used. +Supported values are +.Dq bhyve +for fwctl and +.Dq qemu +for fwcfg. .It Va pc-testdev Ta bool Ta false Ta Enable the PC debug/test device. .El diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index af4d15666ae3..665fec73e48c 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -101,6 +101,7 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" #include "pci_irq.h" #include "pci_lpc.h" +#include "qemu_fwcfg.h" #include "smbiostbl.h" #ifdef BHYVE_SNAPSHOT #include "snapshot.h" @@ -1231,6 +1232,7 @@ set_defaults(void) set_config_bool("acpi_tables", false); set_config_value("memory.size", "256M"); set_config_bool("x86.strictmsr", true); + set_config_value("lpc.fwcfg", "bhyve"); } int @@ -1460,6 +1462,17 @@ main(int argc, char *argv[]) rtc_init(ctx); sci_init(ctx); + if (qemu_fwcfg_init(ctx) != 0) { + fprintf(stderr, "qemu fwcfg initialization error"); + exit(4); + } + + if (qemu_fwcfg_add_file("opt/bhyve/hw.ncpu", sizeof(guest_ncpus), + &guest_ncpus) != 0) { + fprintf(stderr, "Could not add qemu fwcfg opt/bhyve/hw.ncpu"); + exit(4); + } + /* * Exit if a device emulation finds an error in its initilization */ @@ -1554,8 +1567,9 @@ main(int argc, char *argv[]) assert(error == 0); } - if (lpc_bootrom()) + if (lpc_bootrom() && strcmp(lpc_fwcfg(), "bhyve") == 0) { fwctl_init(); + } /* * Change the proc title to include the VM name. diff --git a/usr.sbin/bhyve/pci_lpc.c b/usr.sbin/bhyve/pci_lpc.c index 548726e27d0d..ad47230c005e 100644 --- a/usr.sbin/bhyve/pci_lpc.c +++ b/usr.sbin/bhyve/pci_lpc.c @@ -110,10 +110,20 @@ lpc_device_parse(const char *opts) set_config_value("lpc.bootrom", romfile); varfile = strsep(&str, ","); - if (varfile != NULL) { + if (varfile == NULL) { + error = 0; + goto done; + } + if (strchr(varfile, '=') == NULL) { set_config_value("lpc.bootvars", varfile); + } else { + /* varfile doesn't exist, it's another config + * option */ + pci_parse_legacy_config(find_config_node("lpc"), + varfile); } + pci_parse_legacy_config(find_config_node("lpc"), str); error = 0; goto done; } @@ -160,6 +170,12 @@ lpc_bootrom(void) return (get_config_value("lpc.bootrom")); } +const char * +lpc_fwcfg(void) +{ + return (get_config_value("lpc.fwcfg")); +} + static void lpc_uart_intr_assert(void *arg) { diff --git a/usr.sbin/bhyve/pci_lpc.h b/usr.sbin/bhyve/pci_lpc.h index 611b025d4386..ff3ea98b4f9c 100644 --- a/usr.sbin/bhyve/pci_lpc.h +++ b/usr.sbin/bhyve/pci_lpc.h @@ -72,5 +72,6 @@ void lpc_print_supported_devices(void); char *lpc_pirq_name(int pin); void lpc_pirq_routed(void); const char *lpc_bootrom(void); +const char *lpc_fwcfg(void); #endif diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c index 5ee35d6764e6..1b0b5e3e9931 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -17,6 +17,7 @@ #include "acpi_device.h" #include "inout.h" +#include "pci_lpc.h" #include "qemu_fwcfg.h" #define QEMU_FWCFG_ACPI_DEVICE_NAME "FWCF" @@ -351,37 +352,49 @@ qemu_fwcfg_init(struct vmctx *const ctx) { int error; - error = acpi_device_create(&fwcfg_sc.acpi_dev, ctx, - QEMU_FWCFG_ACPI_DEVICE_NAME, QEMU_FWCFG_ACPI_HARDWARE_ID); - if (error) { - warnx("%s: failed to create ACPI device for QEMU FwCfg", - __func__); - goto done; - } + /* + * Bhyve supports fwctl (bhyve) and fwcfg (qemu) as firmware interfaces. + * Both are using the same ports. So, it's not possible to provide both + * interfaces at the same time to the guest. Therefore, only create acpi + * tables and register io ports for fwcfg, if it's used. + */ + if (strcmp(lpc_fwcfg(), "qemu") == 0) { + error = acpi_device_create(&fwcfg_sc.acpi_dev, ctx, + QEMU_FWCFG_ACPI_DEVICE_NAME, QEMU_FWCFG_ACPI_HARDWARE_ID); + if (error) { + warnx("%s: failed to create ACPI device for QEMU FwCfg", + __func__); + goto done; + } - error = acpi_device_add_res_fixed_ioport(fwcfg_sc.acpi_dev, - QEMU_FWCFG_SELECTOR_PORT_NUMBER, 2); - if (error) { - warnx("%s: failed to add fixed IO port for QEMU FwCfg", - __func__); - goto done; - } + error = acpi_device_add_res_fixed_ioport(fwcfg_sc.acpi_dev, + QEMU_FWCFG_SELECTOR_PORT_NUMBER, 2); + if (error) { + warnx("%s: failed to add fixed IO port for QEMU FwCfg", + __func__); + goto done; + } - /* add handlers for fwcfg ports */ - if ((error = qemu_fwcfg_register_port("qemu_fwcfg_selector", - QEMU_FWCFG_SELECTOR_PORT_NUMBER, QEMU_FWCFG_SELECTOR_PORT_SIZE, - QEMU_FWCFG_SELECTOR_PORT_FLAGS, - qemu_fwcfg_selector_port_handler)) != 0) { - warnx("%s: Unable to register qemu fwcfg selector port 0x%x", - __func__, QEMU_FWCFG_SELECTOR_PORT_NUMBER); - goto done; - } - if ((error = qemu_fwcfg_register_port("qemu_fwcfg_data", - QEMU_FWCFG_DATA_PORT_NUMBER, QEMU_FWCFG_DATA_PORT_SIZE, - QEMU_FWCFG_DATA_PORT_FLAGS, qemu_fwcfg_data_port_handler)) != 0) { - warnx("%s: Unable to register qemu fwcfg data port 0x%x", - __func__, QEMU_FWCFG_DATA_PORT_NUMBER); - goto done; + /* add handlers for fwcfg ports */ + if ((error = qemu_fwcfg_register_port("qemu_fwcfg_selector", + QEMU_FWCFG_SELECTOR_PORT_NUMBER, + QEMU_FWCFG_SELECTOR_PORT_SIZE, + QEMU_FWCFG_SELECTOR_PORT_FLAGS, + qemu_fwcfg_selector_port_handler)) != 0) { + warnx( + "%s: Unable to register qemu fwcfg selector port 0x%x", + __func__, QEMU_FWCFG_SELECTOR_PORT_NUMBER); + goto done; + } + if ((error = qemu_fwcfg_register_port("qemu_fwcfg_data", + QEMU_FWCFG_DATA_PORT_NUMBER, QEMU_FWCFG_DATA_PORT_SIZE, + QEMU_FWCFG_DATA_PORT_FLAGS, + qemu_fwcfg_data_port_handler)) != 0) { + warnx( + "%s: Unable to register qemu fwcfg data port 0x%x", + __func__, QEMU_FWCFG_DATA_PORT_NUMBER); + goto done; + } } /* add common fwcfg items */ From nobody Fri Mar 17 09:59:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdKNS57Thz3y8tW; Fri, 17 Mar 2023 09:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PdKNS4bY6z3CqY; Fri, 17 Mar 2023 09:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679047160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NCmyFrPz0MoV/7DHFl/3+euiLGlku77oQyJYIcLdfME=; b=RdBmffb3dnYvOS5EJdD8rYjgzAOVlvX/0aFTwiE1K+jo67lABFCze/TeJ5KCKVG86P0zuN /L+yLFW3rJb92ZgfRBJzBp/nPlzHlHMYCom3XvC3xcCY7YalRT5N8Yo/J0ll7P7gI5e/7T GBrumNSGbBr33BIZV4ligf/C8IIfc2MvDARhqjn+MGxXS7ysPEeBmPIXkD+fGOimrx/S2M v+aPIwXWeGPVc/WreX2wrOnkMA3xASI241RSDY18VOGO37W9DAgUN+o1jnZLPWjDLedmeH LQLfjr7AJmeC6YqtxLZu6GUUvO9QtJX41L7klZamnXabH/nzm89Grns13Ly2aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679047160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NCmyFrPz0MoV/7DHFl/3+euiLGlku77oQyJYIcLdfME=; b=XSjhJPcSW7a6gMINu/VozzBv1/cllDpfe2hLIYuUJjzyT2/mv4n3R0P6msGNE77vSkD2vz Xs5Vf+w3Mtu5tD0qvrJg730CtzR8MLPosYTmiu3QTOnGm3Q83UhpiWisM/tL9wnBZBC6Cy rdJ7H21nwRe71gJTGP+2ZC7vl9G0DdiwfrSpoztOJp5/5wPlqpX+bKmhaQdvSp04vJHA5t Bi8wj/9NVFEwRJ9sdW3btScmcHcPtoIkn3W0QKE7/Vad50n+nCnaromuilw1tSP7S3lVys qb762ZLMdSvp3ZXwVfYayTv09C+N8qAhd7WX4VqDNVnO0zalt6y3yNBTPo4tBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679047160; a=rsa-sha256; cv=none; b=gbmAJIYkrfcoPBy7gCQ9euRocRDl6f9mPBlKjWOTgBWUsDkxxI4B1xY/6iEASsnuaSec// pWkARdyBX8zf/CQlXEMzCdNz7rpCYdT/vd6v+3RnFhR9ct09v329qRTU/w9prXvA9m+XrA rRK+1PDgkVTWiqnnMINx5ZSieWGw4f+pczq3YuatIX6pFCFrrYDXXGiTq04LcxVFYHFAOM PsIsnr+zaDiZCjpQkDlBle6EoGtZ2jztoeUOYb9h263yq+O08dg0yUEERL9cjirS6BEcTn bPUDT5cTAyHO4SAJbFUSsrKa2BjpIRLDalZepq6RqAjjdnbQlauul1Z4TAHEjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdKNS3ddfzLSj; Fri, 17 Mar 2023 09:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H9xKgX017199; Fri, 17 Mar 2023 09:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H9xKUr017198; Fri, 17 Mar 2023 09:59:20 GMT (envelope-from git) Date: Fri, 17 Mar 2023 09:59:20 GMT Message-Id: <202303170959.32H9xKUr017198@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: c15ceae9e7f9 - stable/13 - carp: carp_master_down_locked() requires net epoch List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: c15ceae9e7f98f7e74ff7848b3aff7176c7e263a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c15ceae9e7f98f7e74ff7848b3aff7176c7e263a commit c15ceae9e7f98f7e74ff7848b3aff7176c7e263a Author: Zhenlei Huang AuthorDate: 2023-03-16 10:00:13 +0000 Commit: Zhenlei Huang CommitDate: 2023-03-17 09:55:00 +0000 carp: carp_master_down_locked() requires net epoch Reviewed by: kp Fixes: 1d126e9b9474 carp: Widen epoch coverage MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D39113 (cherry picked from commit 49cad3daf2a3abe8270f71ee5b15b8990a19529d) --- sys/netinet/ip_carp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index e84a85ebc11e..b6326b14c802 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1732,6 +1732,7 @@ carp_carprcp(struct carpreq *carpr, struct carp_softc *sc, int priv) int carp_ioctl(struct ifreq *ifr, u_long cmd, struct thread *td) { + struct epoch_tracker et; struct carpreq carpr; struct ifnet *ifp; struct carp_softc *sc = NULL; @@ -1816,8 +1817,10 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct thread *td) carp_delroute(sc); break; case MASTER: + NET_EPOCH_ENTER(et); carp_master_down_locked(sc, "user requested via ifconfig"); + NET_EPOCH_EXIT(et); break; default: break; From nobody Fri Mar 17 10:29:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL353KC2z3yBWR; Fri, 17 Mar 2023 10:29: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 4PdL352jz7z3GNh; Fri, 17 Mar 2023 10:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gV+PZn63sFKmOsawt90BW25MHPLIRIkr3Lmk1FmJK5Y=; b=o+3QbXg8HoH7Pg+nh0JCXBSMsImIkxJxCjcmdDcIXLcq0zHHC5pMQft0bN/jpi3fIl0rWQ 2CGH3lRljqWAd1i2AWfgxA6X4nJHZMOJdlPz3Qbwgn5HfjqvuWs9OjVMY3pNJHFHMiQPZR wIyhPPEhW4q2godc/df4CqCqZSjgAeA1ZGkyByTg89a0oMson4AasTP06spF0dcgI4iSET EJfhaeu7k0kxieDeXxb1bjSX8Dsk1COYoMey4lXEIaPkhLwSGD7IcLGyC/Hfjn0wr+uv0H XMF+WFR5RYPcqgaQGPnffzo7X5936QxfuIbpNdr1WJ9gMc6cwas8BxJAOcdMVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gV+PZn63sFKmOsawt90BW25MHPLIRIkr3Lmk1FmJK5Y=; b=RSroO8WY4C2WAHaK0kuwhvH78NZ81f5Y2IdwlrVxcg/vZz8g/UePGquwivRvYqF36NKePz se04E6L5Bf7K3hyRmzUZ4CFXrsAueePwk14WJirADwSx9l7kK4FT0p4JXAN+S/2o82bAFs Wei6nVdcQQfXV04VpbtTDPTQEpii5k2ObT7GwMtsqYfbwGMTe+HP1mgxwXFPz8ur55D/x/ 4KsRq3R0Soj45SJi7dNiwFcavQFNGjeao9E8bXcGn6XwnCZ8dMgqVLrWiPXVrdxaqHBznS sezrrtVjleUEM4FmhEXr6QByirkDOd6n8l4klPLTaIl8bmZzPREej2/xYg34pQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048961; a=rsa-sha256; cv=none; b=w6aFQOg6tBcJWjDuiXBThSmWyhbUAOLjNrZ9jT4XQ/g8MkGw3BnQXHlEhVjC5854KrO7dE GjyQEJB9JcaiWr8KFrTL3q/4iwqZ0jqgIhhHO5sCCJS5No3C3MERpm13Vf1d1YXErO0SWU AC8A0Z1vegzyBtGRRAcdSN6I7J3nqzaX9byToLJOcMqPToEUn3irQm2QWUiqQ60eowczI1 pkmqIybG9XWfKf9Ws8i//l9CKnStrcEGL/4cWXF0TR7kugxO8jNp/6msgg/3L8iYg9zQKA bZ8x3xZNFbKLQXH9IdKF7PPY4ZtMTqucgSmZQJlkyNoTSn2eUWQk58K75qfTPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL351mLHzMpW; Fri, 17 Mar 2023 10:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATLte067252; Fri, 17 Mar 2023 10:29:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATLHE067251; Fri, 17 Mar 2023 10:29:21 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:21 GMT Message-Id: <202303171029.32HATLHE067251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 1adfb2e834c5 - stable/13 - bhyve: add helper to add fwcfg items List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1adfb2e834c57b319d3f0eee1b80e2d7b1a3d421 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=1adfb2e834c57b319d3f0eee1b80e2d7b1a3d421 commit 1adfb2e834c57b319d3f0eee1b80e2d7b1a3d421 Author: Corvin Köhne AuthorDate: 2021-08-11 08:01:19 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:32 +0000 bhyve: add helper to add fwcfg items This helper makes it easier to add multiple fwcfg items. You can pass an index and some data to the helper. The helper adds these information to the fwcfg emulation so that the guest reads the given data on the specified index. Reviewed by: MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38334 (cherry picked from commit 3ef46195ac37111ab247cfabed735d3ee5e7f5b5) --- usr.sbin/bhyve/qemu_fwcfg.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c index 13e21daca7ff..8cb71b819956 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -130,6 +130,31 @@ qemu_fwcfg_data_port_handler(struct vmctx *const ctx __unused, const int in, return (0); } +static int +qemu_fwcfg_add_item(const uint16_t architecture, const uint16_t index, + const uint32_t size, void *const data) +{ + /* truncate architecture and index to their desired size */ + const uint16_t arch = architecture & QEMU_FWCFG_ARCHITECTURE_MASK; + const uint16_t idx = index & QEMU_FWCFG_INDEX_MASK; + + /* get pointer to item specified by selector */ + struct qemu_fwcfg_item *const fwcfg_item = &fwcfg_sc.items[arch][idx]; + + /* check if item is already used */ + if (fwcfg_item->data != NULL) { + warnx("%s: qemu fwcfg item exists (architecture %s index 0x%x)", + __func__, arch ? "specific" : "generic", idx); + return (-1); + } + + /* save data of the item */ + fwcfg_item->size = size; + fwcfg_item->data = data; + + return (0); +} + static int qemu_fwcfg_register_port(const char *const name, const int port, const int size, const int flags, const inout_func_t handler) From nobody Fri Mar 17 10:29:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL36442lz3yBYs; Fri, 17 Mar 2023 10:29: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 4PdL363Z5kz3GQ8; Fri, 17 Mar 2023 10:29:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llyASkX34nS7Sdu2R+GuZq0gWuMrQ4XOtt6niLsnrog=; b=KS0/zMghxQ0kqzpZgQP+tPe8LPA2p8CJc+u3wduXbQY3/pX+ciA4sjcR5K1/9KfrclQyLR E50thPDaON4o/qXCOnvwAzSnR6ohHpxv/2Pa2UxyZL2emIC0aAxkn7Snh0/WZASWB23q9h q5LrHrxXUdDdg7RQC7fr5rN6A5gdXalnSgwn8oTEYCrRKCBf87z68HrRgEfHyNuE8RoZhQ BfXW0Qsmm2nE2mafHreqKZLlnardaLYwIetEzaQdGXdOD5wNGzAQJp/TvMzU/zOi0w7VjY bP2K2OTqsajTTmXaDLSByOiSx1B8LYZlEmBqw/GiAcnu1fJxFNIOFcwUazmEMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llyASkX34nS7Sdu2R+GuZq0gWuMrQ4XOtt6niLsnrog=; b=tX7jOgFiZnLNfr7htVbB/JicUSGpzX3S/hCtCK30zfLAsY1Trotc3r9Mw8YbB12emmPzU5 Z+Z3v+T18wDoMAyqlSNl/3brLLOp1HvjywvnqLjRgrYur2ESpCmQoAn4TKbgfPynWwdFbV 4JKIiJ+EiOvbfWIYzLoqolSCrZkeuklJl3o85IHHZCAHmdnsvJ+rzCN6dNYzLeHkwIA12R Yu76yzRVCIf13UXPApOOIB2bP1pbSx499sjg7HzNoeWPqddX5umQuyoMz/aViiAMYPuvO/ gyWW/qaALJWjaMOBm5v+hzB4GMIF/QMa0XGn+AfxUmEEKuoqJ0UAU8InQAqmTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048962; a=rsa-sha256; cv=none; b=VQAIW7PBuIpRLCkNoh/czHB/qUPcmOZDSvhBsingrYV8HymnCJvch4W5lfQQLCB1LEG7a3 qeNe3pD6dB51b2MzaCJEFeto9r6hl+v1X2YX3cbtYCcV3sT1SrtYJe5To8CpQye4O3+JsG iL1b+fud7kpdb+9hjZ6oFNJtprMqrkyDcxrhF8/x4aa0nN7EBWUzzAhelKRprS0fIoA3A6 MqFCMdigYX8KkkbrIKaesMTvv5De6LJgyJ2EbJoxSE10+CrYKAqM3s+JQee5P5UPBgAgGU uMbiRzpwp2vkCbUMBRHlYQn622iLltdYW3tlwGfBDUN50mwrIR/Jzig3GvlZ/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 4PdL362fhlzMZn; Fri, 17 Mar 2023 10:29:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATMC1067279; Fri, 17 Mar 2023 10:29:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATM81067277; Fri, 17 Mar 2023 10:29:22 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:22 GMT Message-Id: <202303171029.32HATM81067277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 02296919604f - stable/13 - bhyve: add common fwcfg items List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 02296919604f8df8e890d3c7f3b54e707270caf1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=02296919604f8df8e890d3c7f3b54e707270caf1 commit 02296919604f8df8e890d3c7f3b54e707270caf1 Author: Corvin Köhne AuthorDate: 2021-08-11 08:02:57 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:32 +0000 bhyve: add common fwcfg items Qemu defines some common fwcfg items. We don't need to support all of them. Only a subset needs to be present for fwcfg to work properly. - signature The signature is used by the guest to check if qemu's fwcfg is available or not. - id The id is used by the guest to check which features are supported by the fwcfg implementation of the hypervisor. - file_dir The file dir reports all fwcfg items which don't have a fixed index. These are mostly user defined fwcfg items. Reviewed by: MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38335 (cherry picked from commit 34f804e547e7c3b10b12f5450ff2e0a771000daf) --- usr.sbin/bhyve/qemu_fwcfg.c | 99 +++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/qemu_fwcfg.h | 1 + 2 files changed, 100 insertions(+) diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c index 8cb71b819956..e1a67fd0d8ef 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -6,6 +6,7 @@ */ #include +#include #include @@ -38,6 +39,12 @@ #define QEMU_FWCFG_ARCHITECTURE_GENERIC 0 #define QEMU_FWCFG_ARCHITECTURE_SPECIFIC 1 +#define QEMU_FWCFG_INDEX_SIGNATURE 0x00 +#define QEMU_FWCFG_INDEX_ID 0x01 +#define QEMU_FWCFG_INDEX_FILE_DIR 0x19 + +#define QEMU_FWCFG_MIN_FILES 10 + #pragma pack(1) union qemu_fwcfg_selector { @@ -49,6 +56,28 @@ union qemu_fwcfg_selector { uint16_t bits; }; +struct qemu_fwcfg_signature { + uint8_t signature[4]; +}; + +struct qemu_fwcfg_id { + uint32_t interface : 1; /* always set */ + uint32_t DMA : 1; + uint32_t reserved : 30; +}; + +struct qemu_fwcfg_file { + uint32_t be_size; + uint16_t be_selector; + uint16_t reserved; + uint8_t name[QEMU_FWCFG_MAX_NAME]; +}; + +struct qemu_fwcfg_directory { + uint32_t be_count; + struct qemu_fwcfg_file files[0]; +}; + #pragma pack() struct qemu_fwcfg_softc { @@ -155,6 +184,62 @@ qemu_fwcfg_add_item(const uint16_t architecture, const uint16_t index, return (0); } +static int +qemu_fwcfg_add_item_file_dir(void) +{ + const size_t size = sizeof(struct qemu_fwcfg_directory) + + QEMU_FWCFG_MIN_FILES * sizeof(struct qemu_fwcfg_file); + struct qemu_fwcfg_directory *const fwcfg_directory = calloc(1, size); + if (fwcfg_directory == NULL) { + return (ENOMEM); + } + + fwcfg_sc.directory = fwcfg_directory; + + return (qemu_fwcfg_add_item(QEMU_FWCFG_ARCHITECTURE_GENERIC, + QEMU_FWCFG_INDEX_FILE_DIR, sizeof(struct qemu_fwcfg_directory), + (uint8_t *)fwcfg_sc.directory)); +} + +static int +qemu_fwcfg_add_item_id(void) +{ + struct qemu_fwcfg_id *const fwcfg_id = calloc(1, + sizeof(struct qemu_fwcfg_id)); + if (fwcfg_id == NULL) { + return (ENOMEM); + } + + fwcfg_id->interface = 1; + fwcfg_id->DMA = 0; + + uint32_t *const le_fwcfg_id_ptr = (uint32_t *)fwcfg_id; + *le_fwcfg_id_ptr = htole32(*le_fwcfg_id_ptr); + + return (qemu_fwcfg_add_item(QEMU_FWCFG_ARCHITECTURE_GENERIC, + QEMU_FWCFG_INDEX_ID, sizeof(struct qemu_fwcfg_id), + (uint8_t *)fwcfg_id)); +} + +static int +qemu_fwcfg_add_item_signature(void) +{ + struct qemu_fwcfg_signature *const fwcfg_signature = calloc(1, + sizeof(struct qemu_fwcfg_signature)); + if (fwcfg_signature == NULL) { + return (ENOMEM); + } + + fwcfg_signature->signature[0] = 'Q'; + fwcfg_signature->signature[1] = 'E'; + fwcfg_signature->signature[2] = 'M'; + fwcfg_signature->signature[3] = 'U'; + + return (qemu_fwcfg_add_item(QEMU_FWCFG_ARCHITECTURE_GENERIC, + QEMU_FWCFG_INDEX_SIGNATURE, sizeof(struct qemu_fwcfg_signature), + (uint8_t *)fwcfg_signature)); +} + static int qemu_fwcfg_register_port(const char *const name, const int port, const int size, const int flags, const inout_func_t handler) @@ -209,6 +294,20 @@ qemu_fwcfg_init(struct vmctx *const ctx) goto done; } + /* add common fwcfg items */ + if ((error = qemu_fwcfg_add_item_signature()) != 0) { + warnx("%s: Unable to add signature item", __func__); + goto done; + } + if ((error = qemu_fwcfg_add_item_id()) != 0) { + warnx("%s: Unable to add id item", __func__); + goto done; + } + if ((error = qemu_fwcfg_add_item_file_dir()) != 0) { + warnx("%s: Unable to add file_dir item", __func__); + goto done; + } + done: if (error) { acpi_device_destroy(fwcfg_sc.acpi_dev); diff --git a/usr.sbin/bhyve/qemu_fwcfg.h b/usr.sbin/bhyve/qemu_fwcfg.h index 58ef5ed3c6bf..b5454fa9977d 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.h +++ b/usr.sbin/bhyve/qemu_fwcfg.h @@ -11,6 +11,7 @@ #define QEMU_FWCFG_MAX_ARCHS 0x2 #define QEMU_FWCFG_MAX_ENTRIES 0x4000 +#define QEMU_FWCFG_MAX_NAME 56 struct qemu_fwcfg_item { uint32_t size; From nobody Fri Mar 17 10:29:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL375GHCz3yBbw; Fri, 17 Mar 2023 10:29: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 4PdL374c5Pz3GWR; Fri, 17 Mar 2023 10:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZOJ7WScVgUG2QAJD1alrINhIfi2kiCwQi6pejjHLt7o=; b=JORgCCNLoFw+bS8m3x4OLGsL8ySUsgWNxlk6mPcTEQyhamZXwqkP4ZSdSnvUhnpQ7y0EbH WU7Ub/QxUe1ngdDYHe460BT5Yq3YUipRpRPY2NCbRDCVeTmir/K1/c5q4wySHt7hJ1q7wN kwVMSMentteabPL66sNvf8Jllt6lHcyHslQPdOkZZkdcdo8sRyk1/uUCPdR+3uF7p0j14k qWrFJgCSXefakQaJUANa+JPT/Enrotme6xQ+OMqdoqYmnOpgPHSWDeS3xMJgWJx+hvLlb1 EolRJj/PutISC4j3Yd5cM8qStqPQ7wE7oWBKELeYE2whyrcoUkUYwkaqwIHkkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZOJ7WScVgUG2QAJD1alrINhIfi2kiCwQi6pejjHLt7o=; b=A0VCXhYgHqhFQXb0avCSIMGVsyEKGmWAuyS1cixMsQaFA14JW8UpQyKrteWapgZ5jjGVJj X2Wau8c0BJftxpPeeGmX9vF4BufZoUPpNjkCHWEzhlMCCvc4HLoLJftklF8pjp2QIdsYg+ wk+PoqrYKQpJw2UZTo5UNB4Mw23EMAuLZWRcu4wvar0m9Z0YLdUTrlHbP83p+eptdmRUZQ vBtX5egEwq0+pAo86NRbIQOr+K9GfWh2Rux3k1sfoIzcGRIxs4BO8rDQQfDdrbe2FHMqE2 yEipbHgBpn+WQ2xCX3P4+2uAQFt6cBM/a9RUo4NU8ACuVQcRzOfgchvol5NAWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048963; a=rsa-sha256; cv=none; b=WyHmuQk0ouDFjklo26yoQ8bKDE2dHJ8uA3waRO5c5Pw0TyZtlBO04U2bnrKYDxqa7rsm61 VfYChlL5HwUFpGpkavl4g5aryJqjs7SxD3PBJx+5ii1KaIDQfb34O3XmHJEwe0NYauH9Lk vugaIAzSZe9pdyGZfX8m7M4poa4zdy7eArxtY0lhGha02/aC3xjYdECuUHiMBJ4BhwTxol EBK35sLinv/MYJl7NFzGZFAH92ZuU+nRUr/Wn1dQaFv2YkqntMGOvjzVVrikCYM0L8T2s9 NKC90nKoRQ/Gs5l+KPAcO41isZ6weBi6V3/aMEGAARrXXbbpX6rcF9bi4IHDNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL373bnBzMjw; Fri, 17 Mar 2023 10:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATNT3067308; Fri, 17 Mar 2023 10:29:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATNEQ067307; Fri, 17 Mar 2023 10:29:23 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:23 GMT Message-Id: <202303171029.32HATNEQ067307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: fb18fc6b050e - stable/13 - vmm: fix restore of TSC offset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fb18fc6b050e540a694271af7ac1c293e0f4a5b3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=fb18fc6b050e540a694271af7ac1c293e0f4a5b3 commit fb18fc6b050e540a694271af7ac1c293e0f4a5b3 Author: Vitaliy Gusev AuthorDate: 2023-02-28 11:16:35 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:33 +0000 vmm: fix restore of TSC offset After suspend/resume Ubuntu 20.04 and 22.04 installer can hang if tsc-early clocksource has a big skew. Reviewed by: corvink, jhb Fixes: a7db532e3a6f83067b342f569b56076d011f8a1e ("vmm: Simplify saving of absolute TSC values in snapshots.") MFC after: 2 weeks Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38474 (cherry picked from commit 281b496f22d1d666b2ef1e54985432627ec434a4) --- sys/amd64/vmm/vmm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 692b8c991310..8cdf57608055 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -2859,6 +2859,8 @@ vm_snapshot_vcpus(struct vm *vm, struct vm_snapshot_meta *meta) */ tsc = now + vcpu->tsc_offset; SNAPSHOT_VAR_OR_LEAVE(tsc, meta, ret, done); + if (meta->op == VM_SNAPSHOT_RESTORE) + vcpu->tsc_offset = tsc; } done: From nobody Fri Mar 17 10:29:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL390vQqz3yBTW; Fri, 17 Mar 2023 10:29: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 4PdL385X8Bz3Gcf; Fri, 17 Mar 2023 10:29:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O0v9LsQ279LxlDn0wpRXC8qCpjdK6eHgqQ8rmdP/7Xs=; b=WsTU0FoMulQgS/+S6RKhy6IRC2wmLwZLqi7HZDgyC6GT45gGIBNmEIHQ9nksenOVq30OHe LH08cPlizHvKEkbm2pQQeII159PblhMRkPhe3Z5f1SIQz61JO7F/yOU3X5J46wn9C9C8sd TgpLufdqbr7us/28JidFFOsl/lSDr6ECtjHVCtsjgPktIlzQ1YWaYv+jwK8A6yJMJOa4I7 ilEqLaZxE2YatiLEJqn+Ap/kEusfk3g7OgDH5fRj2rmfG4l78KgqZRO5vXW18hQyB+mjzx aZ0jmHqHamtnNtlM1S+XhSecfnJdl8gzHJeXJlCa4btYNYXZoVEKxY0H1eTU8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O0v9LsQ279LxlDn0wpRXC8qCpjdK6eHgqQ8rmdP/7Xs=; b=ZIVI7bzDl+QHyvCoW6kZ2FxaQb3kU59yn/2Cu0b4Zo2+it6GK/p7Tk7qJIrVWFgjbX6Yl8 YFlyL3yELEtiGll3J6mDId+ANd34HN9rYMXLC/CkFtKk092MWsjauw3RcOYKw0ODQLWdNF gmP2uMW4ywTOvFBFRNgwBVHIRpua1pVHimSxqnQVteWMuhXTLLIS927TvnqydC1fgd7Ki9 BqoGCEMgpf8FMONldPSHiOhXaCOWf66aLhS6Is1eEF2CC30V1ca/oESV/pC8p7AOKYkbOz YTXawrT53KK1F/NIChApLH3gJOplhB2oZiwm+EgOeNnfGwoIKSGUv00ByIHL3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048964; a=rsa-sha256; cv=none; b=jVlUY+NtQlGHhkQf3kfir0Fb6Lgz/06/Ry3+sGb0sPu8gFzRgzC5CC3n8N50hm9+iHksN0 GvOYxou+hhgjC2nKMLnkg1aHEDNivVuWLJBEDUABGBw1JWQfIEeWGBqfBVkMo21FYdooaJ TZdNXhp6K2vDb1oZ7t54bOyopZLzMztvp9ucX81TxYTQGoCyXa6/vLfGNUBGlpETGAnEws PBrfZgo9TFrKSlJJtukjlB61CTuDqEakXB0EbLc0F5WJFCYhJHH0/t6AAC6QHxmi+HxGsR 1KUtk45TiIgtKDhA8swDI7Zlc0EmtVdKJmrDqt+TZvP9fIH9HHp+zXLUozHfcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL384dRNzMLx; Fri, 17 Mar 2023 10:29:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATOfl067332; Fri, 17 Mar 2023 10:29:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATOZu067331; Fri, 17 Mar 2023 10:29:24 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:24 GMT Message-Id: <202303171029.32HATOZu067331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 38acc80a5b69 - stable/13 - bhyve: fix restore of kernel structs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 38acc80a5b696a0f9d029b5de209b6a2045332cd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=38acc80a5b696a0f9d029b5de209b6a2045332cd commit 38acc80a5b696a0f9d029b5de209b6a2045332cd Author: Vitaliy Gusev AuthorDate: 2023-02-28 10:32:49 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:33 +0000 bhyve: fix restore of kernel structs vmx_snapshot() and svm_snapshot() do not save any data and error occurs at resume: Restoring kernel structs... vm_restore_kern_struct: Kernel struct size was 0 for: vmx Failed to restore kernel structs. Reviewed by: corvink, markj Fixes: 39ec056e6dbd89e26ee21d2928dbd37335de0ebc ("vmm: Rework snapshotting of CPU-specific per-vCPU data.") MFC after: 2 weeks Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38476 (cherry picked from commit 8104fc31a234bad1ba68910f66876395fc58ebdc) --- sys/amd64/include/vmm.h | 2 -- sys/amd64/include/vmm_snapshot.h | 3 +-- sys/amd64/vmm/amd/svm.c | 10 ---------- sys/amd64/vmm/intel/vmx.c | 7 ------- sys/amd64/vmm/vmm.c | 4 ---- usr.sbin/bhyve/snapshot.c | 1 - 6 files changed, 1 insertion(+), 26 deletions(-) diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index cb883bb0e143..95f5597f7e1a 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -184,7 +184,6 @@ typedef struct vmspace * (*vmi_vmspace_alloc)(vm_offset_t min, vm_offset_t max); typedef void (*vmi_vmspace_free)(struct vmspace *vmspace); typedef struct vlapic * (*vmi_vlapic_init)(void *vcpui); typedef void (*vmi_vlapic_cleanup)(struct vlapic *vlapic); -typedef int (*vmi_snapshot_t)(void *vmi, struct vm_snapshot_meta *meta); typedef int (*vmi_snapshot_vcpu_t)(void *vcpui, struct vm_snapshot_meta *meta); typedef int (*vmi_restore_tsc_t)(void *vcpui, uint64_t now); @@ -210,7 +209,6 @@ struct vmm_ops { vmi_vlapic_cleanup vlapic_cleanup; /* checkpoint operations */ - vmi_snapshot_t snapshot; vmi_snapshot_vcpu_t vcpu_snapshot; vmi_restore_tsc_t restore_tsc; }; diff --git a/sys/amd64/include/vmm_snapshot.h b/sys/amd64/include/vmm_snapshot.h index d08f980e7988..c4d7fc4d4371 100644 --- a/sys/amd64/include/vmm_snapshot.h +++ b/sys/amd64/include/vmm_snapshot.h @@ -47,8 +47,7 @@ struct vmctx; enum snapshot_req { - STRUCT_VMX, - STRUCT_VIOAPIC, + STRUCT_VIOAPIC = 1, STRUCT_VM, STRUCT_VLAPIC, VM_MEM, diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index ee1154ef85b6..d995b68ebdc6 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -2415,15 +2415,6 @@ svm_vlapic_cleanup(struct vlapic *vlapic) } #ifdef BHYVE_SNAPSHOT -static int -svm_snapshot(void *vmi, struct vm_snapshot_meta *meta) -{ - if (meta->op == VM_SNAPSHOT_RESTORE) - flush_by_asid(); - - return (0); -} - static int svm_vcpu_snapshot(void *vcpui, struct vm_snapshot_meta *meta) { @@ -2656,7 +2647,6 @@ const struct vmm_ops vmm_ops_amd = { .vlapic_init = svm_vlapic_init, .vlapic_cleanup = svm_vlapic_cleanup, #ifdef BHYVE_SNAPSHOT - .snapshot = svm_snapshot, .vcpu_snapshot = svm_vcpu_snapshot, .restore_tsc = svm_restore_tsc, #endif diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index fa94c707001c..91406f0614ce 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -4093,12 +4093,6 @@ vmx_vlapic_cleanup(struct vlapic *vlapic) } #ifdef BHYVE_SNAPSHOT -static int -vmx_snapshot(void *vmi, struct vm_snapshot_meta *meta) -{ - return (0); -} - static int vmx_vcpu_snapshot(void *vcpui, struct vm_snapshot_meta *meta) { @@ -4254,7 +4248,6 @@ const struct vmm_ops vmm_ops_intel = { .vlapic_init = vmx_vlapic_init, .vlapic_cleanup = vmx_vlapic_cleanup, #ifdef BHYVE_SNAPSHOT - .snapshot = vmx_snapshot, .vcpu_snapshot = vmx_vcpu_snapshot, .restore_tsc = vmx_restore_tsc, #endif diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 8cdf57608055..1b5e6946d785 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -254,7 +254,6 @@ DEFINE_VMMOPS_IFUNC(void, vmspace_free, (struct vmspace *vmspace)) DEFINE_VMMOPS_IFUNC(struct vlapic *, vlapic_init, (void *vcpui)) DEFINE_VMMOPS_IFUNC(void, vlapic_cleanup, (struct vlapic *vlapic)) #ifdef BHYVE_SNAPSHOT -DEFINE_VMMOPS_IFUNC(int, snapshot, (void *vmi, struct vm_snapshot_meta *meta)) DEFINE_VMMOPS_IFUNC(int, vcpu_snapshot, (void *vcpui, struct vm_snapshot_meta *meta)) DEFINE_VMMOPS_IFUNC(int, restore_tsc, (void *vcpui, uint64_t now)) @@ -2917,9 +2916,6 @@ vm_snapshot_req(struct vm *vm, struct vm_snapshot_meta *meta) int ret = 0; switch (meta->dev_req) { - case STRUCT_VMX: - ret = vmmops_snapshot(vm->cookie, meta); - break; case STRUCT_VMCX: ret = vm_snapshot_vcpu(vm, meta); break; diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c index 0c9e32abd326..6143f6f3a489 100644 --- a/usr.sbin/bhyve/snapshot.c +++ b/usr.sbin/bhyve/snapshot.c @@ -155,7 +155,6 @@ static const struct vm_snapshot_dev_info snapshot_devs[] = { static const struct vm_snapshot_kern_info snapshot_kern_structs[] = { { "vhpet", STRUCT_VHPET }, { "vm", STRUCT_VM }, - { "vmx", STRUCT_VMX }, { "vioapic", STRUCT_VIOAPIC }, { "vlapic", STRUCT_VLAPIC }, { "vmcx", STRUCT_VMCX }, From nobody Fri Mar 17 10:29:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL396wFFz3yBTZ; Fri, 17 Mar 2023 10:29: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 4PdL396TD5z3GXX; Fri, 17 Mar 2023 10:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JvP3D8fZoq2vXuwa9xyWjZta4skgch3LiphTNtMygOA=; b=qsj+S93Rp4aV9CjhXr+6njL8eSQuyri8uFnQ3OLpD05QJuzT5COh1XYlJi8rfltVkYd4NG SOp00CKOCq6yaM8olkRGzTdGaxNHb1yxnaFuX4oxIHm+UU8A/Sr41+prS3psnFBKguJOeS sZcOs+1PEo1r6PMxJ/lzy7qn8r7GSPkiU9HdgfSjfR88siySG19zmJZAQoYMG0UX1q3sCv 4EJldmoBSB1M4MI8dPb+rfdDZffo8rORy+GdQU5lVQpwLW6Iy2FTcp0gLQymnlOYFDxbkd zteF7z/E9MK00G7b6tiVaR1jmTikYIfCjFebCBxXoWCVBzzWVfzVXUCK6nDoyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JvP3D8fZoq2vXuwa9xyWjZta4skgch3LiphTNtMygOA=; b=EY4TWK1M3lTqkVyRr+6Be0Ab6G4MgA1wjSAtYduiSQqM4yv+2a4KEPRjvtQMqc9JrRPTJB i1AKeyBu/4MGOQYqt9VagjMlUGULcnBqeIJESuyprIzJZINzwcssqnLy1X8d1rzomd7Qj/ XWYQPoZod3wGt0uBnntkEqwUIpO59KPfLFJJaCLaUv+SQEHvvM4zOgnQ5/Arczz8ljZ6lE xqFx5CEK8LXS4Jja4G3cj5ZY1lu88F4B97qmjr1G0vW4hxTvSWDGY93kJmNmX9x9bs7q4f 3pVkNaKjiIxCMK9fLXHio6pF1DEo5kkbX+y2cVBCxE7jzhpRh3eWkfujqq+uXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048965; a=rsa-sha256; cv=none; b=By+P807BKx0rz9kop3kKZzmoktExu3NGj9mJfjWRgEdgmY5QQO2JF91UxcIGn58B8btiMZ NxpwV9M9QVH58XRl7oZbvawSfpXsU4GO/x0KyafvzBxDwJSKjIN6F4Lt4rIitBaaqv9uI+ J2NgQLLNRFuLFWmdH8e5U1IydTqYjCatFqJJ9k0J9aI37GIQooEYLUReMyVLPc18PD8CYV RUC6GNbuDfUAoJCyrqnno274o6yIkvk5tkMNS9aN6mpcUfmoLjEe7rW48nSg7BDcos9jSu 9+p8CCISCvN1Rqt11M27K8UqamXiZHs/9y0akhYeyIBnh6r71/9HDd+FkBdADg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL395ZgXzMZp; Fri, 17 Mar 2023 10:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATPRD067357; Fri, 17 Mar 2023 10:29:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATPNY067355; Fri, 17 Mar 2023 10:29:25 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:25 GMT Message-Id: <202303171029.32HATPNY067355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: f6a333f85524 - stable/13 - bhyve: fix resume for vms with guest_ncpus > 1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f6a333f85524fb51c2d15478ba3cc3d65354cf4a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=f6a333f85524fb51c2d15478ba3cc3d65354cf4a commit f6a333f85524fb51c2d15478ba3cc3d65354cf4a Author: Vitaliy Gusev AuthorDate: 2023-02-28 10:28:40 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:33 +0000 bhyve: fix resume for vms with guest_ncpus > 1 This error occurs because vm->vcpu[1] has not been allocated yet when vm_snapshot_vm() is called. To fix this, move spinup_vcpu() before restore code. Reviewed by: corvink, markj MFC after: 2 weeks Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38477 (cherry picked from commit 9ff3e8b7f09034202ad1f24f4fbbe52cf7f56117) --- usr.sbin/bhyve/bhyverun.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index caa284a8dd63..3ff83f55474b 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -552,7 +552,7 @@ fbsdrun_start_thread(void *param) } static void -fbsdrun_addcpu(struct vmctx *ctx, int newcpu, bool suspend) +fbsdrun_addcpu(struct vmctx *ctx, int newcpu) { int error; @@ -562,8 +562,7 @@ fbsdrun_addcpu(struct vmctx *ctx, int newcpu, bool suspend) CPU_SET_ATOMIC(newcpu, &cpumask); - if (suspend) - vm_suspend_cpu(ctx, newcpu); + vm_suspend_cpu(ctx, newcpu); mt_vmm_info[newcpu].mt_ctx = ctx; mt_vmm_info[newcpu].mt_vcpu = newcpu; @@ -1138,7 +1137,7 @@ do_open(const char *vmname) } static void -spinup_vcpu(struct vmctx *ctx, int vcpu, bool suspend) +spinup_vcpu(struct vmctx *ctx, int vcpu) { int error; @@ -1154,7 +1153,7 @@ spinup_vcpu(struct vmctx *ctx, int vcpu, bool suspend) assert(error == 0); } - fbsdrun_addcpu(ctx, vcpu, suspend); + fbsdrun_addcpu(ctx, vcpu); } static bool @@ -1488,6 +1487,16 @@ main(int argc, char *argv[]) assert(error == 0); } + /* Allocate per-VCPU resources. */ + mt_vmm_info = calloc(guest_ncpus, sizeof(*mt_vmm_info)); + + /* + * Add all vCPUs. + */ + for (int vcpu = 0; vcpu < guest_ncpus; vcpu++) { + spinup_vcpu(ctx, vcpu); + } + #ifdef BHYVE_SNAPSHOT if (restore_file != NULL) { fprintf(stdout, "Pausing pci devs...\r\n"); @@ -1564,9 +1573,6 @@ main(int argc, char *argv[]) #endif #ifdef BHYVE_SNAPSHOT - if (restore_file != NULL) - destroy_restore_state(&rstate); - /* initialize mutex/cond variables */ init_snapshot(); @@ -1576,24 +1582,18 @@ main(int argc, char *argv[]) if (init_checkpoint_thread(ctx) < 0) printf("Failed to start checkpoint thread!\r\n"); - if (restore_file != NULL) + if (restore_file != NULL) { + destroy_restore_state(&rstate); vm_restore_time(ctx); -#endif - - /* Allocate per-VCPU resources. */ - mt_vmm_info = calloc(guest_ncpus, sizeof(*mt_vmm_info)); - /* - * Add all vCPUs. - */ - for (int vcpu = 0; vcpu < guest_ncpus; vcpu++) { - bool suspend = (vcpu != BSP); -#ifdef BHYVE_SNAPSHOT - if (restore_file != NULL) - suspend = false; -#endif - spinup_vcpu(ctx, vcpu, suspend); + for (int i = 0; i < guest_ncpus; i++) { + if (i == BSP) + continue; + vm_resume_cpu(ctx, i); + } } +#endif + vm_resume_cpu(ctx, BSP); /* * Head off to the main event dispatch loop From nobody Fri Mar 17 10:29:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3C0sLDz3yBby; Fri, 17 Mar 2023 10:29: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 4PdL3C0RKqz3Gnk; Fri, 17 Mar 2023 10:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mn9ST0CFDnroeWhaYB17XIeSUd3ay4KXz6tYIXuCuP4=; b=eC8PJeT72LhvbAyIh2nJfIGl/F00gVVBT81383PetIhi7HpAbnizWz9aal3Wtkyw3qKQis t1D+g9sM2O+ANmb/A8QmARnXRzvyqRHuEFfb9tW1aSC1sJUzxhrJBU2St2KMtUwd/57cSb 25ODtYgCRwTEB9g2VblVTOgiLv8mDcM+EcqhstV3u+dYehvh044JIk5is7DeCEsIODXZ2w 7Csffw+QA+Cm2Fd9ghcYweHc55fozUnmEVk2l/OxLZaeoBRgs6a4yxqmm8sfEIsmGLifL0 JR/lKIrisatd20Ao0Kyj0EQQRpEbCa0jF1GAftsYKFeARgDn3TqzuSOMHt6ozw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mn9ST0CFDnroeWhaYB17XIeSUd3ay4KXz6tYIXuCuP4=; b=GQvsXdpI7kQ6uK6L2wHJFcHj0y8WlFSouUVhLNESuELswbtorTrIPiBzwyphyPdxnZ92Vk bh1Qa+OVsNAguJT8rhBNyg8p/rNSIo/hbrtbT/L556dHQKpfxdv1r4BBJMT410/TulGOsN 8YKaLSY1LqsGlH2D93gld0Gcm0M70EBKbkuRIoHyCmAFCOBP2F4k19rDIcS1Sm4mm8+GbU vIlxeRygJQ4w6aamcsoBELWR7nqnAhTcLd11Vqihnv1NoTG/Ufbrkif1ak+9SNecBITrYc oKWygR875z9Lj53ZXGrrpCd9XW9mFw7xaigT4t26IWahDUu0QYP27I120nHT2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048967; a=rsa-sha256; cv=none; b=O95IhpxynDHAqHyrEe7VS4JJKa19Yz/B7W97JOCwVd8NOHO3KaQ4DQyo83E6885gxrECSh 3Ci5d8AKyLAxqvUCWTbDb13KzudS5guuKZP3GRIsoecBf8M2kyo4AUK4RQHt4VMaKSxZch 26k0O4a3UK/ZosO79WYgdvy277Y7EgN71Wl8MB6l+Bd1byH2NPq481SJhKouIusMi650c1 zzufat+X4SRFmd1/9fgKVUR9Od2vSNu0Mko6p3bIqHF9ipMbkYzyqKbYBV6nyPjtkswPLI q5VHBEM8WadmFq/YBctnXa82MJg8nhKAo6I3l5BTpebfWOtVtzAEoN6dsSFduw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3B6RsWzM6n; Fri, 17 Mar 2023 10:29:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATQSN067381; Fri, 17 Mar 2023 10:29:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATQHU067380; Fri, 17 Mar 2023 10:29:26 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:26 GMT Message-Id: <202303171029.32HATQHU067380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 38b37099bb19 - stable/13 - bhyvectl: do not return garbage from send_message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 38b37099bb198128b309c08cf4583efd21e72f72 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=38b37099bb198128b309c08cf4583efd21e72f72 commit 38b37099bb198128b309c08cf4583efd21e72f72 Author: Vitaliy Gusev AuthorDate: 2023-03-06 11:27:10 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:33 +0000 bhyvectl: do not return garbage from send_message err is used uninitialized in some cases. Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38886 (cherry picked from commit 89fe7b98fe45cf56d60d0d4dfa1bfad3ba6908ec) --- usr.sbin/bhyvectl/bhyvectl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index cab1e6d72c56..5efccc085119 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1679,12 +1679,12 @@ static int send_message(const char *vmname, nvlist_t *nvl) { struct sockaddr_un addr; - int err, socket_fd; + int err = 0, socket_fd; socket_fd = socket(PF_UNIX, SOCK_STREAM, 0); if (socket_fd < 0) { perror("Error creating bhyvectl socket"); - err = -1; + err = errno; goto done; } @@ -1700,8 +1700,10 @@ send_message(const char *vmname, nvlist_t *nvl) goto done; } - if (nvlist_send(socket_fd, nvl) < 0) + if (nvlist_send(socket_fd, nvl) < 0) { perror("nvlist_send() failed"); + err = errno; + } nvlist_destroy(nvl); done: From nobody Fri Mar 17 10:29:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3D1nLMz3yBTj; Fri, 17 Mar 2023 10:29: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 4PdL3D0xVsz3Gh8; Fri, 17 Mar 2023 10:29:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CThum5FnHPXwPhEoOonLFE89n6PdYyr5/rsZIIUqOtc=; b=oTcpGUjGYmExgI0WRQyWl12gthT/ObdtIjqRpbgjjdL5todIebB9oRBS2SNHvcRZ0Z6tuK 8Sv2Sf86DqDJ/RX16dxX4qCsZuAgYPWxoOmAe8aa9NS4vpuZY2frm4UebtNxIDNcCkYBjg CD1zIfK956HT2P+YCubRefHV7qTtNL5Fa/nxHrf4eX9VzqWLVnzGrnzPSWaVVVDIU1SDOH YeB1TA+TtG+/fauHY/D5UO1/QvDcALy7Bvui+KajwUmGvo1E6hesSCU2Usq/uzYAY8RfoP HHxP06XjYsvuevMRNXi6TyFsRYe5dGnQwZp6SF94NmeE0Oi6Z8JhkSpPuTkJrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CThum5FnHPXwPhEoOonLFE89n6PdYyr5/rsZIIUqOtc=; b=ioppY/R0UbjqLtl1ACZhhGUWD3tExNzTzLphw/0PLvnQJ4LByYDyz1PPBo8wwjMiri7HLI +41FGuVSXzNbhD/lNMWP6ItmgpP59lUCtB6+FnnZim9nf+F2Rfe407TpfEiRvNEBDe6okK N+iYAGRDo1m8ZK3EOFXJOIiKsutsPd60hFJxcg627JEDBjshJfjmPutvMAsYxbpuLG8QpE BPNadyuYBeBta35NTxL5IBN+MqYIzZ5GrBwJmUlvlk6o7pUdugKJM5WChz6vDSy06DdsXZ Wu4KpuXLKYgjobOXRjnDxtb6kSp/IAGMRHzAFW80hCILWuBZNX9B27KwULqZMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048968; a=rsa-sha256; cv=none; b=Wo7PhxZT9kr/wIAOi6LhqKa4dSj73iX6ycWIbqoNda62B4wUJWoLoRCiLELff4ZvlxXS1X 9FXJR51MtgqVKd/yWw3XjamkNMYADo6I/e8vKfnouM7JrOBQ4Xat1eaO9nVl8Asj1iMQCo Yq965ZiKZTDz1SBtn/nkQqLMPKkRkKFex46vhMnxde/Ly9NTKm2bvcAYWEVNpQfwTp/1QR WXi9leKrGIYt7+fgWuqr+x77ONdHsJLkHg+8JUv4mB0BeWNrd0nPdSvl/9sOVby31WcytU +K0EQmfwhC4mGlBId+maU9jCnsIwB/VEK7nOLu3nqP8/Ayi6EWa0sogPYg2kJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3D004szMpX; Fri, 17 Mar 2023 10:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATRDI067405; Fri, 17 Mar 2023 10:29:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATR41067404; Fri, 17 Mar 2023 10:29:27 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:27 GMT Message-Id: <202303171029.32HATR41067404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: d2da92306a89 - stable/13 - bhyvectl: correct socket_fd closing in send_message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d2da92306a89e62f8858e449318a1183f0181a8b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=d2da92306a89e62f8858e449318a1183f0181a8b commit d2da92306a89e62f8858e449318a1183f0181a8b Author: Vitaliy Gusev AuthorDate: 2023-03-06 11:30:44 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:33 +0000 bhyvectl: correct socket_fd closing in send_message Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38889 (cherry picked from commit b64ba2426441ed33120ef0d3057417b7c0be6972) --- usr.sbin/bhyvectl/bhyvectl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 5efccc085119..59ecbebdfeae 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1707,7 +1707,7 @@ send_message(const char *vmname, nvlist_t *nvl) nvlist_destroy(nvl); done: - if (socket_fd > 0) + if (socket_fd >= 0) close(socket_fd); return (err); } From nobody Fri Mar 17 10:29:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3F4HYPz3yBQn; Fri, 17 Mar 2023 10:29: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 4PdL3F1wkqz3Gkr; Fri, 17 Mar 2023 10:29:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SL/QB5+kOCAfJlXc/5sOAjPQdHp1faBXt65KjYZN1V4=; b=iSxDnNwRDdPqrGiI37uD1idkKfCrsvB70ZGk0ErIBvoYm4VvUspuzw93/QUq/oFgaObBr/ yZvT4l6CXm472nKth8A6RzQkcKG2bACOpjO70RqiDqbsdd2FAyQdT8WKEWRyy/5HRRu4ra VnBYqE4eIPQHOKhe5Oj9Ad/hRVTN0rvuFYsVlGjF/1lSrF/nDTmip7enSWDlbMCaMYAIWI Gk+btrX/P2/jo+kLyf3ZhjC3HJikLsx0zmXBMyWYFpYhIy8tNjtq0SJljb6n0LbZ/z5uB8 MGdPhFQmJJ5bmzXTwi4QUFGBBSMHmXPGpjjuknqIMcaE9/UdDwub55oN+XvWeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SL/QB5+kOCAfJlXc/5sOAjPQdHp1faBXt65KjYZN1V4=; b=MdwmEgpPuCDZZSDLTcDxWcLHbTcJ05Xr5HvEr95Athv5gNUfTQe1zOLud0G+LjljFLgE5Q jpGfF++sTdltOjDwtfinmHUUm/nDs6H7aFCq2FkMk5/3bIWkxBWLg5VaE5E3Cv0WAqMuY6 RJz0YSZpQjN44Yc2vjk/LdGwBwMl3dnQqQLheWWHZREPTpMfZZZ2JRkAonccYwE7HNioa3 S8ZDMQ/jq9RfwQZ7VxqYtun/GzjLvEw7LaWFd3c4mp0hmEkxn/oHxexXJwzKqt9uDg8Da5 HPIi2+RGI2jG+s8gmE9J46+U8cipqV4pICfyWDY1CW+gUoftSsvCa+dnbe4hLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048969; a=rsa-sha256; cv=none; b=ZXVS0zPQKj9NpLGCVMW1RjCAtJ18EORttikTPXs/e3KfY5XPHzoi5Ig1Hso4EjGya138mr +JAVeVRHpKgV3agmTqQ7J+sTtit9NcJbltUp0qvu1wOZzfF3x+YUMX9CRunhw1WQEXSKxC Aj299X+Y0A0fX2AERAPJIRDkHmEfxl1Vt8haJL0IwtL8RHwnmQmALkgwWrrqnsJFYFsl6I VJJ8eDXd0OPbCE4/IAkwrnZdrrBDIiNA5DUw4zoq3pk3dA1uoahQ13kHvMgAEirK2djUH8 IqFQSytQlykbzrWvG6IIUM8n6b/rOCxrsrJxWKHqRAiOVMla2lTf2rJXAYtx7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3F0y7CzMmD; Fri, 17 Mar 2023 10:29:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATTtS067435; Fri, 17 Mar 2023 10:29:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATTWV067434; Fri, 17 Mar 2023 10:29:29 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:29 GMT Message-Id: <202303171029.32HATTWV067434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: f63fd20a9ac2 - stable/13 - bhyvectl: don't leak nvlist in send_message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f63fd20a9ac2e88c1b9399b3ef8fc8edb693d192 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=f63fd20a9ac2e88c1b9399b3ef8fc8edb693d192 commit f63fd20a9ac2e88c1b9399b3ef8fc8edb693d192 Author: Vitaliy Gusev AuthorDate: 2023-03-06 11:32:17 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:34 +0000 bhyvectl: don't leak nvlist in send_message Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38900 (cherry picked from commit 942525ab47e9cd9277ac426e082366d58d7bbe41) --- usr.sbin/bhyvectl/bhyvectl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 59ecbebdfeae..4aa235e00489 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1704,9 +1704,9 @@ send_message(const char *vmname, nvlist_t *nvl) perror("nvlist_send() failed"); err = errno; } +done: nvlist_destroy(nvl); -done: if (socket_fd >= 0) close(socket_fd); return (err); From nobody Fri Mar 17 10:29:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3G4d9Pz3yBNW; Fri, 17 Mar 2023 10:29: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 4PdL3G3Dfzz3H5Z; Fri, 17 Mar 2023 10:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kB3olxNFJ8R3xQJJ4Ut24n2o+ocanYZSaWsunEyURIU=; b=TMi0kfAL3/sRM9rhHyMTksbl0ZJLgsarVZTbwa6B8ylcW9fu1bcaXvGwy7S9vqognta4Ok ZIakWw7S7eIujKupM6frR4Q08Doi0XG+qHPRVQSNWk/cvXbvwSq2DMGJenbNFWkaPv2lB5 pBVoQlCYAZKsnNWNX4O9f+pZLzc7b/E2lNmH/ZuDH31lm+zmRHKuIpLuVtBMnmctDWbP+V /n7+9p1sASOReFZBmB9aSkuEyfyDT0Q/ycl0uev9xI4lySy4cBotC/CDCECyCf470bLN76 UKQCpmHR78Ic50/qVSpulu0MNvi97A7//GEimAy9w0jUljojkLgRKnee3/+kfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kB3olxNFJ8R3xQJJ4Ut24n2o+ocanYZSaWsunEyURIU=; b=YI0owbOz0ZW3r8FGtZCDuN8+0nHLqy19hRBMLaLU+JClqHZOo0f0Wd0KNnoxSNuprlkSud q+nijvrC88b0fmEbi2MQqSrLBOhL6xD4DDGuIHDIH6S37EJ3+OAizwdu+q1Zw0dA4UgiQP tFc9pBf7a2RRQMqQ1zL6baCtR8+Zyd/46HicERfWhywnp6cg5JTTwFJ3K8Bw9jgWMQMWGU 8RN89hBbX0/pe5pkJN00VTO5h3jpD0JONed4Z4y+nMCkE0pd5rDNcXsoW18qjIdLh6olYb P9vhg2n0E4SEgpltRMPBXVYJRdfIVJDSJ72hp9ISChoOh+yTJPh9TbyWzk1msg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048970; a=rsa-sha256; cv=none; b=esM+dFaMvuueBhmGfN+1SzBZCYM0w0Yhgdjn2DTJrH9ufP1B2jTsMmlzQsY6NjkfpnItuP Wwyc7N+LzatVvCCs1jbSxYN2mN0AFZ2o1tLaCSxGBlkm3SYHi/TZWsdDPFOaBf15s67TGe wP66KoFY4QscYpIe+slXDtNMxttce14ukW7CYbZpL5OyF84CPllyt6rYuw2nWOXtD3MfVq wKqWftlF23AX4R2dfIZP/1Uy3twqdhF+ZwwqW66suJ2TMmxSUG0cHfIyFpAwAQdADlOwBb rbY5n3Ptp5DNp0LAhaHcyukTjUv1bGzqzZSLtmVV1jgSdkfyMHTa3kO7+Jrmvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3G1spJzMpY; Fri, 17 Mar 2023 10:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATUF0067459; Fri, 17 Mar 2023 10:29:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATUsc067458; Fri, 17 Mar 2023 10:29:30 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:30 GMT Message-Id: <202303171029.32HATUsc067458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 1606dd1d87f7 - stable/13 - libvmm: add missing ioctl's to vm_ioctl_cmds List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1606dd1d87f7b3a1844bed239b1bf916208a4436 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=1606dd1d87f7b3a1844bed239b1bf916208a4436 commit 1606dd1d87f7b3a1844bed239b1bf916208a4436 Author: Vitaliy Gusev AuthorDate: 2023-03-06 11:33:58 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:34 +0000 libvmm: add missing ioctl's to vm_ioctl_cmds Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38866 (cherry picked from commit 755dcd5e49133e18b735de3e53f3bc79a8377082) --- lib/libvmmapi/vmmapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 0c994778dd10..451d679dbbba 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -1753,7 +1753,8 @@ static const cap_ioctl_t vm_ioctl_cmds[] = { VM_RUN, VM_SUSPEND, VM_REINIT, VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SUSPEND_CPU, VM_RESUME_CPU, VM_SET_INTINFO, VM_GET_INTINFO, VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, - VM_RESTART_INSTRUCTION, VM_SET_TOPOLOGY, VM_GET_TOPOLOGY + VM_RESTART_INSTRUCTION, VM_SET_TOPOLOGY, VM_GET_TOPOLOGY, + VM_SNAPSHOT_REQ, VM_RESTORE_TIME }; int From nobody Fri Mar 17 10:29:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3H4cB1z3yBWw; Fri, 17 Mar 2023 10:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PdL3H3gfFz3GyF; Fri, 17 Mar 2023 10:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3cccghnQ6dK8VYnimsou+sTOzjs6LRa/eRTBwCnfc8A=; b=V0sEeK22Pdd2HCU/cSD+GcQ3YPFT01o9C4UeMFMaq0YiBmjcnO5XQzb/6VUUr/KI5jleIA MVZQBeuu+2xzT6TNLIV5rOfJHx/sHfn/Up0fTIw0HQz1naUzS0oQBiQBF5e6vJ4LzHDK5I so4Zi8tn8kLTa8a5sf86Q8IQuYGLancaASRL4cvWZUmEW3TE2VkCiW4LRN/I22Mw4HUpkQ kFbDUj2GKkV3eQES58wgF5xTJn4Q/xN7ePOF38l7yqnPDOSN1+1iJFrpBbFHy93Um/Vpsw w20qeVPedhB7mj1gv1DJgnBYHAabfRxRrgirX1bOMYMqJ3ZZbNmcsQxLugSU9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3cccghnQ6dK8VYnimsou+sTOzjs6LRa/eRTBwCnfc8A=; b=mSIgzvFAYT4SANrjz/6GDRFy1d90zJIXCw1xB0JiAlZw4q4VzHIXxMoqWKWGtl30H2YkeN brj+RJIoIIFnG+tiYPtU7MO0/Bs/G5OdJYUiv1boFvKkTS95AUTIfZbHrA2tvjoqF9bqxC /Cfl6p/PE6bQLRyp9Mwbd5jzVXXVdYa/x4TeLKtHSGa9WfQwii00Lol3mYKwC6JyZFLwoQ pGhzZPJl0uYRkp2PQJ6Moi89o3WgDB79nPxC5F/BVp167QDaql4s0n1q0ewcy7U4SgnRNL eEsXVxJtV6ka0b+mTGHbhhKMAfhzZhmZGTpMu5v9Wd8BqGCa+BCc3Tbzy6hhnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048971; a=rsa-sha256; cv=none; b=xr08zPOqr6jGsV57vGqVyKz6s3qL+jrzh1xoKMkeNlleiZVWIZ2H7vOytQ+NAPNqgRgUUy +npa3H0MiN1nIWtou+mtSEJkvxwibKm+pK2ysbd8xiW3uwkBxvkOSuMJs8vnM6Hr8y640q tpllaorBH9E061EhVBCHJqDlRTN5Iohp/emle6uwyW43f6Q4vfJXy6e8Pev/om5FpLpuYS wnR/hxhC7nDHI0HA85JQvfZeapp49rUy11umdZzJeDvOgRFyepiQZxDnTJS+42WfLm2p4G fO4mX8fJUirjWnHwoMUCLhJppuW+VSrTHuVDbVhfIPUMJ11qBdPVX0QKfaXs3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3H2dG2zMjx; Fri, 17 Mar 2023 10:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATVOb067484; Fri, 17 Mar 2023 10:29:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATV48067483; Fri, 17 Mar 2023 10:29:31 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:31 GMT Message-Id: <202303171029.32HATV48067483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: c8b5f347317d - stable/13 - bhyve: don't flush readonly device at blockif_pause List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8b5f347317d1d0dca53acf2f40682314ad0b64e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=c8b5f347317d1d0dca53acf2f40682314ad0b64e commit c8b5f347317d1d0dca53acf2f40682314ad0b64e Author: Vitaliy Gusev AuthorDate: 2023-03-06 11:35:17 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:34 +0000 bhyve: don't flush readonly device at blockif_pause Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38855 (cherry picked from commit 5c0a03125988b89610f61a1bb2137b0e29d7cf31) --- usr.sbin/bhyve/block_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/block_if.c b/usr.sbin/bhyve/block_if.c index f2e60f865f78..edf191491de1 100644 --- a/usr.sbin/bhyve/block_if.c +++ b/usr.sbin/bhyve/block_if.c @@ -993,7 +993,7 @@ blockif_pause(struct blockif_ctxt *bc) pthread_cond_wait(&bc->bc_work_done_cond, &bc->bc_mtx); pthread_mutex_unlock(&bc->bc_mtx); - if (blockif_flush_bc(bc)) + if (!bc->bc_rdonly && blockif_flush_bc(bc)) fprintf(stderr, "%s: [WARN] failed to flush backing file.\r\n", __func__); } From nobody Fri Mar 17 10:29:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3J6WpXz3yBV3; Fri, 17 Mar 2023 10:29: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 4PdL3J4KhMz3Gym; Fri, 17 Mar 2023 10:29:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oJzSkw+QaoseRBlUk77FifLRg/795Q1CgFh83hjox3s=; b=o6LlwN0MCqIp28nmA7WW+W0cuSJs+EpxUJ4z+28528fOMMQQVrc70HZf7UpYtKM8b7a/16 pm6uBr6TXI7w8KU8g9MCLJaeOqLQBfKmUEudNGWpRtBZifSF//p04Ahuw9qTS+WT940wda P0yapr/hVgbGkVRMM2u0POtgmYFspGCz4sODxP+YU+sDqzrMtzVFLmyzVQchY+jL0UNdN8 Kp+xD1lcgI/IB/uLeZsRTtL4/sgk5Ce1u9k80UUzdTNn9OxKCIi7HqYIfUUANd36lRFoLt TthJ8LoXC8C8A+qt2W8Ht5MpaPps1hXPqUG8rKe9n4Tp7jJ7eNV/wdtkvxBPnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oJzSkw+QaoseRBlUk77FifLRg/795Q1CgFh83hjox3s=; b=BbJ1AsTIb5fIXY8s174b3eWpmErzYZ04FekAvFZ3QnXd8OP1+P8xSY4EvxixDz1stDDwUE w61kWJbBgMYCW/XJyKpr62wMF216IddlDiriFyup10VS8mcYSDgCQip5rR+WEFojtq4WmV jsbnK1ByghDe5MxkDUY4RmiODaUxKaGSDer4wsf/mNPrO/bOxoFQwTagw2jCnTerQAde6v NqhFV6pVC4cEzNCbSaNFuCLJcOdh7k8mQqh0Arj3uvk9yxNXcATwSRoGDchwJVl1rOyIIJ IrNsVPT7FjID1meGzDRNEFqgOe9W9RWj996fGTZqvXC9ykIEe4kiMDG2tVUaCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048972; a=rsa-sha256; cv=none; b=E7OggwJsWZHcPQ51+d4TY/YtIi1upd1kot4/GjxjSazIk0jma2vLbN4iQ8D2DQeNCxoCps HNpamVyBuY3OmH9rRBgIe32HRWEf+RdcBPyjD2YMVM4WqQHOaYZT8ecxubEolxBfOC7FRb ec8NXpGUEScY98NlyCEbWY+/YtfNNgRERh61qq7gqBdl8gqWr6iZ2NTMrR8c/mHXeaU2dd UCjAJ/CRA4tN+BcdBeWiAtgibs5RrCuROwlHzAhAr8Vg2eOvOuP74Yr0VsQXFLhAY+pERt lsePqu9xqXoGInj+TrmnZtlxN84I7B4iz2pxxeYs0rN2i57Ww+vefRlh1X9J9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3J3QQlzMpZ; Fri, 17 Mar 2023 10:29:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATW5x067509; Fri, 17 Mar 2023 10:29:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATWqe067508; Fri, 17 Mar 2023 10:29:32 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:32 GMT Message-Id: <202303171029.32HATWqe067508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 2193f12bf8db - stable/13 - bhyve: add cap limits for ipc socket List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2193f12bf8db21ed1c99dbe02573bb0705a1466e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=2193f12bf8db21ed1c99dbe02573bb0705a1466e commit 2193f12bf8db21ed1c99dbe02573bb0705a1466e Author: Vitaliy Gusev AuthorDate: 2023-03-06 11:36:40 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:35 +0000 bhyve: add cap limits for ipc socket Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38856 (cherry picked from commit 577ddca90877e377e5b40c8baa15fa5b7a3c9965) --- usr.sbin/bhyve/snapshot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c index 6143f6f3a489..37aba32a1929 100644 --- a/usr.sbin/bhyve/snapshot.c +++ b/usr.sbin/bhyve/snapshot.c @@ -1517,6 +1517,9 @@ init_checkpoint_thread(struct vmctx *ctx) int socket_fd; pthread_t checkpoint_pthread; int err; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif memset(&addr, 0, sizeof(addr)); @@ -1547,6 +1550,13 @@ init_checkpoint_thread(struct vmctx *ctx) goto fail; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_ACCEPT, CAP_READ, CAP_RECV, CAP_WRITE, + CAP_SEND, CAP_GETSOCKOPT); + + if (caph_rights_limit(socket_fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif checkpoint_info = calloc(1, sizeof(*checkpoint_info)); checkpoint_info->ctx = ctx; checkpoint_info->socket_fd = socket_fd; From nobody Fri Mar 17 10:29:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3L1FrVz3yBcK; Fri, 17 Mar 2023 10:29: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 4PdL3K5FlYz3GtP; Fri, 17 Mar 2023 10:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uwJ6q8tE+aV4CUyx/9jsMk+Zqwh0JvTznUJykzTKJpE=; b=DMbfqKtOD8CyO0G3mKw2v4qKzrdVPpCTKxwV/BHWKLwijeOyIiU7Z6yKREibD/Uibr+z+1 H02wJqAbIjrNtevetGnYClDiHbKeorFFIStWfkN2HyVDZSDHtj+uJy1x/Ju24pYDuXTuE7 mVZ9y53uhh8Zuspx+ZOlzJXXajlxJeg8BrBcBFb9bK1sKEXwdFtAHAdOamx+nrJAz9Kgep 7myUbIQZ5imudIo/KSVTdpnRwke1jHNQ7dpxPSY9ORaGVGUI3rtHwWAULxkWwEVqnkf9M/ 2Tlz+i46r+5D3yJGEONWijFDdxKWDWrKmcDaX11CXea4opa6RiB/SM9/qJzPpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uwJ6q8tE+aV4CUyx/9jsMk+Zqwh0JvTznUJykzTKJpE=; b=pNRgBOfmkZNk3vOlWUGjnSqyYTZr33coZS9kdiDoR1LIFd+RWU4s4BShOUbumOb4tOj4Zu FE3KXHAVMggOZ8AgDy475ZHXUHktGL/jgr34BcoRBg6G/xOZtZ5Xukg/085yv44MEukOlH sUVXbTmfjZH+OSAMJhs93xK0d+zWKA6S6TJr5HGnKxMIVFOLIDbBBITAL+pMA7Z5DPsTlU RfKnUHtlbh+eMeun+Gbb6NrTToJsyPNQ92p05HCDXzEk9pUmxQLA1ZWjkSF0vDrghq9CT/ VIRbkn18N25GO/rE7+JiY5WAgM0gVW19JXlWMnpI60GvomZVBonmksBvpJOTRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048973; a=rsa-sha256; cv=none; b=k585aIglGmnVgW8bF4WNzPAmRdbCEI23H97tve/svEZ7mxzCsEfQpbT1ij7/JlvzjiHCEK yu58UdKO7bfUZ2hAt3k1ndwxReHBR+M4G/ojZDTf3LBTV2qbudXhAzmSk9jpTUeXB8dE72 F4XqrXb4bD1uBcm6Jf75DxqzQEE0ojvh70AKMygbVAlfCfyji5atNe//FJ4b9u5UvrMVfM r0GL4K4wny43Kf7wyhqoK/0CQJszqYFlNWxhQTsgddamP81VT37G/8TP/i7/GlU4GjBHCX 2cyPt16XtbPKR4vtvHzXhLrp+b8nQy1vXKTr89lxZDqW9nK1wZrYK06SzIuTAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3K4MMbzMLy; Fri, 17 Mar 2023 10:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATXeM067533; Fri, 17 Mar 2023 10:29:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATX5Q067532; Fri, 17 Mar 2023 10:29:33 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:33 GMT Message-Id: <202303171029.32HATX5Q067532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 6efb053bea5f - stable/13 - bhyve: exit with EX_OSERR if init checkpoint or restore time failed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6efb053bea5f94e2c29adafcaf5b9c56d99fa220 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=6efb053bea5f94e2c29adafcaf5b9c56d99fa220 commit 6efb053bea5f94e2c29adafcaf5b9c56d99fa220 Author: Vitaliy Gusev AuthorDate: 2023-03-06 12:30:54 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:35 +0000 bhyve: exit with EX_OSERR if init checkpoint or restore time failed Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38872 (cherry picked from commit d213429e42d48c7de56baf60befd5d953654d337) --- usr.sbin/bhyve/bhyverun.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 3ff83f55474b..bf7b4856a2b4 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1579,12 +1579,13 @@ main(int argc, char *argv[]) /* * checkpointing thread for communication with bhyvectl */ - if (init_checkpoint_thread(ctx) < 0) - printf("Failed to start checkpoint thread!\r\n"); + if (init_checkpoint_thread(ctx) != 0) + errx(EX_OSERR, "Failed to start checkpoint thread"); if (restore_file != NULL) { destroy_restore_state(&rstate); - vm_restore_time(ctx); + if (vm_restore_time(ctx) < 0) + err(EX_OSERR, "Unable to restore time"); for (int i = 0; i < guest_ncpus; i++) { if (i == BSP) From nobody Fri Mar 17 10:29:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3L73RDz3yBV9; Fri, 17 Mar 2023 10:29: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 4PdL3L6GBJz3HHq; Fri, 17 Mar 2023 10:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GNNeFJSuc5hCIfoEYbFvl7fckekEIzq4OT9cs9rkGqI=; b=xYIaSus6UoNHjkCaw545tQBoWIYnfM0TspF8JRvwuLnEj9OzJG1Nhe9V/30djTQcFbMq78 ScO1B3VGPI4tEFHDrMXcKNbjBDtCpIWg4124Dpi6zI8tGbDGnlNejDj15Q+bRLdAxKtvUS EmCPJi/H7l4x4Xig2ZBOExugZrHrOwApp1BX+s3CGU3BA668yTvjJR5C8GY1EDnEE7M/RF AoqefrkFdkh4H3pSiCMFiTguyLec9I2NSf7mqG8m2ptsFA5G21xDzlC/DQDdgATTDox57e boupOtdn/hvoULbnR8fbAKSz3siVg9i1sbpYkbqUMejBXkt+PsbX7O66sYtq6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GNNeFJSuc5hCIfoEYbFvl7fckekEIzq4OT9cs9rkGqI=; b=giooklYibxnASmDeTJcq+A5SdZ+2IAaKrWI6XaLT3Ik26wQiTMMfVxlEmwEclgd8wd3whM ZgcPH1qHcGa7Qz66R45P6iDQMOWjM89CWI9upUYLtRny2TQJEai9vXON360tgC4qSAwh43 Ne33Ge1KjDq+9qVL+WJk33Y/I6B7MUoopCIwzASyMKv0G4LGwB0pMxPfMQWvoFhp4SQ44H ziuJ8tmdQqZr0GjXwF+7A99cy8maUyfV3HBjDy9qerzUBg9EXl5puV59Vt7WHNLdtyKsjb XNhBiXZv9YWSZrImhZGJjnsZirdXDjGdnLheyDeHrdZndw9bRlE73OkRpyHhig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048974; a=rsa-sha256; cv=none; b=sF3DDZ+cWn+HE5L8CN+Ht/zMqTcw8CqgLzaRlr6177TsHWgDytvpbHYO1UdVI7gfuDMfFv 5jOtuPLHy0A/fJpiSbNXYvm74MqkGMjsYwLJO3Ps4/BJv4sJhmd2Z4ZyfFI1bASoGKlfi8 7weAL9kVjVJ3VND1RJFn2pmTiSSn0ZMqUG3YFA2GI/r4ESVKJDTz7l36+zQY8NW9rRa4dp x4kW0g3evbtv33PF85tTbDbeE6SZis4Vcdsy/Ue+ZEIeDUAlsQUsN5ABmsL32lqZxfHVnb rX0V4i6WwEbk8N907I/W6oUg80iAA2MLPWU8WKpWIiL45MGkCsP3MRpSM157AA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3L5DZ7zMM0; Fri, 17 Mar 2023 10:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATYK3067564; Fri, 17 Mar 2023 10:29:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATYxm067563; Fri, 17 Mar 2023 10:29:34 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:34 GMT Message-Id: <202303171029.32HATYxm067563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: c8ec366fd73e - stable/13 - bhyve: init checkput before caph_enter List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8ec366fd73ecf80348e2a7b019d56aeac0a9f00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=c8ec366fd73ecf80348e2a7b019d56aeac0a9f00 commit c8ec366fd73ecf80348e2a7b019d56aeac0a9f00 Author: Vitaliy Gusev AuthorDate: 2023-03-06 12:35:21 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:35 +0000 bhyve: init checkput before caph_enter init_checkpoint_thread binds to a socket. Bhyve isn't allowed to do that after caph_enter. Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38857 (cherry picked from commit 9a9a248964696f45260ea026aa5f9174cc86b137) --- usr.sbin/bhyve/bhyverun.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index bf7b4856a2b4..702ef0e12690 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1562,6 +1562,17 @@ main(int argc, char *argv[]) */ setproctitle("%s", vmname); +#ifdef BHYVE_SNAPSHOT + /* initialize mutex/cond variables */ + init_snapshot(); + + /* + * checkpointing thread for communication with bhyvectl + */ + if (init_checkpoint_thread(ctx) != 0) + errx(EX_OSERR, "Failed to start checkpoint thread"); +#endif + #ifndef WITHOUT_CAPSICUM caph_cache_catpages(); @@ -1573,15 +1584,6 @@ main(int argc, char *argv[]) #endif #ifdef BHYVE_SNAPSHOT - /* initialize mutex/cond variables */ - init_snapshot(); - - /* - * checkpointing thread for communication with bhyvectl - */ - if (init_checkpoint_thread(ctx) != 0) - errx(EX_OSERR, "Failed to start checkpoint thread"); - if (restore_file != NULL) { destroy_restore_state(&rstate); if (vm_restore_time(ctx) < 0) From nobody Fri Mar 17 10:29:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdL3N0ngHz3y9rL; Fri, 17 Mar 2023 10:29: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 4PdL3N0GVnz3HNZ; Fri, 17 Mar 2023 10:29:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tOEO1ibatqtV8Wwvi9ZoXm9UQpeDjF034e+WJjGc2J4=; b=GyCajnxuux8VtrpVdbIrl8Tp7zp64wyfUPicvxJtKZBlpkb6gVuyKUHenTynOijnJqwND/ 8BYN/wm8WHxk5L8991oo+pAoOXwvzMQ3fc4qKan4CErjQmwz8nULQUB18J9cenm7apRKjG 1kL6L4jSmUw65IrnN21bbpuNUmB42VcIUdlwP6Hki+ZR3t42QgYDEKywlxVdf6deYkBXb5 RR9xZtyHrNrnaTRUZCNsiloSbuQTKFzGKi+UspLJ4kZf1uTFfp0fpj8pW4sPjVkp34+pz4 YJuvwSybu35pBA2j/0Wy0CjBu+H2d4pK2RbqGLR+IVsuZYV2x/N4p1ZVXXyDwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679048976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tOEO1ibatqtV8Wwvi9ZoXm9UQpeDjF034e+WJjGc2J4=; b=LbgMdmr+lCQVxv/I5T9mcV7YlZK7tqrmqj+FwKjFM1sA93sy0hARd0IL1i0x2RX869mini q0U8pBIXYd31Cm7nr1eu4aSnMeFquD+MOso3Fow2VBjtchAcElP1eM9geB2Ro/Kqd++1FI fmM4qg9VyuHd9lUokhH3ZUj5tNGcdT47nNWOU0Bndqwj7L4lbaj1k4UvdowcuCMaxqIMLn XQRwQmRZGg3ew+3swKl0aaFIXZ1BvGzR8l58Xei2NAT7BpuqbnsHeVEJeJvKnn+s8zMhO8 ztV4k0Yni7TlK4IpW/lKHKD5fttP5gKjupHXjEm/bnmxj73zruPZrQAFVw+GvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679048976; a=rsa-sha256; cv=none; b=IEcfYx/qIc4ZQHwKbkcuTD91QB+Ge9gAt7JZ1Nm/ynmUQYS25BNajTlCoMz2uK/YdfY3VM sZWNnfL6njCqZ38pezgRsLXnGLW5NewoQfdjbFv4poWjDVimZaObFAYbv3kWmc+hDmLweN zbMezh2riq5mypJeagigeiCwYFnMoO6RPYt1FfnOVYtEcT3MtuVmlwwAW5bu1QzqV9ivRH HM1h1oRYfGWmAddS1Cmow4eIMhN/GXK+HSb7e1Wlv/2Wbt94uwgyx28yWgoPR8QdQuBQLL k0pbMymd/oqQT7hDggebmtThHoLEp3m9CikD4hdcdQWwfWx2HXpOP++8/Kq5Mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdL3M62VgzMpb; Fri, 17 Mar 2023 10:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HATZeO067591; Fri, 17 Mar 2023 10:29:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HATZlE067590; Fri, 17 Mar 2023 10:29:35 GMT (envelope-from git) Date: Fri, 17 Mar 2023 10:29:35 GMT Message-Id: <202303171029.32HATZlE067590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 4e10f8056b24 - stable/13 - bhyvectl: don't permit using --suspend and --checkpoint at same time List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4e10f8056b24df320fdc0c2d520461e3155597d3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=4e10f8056b24df320fdc0c2d520461e3155597d3 commit 4e10f8056b24df320fdc0c2d520461e3155597d3 Author: Vitaliy Gusev AuthorDate: 2023-03-06 12:42:15 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 10:26:35 +0000 bhyvectl: don't permit using --suspend and --checkpoint at same time When using the --suspend and --checkpoint parameter, bhyvectl will produce two checkpoint images and the exits. This is slightly ambiguous. So, permit only one of theses parameters at the same time. Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38887 (cherry picked from commit 062f2818c1ad35bdc3d520c7572e3cefda657770) --- usr.sbin/bhyvectl/bhyvectl.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 4aa235e00489..e5789eaf30e8 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -86,8 +86,7 @@ usage(bool cpu_intel) " [--create]\n" " [--destroy]\n" #ifdef BHYVE_SNAPSHOT - " [--checkpoint=]\n" - " [--suspend=]\n" + " [--checkpoint= | --suspend=]\n" #endif " [--get-all]\n" " [--get-stats]\n" @@ -299,7 +298,6 @@ static int unassign_pptdev, bus, slot, func; static int run; static int get_cpu_topology; #ifdef BHYVE_SNAPSHOT -static int vm_checkpoint_opt; static int vm_suspend_opt; #endif @@ -1743,7 +1741,7 @@ main(int argc, char *argv[]) struct tm tm; struct option *opts; #ifdef BHYVE_SNAPSHOT - char *checkpoint_file, *suspend_file; + char *checkpoint_file = NULL; #endif cpu_intel = cpu_vendor_intel(); @@ -1905,12 +1903,12 @@ main(int argc, char *argv[]) break; #ifdef BHYVE_SNAPSHOT case SET_CHECKPOINT_FILE: - vm_checkpoint_opt = 1; - checkpoint_file = optarg; - break; case SET_SUSPEND_FILE: - vm_suspend_opt = 1; - suspend_file = optarg; + if (checkpoint_file != NULL) + usage(cpu_intel); + + checkpoint_file = optarg; + vm_suspend_opt = (ch == SET_SUSPEND_FILE); break; #endif default: @@ -2385,11 +2383,8 @@ main(int argc, char *argv[]) vm_destroy(ctx); #ifdef BHYVE_SNAPSHOT - if (!error && vm_checkpoint_opt) - error = snapshot_request(vmname, checkpoint_file, false); - - if (!error && vm_suspend_opt) - error = snapshot_request(vmname, suspend_file, true); + if (!error && checkpoint_file) + error = snapshot_request(vmname, checkpoint_file, vm_suspend_opt); #endif free (opts); From nobody Fri Mar 17 11:07:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdLtt6F7Jz3yD2N; Fri, 17 Mar 2023 11:07: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 4PdLtt5hW7z3MkM; Fri, 17 Mar 2023 11:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679051238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ml39mn0roYAhOwWJgxES1X64YZOvcpgSoNDdvEqug1U=; b=y4rV59Ic0/KhMIX0Vr6W2va5mm4RAVn9EnQ9Ia6ycYiB6Jcj7/rV+Gz06HYw2CyXOgtMfl HrwSpl2A3WzT65zktfPmQtIloIuzC2klaTWspmALX0w0fkeEiSnLjvW5P3exeRXp1e7fD0 /OYbWljfTk6XRIVtYEYDE5TK4ggVLVU1CgofFzcvnDvC56LTLtgufHbLy4N2StRjPzFY8Y oSnnrgIeHui0//XwYox5IEsPb8Uj85kG+ghJEDuIpMBXmAIs4H6111LNZ44rDNZxlvv14b hiQREofX1VRTNT5loTEqfmO79MA1bM+off6rGdFYsz7wba7XgF4+yh/qQ5x4wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679051238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ml39mn0roYAhOwWJgxES1X64YZOvcpgSoNDdvEqug1U=; b=aRbgCxrs5GZqEMlukt85Z9FhkW5udWjc7ALaC3Uudde65M7IhgN95Yg0kBNAVNF5lreIwW +ZAhPu7epngsvJHMnemPI09g/uEyv6O+o2V7lmpX5dzD9XwN+JP/TAkXuZFVptd2vdB4Ld A62MxKHONobiFj38KMHbBFOPgHQ8xoiz1paQjePus6PIH038wsQnLmLraohq8+Of/5GRws 1JWOIYpHUGkc/TYxywAeMMVe5bst9kLVIuBgMF4Qvoae473+Xj3YS7rVjkRzhfFgKL60OR JfYMayexYdeoOM/C1n5GgTnuZ488vngiFjgXkURJ+d57Rqd/xSflINCD4DcUwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679051238; a=rsa-sha256; cv=none; b=BBk3P/F1xA2IVQwPa1wISyXSatx6TlldZAil6N1INRGc/nCzViB9Y4fXkKi+dpDA8bvUom QUkRkV9Xy3E4j9SkQTz4SlLthaYQky+Q22+By5Y5IeigqILqookF3q9DaScsZSNKKdxr1w oAI+ZKrJghoArUtrYEcQlASFXgeb84SSIqsnoLN4K0i4Kgr7C2Ol1OvutcK7XgvpCnzIOC 2IlINyZaLwyLWIKguerbafWcSVbN8OSPM8O2Zlg0sQikvi6g/7gA5lf1RYaWsoJXYvSNKc jCbqwVpzvT9VtTUA5YSe8iAz1e11eIg2iYz7wFk8kAITcDoS5SJlrveQqlrAog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdLtt4kDbzNj2; Fri, 17 Mar 2023 11:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HB7Ig7033222; Fri, 17 Mar 2023 11:07:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HB7IRl033221; Fri, 17 Mar 2023 11:07:18 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:07:18 GMT Message-Id: <202303171107.32HB7IRl033221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 7861fce32b4d - main - stress2: Fix compiler warning List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7861fce32b4dd76fe82b405c4fa4d42b3252846c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=7861fce32b4dd76fe82b405c4fa4d42b3252846c commit 7861fce32b4dd76fe82b405c4fa4d42b3252846c Author: Peter Holm AuthorDate: 2023-03-17 11:06:52 +0000 Commit: Peter Holm CommitDate: 2023-03-17 11:06:52 +0000 stress2: Fix compiler warning --- tools/test/stress2/lib/resources.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/stress2/lib/resources.c b/tools/test/stress2/lib/resources.c index 935a085a58de..1888d1fba87f 100644 --- a/tools/test/stress2/lib/resources.c +++ b/tools/test/stress2/lib/resources.c @@ -149,7 +149,7 @@ usermem(void) } static void -cleanupdf() +cleanupdf(void) { unlink(dfpath); } From nobody Fri Mar 17 11:33:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMTJ3pTkz3yFgd; Fri, 17 Mar 2023 11:33: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 4PdMTJ3DmVz3PfB; Fri, 17 Mar 2023 11:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HIbYfQQRGw51nNxeGHnc+2CzTCi/mOZESezI44/D8sg=; b=hwHsrTRKMI0iVOQwVRBX8A0f9rIUwluRIyTAiLvpOI74UOBxuq66/Rf/1uuE/msixCHONl WJIK9iEaLsYG7GmzeVGbUImzsJ5BYVRrF1L0hXlAONavKOeCxTIV7cgGXFrfD3sJsYNNVI QX7n0rO6xQQg203FcDeO6orv049zCkVIRJP8/KTT0yTfX89FWxWiXIu0KNrHHKq3JAEX9n 1d0JfHawvHAy/LPKkIaw2jU6gqanlZ5r0L/BOO84mOcQ2MSi53FO5W0XGRmiiPOY+U/yZr IIXmLVXgi/G2/MbwIPzugbqVp8Fml6vS4ri64dEB/TM4frBC+sj15c7S0kxElg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HIbYfQQRGw51nNxeGHnc+2CzTCi/mOZESezI44/D8sg=; b=MeIFzMKCoSSJ2ZhRbo9u9JrMsqzH6ZXeLYvEQPLMekHSc7o+i4kCSEzE0sxEj8m2pMkWY/ NcxXizbXcwMLCOWC/MtvVmYdG3fHgLi7/0AYvFWz6d07NrDSYCMv5fNbb3vAq/W7AhaVHW 98/Lda8IP5VTvo6enyKkPPeqTN8DOWUM8lFKuxb9XE98N8YfC/lh3s7bJO2I+fYvFTJD3c bxf/l5SOzTsq6gizUQ6xlHDMC7Vl39X8zHqGh3Un2RCswk3z4w3W0qVo1xCt1gI1eHUA6h SGgoVNna1hK5BKR0vwnDXe7bXkyxRJ9PJlTX3eYWDUCDFhRa7Qmqer3Y/DbaLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052820; a=rsa-sha256; cv=none; b=BCRYDCzPOmBtXVrix3gIPqzF29NYra0zdrNYXia+DauHlJW2qdt34w91pEsPptEf6jvlRF aktgin6IPGBNUS7W6S6NfMsY/GCeAgWl58FII5oKPsFGlE2xyR/iiEAkUUBo4bRKbgIdoP eBZDO6dgZn0nUWA9jnolagxwvrkT3V7IhAdX9JFvn0QqQ7hufJ5yMr2rZsODhypjbZvYFf Xz556Ay++ntm2Q971UzM3MilOhMuABi4+jCioIIMlKhfdLskUdTU3ZktIm+qDtaEBVNcc6 YwjQjPmT1lWCiwee/ePnJolBkq1AVsfMYw4b6ixPNu3+0Bnn+BGbuCAPE2M1fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMTJ2FzGzNxy; Fri, 17 Mar 2023 11:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBXea3081780; Fri, 17 Mar 2023 11:33:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBXe07081779; Fri, 17 Mar 2023 11:33:40 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:33:40 GMT Message-Id: <202303171133.32HBXe07081779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 031461b1666e - main - arm: Remove kernel config APALIS-IMX6 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 031461b1666e31280405dc89f7361c27d9e44e52 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=031461b1666e31280405dc89f7361c27d9e44e52 commit 031461b1666e31280405dc89f7361c27d9e44e52 Author: Emmanuel Vadot AuthorDate: 2023-03-15 09:17:24 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:33:46 +0000 arm: Remove kernel config APALIS-IMX6 It reference to a non-existant dts file apalis-imx6.dts so unlikekly to compile. Aldo IMX6 support is in GENERIC so anyone interested in this board should make it work with GENERIC kernel (if that's not already the case). Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39086 --- sys/arm/conf/APALIS-IMX6 | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/sys/arm/conf/APALIS-IMX6 b/sys/arm/conf/APALIS-IMX6 deleted file mode 100644 index 084bee232a12..000000000000 --- a/sys/arm/conf/APALIS-IMX6 +++ /dev/null @@ -1,31 +0,0 @@ -# Kernel configuration for Toradex Apalis i.MX6 -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "IMX6" -ident APALIS-IMX6 - -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - -# Flattened Device Tree -options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=apalis-imx6.dts From nobody Fri Mar 17 11:33:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMTK4qZPz3yFyt; Fri, 17 Mar 2023 11:33: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 4PdMTK4M8Zz3Pwg; Fri, 17 Mar 2023 11:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4bbDanFKbfWgl9i2xwDg8W+VZC3I1w+aEuc49pVJxCw=; b=UQcJIhOEiebRKuOdYeJkatbhXMWplcc3km+Ow6J4DIn0FCDqeezQlhiun36CzA1D3OXRUF 2RlbaIv97o6uEEkngf7/Ag0kzh2LCke3PKIkH47ST5e3TH5VeCoL7INrrIkav5lBJa9Dth nU7TIloht8kwQXfuS5HPNlAuckpEQfCnUa4WLIzefl1wdyW6Aj44dBAjRyNy0zUL72Y8Jn IW5/4y8cSs4VPV8Uio3TcU+zfXwGgsrSeYhGK0oIt4LN0v32ULVzhM3WlvpnEKrB3acimb fQcya590hXC82eokp2bM9tDfOnAEty90OLBSbmMtxYKzX4cPSfB7LNdCdlpJpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4bbDanFKbfWgl9i2xwDg8W+VZC3I1w+aEuc49pVJxCw=; b=tQew59/09r/WUUAdeA1FdW07fsF+GX/QllRN34np+apN+nK+2zphlWo+/zYFW1zd5nLziF cm1EBMhkkn2EUpoFOchfqi06O/XktlKtxEb4/rQN+UdLqkwpGiaNNjKxZBYygb8p6PIwYV onUMqfW6yNhdR3NmBQRWgVxTkhnxgDTouvnyB1m0E/Dp3wKsbg8U1lzXIGevaYtXG/yjr3 fr1O33oRXKJo7ZzISKZfZtztLgyPab6XEEJGw/cVgEGLDuPlo7hQeWPfmkEr1SmNzu6UgM yQVXCtPGyE+F1+YtAba4Go6hGdxVL+FBWuuF/pF7uMm92TRZsHAgJqAo9YjQRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052821; a=rsa-sha256; cv=none; b=PCjUgoRdpK3O02aPO4kzCZW6rJNS2c8QLheibTa4iB3rnbDhHldIAwZSVFTbOmlal+K62h UsLc7sw0JN7MUVTyReK3BhgEJgK4hDKSnYPpBvlI5IBo3IoqV/Q25WFnqP5jkDPbJim0dL Dn1oPKq+dj9Eni79XlyhJnlRhwebYvXm2P08ZVROB/FMwCKmZJMDzrWnV43DAi545CDAok XjDTGY3Es1oVaQqb0MBRZXkOOcBa6jIzzAD1RNYpnTfj4C2uI47BQ250tkRhpcMYJ42iig ySLUPa04Q5ZNXeSQ/OYQ4V1+8vw4+XPEKQETF4QT5ivD41LzCV8PQGlr9reIAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMTK38wkzP1w; Fri, 17 Mar 2023 11:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBXfFD081799; Fri, 17 Mar 2023 11:33:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBXftf081798; Fri, 17 Mar 2023 11:33:41 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:33:41 GMT Message-Id: <202303171133.32HBXftf081798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: ba9f8eeb4789 - main - arm: Remove VYBRID specific kernel config List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba9f8eeb478975069b644f2228808d5e0c0dc1b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ba9f8eeb478975069b644f2228808d5e0c0dc1b1 commit ba9f8eeb478975069b644f2228808d5e0c0dc1b1 Author: Emmanuel Vadot AuthorDate: 2023-03-15 09:26:24 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:33:51 +0000 arm: Remove VYBRID specific kernel config We had GENERIC for a while now so anyone still interested in those boards should make sure that we can boot on them with it and with upstream DTS files. Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39087 --- sys/arm/conf/COLIBRI-VF50 | 28 ----------- sys/arm/conf/COSMIC | 28 ----------- sys/arm/conf/QUARTZ | 28 ----------- sys/arm/conf/VYBRID | 120 ---------------------------------------------- 4 files changed, 204 deletions(-) diff --git a/sys/arm/conf/COLIBRI-VF50 b/sys/arm/conf/COLIBRI-VF50 deleted file mode 100644 index af0085615786..000000000000 --- a/sys/arm/conf/COLIBRI-VF50 +++ /dev/null @@ -1,28 +0,0 @@ -# Kernel configuration for Toradex Colibri VF50 Evaluation Board. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "VYBRID" -ident COLIBRI-VF50 - -#FDT -options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=vybrid-colibri-vf50.dts diff --git a/sys/arm/conf/COSMIC b/sys/arm/conf/COSMIC deleted file mode 100644 index b9d1ffc5aa42..000000000000 --- a/sys/arm/conf/COSMIC +++ /dev/null @@ -1,28 +0,0 @@ -# Kernel configuration for Cosmic Board (Freescale Vybrid Family development board). -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "VYBRID" -ident COSMIC - -#FDT -options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=vybrid-cosmic.dts diff --git a/sys/arm/conf/QUARTZ b/sys/arm/conf/QUARTZ deleted file mode 100644 index de6d38463b17..000000000000 --- a/sys/arm/conf/QUARTZ +++ /dev/null @@ -1,28 +0,0 @@ -# Kernel configuration for Device Solutions Quartz Module. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "VYBRID" -ident QUARTZ - -#FDT -options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=vybrid-quartz.dts diff --git a/sys/arm/conf/VYBRID b/sys/arm/conf/VYBRID deleted file mode 100644 index 2ce765ec483b..000000000000 --- a/sys/arm/conf/VYBRID +++ /dev/null @@ -1,120 +0,0 @@ -# -# Kernel configuration for Vybrid Family boards. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -ident VYBRID -include "std.armv7" -include "../freescale/vybrid/std.vybrid" - -options SCHED_4BSD # 4BSD scheduler -options PLATFORM # Platform based SoC -#options SMP # Enable multiple cores - -# NFS root from boopt/dhcp -#options BOOTP -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ffec0 - -#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" -options ROOTDEVNAME=\"ufs:/dev/da0\" - -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING - -# Interrupt controller -device gic - -# pseudo devices -device clk -device phy -device hwreset -device nvmem -device regulator -device syscon - -# ARM MPCore timer -device mpcore_timer - -# MMC/SD/SDIO Card slot support -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device sdhci # generic sdhci - -# Pseudo devices - -device loop -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. -device usb -#device musb -device ehci -#device ohci - -device umass -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass - -# SATA -#device ata -#device atadisk -#device mvs - -# Serial ports -device uart - -# I2C (TWSI) -device iic -device iicbus - -# Ethernet -device ether -device ffec - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter - -device sound - -# SPI -device spibus -device vf_spi - -# Framebuffer -device vt -device kbdmux -device ukbd - -# HID support -device hid # Generic HID support - -# Flattened Device Tree -options FDT # Configure using FDT/DTB data From nobody Fri Mar 17 11:33:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMTL5Pd1z3yFmM; Fri, 17 Mar 2023 11:33: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 4PdMTL4j5qz3PjV; Fri, 17 Mar 2023 11:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7GsA2FkMhHdoyIIRjmldIDaX8Sq5NswtEeIx03050g=; b=l44uotRibyMWeRKGFGuXyLYqMuvLrPEbCauHrbAhPOqNac3F9POydlUKeLM5dq1+j5gnyw vA6rX54OahruLJSxZ6/uNoHUd3gKlunimT2wwrjsroL490v7jFg1RNTuWuZ3lXnega5ZeE zlc0zC/g5uSv+tZTqQXgnCKf56MOFVSIED2BGRhqvuQ3+zPOp8omkaOYYaODiDxF0RTkZ+ jcvyPMBj2iX/+17ATPWPANuWhs/FYRZ53Kc7nX9pYFSiSgdYWLcV5QzyibVIcWt9EeKsYZ sKmTX5HmcEILfQ1pwdbj2jrl3qgcEp/5A1Q09BVF+Rsn3KFhhDArvOC+lGejdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7GsA2FkMhHdoyIIRjmldIDaX8Sq5NswtEeIx03050g=; b=I7ha6Ns5iIIo9DJQai7Weq2NgI8QPRssg5Ba95znlk1c0FT483YqAIXlsEBexHjhAkJjtv jrXPSF1m9ZhVmqSTpr+QuOJIyXaUQKBiCK3gV9B6HvTn7QgTL8buQVyDOhU5vUpHNoj8lV JslDJyzm6U0brLrTaVd48rIDz037+9S5ZfhdNjx2rnfwbBR5OiT18F5syMOCpwrUWDD4/A KJzTYOgq6XOWTX15NinCOfBbUFMksN+LpASB+xHEKTcfR8uvrB4hPpoLyy/YcTBAmNzo1S dhbaasNWWWSlvODrAd/fWsq7CZ1rm/3Ne4Kly8AVWDwXDf/8cT5cZ0L8jik1Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052822; a=rsa-sha256; cv=none; b=Ff5f5Xb7i6AFTyEYG1dL2x3q06AgpNl3bO5IS2aW7Agsxd4nGWV9C/N0W8YD/jwGWt0kW0 lUU9JtaYlD3IOSg/N8JKcUnodT3x/Bv8xwQcCTwZ5mTuJ6TOmYZ4zNpN2s3fgr4ZfHWLGn ZTsFWzgbrzDR/YRdeDSvrgcRlkl7IZ63b3JjWVrWjtxyZp1OCjrKrbbzq07B3+rCNxTfXs vLDrd4cjuxgqjwvUUGTEsPmtoY5X2TbA1WhiHTzZ04Z0zwkd24mg2/1MFZauTDY2SrnZRk e84++/qeNgcvX1VayvgJ6FTteSJ0eKYrns9IX2EBF4i0+/ec6OBXBSwVaorWYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMTL3hd7zNy0; Fri, 17 Mar 2023 11:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBXg7P081818; Fri, 17 Mar 2023 11:33:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBXgTc081817; Fri, 17 Mar 2023 11:33:42 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:33:42 GMT Message-Id: <202303171133.32HBXgTc081817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: cdb0c2a73df6 - main - arm: Remove IMX5 specific kernel configs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cdb0c2a73df624f0facf9903c64663c0bab419a8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cdb0c2a73df624f0facf9903c64663c0bab419a8 commit cdb0c2a73df624f0facf9903c64663c0bab419a8 Author: Emmanuel Vadot AuthorDate: 2023-03-15 09:39:02 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:33:57 +0000 arm: Remove IMX5 specific kernel configs We had GENERIC for a while now so anyone still interested in those boards should make sure that we can boot on them with it and with upstream DTS files. Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39089 --- sys/arm/conf/EFIKA_MX | 145 -------------------------------------------------- sys/arm/conf/IMX53 | 131 --------------------------------------------- 2 files changed, 276 deletions(-) diff --git a/sys/arm/conf/EFIKA_MX b/sys/arm/conf/EFIKA_MX deleted file mode 100644 index 941922355057..000000000000 --- a/sys/arm/conf/EFIKA_MX +++ /dev/null @@ -1,145 +0,0 @@ -# -# Kernel configuration for Efika MX Smarttop/Smartbook boards -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -ident EFIKA_MX - -include "std.armv7" -include "../freescale/imx/std.imx51" - -makeoptions WITHOUT_MODULES="ahc" - -options SOC_IMX51 - -options SCHED_4BSD # 4BSD scheduler -#options MD_ROOT # MD is a potential root device -#options NFSD # Network Filesystem Server -options PLATFORM -options INCLUDE_CONFIG_FILE # Include this file in kernel - -# NFS root from boopt/dhcp -#options BOOTP -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ue0 - -options ROOTDEVNAME=\"ufs:ada0s2a\" - - -# kernel/memory size reduction -#options MUTEX_NOINLINE -#options NO_FFS_SNAPSHOT -#options NO_SWAPPING -#options NO_SYSCTL_DESCR -#options RWLOCK_NOINLINE - -# pseudo devices -device clk -device phy -device hwreset -device nvmem -device regulator -device syscon - -# The `bpf' device enables the Berkeley Packet Filter. -# Be aware of the administrative consequences of enabling this! -# Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter - -# Pseudo devices. -device loop # Network loopback -device ether # Ethernet support -#device vlan # 802.1Q VLAN support -#device tuntap # Packet tunnel. -#device md # Memory "disks" -#device gif # IPv6 and IPv4 tunneling -#device firmware # firmware assist module - -# Serial (COM) ports -device uart # Multi-uart driver - -device ata -device atapci # Only for helper functions -device imxata - -device gpio -device gpioled - -device fsliic -device iic -device iicbus - -# SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device ehci # OHCI USB interface -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da -device uhid # "Human Interface Devices" -device u3g - -# USB Ethernet, requires miibus -device miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB - -# USB Wireless -device rum # Ralink Technology RT2501USB wireless NICs - -# Watchdog timer. -# WARNING: can't be disabled!!! -device imxwdt # Watchdog - -# Wireless NIC cards -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm - -# HID support -device hid # Generic HID support - -# Flattened Device Tree -options FDT # Configure using FDT/DTB data -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=efikamx.dts -device fdt_pinctrl # FDT pinmux driver - -# NOTE: serial console will be disabled if syscons enabled -# Uncomment following lines for framebuffer/syscons support -device sc -device kbdmux -options SC_DFLT_FONT # compile font in -makeoptions SC_DFLT_FONT=cp437 -device ukbd # Allow keyboard like HIDs to control console -device ums diff --git a/sys/arm/conf/IMX53 b/sys/arm/conf/IMX53 deleted file mode 100644 index aed467424add..000000000000 --- a/sys/arm/conf/IMX53 +++ /dev/null @@ -1,131 +0,0 @@ -# -# Kernel configuration for i.MX53 boards -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -ident IMX53 - -include "std.armv7" -include "../freescale/imx/std.imx53" - -options SOC_IMX53 - -options SCHED_4BSD # 4BSD scheduler -#options NFSD # Network Filesystem Server -options PLATFORM -options INCLUDE_CONFIG_FILE # Include this file in kernel - -# kernel/memory size reduction -#options MUTEX_NOINLINE -#options NO_FFS_SNAPSHOT -#options NO_SWAPPING -#options NO_SYSCTL_DESCR -#options RWLOCK_NOINLINE - -# The `bpf' device enables the Berkeley Packet Filter. -# Be aware of the administrative consequences of enabling this! -# Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter - -# pseudo devices -device clk -device phy -device hwreset -device nvmem -device regulator -device syscon - -# Pseudo devices. -device loop # Network loopback -device ether # Ethernet support -#device vlan # 802.1Q VLAN support -#device tuntap # Packet tunnel. -device md # Memory "disks" -#device gif # IPv6 and IPv4 tunneling -#device firmware # firmware assist module - -# Ethernet -device ffec # Freescale Fast Ethernet Controller -device miibus # Standard mii bus - -# Serial (COM) ports -device uart # Multi-uart driver - -device ata -device atapci # Only for helper functions -device imxata - -device gpio -device gpioled - -device fsliic -device iic -device iicbus - -# SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device ehci # OHCI USB interface -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da -device uhid # "Human Interface Devices" -#device ukbd # Allow keyboard like HIDs to control console -device ums - -# USB Ethernet, requires miibus -#device miibus -#device aue # ADMtek USB Ethernet -#device axe # ASIX Electronics USB Ethernet -#device cdce # Generic USB over Ethernet -#device cue # CATC USB Ethernet -#device kue # Kawasaki LSI USB Ethernet -#device rue # RealTek RTL8150 USB Ethernet -#device udav # Davicom DM9601E USB - -# USB Wireless -#device rum # Ralink Technology RT2501USB wireless NICs - -# Watchdog timer. -# WARNING: can't be disabled!!! -device imxwdt # Watchdog - -# Wireless NIC cards -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm - -# MMC -#device sdhci # SD controller -#device mmc # SD/MMC protocol -#device mmcsd # SDCard disk device - -# HID support -device hid # Generic HID support - - -# Flattened Device Tree -options FDT # Configure using FDT/DTB data -makeoptions MODULES_EXTRA="dtb/imx5 imx" -device fdt_pinctrl # FDT pinmux driver From nobody Fri Mar 17 11:33:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMTM6FZ7z3yFk9; Fri, 17 Mar 2023 11:33: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 4PdMTM5YVRz3Q7V; Fri, 17 Mar 2023 11:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Ax5F/Q14HIJvvW6KwWCPH5DlO29fySZnUBIrcPDhKU=; b=AlFgSz/kjPrF66Tgk2N7FgQqF4G9ID5uv/+l2CrbVguRMmxP5uDLW2rMfanqk0BDJrZfRM lwpvQEzAQRwcMZreBr9Nc7MlKKHOWzxzqD52veBYfXWb6RvK2S3MHTp3pCHlEPbB/pRewo H6d2sOWvhxG/mEQDql0VOQ00JnHlJtjyJNGUTkgLzcqkUOSl31U01G0lQB6HEiCs9I68Xq VbZ2x51nfZPtAOe9wNZR9DZmAgZ164cupu9iNyglKEA8WXkoN5B/K4qVaPJR2VOotEpLn+ BAhHjGVOzRn+A4ft0DZVMH1y78AqeIkgdvzNULJ+osQY5YZ1fQ+ysDMkutlx+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Ax5F/Q14HIJvvW6KwWCPH5DlO29fySZnUBIrcPDhKU=; b=K0HbCpyOegImGox0uJ59uiO8MW0x/hD0F11ubh6DoUYitZmLonzr/KUxYY7scFhygFiti6 hpahvN6gy8HlF5NLiZFzllYy91ZpNcBNxjp1B5UngBnq5Td/RZT3eB1XI8jb0nmtzDav4M HUltSenZqcq1OutHSHxSW+QqnqSlkPAlSEsIs1G8N2OLScvGB6UyLjmBXL4kahQ3DI06Bp rtQ5TqMmMq4MUVhdcX9Fcc9kNycygq13biD5Taj19bivFYz9ozHFVMsPt+KVipSHR6fN+B ar4rBMZaWdVEcUR0TxFvueiwCBDcM1cqxhYAuwmv7QkSMFsGNgMoyA012QtoAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052823; a=rsa-sha256; cv=none; b=yO5x65kIS+JylaDfGhrWXMZTULYykJ01D6lGXPTnL925vJwPHdSdqYKfbIKgaDADeM4VNJ vdqgF+cbvm6DiI5/gwRQ4Xg7Y8SVXtS1SlMN/VCalfIrkNeJGUdkJm28eWoeHe1qnA5U0b 4YTrlulVg06WhuWJ9Em1NlJF3b59aOU9Ai+ZmLJI/IzKKdB/iuDJ0xSxoTOa37mgaRqo23 fU997unkklIjFo0cmRjURdUatRzPpFAaPvZvAs1rf3RcjuTK7cLAMkXswkThbA4QROlpVv wQ0HAX5/kLJP5xY8yJCySoNyxsoLDj1CUmL90Q1vdK7+z+e90O78PDCjwTi2RA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMTM4dHnzPRL; Fri, 17 Mar 2023 11:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBXhpT081839; Fri, 17 Mar 2023 11:33:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBXhcO081838; Fri, 17 Mar 2023 11:33:43 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:33:43 GMT Message-Id: <202303171133.32HBXhcO081838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 1c4ff02a7458 - main - arm: Remove IMX6 kernel config List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c4ff02a74585231ddc7b45589debf07e13472e9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1c4ff02a74585231ddc7b45589debf07e13472e9 commit 1c4ff02a74585231ddc7b45589debf07e13472e9 Author: Emmanuel Vadot AuthorDate: 2023-03-15 09:53:15 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:34:03 +0000 arm: Remove IMX6 kernel config All devices are in GENERIC and GENERIC is known to boot on those SoCs. Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39090 --- sys/arm/conf/IMX6 | 138 ------------------------------------------------------ 1 file changed, 138 deletions(-) diff --git a/sys/arm/conf/IMX6 b/sys/arm/conf/IMX6 deleted file mode 100644 index dd8ca9266fad..000000000000 --- a/sys/arm/conf/IMX6 +++ /dev/null @@ -1,138 +0,0 @@ -# -# Kernel configuration for Freescale i.MX6 systems. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -ident IMX6 -include "std.armv7" -include "../freescale/imx/std.imx6" - -options SOC_IMX6 - -options SCHED_ULE # ULE scheduler -#options NFSD # Network Filesystem Server -options INCLUDE_CONFIG_FILE # Include this file in kernel -options PLATFORM -options SMP # Enable multiple cores - -# NFS root from boopt/dhcp -#options BOOTP -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ffec0 - -# U-Boot stuff lives on slice 1, FreeBSD on slice 2. -options ROOTDEVNAME=\"ufs:mmcsd0s2a\" - -# Interrupt controller -device gic -# Cache controller -device pl310 # PL310 L2 cache controller -# ARM MPCore timer -device mpcore_timer - -# Pseudo devices. -device loop # Network loopback -device vlan # 802.1Q VLAN support -device tuntap # Packet tunnel. -device md # Memory "disks" -#device gif # IPv6 and IPv4 tunneling -#device firmware # firmware assist module -device ether # Ethernet support -device miibus # Required for ethernet -device bpf # Berkeley packet filter (required for DHCP) - -# General-purpose input/output -device gpio - -# Serial (COM) ports -device uart # Multi-uart driver - -# SDCard -device sdhci # SD controller -device mmc # SD/MMC protocol -device mmcsd # SDCard disk device - -# SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) - -# ATA controllers -device ahci # AHCI-compatible SATA controllers - -# USB support -device ehci # OHCI USB interface -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da -device uhid # "Human Interface Devices" -device u3g # USB modems -#device ukbd # Allow keyboard like HIDs to control console -#device ums # USB mouse - -# USB Ethernet, requires miibus -#device aue # ADMtek USB Ethernet -#device axe # ASIX Electronics USB Ethernet -#device cdce # Generic USB over Ethernet -#device cue # CATC USB Ethernet -#device kue # Kawasaki LSI USB Ethernet -#device rue # RealTek RTL8150 USB Ethernet -#device udav # Davicom DM9601E USB - -# USB Wireless -#device rum # Ralink Technology RT2501USB wireless NICs - -# Wireless NIC cards -#device wlan # 802.11 support -#device wlan_wep # 802.11 WEP support -#device wlan_ccmp # 802.11 CCMP support -#device wlan_tkip # 802.11 TKIP support -#device wlan_amrr # AMRR transmit rate control algorithm - -# HID support -device hid # Generic HID support - -device vt -device kbdmux -device ukbd -device videomode -device hdmi - -# Flattened Device Tree -options FDT # Configure using FDT/DTB data -makeoptions MODULES_EXTRA="dtb/imx6 imx" -device fdt_pinctrl # FDT pinmux driver - -# pseudo devices -device clk -device phy -device hwreset -device nvmem -device regulator -device syscon - -# SoC-specific devices -device ffec # Freescale Fast Ethernet Controller -device fsliic # Freescale i2c/iic -device iic # iic protocol -device iicbus # iic bus -device imx6_snvs # On-chip RTC -device imxwdt # Watchdog. WARNING: can't be disabled!!! - From nobody Fri Mar 17 11:34:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMVK1ZDHz3yG04; Fri, 17 Mar 2023 11:34: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 4PdMVK1Hm3z3Qtw; Fri, 17 Mar 2023 11:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+fZHZk2B73uzlj7gZieNUsCZ5e35KbSKzpcL0/oENZ8=; b=J9z8JmN8LQxwEKVqv1Er+/Zva51FPrBayH6HCRbKuPLbTtKbnGAXYIveY2MS/t6st57kRU FR7Hgl07FER2OCu+P46NVMx64Nhnh3mCHU1yuamClCchPDbDE+AXWh8//BTGAqfkzTcfxK 4vtCA7LuvcRrHHXg5utcXOBIlBZsj83tBVMsfQA0Uf68XnCw0EjCrxqwz3WBnltcY3+frU UJaQZyazIExNTYYlRVttfanpXZX40o2DjZrYOOPqfIMq78N5o3cpW/lcPQ8X0jDjauJpMa +nmDgfXsaExedPlXZGnvkthsl2mw1gK2tfNNTYjagf3GNNyMsXO31ePklVxuKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+fZHZk2B73uzlj7gZieNUsCZ5e35KbSKzpcL0/oENZ8=; b=Cnjlds+I84ehlkNCsxGmlx3Jp6iTjQsGmi4aBg4ardfAvdNQhgJjMoYVsuCBH/TRFbC65s GA2EbCGyO+sbc4AUjAvTH7F0tyAS3+ngklOBFrxMg25kfbsskAV2f+Qfxhd/0O3cnoF5l+ oqQmOO5s6uyddeA8rkpDuIkpX/LV9kdge5ZsRdA4hf67fs4+NMEGekKJ6HvuV8eCWJwht5 riJhUeVVun2eU4kN+addwPI5lx1xIA2AcZke7uh2orOtHHUxkYabHXea8843ZzfjKquMMK PRWgU8p45FKW1/GNymkJMzQ7zQfxgqkEoWMSaeNevoeAHc+gL7XMUjpeBMQCQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052873; a=rsa-sha256; cv=none; b=WxnLRucCOwUn488UN3yY+qk+tIuJzqJaEztPn1yyPLjODDkZkSJ0ltvpf9ChVL4Cmk+pvJ /1Ltq2fyO8KNSweNY9Xq30ZT7aaDcZ/q0vFkuAay4YZKQ2xt/SBMXou5tK6TiKqcbo3k3G k890DdI789izFnQrkbPxNE1rO+6zl7ktQ3a1aYjT3U/Ej0TYogbel19eFJkkw3pOAmgGQ8 cHgICW8cvxiZzzU8i9zGP7/kPlElb3JwtWl8zJFyAyFDJlq/mt8KY2PiLJgQGVUqXQbPaZ InCixGPoD11RzoVegfo5LA4inRYq/KZpe909Z1Odqn0mM/3ROEc6Z74XJZwQ6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMVK0L6DzPTm; Fri, 17 Mar 2023 11:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBYX7C082084; Fri, 17 Mar 2023 11:34:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBYXvA082083; Fri, 17 Mar 2023 11:34:33 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:34:33 GMT Message-Id: <202303171134.32HBYXvA082083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 37531e78df29 - main - arm: allwinner: Garbage collect a10_hdmi driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37531e78df291720c36641bd503b232187d40776 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=37531e78df291720c36641bd503b232187d40776 commit 37531e78df291720c36641bd503b232187d40776 Author: Emmanuel Vadot AuthorDate: 2023-03-15 12:00:20 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:34:40 +0000 arm: allwinner: Garbage collect a10_hdmi driver It was disconnected 5 years ago in 4573cd3914d7 ("arm: allwinner: Disconnect A10/A20 HDMI driver") as it wasn't working. Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39117 --- sys/arm/allwinner/a10_fb.c | 660 ---------------------------------- sys/arm/allwinner/a10_hdmi.c | 723 -------------------------------------- sys/arm/allwinner/a10_hdmiaudio.c | 435 ----------------------- 3 files changed, 1818 deletions(-) diff --git a/sys/arm/allwinner/a10_fb.c b/sys/arm/allwinner/a10_fb.c deleted file mode 100644 index 387d5daa10c1..000000000000 --- a/sys/arm/allwinner/a10_fb.c +++ /dev/null @@ -1,660 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR 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. - * - * $FreeBSD$ - */ - -/* - * Allwinner A10/A20 Framebuffer - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include - -#include -#include - -#include "fb_if.h" -#include "hdmi_if.h" - -#define FB_DEFAULT_W 800 -#define FB_DEFAULT_H 600 -#define FB_DEFAULT_REF 60 -#define FB_BPP 32 -#define FB_ALIGN 0x1000 - -#define HDMI_ENABLE_DELAY 20000 -#define DEBE_FREQ 300000000 - -#define DOT_CLOCK_TO_HZ(c) ((c) * 1000) - -/* Display backend */ -#define DEBE_REG_START 0x800 -#define DEBE_REG_END 0x1000 -#define DEBE_REG_WIDTH 4 -#define DEBE_MODCTL 0x800 -#define MODCTL_ITLMOD_EN (1 << 28) -#define MODCTL_OUT_SEL_MASK (0x7 << 20) -#define MODCTL_OUT_SEL(sel) ((sel) << 20) -#define OUT_SEL_LCD 0 -#define MODCTL_LAY0_EN (1 << 8) -#define MODCTL_START_CTL (1 << 1) -#define MODCTL_EN (1 << 0) -#define DEBE_DISSIZE 0x808 -#define DIS_HEIGHT(h) (((h) - 1) << 16) -#define DIS_WIDTH(w) (((w) - 1) << 0) -#define DEBE_LAYSIZE0 0x810 -#define LAY_HEIGHT(h) (((h) - 1) << 16) -#define LAY_WIDTH(w) (((w) - 1) << 0) -#define DEBE_LAYCOOR0 0x820 -#define LAY_XCOOR(x) ((x) << 16) -#define LAY_YCOOR(y) ((y) << 0) -#define DEBE_LAYLINEWIDTH0 0x840 -#define DEBE_LAYFB_L32ADD0 0x850 -#define LAYFB_L32ADD(pa) ((pa) << 3) -#define DEBE_LAYFB_H4ADD 0x860 -#define LAY0FB_H4ADD(pa) ((pa) >> 29) -#define DEBE_REGBUFFCTL 0x870 -#define REGBUFFCTL_LOAD (1 << 0) -#define DEBE_ATTCTL1 0x8a0 -#define ATTCTL1_FBFMT(fmt) ((fmt) << 8) -#define FBFMT_XRGB8888 9 -#define ATTCTL1_FBPS(ps) ((ps) << 0) -#define FBPS_32BPP_ARGB 0 - -/* Timing controller */ -#define TCON_GCTL 0x000 -#define GCTL_TCON_EN (1 << 31) -#define GCTL_IO_MAP_SEL_TCON1 (1 << 0) -#define TCON_GINT1 0x008 -#define GINT1_TCON1_LINENO(n) (((n) + 2) << 0) -#define TCON0_DCLK 0x044 -#define DCLK_EN 0xf0000000 -#define TCON1_CTL 0x090 -#define TCON1_EN (1 << 31) -#define INTERLACE_EN (1 << 20) -#define TCON1_SRC_SEL(src) ((src) << 0) -#define TCON1_SRC_CH1 0 -#define TCON1_SRC_CH2 1 -#define TCON1_SRC_BLUE 2 -#define TCON1_START_DELAY(sd) ((sd) << 4) -#define TCON1_BASIC0 0x094 -#define TCON1_BASIC1 0x098 -#define TCON1_BASIC2 0x09c -#define TCON1_BASIC3 0x0a0 -#define TCON1_BASIC4 0x0a4 -#define TCON1_BASIC5 0x0a8 -#define BASIC_X(x) (((x) - 1) << 16) -#define BASIC_Y(y) (((y) - 1) << 0) -#define BASIC3_HT(ht) (((ht) - 1) << 16) -#define BASIC3_HBP(hbp) (((hbp) - 1) << 0) -#define BASIC4_VT(vt) ((vt) << 16) -#define BASIC4_VBP(vbp) (((vbp) - 1) << 0) -#define BASIC5_HSPW(hspw) (((hspw) - 1) << 16) -#define BASIC5_VSPW(vspw) (((vspw) - 1) << 0) -#define TCON1_IO_POL 0x0f0 -#define IO_POL_IO2_INV (1 << 26) -#define IO_POL_PHSYNC (1 << 25) -#define IO_POL_PVSYNC (1 << 24) -#define TCON1_IO_TRI 0x0f4 -#define IO0_OUTPUT_TRI_EN (1 << 24) -#define IO1_OUTPUT_TRI_EN (1 << 25) -#define IO_TRI_MASK 0xffffffff -#define START_DELAY(vbl) (MIN(32, (vbl)) - 2) -#define VBLANK_LEN(vt, vd, i) ((((vt) << (i)) >> 1) - (vd) - 2) -#define VTOTAL(vt) ((vt) * 2) -#define DIVIDE(x, y) (((x) + ((y) / 2)) / (y)) - -struct a10fb_softc { - device_t dev; - device_t fbdev; - struct resource *res[2]; - - /* Framebuffer */ - struct fb_info info; - size_t fbsize; - bus_addr_t paddr; - vm_offset_t vaddr; - - /* HDMI */ - eventhandler_tag hdmi_evh; -}; - -static struct resource_spec a10fb_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* DEBE */ - { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* TCON */ - { -1, 0 } -}; - -#define DEBE_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) -#define DEBE_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) - -#define TCON_READ(sc, reg) bus_read_4((sc)->res[1], (reg)) -#define TCON_WRITE(sc, reg, val) bus_write_4((sc)->res[1], (reg), (val)) - -static int -a10fb_allocfb(struct a10fb_softc *sc) -{ - sc->vaddr = kmem_alloc_contig(sc->fbsize, M_NOWAIT | M_ZERO, 0, ~0, - FB_ALIGN, 0, VM_MEMATTR_WRITE_COMBINING); - if (sc->vaddr == 0) { - device_printf(sc->dev, "failed to allocate FB memory\n"); - return (ENOMEM); - } - sc->paddr = pmap_kextract(sc->vaddr); - - return (0); -} - -static void -a10fb_freefb(struct a10fb_softc *sc) -{ - kmem_free(sc->vaddr, sc->fbsize); -} - -static int -a10fb_setup_debe(struct a10fb_softc *sc, const struct videomode *mode) -{ - int width, height, interlace, reg; - clk_t clk_ahb, clk_dram, clk_debe; - hwreset_t rst; - uint32_t val; - int error; - - interlace = !!(mode->flags & VID_INTERLACE); - width = mode->hdisplay; - height = mode->vdisplay << interlace; - - /* Leave reset */ - error = hwreset_get_by_ofw_name(sc->dev, 0, "de_be", &rst); - if (error != 0) { - device_printf(sc->dev, "cannot find reset 'de_be'\n"); - return (error); - } - error = hwreset_deassert(rst); - if (error != 0) { - device_printf(sc->dev, "couldn't de-assert reset 'de_be'\n"); - return (error); - } - /* Gating AHB clock for BE */ - error = clk_get_by_ofw_name(sc->dev, 0, "ahb_de_be", &clk_ahb); - if (error != 0) { - device_printf(sc->dev, "cannot find clk 'ahb_de_be'\n"); - return (error); - } - error = clk_enable(clk_ahb); - if (error != 0) { - device_printf(sc->dev, "cannot enable clk 'ahb_de_be'\n"); - return (error); - } - /* Enable DRAM clock to BE */ - error = clk_get_by_ofw_name(sc->dev, 0, "dram_de_be", &clk_dram); - if (error != 0) { - device_printf(sc->dev, "cannot find clk 'dram_de_be'\n"); - return (error); - } - error = clk_enable(clk_dram); - if (error != 0) { - device_printf(sc->dev, "cannot enable clk 'dram_de_be'\n"); - return (error); - } - /* Set BE clock to 300MHz and enable */ - error = clk_get_by_ofw_name(sc->dev, 0, "de_be", &clk_debe); - if (error != 0) { - device_printf(sc->dev, "cannot find clk 'de_be'\n"); - return (error); - } - error = clk_set_freq(clk_debe, DEBE_FREQ, CLK_SET_ROUND_DOWN); - if (error != 0) { - device_printf(sc->dev, "cannot set 'de_be' frequency\n"); - return (error); - } - error = clk_enable(clk_debe); - if (error != 0) { - device_printf(sc->dev, "cannot enable clk 'de_be'\n"); - return (error); - } - - /* Initialize all registers to 0 */ - for (reg = DEBE_REG_START; reg < DEBE_REG_END; reg += DEBE_REG_WIDTH) - DEBE_WRITE(sc, reg, 0); - - /* Enable display backend */ - DEBE_WRITE(sc, DEBE_MODCTL, MODCTL_EN); - - /* Set display size */ - DEBE_WRITE(sc, DEBE_DISSIZE, DIS_HEIGHT(height) | DIS_WIDTH(width)); - - /* Set layer 0 size, position, and stride */ - DEBE_WRITE(sc, DEBE_LAYSIZE0, LAY_HEIGHT(height) | LAY_WIDTH(width)); - DEBE_WRITE(sc, DEBE_LAYCOOR0, LAY_XCOOR(0) | LAY_YCOOR(0)); - DEBE_WRITE(sc, DEBE_LAYLINEWIDTH0, width * FB_BPP); - - /* Point layer 0 to FB memory */ - DEBE_WRITE(sc, DEBE_LAYFB_L32ADD0, LAYFB_L32ADD(sc->paddr)); - DEBE_WRITE(sc, DEBE_LAYFB_H4ADD, LAY0FB_H4ADD(sc->paddr)); - - /* Set backend format and pixel sequence */ - DEBE_WRITE(sc, DEBE_ATTCTL1, ATTCTL1_FBFMT(FBFMT_XRGB8888) | - ATTCTL1_FBPS(FBPS_32BPP_ARGB)); - - /* Enable layer 0, output to LCD, setup interlace */ - val = DEBE_READ(sc, DEBE_MODCTL); - val |= MODCTL_LAY0_EN; - val &= ~MODCTL_OUT_SEL_MASK; - val |= MODCTL_OUT_SEL(OUT_SEL_LCD); - if (interlace) - val |= MODCTL_ITLMOD_EN; - else - val &= ~MODCTL_ITLMOD_EN; - DEBE_WRITE(sc, DEBE_MODCTL, val); - - /* Commit settings */ - DEBE_WRITE(sc, DEBE_REGBUFFCTL, REGBUFFCTL_LOAD); - - /* Start DEBE */ - val = DEBE_READ(sc, DEBE_MODCTL); - val |= MODCTL_START_CTL; - DEBE_WRITE(sc, DEBE_MODCTL, val); - - return (0); -} - -static int -a10fb_setup_pll(struct a10fb_softc *sc, uint64_t freq) -{ - clk_t clk_sclk1, clk_sclk2; - int error; - - error = clk_get_by_ofw_name(sc->dev, 0, "lcd_ch1_sclk1", &clk_sclk1); - if (error != 0) { - device_printf(sc->dev, "cannot find clk 'lcd_ch1_sclk1'\n"); - return (error); - } - error = clk_get_by_ofw_name(sc->dev, 0, "lcd_ch1_sclk2", &clk_sclk2); - if (error != 0) { - device_printf(sc->dev, "cannot find clk 'lcd_ch1_sclk2'\n"); - return (error); - } - - error = clk_set_freq(clk_sclk2, freq, 0); - if (error != 0) { - device_printf(sc->dev, "cannot set lcd ch1 frequency\n"); - return (error); - } - error = clk_enable(clk_sclk2); - if (error != 0) { - device_printf(sc->dev, "cannot enable lcd ch1 sclk2\n"); - return (error); - } - error = clk_enable(clk_sclk1); - if (error != 0) { - device_printf(sc->dev, "cannot enable lcd ch1 sclk1\n"); - return (error); - } - - return (0); -} - -static int -a10fb_setup_tcon(struct a10fb_softc *sc, const struct videomode *mode) -{ - u_int interlace, hspw, hbp, vspw, vbp, vbl, width, height, start_delay; - u_int vtotal, framerate, clk; - clk_t clk_ahb; - hwreset_t rst; - uint32_t val; - int error; - - interlace = !!(mode->flags & VID_INTERLACE); - width = mode->hdisplay; - height = mode->vdisplay; - hspw = mode->hsync_end - mode->hsync_start; - hbp = mode->htotal - mode->hsync_start; - vspw = mode->vsync_end - mode->vsync_start; - vbp = mode->vtotal - mode->vsync_start; - vbl = VBLANK_LEN(mode->vtotal, mode->vdisplay, interlace); - start_delay = START_DELAY(vbl); - - /* Leave reset */ - error = hwreset_get_by_ofw_name(sc->dev, 0, "lcd", &rst); - if (error != 0) { - device_printf(sc->dev, "cannot find reset 'lcd'\n"); - return (error); - } - error = hwreset_deassert(rst); - if (error != 0) { - device_printf(sc->dev, "couldn't de-assert reset 'lcd'\n"); - return (error); - } - /* Gating AHB clock for LCD */ - error = clk_get_by_ofw_name(sc->dev, 0, "ahb_lcd", &clk_ahb); - if (error != 0) { - device_printf(sc->dev, "cannot find clk 'ahb_lcd'\n"); - return (error); - } - error = clk_enable(clk_ahb); - if (error != 0) { - device_printf(sc->dev, "cannot enable clk 'ahb_lcd'\n"); - return (error); - } - - /* Disable TCON and TCON1 */ - TCON_WRITE(sc, TCON_GCTL, 0); - TCON_WRITE(sc, TCON1_CTL, 0); - - /* Enable clocks */ - TCON_WRITE(sc, TCON0_DCLK, DCLK_EN); - - /* Disable IO and data output ports */ - TCON_WRITE(sc, TCON1_IO_TRI, IO_TRI_MASK); - - /* Disable TCON and select TCON1 */ - TCON_WRITE(sc, TCON_GCTL, GCTL_IO_MAP_SEL_TCON1); - - /* Source width and height */ - TCON_WRITE(sc, TCON1_BASIC0, BASIC_X(width) | BASIC_Y(height)); - /* Scaler width and height */ - TCON_WRITE(sc, TCON1_BASIC1, BASIC_X(width) | BASIC_Y(height)); - /* Output width and height */ - TCON_WRITE(sc, TCON1_BASIC2, BASIC_X(width) | BASIC_Y(height)); - /* Horizontal total and back porch */ - TCON_WRITE(sc, TCON1_BASIC3, BASIC3_HT(mode->htotal) | BASIC3_HBP(hbp)); - /* Vertical total and back porch */ - vtotal = VTOTAL(mode->vtotal); - if (interlace) { - framerate = DIVIDE(DIVIDE(DOT_CLOCK_TO_HZ(mode->dot_clock), - mode->htotal), mode->vtotal); - clk = mode->htotal * (VTOTAL(mode->vtotal) + 1) * framerate; - if ((clk / 2) == DOT_CLOCK_TO_HZ(mode->dot_clock)) - vtotal += 1; - } - TCON_WRITE(sc, TCON1_BASIC4, BASIC4_VT(vtotal) | BASIC4_VBP(vbp)); - /* Horizontal and vertical sync */ - TCON_WRITE(sc, TCON1_BASIC5, BASIC5_HSPW(hspw) | BASIC5_VSPW(vspw)); - /* Polarity */ - val = IO_POL_IO2_INV; - if (mode->flags & VID_PHSYNC) - val |= IO_POL_PHSYNC; - if (mode->flags & VID_PVSYNC) - val |= IO_POL_PVSYNC; - TCON_WRITE(sc, TCON1_IO_POL, val); - - /* Set scan line for TCON1 line trigger */ - TCON_WRITE(sc, TCON_GINT1, GINT1_TCON1_LINENO(start_delay)); - - /* Enable TCON1 */ - val = TCON1_EN; - if (interlace) - val |= INTERLACE_EN; - val |= TCON1_START_DELAY(start_delay); - val |= TCON1_SRC_SEL(TCON1_SRC_CH1); - TCON_WRITE(sc, TCON1_CTL, val); - - /* Setup PLL */ - return (a10fb_setup_pll(sc, DOT_CLOCK_TO_HZ(mode->dot_clock))); -} - -static void -a10fb_enable_tcon(struct a10fb_softc *sc, int onoff) -{ - uint32_t val; - - /* Enable TCON */ - val = TCON_READ(sc, TCON_GCTL); - if (onoff) - val |= GCTL_TCON_EN; - else - val &= ~GCTL_TCON_EN; - TCON_WRITE(sc, TCON_GCTL, val); - - /* Enable TCON1 IO0/IO1 outputs */ - val = TCON_READ(sc, TCON1_IO_TRI); - if (onoff) - val &= ~(IO0_OUTPUT_TRI_EN | IO1_OUTPUT_TRI_EN); - else - val |= (IO0_OUTPUT_TRI_EN | IO1_OUTPUT_TRI_EN); - TCON_WRITE(sc, TCON1_IO_TRI, val); -} - -static int -a10fb_configure(struct a10fb_softc *sc, const struct videomode *mode) -{ - size_t fbsize; - int error; - - fbsize = round_page(mode->hdisplay * mode->vdisplay * (FB_BPP / NBBY)); - - /* Detach the old FB device */ - if (sc->fbdev != NULL) { - device_delete_child(sc->dev, sc->fbdev); - sc->fbdev = NULL; - } - - /* If the FB size has changed, free the old FB memory */ - if (sc->fbsize > 0 && sc->fbsize != fbsize) { - a10fb_freefb(sc); - sc->vaddr = 0; - } - - /* Allocate the FB if necessary */ - sc->fbsize = fbsize; - if (sc->vaddr == 0) { - error = a10fb_allocfb(sc); - if (error != 0) { - device_printf(sc->dev, "failed to allocate FB memory\n"); - return (ENXIO); - } - } - - /* Setup display backend */ - error = a10fb_setup_debe(sc, mode); - if (error != 0) - return (error); - - /* Setup display timing controller */ - error = a10fb_setup_tcon(sc, mode); - if (error != 0) - return (error); - - /* Attach framebuffer device */ - sc->info.fb_name = device_get_nameunit(sc->dev); - sc->info.fb_vbase = (intptr_t)sc->vaddr; - sc->info.fb_pbase = sc->paddr; - sc->info.fb_size = sc->fbsize; - sc->info.fb_bpp = sc->info.fb_depth = FB_BPP; - sc->info.fb_stride = mode->hdisplay * (FB_BPP / NBBY); - sc->info.fb_width = mode->hdisplay; - sc->info.fb_height = mode->vdisplay; - - sc->fbdev = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); - if (sc->fbdev == NULL) { - device_printf(sc->dev, "failed to add fbd child\n"); - return (ENOENT); - } - - error = device_probe_and_attach(sc->fbdev); - if (error != 0) { - device_printf(sc->dev, "failed to attach fbd device\n"); - return (error); - } - - return (0); -} - -static void -a10fb_hdmi_event(void *arg, device_t hdmi_dev) -{ - const struct videomode *mode; - struct videomode hdmi_mode; - struct a10fb_softc *sc; - struct edid_info ei; - uint8_t *edid; - uint32_t edid_len; - int error; - - sc = arg; - edid = NULL; - edid_len = 0; - mode = NULL; - - error = HDMI_GET_EDID(hdmi_dev, &edid, &edid_len); - if (error != 0) { - device_printf(sc->dev, "failed to get EDID: %d\n", error); - } else { - error = edid_parse(edid, &ei); - if (error != 0) { - device_printf(sc->dev, "failed to parse EDID: %d\n", - error); - } else { - if (bootverbose) - edid_print(&ei); - mode = ei.edid_preferred_mode; - } - } - - /* If the preferred mode could not be determined, use the default */ - if (mode == NULL) - mode = pick_mode_by_ref(FB_DEFAULT_W, FB_DEFAULT_H, - FB_DEFAULT_REF); - - if (mode == NULL) { - device_printf(sc->dev, "failed to find usable video mode\n"); - return; - } - - if (bootverbose) - device_printf(sc->dev, "using %dx%d\n", - mode->hdisplay, mode->vdisplay); - - /* Disable HDMI */ - HDMI_ENABLE(hdmi_dev, 0); - - /* Disable timing controller */ - a10fb_enable_tcon(sc, 0); - - /* Configure DEBE and TCON */ - error = a10fb_configure(sc, mode); - if (error != 0) { - device_printf(sc->dev, "failed to configure FB: %d\n", error); - return; - } - - hdmi_mode = *mode; - hdmi_mode.hskew = mode->hsync_end - mode->hsync_start; - hdmi_mode.flags |= VID_HSKEW; - HDMI_SET_VIDEOMODE(hdmi_dev, &hdmi_mode); - - /* Enable timing controller */ - a10fb_enable_tcon(sc, 1); - - DELAY(HDMI_ENABLE_DELAY); - - /* Enable HDMI */ - HDMI_ENABLE(hdmi_dev, 1); -} - -static int -a10fb_probe(device_t dev) -{ - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "allwinner,sun7i-a20-fb")) - return (ENXIO); - - device_set_desc(dev, "Allwinner Framebuffer"); - return (BUS_PROBE_DEFAULT); -} - -static int -a10fb_attach(device_t dev) -{ - struct a10fb_softc *sc; - - sc = device_get_softc(dev); - - sc->dev = dev; - - if (bus_alloc_resources(dev, a10fb_spec, sc->res)) { - device_printf(dev, "cannot allocate resources for device\n"); - return (ENXIO); - } - - sc->hdmi_evh = EVENTHANDLER_REGISTER(hdmi_event, - a10fb_hdmi_event, sc, 0); - - return (0); -} - -static struct fb_info * -a10fb_fb_getinfo(device_t dev) -{ - struct a10fb_softc *sc; - - sc = device_get_softc(dev); - - return (&sc->info); -} - -static device_method_t a10fb_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, a10fb_probe), - DEVMETHOD(device_attach, a10fb_attach), - - /* FB interface */ - DEVMETHOD(fb_getinfo, a10fb_fb_getinfo), - - DEVMETHOD_END -}; - -static driver_t a10fb_driver = { - "fb", - a10fb_methods, - sizeof(struct a10fb_softc), -}; - -DRIVER_MODULE(fb, simplebus, a10fb_driver, 0, 0); diff --git a/sys/arm/allwinner/a10_hdmi.c b/sys/arm/allwinner/a10_hdmi.c deleted file mode 100644 index ee57c07737de..000000000000 --- a/sys/arm/allwinner/a10_hdmi.c +++ /dev/null @@ -1,723 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR 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. - * - * $FreeBSD$ - */ - -/* - * Allwinner A10/A20 HDMI TX - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include - -#include - -#include "hdmi_if.h" - -#define HDMI_CTRL 0x004 -#define CTRL_MODULE_EN (1 << 31) -#define HDMI_INT_STATUS 0x008 -#define HDMI_HPD 0x00c -#define HPD_DET (1 << 0) -#define HDMI_VID_CTRL 0x010 -#define VID_CTRL_VIDEO_EN (1 << 31) -#define VID_CTRL_HDMI_MODE (1 << 30) -#define VID_CTRL_INTERLACE (1 << 4) -#define VID_CTRL_REPEATER_2X (1 << 0) -#define HDMI_VID_TIMING0 0x014 -#define VID_ACT_V(v) (((v) - 1) << 16) -#define VID_ACT_H(h) (((h) - 1) << 0) -#define HDMI_VID_TIMING1 0x018 -#define VID_VBP(vbp) (((vbp) - 1) << 16) -#define VID_HBP(hbp) (((hbp) - 1) << 0) -#define HDMI_VID_TIMING2 0x01c -#define VID_VFP(vfp) (((vfp) - 1) << 16) -#define VID_HFP(hfp) (((hfp) - 1) << 0) -#define HDMI_VID_TIMING3 0x020 -#define VID_VSPW(vspw) (((vspw) - 1) << 16) -#define VID_HSPW(hspw) (((hspw) - 1) << 0) -#define HDMI_VID_TIMING4 0x024 -#define TX_CLOCK_NORMAL 0x03e00000 -#define VID_VSYNC_ACTSEL (1 << 1) -#define VID_HSYNC_ACTSEL (1 << 0) -#define HDMI_AUD_CTRL 0x040 -#define AUD_CTRL_EN (1 << 31) -#define AUD_CTRL_RST (1 << 30) -#define HDMI_ADMA_CTRL 0x044 -#define HDMI_ADMA_MODE (1 << 31) -#define HDMI_ADMA_MODE_DDMA (0 << 31) -#define HDMI_ADMA_MODE_NDMA (1 << 31) -#define HDMI_AUD_FMT 0x048 -#define AUD_FMT_CH(n) ((n) - 1) -#define HDMI_PCM_CTRL 0x04c -#define HDMI_AUD_CTS 0x050 -#define HDMI_AUD_N 0x054 -#define HDMI_AUD_CH_STATUS0 0x058 -#define CH_STATUS0_FS_FREQ (0xf << 24) -#define CH_STATUS0_FS_FREQ_48 (2 << 24) -#define HDMI_AUD_CH_STATUS1 0x05c -#define CH_STATUS1_WORD_LEN (0x7 << 1) -#define CH_STATUS1_WORD_LEN_16 (1 << 1) -#define HDMI_AUDIO_RESET_RETRY 1000 -#define HDMI_AUDIO_CHANNELS 2 -#define HDMI_AUDIO_CHANNELMAP 0x76543210 -#define HDMI_AUDIO_N 6144 /* 48 kHz */ -#define HDMI_AUDIO_CTS(r, n) ((((r) * 10) * ((n) / 128)) / 480) -#define HDMI_PADCTRL0 0x200 -#define PADCTRL0_BIASEN (1 << 31) -#define PADCTRL0_LDOCEN (1 << 30) -#define PADCTRL0_LDODEN (1 << 29) -#define PADCTRL0_PWENC (1 << 28) -#define PADCTRL0_PWEND (1 << 27) -#define PADCTRL0_PWENG (1 << 26) -#define PADCTRL0_CKEN (1 << 25) -#define PADCTRL0_SEN (1 << 24) -#define PADCTRL0_TXEN (1 << 23) -#define HDMI_PADCTRL1 0x204 -#define PADCTRL1_AMP_OPT (1 << 23) -#define PADCTRL1_AMPCK_OPT (1 << 22) -#define PADCTRL1_DMP_OPT (1 << 21) -#define PADCTRL1_EMP_OPT (1 << 20) -#define PADCTRL1_EMPCK_OPT (1 << 19) -#define PADCTRL1_PWSCK (1 << 18) -#define PADCTRL1_PWSDT (1 << 17) -#define PADCTRL1_REG_CSMPS (1 << 16) -#define PADCTRL1_REG_DEN (1 << 15) -#define PADCTRL1_REG_DENCK (1 << 14) -#define PADCTRL1_REG_PLRCK (1 << 13) -#define PADCTRL1_REG_EMP (0x7 << 10) -#define PADCTRL1_REG_EMP_EN (0x2 << 10) -#define PADCTRL1_REG_CD (0x3 << 8) -#define PADCTRL1_REG_CKSS (0x3 << 6) -#define PADCTRL1_REG_CKSS_1X (0x1 << 6) -#define PADCTRL1_REG_CKSS_2X (0x0 << 6) -#define PADCTRL1_REG_AMP (0x7 << 3) -#define PADCTRL1_REG_AMP_EN (0x6 << 3) -#define PADCTRL1_REG_PLR (0x7 << 0) -#define HDMI_PLLCTRL0 0x208 -#define PLLCTRL0_PLL_EN (1 << 31) -#define PLLCTRL0_BWS (1 << 30) -#define PLLCTRL0_HV_IS_33 (1 << 29) -#define PLLCTRL0_LDO1_EN (1 << 28) -#define PLLCTRL0_LDO2_EN (1 << 27) -#define PLLCTRL0_SDIV2 (1 << 25) -#define PLLCTRL0_VCO_GAIN (0x1 << 22) -#define PLLCTRL0_S (0x7 << 17) -#define PLLCTRL0_CP_S (0xf << 12) -#define PLLCTRL0_CS (0x7 << 8) -#define PLLCTRL0_PREDIV(x) ((x) << 4) -#define PLLCTRL0_VCO_S (0x8 << 0) -#define HDMI_PLLDBG0 0x20c -#define PLLDBG0_CKIN_SEL (1 << 21) -#define PLLDBG0_CKIN_SEL_PLL3 (0 << 21) -#define PLLDBG0_CKIN_SEL_PLL7 (1 << 21) -#define HDMI_PKTCTRL0 0x2f0 -#define HDMI_PKTCTRL1 0x2f4 -#define PKTCTRL_PACKET(n,t) ((t) << ((n) << 2)) -#define PKT_NULL 0 -#define PKT_GC 1 -#define PKT_AVI 2 -#define PKT_AI 3 -#define PKT_SPD 5 -#define PKT_END 15 -#define DDC_CTRL 0x500 -#define CTRL_DDC_EN (1 << 31) -#define CTRL_DDC_ACMD_START (1 << 30) -#define CTRL_DDC_FIFO_DIR (1 << 8) -#define CTRL_DDC_FIFO_DIR_READ (0 << 8) -#define CTRL_DDC_FIFO_DIR_WRITE (1 << 8) -#define CTRL_DDC_SWRST (1 << 0) -#define DDC_SLAVE_ADDR 0x504 -#define SLAVE_ADDR_SEG_SHIFT 24 -#define SLAVE_ADDR_EDDC_SHIFT 16 -#define SLAVE_ADDR_OFFSET_SHIFT 8 -#define SLAVE_ADDR_SHIFT 0 -#define DDC_INT_STATUS 0x50c -#define INT_STATUS_XFER_DONE (1 << 0) -#define DDC_FIFO_CTRL 0x510 -#define FIFO_CTRL_CLEAR (1 << 31) -#define DDC_BYTE_COUNTER 0x51c -#define DDC_COMMAND 0x520 -#define COMMAND_EOREAD (4 << 0) -#define DDC_CLOCK 0x528 -#define DDC_CLOCK_M (1 << 3) -#define DDC_CLOCK_N (5 << 0) -#define DDC_FIFO 0x518 -#define SWRST_DELAY 1000 -#define DDC_DELAY 1000 -#define DDC_RETRY 1000 -#define DDC_BLKLEN 16 -#define DDC_ADDR 0x50 -#define EDDC_ADDR 0x60 -#define EDID_LENGTH 128 -#define DDC_CTRL_LINE 0x540 -#define DDC_LINE_SCL_ENABLE (1 << 8) -#define DDC_LINE_SDA_ENABLE (1 << 9) -#define HDMI_ENABLE_DELAY 50000 -#define DDC_READ_RETRY 4 -#define EXT_TAG 0x00 -#define CEA_TAG_ID 0x02 -#define CEA_DTD 0x03 -#define DTD_BASIC_AUDIO (1 << 6) -#define CEA_REV 0x02 -#define CEA_DATA_OFF 0x03 -#define CEA_DATA_START 4 -#define BLOCK_TAG(x) (((x) >> 5) & 0x7) -#define BLOCK_TAG_VSDB 3 -#define BLOCK_LEN(x) ((x) & 0x1f) -#define HDMI_VSDB_MINLEN 5 -#define HDMI_OUI "\x03\x0c\x00" -#define HDMI_OUI_LEN 3 -#define HDMI_DEFAULT_FREQ 297000000 - -struct a10hdmi_softc { - struct resource *res; - - struct intr_config_hook mode_hook; - - uint8_t edid[EDID_LENGTH]; - - int has_hdmi; - int has_audio; - - clk_t clk_ahb; - clk_t clk_hdmi; - clk_t clk_lcd; -}; - -static struct resource_spec a10hdmi_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { -1, 0 } -}; - -#define HDMI_READ(sc, reg) bus_read_4((sc)->res, (reg)) -#define HDMI_WRITE(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) - -static void -a10hdmi_init(struct a10hdmi_softc *sc) -{ - /* Enable the HDMI module */ - HDMI_WRITE(sc, HDMI_CTRL, CTRL_MODULE_EN); - - /* Configure PLL/DRV settings */ - HDMI_WRITE(sc, HDMI_PADCTRL0, PADCTRL0_BIASEN | PADCTRL0_LDOCEN | - PADCTRL0_LDODEN | PADCTRL0_PWENC | PADCTRL0_PWEND | - PADCTRL0_PWENG | PADCTRL0_CKEN | PADCTRL0_TXEN); - HDMI_WRITE(sc, HDMI_PADCTRL1, PADCTRL1_AMP_OPT | PADCTRL1_AMPCK_OPT | - PADCTRL1_EMP_OPT | PADCTRL1_EMPCK_OPT | PADCTRL1_REG_DEN | - PADCTRL1_REG_DENCK | PADCTRL1_REG_EMP_EN | PADCTRL1_REG_AMP_EN); - - /* Select PLL3 as input clock */ - HDMI_WRITE(sc, HDMI_PLLDBG0, PLLDBG0_CKIN_SEL_PLL3); - - DELAY(HDMI_ENABLE_DELAY); -} - -static void -a10hdmi_hpd(void *arg) -{ - struct a10hdmi_softc *sc; - device_t dev; - uint32_t hpd; - - dev = arg; - sc = device_get_softc(dev); - - hpd = HDMI_READ(sc, HDMI_HPD); - if ((hpd & HPD_DET) == HPD_DET) - EVENTHANDLER_INVOKE(hdmi_event, dev, HDMI_EVENT_CONNECTED); - - config_intrhook_disestablish(&sc->mode_hook); -} - -static int -a10hdmi_probe(device_t dev) -{ - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "allwinner,sun7i-a20-hdmi")) - return (ENXIO); - - device_set_desc(dev, "Allwinner HDMI TX"); - return (BUS_PROBE_DEFAULT); -} - -static int -a10hdmi_attach(device_t dev) -{ - struct a10hdmi_softc *sc; - int error; - - sc = device_get_softc(dev); *** 873 LINES SKIPPED *** From nobody Fri Mar 17 11:34:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMVL3pxfz3yG07; Fri, 17 Mar 2023 11:34: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 4PdMVL2P0Sz3Qv7; Fri, 17 Mar 2023 11:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gHz7Go+PW7QjljTqo4gemZylUORZCPUJJgwE0UyY09k=; b=aohVnuyDHxQphvuhGWpns0na+qKAQLfOwjR4Mlu1p3nHa72jFLj/zrfVttI3TMfuNgcMQJ YOwf8lr9ZGhlugzpUX7X+I3M1OtacnhaPz3aDDRJbXHsUtswgr2QLtwsih04N6dJK+gI1T RIELW3d31UsOIOh4EDGRXR+oo3B8hOJvug3XyDiVv4kTxaxyvM2UhsqNNjTTiiKLR8wDF4 Zf68XgM72Wg+ZDG6VFwdrdVq9BJbPVreNgPR/AEwYFA1BzFIqKc+hOJFKMpeS9lwtIrpud IHjlKtf0xLSLk3Toq1hD3mgbByo6IZBT8ydj0q7FQ9TGpHQRGAYQHEVT5zzt5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gHz7Go+PW7QjljTqo4gemZylUORZCPUJJgwE0UyY09k=; b=I0uExcR5jixDKTX4fSNhE8xkYxFT4BZ3g2Ccc7sZS3Bue3M4X4+9sKUWa1d0mjdqg2mR8Z RgFiZwwjScIW7EiTycz7IVC+DK3T7sSpE1erbitdinTY9fM5tdEQTf81kDVqLezQyWMPjQ cmKFiFvEq1Gpuro6qJESWsTBg9pIuLrV+Fx0p76VuiShh8PNpgEHikQw5Ik+kDC+kdzeij ccwVKSBCTKC4xtSD5BM2zCqCOjLl052b40u8gBDQ9yzmHh3PbCnqHof+Dtbq29CWLumUiq VM3q1tSXtKugDCKvFMj7sl6lwSkOOH4IMdggWZv/oq+hC7pAmuGmVP/+CUVjrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052874; a=rsa-sha256; cv=none; b=IsQMKjZvONGxXUR2odepwtk9PFCYRdRbrVWwazSLLTrYVuvnzKnCEVWxTNvdhbnNVd5YI1 VfLSqnPVqU4HKL1owqbjpe0hsIgGall8nKL3H7fbVHV2CQ88V7FGiAqXEJx6VCrUZnIG6P cRF/Pz3gcD6yVo4mM0RYlaLP3V19quIfohN/N5N6sTdTw8wNVNtNKH1KwiBE3uUYMNdi8S mQ22pKMh9xgwB5b9jmrP5pG69svoH3gTh9E3FyF9N+agGZcHSLHtU+p8bFhE8b1k0H9yHB p7UHF+1ipWRoqpJSXD7G7XkDkU2W0LYWh1HsO1N4cp8xiOTnogfQkVGbgfKMJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMVL1KplzPRT; Fri, 17 Mar 2023 11:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBYYmw082105; Fri, 17 Mar 2023 11:34:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBYYkB082104; Fri, 17 Mar 2023 11:34:34 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:34:34 GMT Message-Id: <202303171134.32HBYYkB082104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 8574d32f226a - main - arm: imx: Rename video related devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8574d32f226a5fc5b3d453d46745a8681ddbb465 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=8574d32f226a5fc5b3d453d46745a8681ddbb465 commit 8574d32f226a5fc5b3d453d46745a8681ddbb465 Author: Emmanuel Vadot AuthorDate: 2023-03-16 09:30:57 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:34:46 +0000 arm: imx: Rename video related devices device 'hdmi' is too generic (and will be used later in a new device) so rename the arm IMX devices to some proper name. Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39118 --- sys/arm/conf/GENERIC | 5 +++++ sys/arm/freescale/imx/files.imx6 | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 84f81a2f142c..024ff2a13ab4 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -247,6 +247,11 @@ device videomode device hdmi device vchiq +# IMX6 HDMI Controller +device dwc_hdmi +device imx6_hdmi +device imx6_ipu + # Pinmux device fdt_pinctrl diff --git a/sys/arm/freescale/imx/files.imx6 b/sys/arm/freescale/imx/files.imx6 index 926c2b25f4b9..2cf2524d2ae5 100644 --- a/sys/arm/freescale/imx/files.imx6 +++ b/sys/arm/freescale/imx/files.imx6 @@ -23,10 +23,10 @@ arm/freescale/imx/imx6_audmux.c optional sound arm/freescale/imx/imx6_ssi.c optional sound fslsdma arm/freescale/imx/imx6_ahci.c optional ahci -dev/hdmi/dwc_hdmi.c optional hdmi -arm/freescale/imx/imx6_hdmi.c optional hdmi +dev/hdmi/dwc_hdmi.c optional vt dwc_hdmi +arm/freescale/imx/imx6_hdmi.c optional vt imx6_hdmi -arm/freescale/imx/imx6_ipu.c optional vt +arm/freescale/imx/imx6_ipu.c optional vt imx6_ipu # # Optional devices. From nobody Fri Mar 17 11:34:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMVM6c4Rz3yFhN; Fri, 17 Mar 2023 11:34: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 4PdMVM5Rn4z3R5c; Fri, 17 Mar 2023 11:34:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hencsVsUG4mhKhYzeMeCCQW5NsUYYZ35qvJAWslJkh4=; b=q/XkWQ2MyCekAYi8N92ZIiRCGI6AChWipaZBvKsGwVmRA6Qm1UobFuVJXLJc3rBkhuX9cX UCYGzp5XtrkUB+dMdhy120Lw13VyfSuD+Mq9P2QRL9U5UlEyfCzCB/VqWAWXCo+2P6A7EI BaPPn7DtoW6IT3AykmuBmOp+4omkUbWeTjPkWENoBErS47c97dUvlW32bAbS2Yug8Xd70W 6uZcqQVTk90xAoQTUmkGOnXZcSl0dSUqNUxgiN+Z/yEHuPQOJBavWRAfxXcZ7mM1Ha5duu S4BSxm4D83CwU/BZ8MbB8+lBB4RTNJd+F/9FIBR5Djpar2XHOjY+F21mSu8X8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hencsVsUG4mhKhYzeMeCCQW5NsUYYZ35qvJAWslJkh4=; b=U3EMGp/hf2KcfvLcurLx2ydzp+w6Uh9N+1UfLtKPlifN476pTjp2JtFmGSRigDzCINjP1v TDG3Nu2pU5zFAelnVqCdLgU1WqYhBfCzD9nfW5RIhkT5UnzVsLvaEZJq9U/OfTFFH9Ne96 BkoBAah4oPIQouO/7KLYmiBjx/6191S9r2bCF8BKINwZaMWXRa5Az350EtP9C4zn/1KNmc PfY9YrO7AOdNPomCME4LYb7SGb+yGDnmd/NDnBd71nwERkd950gc6uam9YU/3m+o5+Scvo d2TuHDMNVh7l9E6xYaX6Xqp4oolx3cv6O0cjT1bvHpsNchnjtuqkxc+6JobYjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052875; a=rsa-sha256; cv=none; b=fB9xj1Xwj4mxH709Yi1vj5v3r/6m3aAtCT/FE3U7xjHgAlh8EphUO+jWlpq7V33q1dAe/S nLuisQr0VUwJkfNxf03u/h9LcJVe3fu4+sFbFB5PMG+Kzvf62+NF1jl7AUF3R2K/SvMd2s k38A7ytGGW7xDeKaUBpgyTAgC+qQ1gXixOuKrT/ShLqfqclOJMVMc6BLFNtw6phgm+klkA +OHXc7RzULw0bCrcHhArbvbjAWQscaz/PAunjLkc1Iaesg1x6wJVKfK+43QyC0jWrl31he Wd5LSwiTjwT6gRp0ofckHskzd9NFSmvPzwIEK/S5tsqQlE4GBX77668L4/IlBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMVM2v05zP74; Fri, 17 Mar 2023 11:34:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBYZjm082129; Fri, 17 Mar 2023 11:34:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBYZLL082128; Fri, 17 Mar 2023 11:34:35 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:34:35 GMT Message-Id: <202303171134.32HBYZLL082128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 3bcb469c61de - main - arm: ti: Rename video related devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3bcb469c61de035dcd9044132162ddeee80b935b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3bcb469c61de035dcd9044132162ddeee80b935b commit 3bcb469c61de035dcd9044132162ddeee80b935b Author: Emmanuel Vadot AuthorDate: 2023-03-16 09:36:23 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:34:52 +0000 arm: ti: Rename video related devices device 'hdmi' is too generic (and will be used later in a new device) so rename the arm TI devices to some proper name. Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39119 --- sys/arm/conf/GENERIC | 3 +++ sys/arm/ti/am335x/files.am335x | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 024ff2a13ab4..74958061be46 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -252,6 +252,9 @@ device dwc_hdmi device imx6_hdmi device imx6_ipu +# TDA19988 HDMI Encoder +device tda19988 + # Pinmux device fdt_pinctrl diff --git a/sys/arm/ti/am335x/files.am335x b/sys/arm/ti/am335x/files.am335x index 4ecdc1e35b43..b5f78ae6f4a8 100644 --- a/sys/arm/ti/am335x/files.am335x +++ b/sys/arm/ti/am335x/files.am335x @@ -19,7 +19,7 @@ arm/ti/am335x/am335x_musb.c optional musb fdt arm/ti/am335x/am335x_usb_phy.c optional musb fdt arm/ti/am335x/am3359_cppi41.c optional musb fdt -arm/ti/am335x/tda19988.c optional hdmi +arm/ti/am335x/tda19988.c optional tda19988 arm/ti/ti_edma3.c standard arm/ti/cpsw/if_cpsw.c optional cpsw From nobody Fri Mar 17 11:34:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMVN6mlKz3yFkf; Fri, 17 Mar 2023 11:34: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 4PdMVN4WJdz3R3w; Fri, 17 Mar 2023 11:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fj2OobpsETjCtaeKEtaX4non4hrOrEe0t5MFp1NKXvA=; b=hOHhafjK3XCr0jNwkmqiv+EEZYBfJuKHSQuBfWnEdVZ6JE+LrtCnBYUngGijBoDt1A86xm jcTT6MYjnQq/Cz2Dhyn+pDlECk6+XhPYl5GALVsp0UDMGblUpF7Gca7Bz0VeLOcKhZUoJx CLObpBrJ6H53zkA5vWdXEfvChc7WRf0sPHdaNQp/ym+lhf1A7PlafMH7VMNdy0qFBnvA5s elQ49AkdwOWCtpWEWSJVEA60f63iVXPzC7Vi0KioqGhB4tl+P9F6WaxmxIPkIx3nM+gIWJ oxDhkuamYjKe+GJNzr7GKnNFdKiKiUE0jKY5cv6LOGm4/VLT0GIMMBk6R7gPvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fj2OobpsETjCtaeKEtaX4non4hrOrEe0t5MFp1NKXvA=; b=bt7oZrpeJ2YZNyBZH5pWvxsbFc0eR3ksVAMSyeFGc6Xpssk63vELhESPdJlLThvmsO6xNQ sG4j41soCIxv8SO30iqjsXjz0qk0VK5giSy8le1eE4xz8ZLxYCnsUeoydpsYFrnh9DqXEE 2vhsYznfh/23WOFeGNEDlJDE6Yw74PIBY6axO3VNvJbAmFCFwQCiZRxEqH2X26UWce5CAC Ow6utxJbrRvNQA7GbemVufrffMgwujsIZ19v9e52CazJJgivHe4TGhfSE+2ffvafSu7tjc rpDeWPmQJQ9S5l8T2EVK4/3QenCRjaiNT3RL2i/NcIDg/aKOP3dh6e9y/XkXzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052876; a=rsa-sha256; cv=none; b=il9O7gItsAP0G6Q2lqGyI/StKvxn36wSEY57+DNfShnIHhYvsWrgnLjokcAqnW8S94q03/ zSwNok32X/Hm64sJpMFV/lqSO0F88/pRd/hRUTwhNlywVGuGlxfMgdqlIyBdtDfbNzZ4kY b+OkrW9iV8w68D+sewVV+/ybKEp0/9+jnTNtlhsahge2tUFXDpoYfYVT+pKMwheTPn8djv Rn2KQQ72zFQLH5yNVLQebyHS5Hg7f4CIOrDRlO/b3WXa/cWpSgVOGd2p2xMnQZsP4mE8ki aoFA+8MQzxW1V3Qb/trdJo+Q+3jNFYXrUGosag44PbJIOJqMixhmlcqltBzsWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMVN3Lh6zP75; Fri, 17 Mar 2023 11:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBYa2q082153; Fri, 17 Mar 2023 11:34:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBYaUc082152; Fri, 17 Mar 2023 11:34:36 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:34:36 GMT Message-Id: <202303171134.32HBYaUc082152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 00e84f52f098 - main - arm: Rename hdmi_if.m to crtc_if.m List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00e84f52f0985e6b2fd73694aa5f4b50a5f957af Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=00e84f52f0985e6b2fd73694aa5f4b50a5f957af commit 00e84f52f0985e6b2fd73694aa5f4b50a5f957af Author: Emmanuel Vadot AuthorDate: 2023-03-16 09:48:06 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:34:57 +0000 arm: Rename hdmi_if.m to crtc_if.m There is nothing hdmi related in this interface, it's just a generic interface for crt controller so rename it. This also remove the 'hdmi' device used in arm kernel config. 'vt' now controls if we build this interface (sc(4) isn't supported on arm). Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39120 --- sys/arm/conf/GENERIC | 1 - sys/arm/freescale/imx/imx6_hdmi.c | 8 ++++---- sys/arm/freescale/imx/imx6_ipu.c | 6 +++--- sys/arm/ti/am335x/am335x_lcd.c | 6 +++--- sys/arm/ti/am335x/tda19988.c | 8 ++++---- sys/conf/files.arm | 2 +- sys/dev/hdmi/dwc_hdmi.c | 2 +- sys/dev/hdmi/dwc_hdmi_fdt.c | 2 +- sys/dev/{hdmi/hdmi_if.m => video/crtc_if.m} | 2 +- 9 files changed, 18 insertions(+), 19 deletions(-) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 74958061be46..815fd2a1881e 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -244,7 +244,6 @@ device vt device kbdmux device ums device videomode -device hdmi device vchiq # IMX6 HDMI Controller diff --git a/sys/arm/freescale/imx/imx6_hdmi.c b/sys/arm/freescale/imx/imx6_hdmi.c index 28a62a66fd01..f5b4a2ab0ac5 100644 --- a/sys/arm/freescale/imx/imx6_hdmi.c +++ b/sys/arm/freescale/imx/imx6_hdmi.c @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include -#include "hdmi_if.h" +#include "crtc_if.h" struct imx_hdmi_softc { struct dwc_hdmi_softc base; @@ -200,9 +200,9 @@ static device_method_t imx_hdmi_methods[] = { DEVMETHOD(device_attach, imx_hdmi_attach), DEVMETHOD(device_detach, imx_hdmi_detach), - /* HDMI methods */ - DEVMETHOD(hdmi_get_edid, dwc_hdmi_get_edid), - DEVMETHOD(hdmi_set_videomode, dwc_hdmi_set_videomode), + /* CRTC methods */ + DEVMETHOD(crtc_get_edid, dwc_hdmi_get_edid), + DEVMETHOD(crtc_set_videomode, dwc_hdmi_set_videomode), DEVMETHOD_END }; diff --git a/sys/arm/freescale/imx/imx6_ipu.c b/sys/arm/freescale/imx/imx6_ipu.c index be9487620a06..02bfbe8e0049 100644 --- a/sys/arm/freescale/imx/imx6_ipu.c +++ b/sys/arm/freescale/imx/imx6_ipu.c @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include "fb_if.h" -#include "hdmi_if.h" +#include "crtc_if.h" static int have_ipu = 0; @@ -1120,7 +1120,7 @@ ipu_hdmi_event(void *arg, device_t hdmi_dev) edid = NULL; edid_len = 0; - if (HDMI_GET_EDID(hdmi_dev, &edid, &edid_len) != 0) { + if (CRTC_GET_EDID(hdmi_dev, &edid, &edid_len) != 0) { device_printf(sc->sc_dev, "failed to get EDID info from HDMI framer\n"); } @@ -1150,7 +1150,7 @@ ipu_hdmi_event(void *arg, device_t hdmi_dev) ipu_init(sc); - HDMI_SET_VIDEOMODE(hdmi_dev, sc->sc_mode); + CRTC_SET_VIDEOMODE(hdmi_dev, sc->sc_mode); } static int diff --git a/sys/arm/ti/am335x/am335x_lcd.c b/sys/arm/ti/am335x/am335x_lcd.c index 06563a476a3c..34f46613afac 100644 --- a/sys/arm/ti/am335x/am335x_lcd.c +++ b/sys/arm/ti/am335x/am335x_lcd.c @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include "am335x_pwm.h" #include "fb_if.h" -#include "hdmi_if.h" +#include "crtc_if.h" #define LCD_PID 0x00 #define LCD_CTRL 0x04 @@ -871,7 +871,7 @@ am335x_lcd_hdmi_event(void *arg, device_t hdmi, int event) edid = NULL; edid_len = 0; - if (HDMI_GET_EDID(hdmi_dev, &edid, &edid_len) != 0) { + if (CRTC_GET_EDID(hdmi_dev, &edid, &edid_len) != 0) { device_printf(sc->sc_dev, "failed to get EDID info from HDMI framer\n"); return; } @@ -925,7 +925,7 @@ am335x_lcd_hdmi_event(void *arg, device_t hdmi, int event) hdmi_mode.hskew = videomode->hsync_end - videomode->hsync_start; hdmi_mode.flags |= VID_HSKEW; - HDMI_SET_VIDEOMODE(hdmi_dev, &hdmi_mode); + CRTC_SET_VIDEOMODE(hdmi_dev, &hdmi_mode); } static int diff --git a/sys/arm/ti/am335x/tda19988.c b/sys/arm/ti/am335x/tda19988.c index 8f3a626b7c42..ff3f374a9bcd 100644 --- a/sys/arm/ti/am335x/tda19988.c +++ b/sys/arm/ti/am335x/tda19988.c @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include "iicbus_if.h" -#include "hdmi_if.h" +#include "crtc_if.h" #define MKREG(page, addr) (((page) << 8) | (addr)) @@ -782,9 +782,9 @@ static device_method_t tda_methods[] = { DEVMETHOD(device_attach, tda19988_attach), DEVMETHOD(device_detach, tda19988_detach), - /* HDMI methods */ - DEVMETHOD(hdmi_get_edid, tda19988_get_edid), - DEVMETHOD(hdmi_set_videomode, tda19988_set_videomode), + /* CRTC methods */ + DEVMETHOD(crtc_get_edid, tda19988_get_edid), + DEVMETHOD(crtc_set_videomode, tda19988_set_videomode), {0, 0}, }; diff --git a/sys/conf/files.arm b/sys/conf/files.arm index de7dfdffa591..d236c083cc43 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -86,7 +86,7 @@ dev/dwc/if_dwc.c optional dwc dev/dwc/if_dwc_if.m optional dwc dev/fb/fb.c optional sc dev/fdt/fdt_arm_platform.c optional platform fdt -dev/hdmi/hdmi_if.m optional hdmi +dev/video/crtc_if.m optional vt dev/hwpmc/hwpmc_arm.c optional hwpmc dev/hwpmc/hwpmc_armv7.c optional hwpmc dev/iicbus/twsi/twsi.c optional twsi diff --git a/sys/dev/hdmi/dwc_hdmi.c b/sys/dev/hdmi/dwc_hdmi.c index 0f1388874292..52b0045a00ee 100644 --- a/sys/dev/hdmi/dwc_hdmi.c +++ b/sys/dev/hdmi/dwc_hdmi.c @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "hdmi_if.h" +#include "crtc_if.h" #define I2C_DDC_ADDR (0x50 << 1) #define I2C_DDC_SEGADDR (0x30 << 1) diff --git a/sys/dev/hdmi/dwc_hdmi_fdt.c b/sys/dev/hdmi/dwc_hdmi_fdt.c index 4486e83f1a73..810a1f53e2dc 100644 --- a/sys/dev/hdmi/dwc_hdmi_fdt.c +++ b/sys/dev/hdmi/dwc_hdmi_fdt.c @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include -#include "hdmi_if.h" +#include "crtc_if.h" struct dwc_hdmi_fdt_softc { struct dwc_hdmi_softc base; diff --git a/sys/dev/hdmi/hdmi_if.m b/sys/dev/video/crtc_if.m similarity index 99% rename from sys/dev/hdmi/hdmi_if.m rename to sys/dev/video/crtc_if.m index 81dbfa2009bb..8cf81bccccf9 100644 --- a/sys/dev/hdmi/hdmi_if.m +++ b/sys/dev/video/crtc_if.m @@ -30,7 +30,7 @@ #include #include -INTERFACE hdmi; +INTERFACE crtc; HEADER { #include From nobody Fri Mar 17 11:34:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdMVP73T6z3yG4P; Fri, 17 Mar 2023 11:34: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 4PdMVP5Vtzz3RJn; Fri, 17 Mar 2023 11:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nfMl9Nt15z0iDAYHEdCnhkptqiUsB74Dau/MtZcso8Q=; b=X6LAMnWflfqIdMr9qDLo/of+VR9yGMo+d0lvbKmeNnhzCia4/7uMlVevIGha4VOcDzZ6hr DtqFpqtL63iG0V7JBUTYk199zVcoLZtdt4hEh5UJV4KNRa+khR37Ee0tTGv+WGQgqVynHc SMWWcs83qg+2apEbyalqbUf/Ye9AEcW2N5qYSOB6LVdgwxNL6ud7R0TYfHnBSKAXPrqXM4 J8zhT8u+Rx8qepHI+cx2eMANwDY5/BSqkd9UqMOeSA4Wnauxrql6DdL3i+GeuROsqi2gFm uY7+j60XWfl5JyTVZU0yVRPX4jZ1H1Ra0yYERZBuO6spx1ofj49Mnau/eJjAUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679052877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nfMl9Nt15z0iDAYHEdCnhkptqiUsB74Dau/MtZcso8Q=; b=G+jHtNkZCoiPf9HyusVQDrJD+G1E6icCYLbAi85gwdGtNkB/yVBSRwcnFx/NkPgNFnk2ym LsPyd9kIBU4vmtyKXu1bR/uVtaeJ+92nYfqymA2GEui2JZQhTqdfOiESb19H6Gb7eBV9jw 1xaORbhc48vR7VYc2znn8KBS/8exH+tn5aozhgPOL1yauPvIMvuQK7owLLdBspHL4D7oAA OwAvDAAb/Zl+GV+llV7YgQMQi6HEAyfQnfswpoXdkeFi3qhgEcCsfMNaKh8gNrNDQKwbep f64sPPZg7W6vh9JqJP5P2hqAmLXP/Guz9Iq48v94QOHa8Jt4oRH8tqc5mzEneA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679052877; a=rsa-sha256; cv=none; b=sI+ELN7N1pT6QcCjKolBh8y0v6YCNZgyFq7lXVcBdLTVF2QQrKzYEmE29HN7D57f2dPVYX x1JId0dAIp61SuMrfyVjLPnA6dWUQ5pem473QR1Z+1zTqqjDKDznN3TmYGfinK/cUGn0UU 7ULX4MU2wHhjefKXjlx3rSnTJqEcjkwI7choOxMWGAjk14oooi/DR9pHd8Sp4wLikt9x24 McVxWCsVmbCIuuKuQwZm2sWOKXnoYxFV/6wgJyzhLJRxqjYjqv027H4SCPHTlz0FebLllO RCRG7eX3rDt01mvA4Hu591bGv299iRmfA/shAbv8F0ADLWD/JBX97yjIEEDciA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdMVP4Q1LzPRV; Fri, 17 Mar 2023 11:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HBYb0x082172; Fri, 17 Mar 2023 11:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HBYb07082171; Fri, 17 Mar 2023 11:34:37 GMT (envelope-from git) Date: Fri, 17 Mar 2023 11:34:37 GMT Message-Id: <202303171134.32HBYb07082171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a4f8318acec6 - main - UPDATING: Document arm video devices renaming. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4f8318acec6ae2a725bb7fdc014db416d16a766 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a4f8318acec6ae2a725bb7fdc014db416d16a766 commit a4f8318acec6ae2a725bb7fdc014db416d16a766 Author: Emmanuel Vadot AuthorDate: 2023-03-16 09:38:46 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 12:35:03 +0000 UPDATING: Document arm video devices renaming. Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D39121 --- UPDATING | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/UPDATING b/UPDATING index dbaa5f2a92db..092115d899ea 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20230316: + Video related devices for some arm devices have been renamed. + If you have a custom kernel config and want to use hdmi output on + IMX6 board you need to add "device dwc_hdmi" "device imx6_hdmi" and + "device imx6_ipu" to it. + If you have a custom kernel config and want to use hdmi output on + TI AM335X board you need to add "device tda19988" to it. + If you add "device hdmi" in it you need to remove it as it doesn't + exist anymore. + 20230221: Introduce new kernel options KBD_DELAY1 and KBD_DELAY2. See atkbdc(4) for details. From nobody Fri Mar 17 12:48:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdP804Q3rz3yL8C; Fri, 17 Mar 2023 12:48: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 4PdP803w5zz3p0d; Fri, 17 Mar 2023 12:48:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679057328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OslbKchKiCrGS1uE1hJpMMl2dMFHcDs9aA5ZL3vi8wE=; b=E8T1vCfA1VHco/1MpvawG5beCW/24av24qO12qEgtfFOeNU06vhSEH9ajyx7m0VclwjMGN G5GS5j14je0UJY1uCwJPMgW3qEorU+FvflcaToTg5R8trA9oQwAcwOs5mmdc2R50Fhk0Hy 479fNUBzvFlD1oNn7oiHk0P/LHn0zqriB9vcLeQun4mbTt3nV1JVs0LpfaVOJJY8Yh3AT5 OQB8hfklvJX5FE3JHA9zwtHaJyuE55SpYTO28xBpD69Af8Fmzd3urWXj9CJ6LOkfV1WGAE az6pfo6GQeb4dcjtgWp/ApAt1bBDZBFDwFN+qcrtMl6M1Wadw0qxJliIjtibuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679057328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OslbKchKiCrGS1uE1hJpMMl2dMFHcDs9aA5ZL3vi8wE=; b=BfdAZf4kNViXp3cXUmF3CgZc9Wt9UjWSUhbK7GV5hJxIjKdy/9vfN9zX1r36pWfAh/ksHn 2lPWP8dZwUsQ80i1UV5IQEupfPr8cmKU7pJwl4ME6HQFVeON8J4SxndVPjkEASxih2Sd/k AmH+eqAaIaYwqgQEevUeuzW2XGGnjRVKtHFK8Qx7TmtEtweVTS+MRtIjLoRMOpDxfqpLWZ 2rvB8CkX70bM1yhowfeZtjMOIUkPfhOL0W0HpCBlHgHT9wJOArP9yW8aMYyx6yZ7LmPfCd 68tzM0o+gm+JdSHGTx9XjA5H3RHPPwakoOK8aXq9dg2e1aYaTe36NmkFRLU7EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679057328; a=rsa-sha256; cv=none; b=MBzwpbZL4SR1zIpGrfV5uQhBZqIMml1etl/pc3XGTHKIYbeXHEuqucSM44igB8r44JG1Pk e4UW8q/xo+913YLrlG8ADFxnXn3dS19I6GGW+BZSwW3qsHC32LkqCr3JZHSnVo0uGcpvho ETexfOdHNY5d3X/1dNHkq7EE02+XMSTwGxA6PW12v5T99wdfCPPLBJhrMQbogVDBVCoVY+ xaAIjCsqCeKgiIjiUddVicHh8uRyyLKI0GMWyICaJ/g7AHEd0TOyCgM9VpkaEQugTgdqhM NwDrc+V8hMngzyqEmwu8Gy1+yPS14ZkvswwowYwCoA0c7k0HiqJO2FVbOvzmXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdP802gJqzR0r; Fri, 17 Mar 2023 12:48:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HCmmfT096821; Fri, 17 Mar 2023 12:48:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HCmmfN096820; Fri, 17 Mar 2023 12:48:48 GMT (envelope-from git) Date: Fri, 17 Mar 2023 12:48:48 GMT Message-Id: <202303171248.32HCmmfN096820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 949efdaa1db8 - main - arm: Remove SOCFPGA specific kernel configs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 949efdaa1db8cfe165760ebb78efd3e04ad1f758 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=949efdaa1db8cfe165760ebb78efd3e04ad1f758 commit 949efdaa1db8cfe165760ebb78efd3e04ad1f758 Author: Emmanuel Vadot AuthorDate: 2023-03-15 09:29:27 +0000 Commit: Emmanuel Vadot CommitDate: 2023-03-17 13:49:01 +0000 arm: Remove SOCFPGA specific kernel configs We had GENERIC for a while now so anyone still interested in those boards should make sure that we can boot on them with it and with upstream DTS files. Sponsored by: Beckhoff Automation GmbH & Co. KG Reviewed by: br Differential Revision: https://reviews.freebsd.org/D39088 --- sys/arm/conf/SOCDK | 30 ------------- sys/arm/conf/SOCFPGA | 110 ----------------------------------------------- sys/arm/conf/SOCKIT | 30 ------------- sys/arm/conf/SOCKIT-BERI | 37 ---------------- 4 files changed, 207 deletions(-) diff --git a/sys/arm/conf/SOCDK b/sys/arm/conf/SOCDK deleted file mode 100644 index b5561b9b7ff2..000000000000 --- a/sys/arm/conf/SOCDK +++ /dev/null @@ -1,30 +0,0 @@ -# -# Kernel configuration for Altera Arria10 SOC Development Kit. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "SOCFPGA" -ident SOCDK - -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s4\" - -# Flattened Device Tree -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=socfpga_arria10_socdk_sdmmc.dts diff --git a/sys/arm/conf/SOCFPGA b/sys/arm/conf/SOCFPGA deleted file mode 100644 index 0ffd0ab53631..000000000000 --- a/sys/arm/conf/SOCFPGA +++ /dev/null @@ -1,110 +0,0 @@ -# -# Kernel configuration for Altera SOCFPGA development kits. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -ident SOCFPGA -include "std.armv7" -include "../altera/socfpga/std.socfpga" - -makeoptions MODULES_OVERRIDE="" - -options SCHED_ULE # ULE scheduler -options PLATFORM # Platform based SoC -options SMP # Enable multiple cores - -options SOC_ALTERA_ARRIA10 -options SOC_ALTERA_CYCLONE5 - -# NFS root from boopt/dhcp -#options BOOTP -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ue0 - -# pseudo devices -device clk -device phy -device hwreset -device nvmem -device regulator -device syscon - -# Interrupt controller -device gic - -# ARM MPCore timer -device mpcore_timer - -# DMA support -device xdma -device pl330 - -# MMC/SD/SDIO Card slot support -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device dwmmc - -# Pseudo devices - -device loop -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device usb -device dwcotg - -device umass -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass - -# Serial ports -device uart -device uart_snps - -# I2C (TWSI) -device iic -device iicbus - -# SPI -device spibus -device cqspi -device n25q - -# Ethernet -device ether -device mii -device smsc -device smscphy -device dwc -device micphy - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter - -# Flattened Device Tree -options FDT # Configure using FDT/DTB data diff --git a/sys/arm/conf/SOCKIT b/sys/arm/conf/SOCKIT deleted file mode 100644 index d1e9a85d7bd9..000000000000 --- a/sys/arm/conf/SOCKIT +++ /dev/null @@ -1,30 +0,0 @@ -# -# Kernel configuration for Terasic SoCKit (Altera Cyclone V SoC). -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "SOCFPGA" -ident SOCKIT - -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s4\" - -# Flattened Device Tree -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=socfpga_cyclone5_sockit_sdmmc.dts diff --git a/sys/arm/conf/SOCKIT-BERI b/sys/arm/conf/SOCKIT-BERI deleted file mode 100644 index 0e21f5c27604..000000000000 --- a/sys/arm/conf/SOCKIT-BERI +++ /dev/null @@ -1,37 +0,0 @@ -# -# Kernel configuration for Terasic SoCKit (Altera Cyclone V SoC). -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -#NO_UNIVERSE - -include "SOCFPGA" -ident SOCKIT-BERI - -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s4\" - -# BERI specific -device beri_ring -device beri_mem -device beri_vtblk -device vtbe -device altera_pio - -# Flattened Device Tree -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=socfpga_cyclone5_sockit_beri_sdmmc.dts From nobody Fri Mar 17 12:50:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdP9z0848z3yL8d; Fri, 17 Mar 2023 12:50: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 4PdP9y6jR9z3pfy; Fri, 17 Mar 2023 12:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679057430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xUYvQJEkCKxgBsHrb6a02SBwKe4tVDB027jO5C6VRzo=; b=rxQeSBKQ7sAVuAh55Pe5SuzGjZDAnH2cocQkirr3h/x+t0ZY9btR8B998rjenojwN6SRYH ZcMFEbmokTlxdMM//v2Inf9Tato8lWHf71NWjPozx9ByOTW5ZTdX4oI53/m965SVGCvs2t KBOXcywDCDUEN5PpZoj93uHlcvyFRPL+9dma8InxxWPTrTM5/vwM9L7dJwxeybfrp8Qa5E 2EAnlrf8o5NkRG22cMtyqWf1VPaMiBctz8QUY2BBLeVr26fFowpwL55D1AqWpgMYFHbImT HTd5cdaWZhepBtxswJvVgqYtZ8hxq6jhBqUmbzyrmTlqP1EWj0EmBUdhJMIACQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679057430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xUYvQJEkCKxgBsHrb6a02SBwKe4tVDB027jO5C6VRzo=; b=InSy7byDN1MG+lAQPsmMjX5gCfQwAPj3bEzmA9zhY5b0vqyYXh7+9cnkcUk3jVVtVTadeI +gqNFehhcWcrHzhnLwveTGic1y+Aqd7qkV0zIbqxHQmLRsgvNqO7TShtiCfUy0qAVeK7DJ ewlgEK3PvfqQ/ILT7Kxg7YZWgTu21bWoTmLPqDW0JdJZRZ7qvn2abeDGojfQYqWE82dBuS rcDDNx9hNJj4M0kYF4BnSdwcxfMOM/AVVSkNBctDtiH7hxOpMDCR+hwEZ4fXsD7SfwbQLu WfiVzuwGZByXR0jthFtg3S96aIIpy00/u585WiaWnePFJteKgeMB5PWKQlnSqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679057430; a=rsa-sha256; cv=none; b=U+lDlXlrtPbKzvwp3VqeUhvc7FEPkbvlbbJ2Mw7vJf/wxBLmahl/jSkNj9u5Nqkg9iCeFc 4+5PA6Jr4Rh6hvPwdTaVJfH96AH1YHtx+O025Mn+yn8Qg1LPG4AHnfLorjAalUmwv0UVzv mFDZm0aEjGoI4TLROFpsYieM2vKQ9944iUvRECLJXeHstMzCSD4tS3r6GO8MJ88VSOilVU vlr+Gl9nRHbUBC9A8cSCITJ18/zUwTdppcMD4gqQ2/f82g+xKP7B08QhBE2nqKX30q+zRv TtG232mXbdv7BMDMikae3F7jID3G0x8R7opg3glm2Q7KJE0MNTr2aqkHl9YJzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdP9y5mL9zR11; Fri, 17 Mar 2023 12:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HCoUtE005580; Fri, 17 Mar 2023 12:50:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HCoULQ005579; Fri, 17 Mar 2023 12:50:30 GMT (envelope-from git) Date: Fri, 17 Mar 2023 12:50:30 GMT Message-Id: <202303171250.32HCoULQ005579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 94a3876d7e18 - main - vmm: fix missing ipi statistic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94a3876d7e18ada9596464623829d37d186da856 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=94a3876d7e18ada9596464623829d37d186da856 commit 94a3876d7e18ada9596464623829d37d186da856 Author: Vitaliy Gusev AuthorDate: 2023-03-17 09:17:22 +0000 Commit: Corvin Köhne CommitDate: 2023-03-17 12:50:08 +0000 vmm: fix missing ipi statistic ipi counters are missing in bhyvectl's output because vm_maxcpu is 0 when initializing them. That's because vmm_stat_register is executed before vmm_init. Instead of directly fixing it, there's a better solution in illumos which is cherry picked: https://github.com/illumos/illumos-gate/commit/65a3bc83734e5fb0fc2c19df3e5112b87dcdc3f8 It replaces the matrix statistic by two counters per vcpu. One for counting the ipis to the vcpu and one counting the ipis received by the vcpu. This has several advantages: - A matrix statistic becomes huge when using many vcpus. - A matrix statistic easily reaches the MAX_VMM_STAT_ELEMS limit. - Two counters are enough in most cases. DTrace can be used for more advanced debugging purposes. - A matrix statistic wastes memory. The matrix size is determined by vm_maxcpu regardless of the number of vcpus assigned to the vm. Reviewed by: corvink, markj Fixes: ee98f99d7a68b284a669fefb969cbfc31df2d0ab ("vmm: Convert VM_MAXCPU into a loader tunable hw.vmm.maxcpu.") MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D39038 --- sys/amd64/vmm/io/vlapic.c | 9 ++++++--- sys/amd64/vmm/vmm_stat.c | 3 --- sys/amd64/vmm/vmm_stat.h | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 884e232b1422..2144cbabd979 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -905,7 +905,8 @@ vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32_t dest, bool phys, } } -static VMM_STAT_ARRAY(IPIS_SENT, VMM_STAT_NELEMS_VCPU, "ipis sent to vcpu"); +static VMM_STAT(VLAPIC_IPI_SEND, "ipis sent from vcpu"); +static VMM_STAT(VLAPIC_IPI_RECV, "ipis received by vcpu"); static void vlapic_set_tpr(struct vlapic *vlapic, uint8_t val) @@ -1102,7 +1103,8 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu) CPU_FOREACH_ISSET(i, &dmask) { vcpu = vm_vcpu(vlapic->vm, i); lapic_intr_edge(vcpu, vec); - vmm_stat_array_incr(vlapic->vcpu, IPIS_SENT, i, 1); + vmm_stat_incr(vlapic->vcpu, VLAPIC_IPI_SEND, 1); + vmm_stat_incr(vcpu, VLAPIC_IPI_RECV, 1); VLAPIC_CTR2(vlapic, "vlapic sending ipi %d to vcpuid %d", vec, i); } @@ -1223,7 +1225,8 @@ vlapic_self_ipi_handler(struct vlapic *vlapic, uint64_t val) vec = val & 0xff; lapic_intr_edge(vlapic->vcpu, vec); - vmm_stat_array_incr(vlapic->vcpu, IPIS_SENT, vlapic->vcpuid, 1); + vmm_stat_incr(vlapic->vcpu, VLAPIC_IPI_SEND, 1); + vmm_stat_incr(vlapic->vcpu, VLAPIC_IPI_RECV, 1); VLAPIC_CTR1(vlapic, "vlapic self-ipi %d", vec); } diff --git a/sys/amd64/vmm/vmm_stat.c b/sys/amd64/vmm/vmm_stat.c index 2750982185aa..2df4423bc60f 100644 --- a/sys/amd64/vmm/vmm_stat.c +++ b/sys/amd64/vmm/vmm_stat.c @@ -70,9 +70,6 @@ vmm_stat_register(void *arg) if (vst->scope == VMM_STAT_SCOPE_AMD && !vmm_is_svm()) return; - if (vst->nelems == VMM_STAT_NELEMS_VCPU) - vst->nelems = vm_maxcpu; - if (vst_num_elems + vst->nelems >= MAX_VMM_STAT_ELEMS) { printf("Cannot accommodate vmm stat type \"%s\"!\n", vst->desc); return; diff --git a/sys/amd64/vmm/vmm_stat.h b/sys/amd64/vmm/vmm_stat.h index 050d3c13dda1..e40a960ec82a 100644 --- a/sys/amd64/vmm/vmm_stat.h +++ b/sys/amd64/vmm/vmm_stat.h @@ -58,8 +58,6 @@ struct vmm_stat_type { void vmm_stat_register(void *arg); -#define VMM_STAT_NELEMS_VCPU (-1) - #define VMM_STAT_FDEFINE(type, nelems, desc, func, scope) \ struct vmm_stat_type type[1] = { \ { -1, nelems, desc, func, scope } \ From nobody Fri Mar 17 13:11:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdPdl1YPwz3yMGP; Fri, 17 Mar 2023 13:11: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 4PdPdl15pCz3r9Y; Fri, 17 Mar 2023 13:11:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679058667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nbedifgSl0/fdi4tZY3xwVI8v9VjjZJMN0jxM3XW7X4=; b=o4Pt8YY9aFk1Xwg8FiYGDg6CiKtrzD88HBL5Gv+KfHL2zzCGsRDDIAroPzUTu1KdM/4Xw5 vvAgy+tiAbA/vF5K8hW95Bw7IFd+GHrfPNSFfNzokxO5WXCIlYPPS+R5NhnASr3o17iIQ6 AVScSu7hMG8XyQVY+NUpjL8oiqvZv9z2G2rv6OyNML8NVcpSr8BH/ckVEdtvRWeGCP2DH4 t2p9WSBaMaDCmZ+CLaZiUBypA3odpEjnyT49Ys+cwhgOIz3CuMBNBJ+4tz+ZP0KPNZH+Df 3j3LL2L0uL9aBhZ0Ak5VLM1LE0YVaOP9cRM3Vo0CnTGCPM1yDrkcgtCliuOiYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679058667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nbedifgSl0/fdi4tZY3xwVI8v9VjjZJMN0jxM3XW7X4=; b=ZtACH+Z9U7fIIHQ/GcdBEnJGpDXDkny5p53Ze7QlR+KT0Tub3tegrF97aI8aMT1xOKgN+1 Qm/vk8AkfE9/iXahvCvC9Dcc2VXMYtZEFuUmyxEcu4FkyNYyr0b0xexRhf0AY5xmXSGm5B kim2+5PrruloyfKGW07JZKFPGUFm06y4aauTtYCcHXAJXEQjvAocl1wJrFT0lcuUPhHrmq RlB2t7GYj3HQGnmbqxITb9E9P9ylF7BQlbBBzM89y5Zc/r8nmnRErBP8kftpltMKXO+xzI 1lugrA9297TbLXuwoNUhDvi//OiVgs1+0CFyuoAD9r+HJeWxFKf5HBOp7ScEWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679058667; a=rsa-sha256; cv=none; b=KcL1k2hOzDF1v04Ou0WcZtSewMjOY5nec2uXNf9tQj3O3Sqh38Bkfs2rqPCAmuR+5LCAEr HT8SHE0P75Bcbh0H6fh9I4so7LgZXXSa0g/4usZU1IiWInCV6mjEtIKw2IheH4hoNrGX/W TKzFjRowsV931Z4qx5QXGO1v3TMzLLK7lOGfmwyaKmT4LGss68z31EBX87qSG1YAYuRFZ9 2eJKCmW5eHfuSACF3rTM4x9mdyvwRiH6P4a5fceR48mShK6Yj+yyl5kXLcqahE1Bxs3jjz OtWP0lKZ3vhCMMAOkFIkY3sZ6yreFO1DEOd8UnC/CSEFgPsZKEIFAYxVswSEQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdPdl09hlzRQS; Fri, 17 Mar 2023 13:11:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HDB6dq043115; Fri, 17 Mar 2023 13:11:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HDB64d043114; Fri, 17 Mar 2023 13:11:06 GMT (envelope-from git) Date: Fri, 17 Mar 2023 13:11:06 GMT Message-Id: <202303171311.32HDB64d043114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ff6d60946a0e - main - amd64 acpi_wakeup.c: fix typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff6d60946a0e9e0ade3045b734ed4bea08e20938 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ff6d60946a0e9e0ade3045b734ed4bea08e20938 commit ff6d60946a0e9e0ade3045b734ed4bea08e20938 Author: Konstantin Belousov AuthorDate: 2023-03-17 12:42:26 +0000 Commit: Konstantin Belousov CommitDate: 2023-03-17 13:10:34 +0000 amd64 acpi_wakeup.c: fix typo Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/amd64/acpica/acpi_wakeup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index 0f04ccb6f2fc..9601a88e11a4 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -250,7 +250,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) ia32_pause(); } else { /* - * Re-initialize console hardware as soon as possibe. + * Re-initialize console hardware as soon as possible. * No console output (e.g. printf) is allowed before * this point. */ From nobody Fri Mar 17 13:29:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdQ2l2dnxz3yNC6; Fri, 17 Mar 2023 13:29: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 4PdQ2l27BTz3tY8; Fri, 17 Mar 2023 13:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679059759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+sg7RuX/QtRe1AYhOurE/sATpJclm8HKeDKkhT9+f8A=; b=UG99G48Ns5YpwasfYAUIzIuJsxc3m56dzl/SDc5kp/Z4VQPA08Ikhay78E6e8lZGRCJjel /1HugNWkoanlz7+vHGNowiYc3FTGNY2Wsi4U0uJLeaJhK9dPgJyFWjahLE/B1kGCvFMxqw PJIyilBece+W+qnZwNZ09HoXa5WzAeg5zndArpvMfvVfbg5I8eIL91aF57x8pBqfF+pOWE 3Pqzda/GFR7PUPLzNUrR8LZjCQ4H+Jh/ZMERhsrcMF/T/4UzY4Zhvv8IGGShyq7teu4Ytz Oxflz53/CkB/Yu/nJ5ZoKxuams4mihdNEbHeTRd+MlQ/7iMGWiEEDUEOv287NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679059759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+sg7RuX/QtRe1AYhOurE/sATpJclm8HKeDKkhT9+f8A=; b=TUEQJGvE6pb1cfnTkpwm9+LpkDuLxrRCtfh12vo3PF2ilZMNXIuz2TaMmj+gp7Wy2c7aXU dkzOw2I4YfV1bAdN/OIPku8xXZ7V7rArOOgSu56EKm9SN50MGwpg+JebucIzIS61e9Dfhz mnQ14t4vFP6z1T2NjF1x5Q6pnp59lzT7sg7TchrDJH0TIGPxy0ncxNZdlm70vam3deqZAJ GYC5fSRI8NTz3KbYdLe2Gmfozv+zNo7+mZPR2CCkjCcqX6z1cKTuc/16Z8+ZHKLTavCnpH f59Pad0002DxPjJ82m+mkdM7cRO/k3mTes8e15bHGdQkNYKv2wOYW+9rIp/w8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679059759; a=rsa-sha256; cv=none; b=fyjn8lZu9txL5iacO4nAucmwWTZE4CTvQVwN0BzeELWMRkqVi/lQcuTb9AXmSESbrV0WDO jMZjGUlfM5tnIHObMpZ2s6gHTh96hlv+03E29fnRdXDHMxGXr4dTU6xPJvtnnxrTJQSkfs zDu5jThnszryMA1uzwXaXmfyQa/gmfWgMsc81lVXs7hSr5vV/DHgNTFQzHty1gycFMDM0w uaFv9HFY3AKG+i4G3aOZm7KcM2IG5gIurjtFbSZBylFTbKxKk8sFneTKTXSvf6i+uo8e+e HoR0VJDgCM7hThUXdcno2W3CeZvnWRjm2XqMfu7g8E9oEZ0+zL7yCNnCuMgnkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdQ2l1B5PzRZS; Fri, 17 Mar 2023 13:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HDTJtr063689; Fri, 17 Mar 2023 13:29:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HDTJj7063688; Fri, 17 Mar 2023 13:29:19 GMT (envelope-from git) Date: Fri, 17 Mar 2023 13:29:19 GMT Message-Id: <202303171329.32HDTJj7063688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 491263d7a640 - main - ping: Avoid magic numbers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 491263d7a640a85a6be40fd0c0a9397d072f0847 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=491263d7a640a85a6be40fd0c0a9397d072f0847 commit 491263d7a640a85a6be40fd0c0a9397d072f0847 Author: Jose Luis Duran AuthorDate: 2023-03-17 13:24:44 +0000 Commit: Mark Johnston CommitDate: 2023-03-17 13:24:44 +0000 ping: Avoid magic numbers The sizeof(struct ip) is 20. The sizeof(struct in_addr) is 4. No functional change intended. Reviewed by: asomers, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39125 --- sbin/ping/ping.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 6e069adfecfa..fe319bfb70a5 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1670,7 +1670,7 @@ pr_iph(struct ip *ip) int hlen; hlen = ip->ip_hl << 2; - cp = (u_char *)ip + 20; /* point to options */ + cp = (u_char *)ip + sizeof(struct ip); /* point to options */ (void)printf("Vr HL TOS Len ID Flg off TTL Pro cks Src Dst\n"); (void)printf(" %1x %1x %02x %04x %04x", @@ -1686,7 +1686,7 @@ pr_iph(struct ip *ip) memcpy(&ina, &ip->ip_dst.s_addr, sizeof ina); (void)printf(" %s ", inet_ntoa(ina)); /* dump any option bytes */ - while (hlen-- > 20) { + while (hlen-- > (int)sizeof(struct ip)) { (void)printf("%02x", *cp++); } (void)putchar('\n'); @@ -1706,7 +1706,7 @@ pr_addr(struct in_addr ina) if (options & F_NUMERIC) return inet_ntoa(ina); - hp = cap_gethostbyaddr(capdns, (char *)&ina, 4, AF_INET); + hp = cap_gethostbyaddr(capdns, (char *)&ina, sizeof(ina), AF_INET); if (hp == NULL) return inet_ntoa(ina); From nobody Fri Mar 17 16:26:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdTyy5nNGz3yY7Z; Fri, 17 Mar 2023 16:26: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 4PdTyy5HlMz4GpY; Fri, 17 Mar 2023 16:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679070378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=83L4KozjlZIh5dOqlP+GrR7SBaJCZxYX1b0VRuVs92U=; b=DfpdwsS6Qfes/PqScJd0PnO38fMbTa3jJjW3fhq2OUejb696yfVfnbwO9TwO/KugeQEmkZ P3tH44JdOdhPpKQL5ZHgn/vVxWu3C8qjlqGK7I0J81/fLbPIugDxZIT3XUdKJcViVMtOO3 nz4DAu7NxaZptkycktwGZ0gEXquIlHVcpeqCP9juyvJLxMCHX72YGgV+HvIHVZB/dEle9v fm17SjElJ3qoQhK/npAhsf44U38Af98uF0xyZ7Vg65dkYLy7kCs8qNDib5ncPHJSghmp+l iZvNsYdJfHtOKmFi09x1E2m4UXBUxTvH8dxnT1bFkfLTIGZxBUjzvZaYqYSMfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679070378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=83L4KozjlZIh5dOqlP+GrR7SBaJCZxYX1b0VRuVs92U=; b=hNperES6Fau93H5Mr8z8h4LrTz7fSooH986pbob+TQIVlW3U5s+CvqIqUMm6sOKgO7821c l60eZSxhrNMj5wH6vEch4S8aUf0ak7ZPKfAKM3rIh9hhFRhh/WKK0jojQnOZUvvUYKjxKs aRa4KQs9F6TPKxG1ljeSHVl+0Te5CuJgAhWqiMReOA6hqaV68Knn7ROvjBXMs7ghlrhZD3 WksGkKalMAmXkOX9dYosmkngDCcdaYRLYJLK7GuPy+BWl7JFeNCJvV1fjVmeHLaLGwiyMs uOfw+e1B7aSF2OBlBuZbGzuKk0c7EnVTbccxxGmnpEIS8QclVDpFsaUqoCi3fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679070378; a=rsa-sha256; cv=none; b=uvCv8wVhPHcmWRz71rdjPdLoT8F1MDDD+1uONbD5NDiZfMNP8ghMsrUeXDU7OAtTOGLC1p LoLF/zbtwYoeehW7czqroBcG9mzYfqIo1cyK1aW8TjL15GQ4Xlb7pcRu2YYdf09zqDf524 TruQ2Y/DFvAdefKx1vpJ4CiLMZHDaAZC3FsFYvh1YUPM42Km57a9kea3qAzBqv77bMbUBq q/2KG9NICTIiaIhYbJKJ2A+oSdPB9DYbpTPXD4LsARocMY18ki4X+uqFgmMvki5uIKr6Np XawUfbazy2jbFK3pTH5rk3nfYleK7D3MNXxl3lL9wTPNw5XUXVc6fPpjRjsXaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdTyy47q1zXVd; Fri, 17 Mar 2023 16:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HGQI1I058547; Fri, 17 Mar 2023 16:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HGQIZi058546; Fri, 17 Mar 2023 16:26:18 GMT (envelope-from git) Date: Fri, 17 Mar 2023 16:26:18 GMT Message-Id: <202303171626.32HGQIZi058546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 62a573d9537c - main - vfs: retire KERN_VNODE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62a573d9537c717b2d373f26ba90e4b142823466 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=62a573d9537c717b2d373f26ba90e4b142823466 commit 62a573d9537c717b2d373f26ba90e4b142823466 Author: Mateusz Guzik AuthorDate: 2023-03-16 17:21:59 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-17 16:21:45 +0000 vfs: retire KERN_VNODE It got disabled in 2003: commit acb18acfec97aa7fe26ff48f80a5c3f89c9b542d Author: Poul-Henning Kamp Date: Sun Feb 23 18:09:05 2003 +0000 Bracket the kern.vnode sysctl in #ifdef notyet because it results in massive locking issues on diskless systems. It is also not clear that this sysctl is non-dangerous in its requirements for locked down memory on large RAM systems. There does not seem to be practical use for it and the disabled routine does not work anyway. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39127 --- lib/libc/gen/sysctl.3 | 11 +---- sys/kern/kern_xxx.c | 9 +--- sys/kern/vfs_subr.c | 97 ------------------------------------- sys/security/audit/audit_bsm_klib.c | 1 - sys/sys/sysctl.h | 2 +- sys/sys/vnode.h | 30 ------------ 6 files changed, 3 insertions(+), 147 deletions(-) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index c4883e0aeb4d..4f805d45790a 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd October 18, 2021 +.Dd March 16, 2023 .Dt SYSCTL 3 .Os .Sh NAME @@ -354,7 +354,6 @@ information. .It Dv KERN_SECURELVL Ta integer Ta raise only .It Dv KERN_UPDATEINTERVAL Ta integer Ta no .It Dv KERN_VERSION Ta string Ta no -.It Dv KERN_VNODE Ta struct xvnode Ta no .El .Bl -tag -width 6n .It Li KERN_ARGMAX @@ -487,14 +486,6 @@ This level may be raised by processes with appropriate privilege. It may not be lowered. .It Li KERN_VERSION The system version string. -.It Li KERN_VNODE -Return the entire vnode table. -Note, the vnode table is not necessarily a consistent snapshot of -the system. -The returned data consists of an array whose size depends on the -current number of such objects in the system. -Each element of the array consists of a -.Va struct xvnode . .El .Ss CTL_NET The string and integer information available for the CTL_NET level diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index f95246f1cf38..b0026777a389 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -111,7 +111,7 @@ oquota(struct thread *td, struct oquota_args *uap) #define KINFO_PROC (0<<8) #define KINFO_RT (1<<8) -#define KINFO_VNODE (2<<8) +/* UNUSED, was KINFO_VNODE (2<<8) */ #define KINFO_FILE (3<<8) #define KINFO_METER (4<<8) #define KINFO_LOADAVG (5<<8) @@ -184,13 +184,6 @@ ogetkerninfo(struct thread *td, struct ogetkerninfo_args *uap) 0, 0, 0, &size, 0); break; - case KINFO_VNODE: - name[0] = CTL_KERN; - name[1] = KERN_VNODE; - error = userland_sysctl(td, name, 2, uap->where, uap->size, - 0, 0, 0, &size, 0); - break; - case KINFO_PROC: name[0] = CTL_KERN; name[1] = KERN_PROC; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 0b9d7ca9778f..c117ada017c9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4704,103 +4704,6 @@ sysctl_ovfs_conf(SYSCTL_HANDLER_ARGS) #endif /* 1 || COMPAT_PRELITE2 */ #endif /* !BURN_BRIDGES */ -#define KINFO_VNODESLOP 10 -#ifdef notyet -/* - * Dump vnode list (via sysctl). - */ -/* ARGSUSED */ -static int -sysctl_vnode(SYSCTL_HANDLER_ARGS) -{ - struct xvnode *xvn; - struct mount *mp; - struct vnode *vp; - int error, len, n; - - /* - * Stale numvnodes access is not fatal here. - */ - req->lock = 0; - len = (numvnodes + KINFO_VNODESLOP) * sizeof *xvn; - if (!req->oldptr) - /* Make an estimate */ - return (SYSCTL_OUT(req, 0, len)); - - error = sysctl_wire_old_buffer(req, 0); - if (error != 0) - return (error); - xvn = malloc(len, M_TEMP, M_ZERO | M_WAITOK); - n = 0; - mtx_lock(&mountlist_mtx); - TAILQ_FOREACH(mp, &mountlist, mnt_list) { - if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) - continue; - MNT_ILOCK(mp); - TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { - if (n == len) - break; - vref(vp); - xvn[n].xv_size = sizeof *xvn; - xvn[n].xv_vnode = vp; - xvn[n].xv_id = 0; /* XXX compat */ -#define XV_COPY(field) xvn[n].xv_##field = vp->v_##field - XV_COPY(usecount); - XV_COPY(writecount); - XV_COPY(holdcnt); - XV_COPY(mount); - XV_COPY(numoutput); - XV_COPY(type); -#undef XV_COPY - xvn[n].xv_flag = vp->v_vflag; - - switch (vp->v_type) { - case VREG: - case VDIR: - case VLNK: - break; - case VBLK: - case VCHR: - if (vp->v_rdev == NULL) { - vrele(vp); - continue; - } - xvn[n].xv_dev = dev2udev(vp->v_rdev); - break; - case VSOCK: - xvn[n].xv_socket = vp->v_socket; - break; - case VFIFO: - xvn[n].xv_fifo = vp->v_fifoinfo; - break; - case VNON: - case VBAD: - default: - /* shouldn't happen? */ - vrele(vp); - continue; - } - vrele(vp); - ++n; - } - MNT_IUNLOCK(mp); - mtx_lock(&mountlist_mtx); - vfs_unbusy(mp); - if (n == len) - break; - } - mtx_unlock(&mountlist_mtx); - - error = SYSCTL_OUT(req, xvn, n * sizeof *xvn); - free(xvn, M_TEMP); - return (error); -} - -SYSCTL_PROC(_kern, KERN_VNODE, vnode, CTLTYPE_OPAQUE | CTLFLAG_RD | - CTLFLAG_MPSAFE, 0, 0, sysctl_vnode, "S,xvnode", - ""); -#endif - static void unmount_or_warn(struct mount *mp) { diff --git a/sys/security/audit/audit_bsm_klib.c b/sys/security/audit/audit_bsm_klib.c index 31a9bf29265d..9dde8362ce9c 100644 --- a/sys/security/audit/audit_bsm_klib.c +++ b/sys/security/audit/audit_bsm_klib.c @@ -182,7 +182,6 @@ audit_ctlname_to_sysctlevent(int name[], uint64_t valid_arg) case KERN_HOSTID: case KERN_SECURELVL: case KERN_HOSTNAME: - case KERN_VNODE: case KERN_PROC: case KERN_FILE: case KERN_PROF: diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 79da4772615f..9cfd759166bd 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -972,7 +972,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define KERN_HOSTNAME 10 /* string: hostname */ #define KERN_HOSTID 11 /* int: host identifier */ #define KERN_CLOCKRATE 12 /* struct: struct clockrate */ -#define KERN_VNODE 13 /* struct: vnode structures */ +/* was: #define KERN_VNODE 13 ; disabled in 2003 and removed in 2023 */ #define KERN_PROC 14 /* struct: process entries */ #define KERN_FILE 15 /* struct: file entries */ #define KERN_PROF 16 /* node: kernel profiling info */ diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 04596a7184ee..a3eb00f0fe7c 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -199,36 +199,6 @@ _Static_assert(sizeof(struct vnode) <= 448, "vnode size crosses 448 bytes"); /* XXX: These are temporary to avoid a source sweep at this time */ #define v_object v_bufobj.bo_object -/* - * Userland version of struct vnode, for sysctl. - */ -struct xvnode { - size_t xv_size; /* sizeof(struct xvnode) */ - void *xv_vnode; /* address of real vnode */ - u_long xv_flag; /* vnode vflags */ - int xv_usecount; /* reference count of users */ - int xv_writecount; /* reference count of writers */ - int xv_holdcnt; /* page & buffer references */ - u_long xv_id; /* capability identifier */ - void *xv_mount; /* address of parent mount */ - long xv_numoutput; /* num of writes in progress */ - enum vtype xv_type; /* vnode type */ - union { - void *xvu_socket; /* unpcb, if VSOCK */ - void *xvu_fifo; /* fifo, if VFIFO */ - dev_t xvu_rdev; /* maj/min, if VBLK/VCHR */ - struct { - dev_t xvu_dev; /* device, if VDIR/VREG/VLNK */ - ino_t xvu_ino; /* id, if VDIR/VREG/VLNK */ - } xv_uns; - } xv_un; -}; -#define xv_socket xv_un.xvu_socket -#define xv_fifo xv_un.xvu_fifo -#define xv_rdev xv_un.xvu_rdev -#define xv_dev xv_un.xv_uns.xvu_dev -#define xv_ino xv_un.xv_uns.xvu_ino - /* We don't need to lock the knlist */ #define VN_KNLIST_EMPTY(vp) ((vp)->v_pollinfo == NULL || \ KNLIST_EMPTY(&(vp)->v_pollinfo->vpi_selinfo.si_note)) From nobody Fri Mar 17 17:31:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdWQ86VClz3ycVx; Fri, 17 Mar 2023 17:31: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 4PdWQ85vdzz4Q0S; Fri, 17 Mar 2023 17:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679074288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Ri9k2TDt1y5db3/puePEgog1gxsXEB/B0Z3pUDjsqQ=; b=BSHNl8dmhKOVaICPdHDLsW5dPK6dCc61hO5K8Y+X8luWprSiGvblrZAP2QnHviiZ/QHwFn DSy5BqkJn6td+P985dkA3PtVSUYHt3LCQW/+EyPt3Vdf4ZtOeB5YUByUMAZDkt603LxZZZ J+IT7L9Iuees4iSp7KknIk2zJ1OJ9WUA6gFnujSMJe1FXXCzNDIG96AkLG5P/js8wpHlpl k4Xg3Ylb05sVVcjYR6lVlHpY64XoCzueI+xvVXHT/bLiuZCMWeJWvnJjQ8iZoDpEP3fUZj A0oUGScVkvFbFe/6n6gw+zor57OxCM++JTsyPivfKS+vJGJHA77swXo2btqIng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679074288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Ri9k2TDt1y5db3/puePEgog1gxsXEB/B0Z3pUDjsqQ=; b=wCuWk0SaFzfO3toucDM9UQdhPVN42L3c70eeYZPjPo3l1CJRMNoCoBVe5aPld4fXHtjCE9 GMHfcSYZwwudSvBoQpU29rjTCDFyGmEx57xyPY+WWLBuIhzeCN7N/GmtR9jLb0Kn0JTHqd dGT6xcmCH22xuxWZTpGcUyXsv6pvJPQ05XWsyAoKN94vArzjqxAAyjQG5zz088bduf/xkT pL9l1D1ETMCR9WSLux8ul08rVyg74mSRLPOAKCG9ZNcHqKsn220UL2P3TPskzQ4e7834FH WkjWkFxhXXMZFP6CTDMJQgztX4clZK+pzU7cwOuD4YuubtHUXIY2sQm7fqQTgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679074288; a=rsa-sha256; cv=none; b=gVf5MPyxSg2eWrdK+TK5h3nARxT2D4jUOeG88Pz+2H2n3Zry0FeRBq6pjD2w/v1CKoUiH9 GOWmkGyXk/5MSHw7cvZ/X0rfGIK5+7qN60cCuKK6M8wo7a1Ut0D9xYoTMNmDjvmU5Hq1ps fzJOArzeyytC7O8XV58WrLqXZhu2hI9hj7k9Oc8zcSM56GjswfT+7WgsYq5yk7OiqS2p9i mEJnTqbTuWteZDPcqJoMOL0xsT75ALooO8yeIYqORUt2laEPOTp7O7ubb6d7dX4g23F8ng p6a6RdyYOAcBscDTGK59irwZFPJSxSmKTH8K5iHq7T3UQF2YP9UlbS5CJd9hmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdWQ8508zzZLf; Fri, 17 Mar 2023 17:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HHVSOL070139; Fri, 17 Mar 2023 17:31:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HHVSbA070138; Fri, 17 Mar 2023 17:31:28 GMT (envelope-from git) Date: Fri, 17 Mar 2023 17:31:28 GMT Message-Id: <202303171731.32HHVSbA070138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f50f53931edb - main - xhci(4): Correct PCI device IDs for Zhaoxin USB 3.0 controllers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f50f53931edb24c5f30434603f5d1d3043effc0c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f50f53931edb24c5f30434603f5d1d3043effc0c commit f50f53931edb24c5f30434603f5d1d3043effc0c Author: Zhenlei Huang AuthorDate: 2023-03-17 17:12:30 +0000 Commit: Zhenlei Huang CommitDate: 2023-03-17 17:30:18 +0000 xhci(4): Correct PCI device IDs for Zhaoxin USB 3.0 controllers And minor style fixes. Reviewed by: hselasky Tested by: Weitao Wang Fixes: 0d7064d58f89 xhci(4): Add new USB IDs Differential Revision: https://reviews.freebsd.org/D38921 --- sys/dev/usb/controller/xhci_pci.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c index 3fff1ec1db01..5da68a156724 100644 --- a/sys/dev/usb/controller/xhci_pci.c +++ b/sys/dev/usb/controller/xhci_pci.c @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #define PCI_XHCI_VENDORID_AMD 0x1022 #define PCI_XHCI_VENDORID_INTEL 0x8086 #define PCI_XHCI_VENDORID_VMWARE 0x15ad -#define PCI_XHCI_VENDORID_ZHAOXIN 0x1d17 +#define PCI_XHCI_VENDORID_ZHAOXIN 0x1d17 static device_probe_t xhci_pci_probe; static device_detach_t xhci_pci_detach; @@ -206,12 +206,12 @@ xhci_pci_match(device_t self) case 0x1ada10de: return ("NVIDIA TU106 USB 3.1 controller"); - case 0x1d179202: - return ("Zhaoxin ZX-100 USB 3.0 controller"); - case 0x1d179203: - return ("Zhaoxin ZX-200 USB 3.0 controller"); - case 0x1d179204: - return ("Zhaoxin ZX-E USB 3.0 controller"); + case 0x92021d17: + return ("Zhaoxin ZX-100 USB 3.0 controller"); + case 0x92031d17: + return ("Zhaoxin ZX-200 USB 3.0 controller"); + case 0x92041d17: + return ("Zhaoxin ZX-E USB 3.0 controller"); default: break; @@ -401,9 +401,9 @@ xhci_pci_attach(device_t self) case PCI_XHCI_VENDORID_VMWARE: strlcpy(sc->sc_vendor, "VMware", sizeof(sc->sc_vendor)); break; - case PCI_XHCI_VENDORID_ZHAOXIN: - strlcpy(sc->sc_vendor, "Zhaoxin", sizeof(sc->sc_vendor)); - break; + case PCI_XHCI_VENDORID_ZHAOXIN: + strlcpy(sc->sc_vendor, "Zhaoxin", sizeof(sc->sc_vendor)); + break; default: if (bootverbose) device_printf(self, "(New XHCI DeviceId=0x%08x)\n", From nobody Fri Mar 17 17:31:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdWQB16HXz3ycYH; Fri, 17 Mar 2023 17:31: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 4PdWQB08Lnz4Prj; Fri, 17 Mar 2023 17:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679074290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sqWNRccMt2Ff6h1asWA2l4UIcIZAo/elPGF55NnCVU0=; b=jFdE5cMoBu/RJ6R2ssxTFbMOP5DFYGRO93VuFP2R2t1+QQO8F+R3P37CGkASjFS2ug3YcO VTNE4O56OaorBbZKd++Wp5wADybsM3RxklkhARpkh9uTSql5jz/m1bQXCa7zHfa8TDFrn/ TDpDMdfpKkzKOUEnk07zlmaDuOzebKIqTMYa6cD2vaSYZOZsmOmfx+luGE05PpqYEk6Q2g FPmkp6c5kdbuaqpEO6mrrXeZe7Ct5XWlDkEtWZoZcsaTFaLkT1+9DAXohHjvxkaYcE97f3 VFqa1lDVC+XqjWb0IGQ18V5/oSImUeP4Q5Yzk+62iYqcdAU2paCO7Gx44uKqvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679074290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sqWNRccMt2Ff6h1asWA2l4UIcIZAo/elPGF55NnCVU0=; b=tNDp4Cjfcl827xD7VdRy4pMIWZ2CahdaZ93fvteDFsVOE4XRrhOsugTVtySv6e1XLax+wn CoSaXu4OlGsIBpiZYnRMTcOZ39nWL+7xdP42GXnVByiRMZl76CghQlCuCTPHwvSUSWoeMc 65nc+frBBKahhZiwDKa4dDEoH/oX7FWqE366uo+gMQsWcdC3y2j9IDgLCyzWM9DUIQFUyh wUUNZ695oE4JujcPoNUVWAm2zfJFN7KlCeOZS7ly1jSw46F3Q4rF+D6GTGLEJbrv2D0wCf 75u6j2JEafkoQn2g/cmFK+905eoj0TTHUI6zKwA6Ph2GOVdqG135J7Wdev3NBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679074290; a=rsa-sha256; cv=none; b=Ksq9lPg80TkTvnP3oeJuJofR+OrCFXxdgq5iTbHWSpcZM28aPEekSfGOGfIsQTkyYhrQt/ Ckv+roovq486LJfV/6K/okwO2KIR3fpfLCMbINgS+v+fV90/0o8Gd0gdJfFs1Jye02ZKX5 iOwYwwPmGHkXKoxk3sMywqJkJHHfCjdHf+FIOMBTilpuNkzJKqj1L7aHjNZPvOFIbGA0ye hwg7aN1PZf141GFu+R7eN7qr2YLcIZi293djiKk0Xll21twrIId5tAtDKSZucfAkmAEBnD /9sDtS/Le5vYcXzCIy6TIsQb7BYqO0X0UXtrc144aDODFDxQ8kFXEZVsXPtfcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdWQ95yBKzYnV; Fri, 17 Mar 2023 17:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HHVTjR070159; Fri, 17 Mar 2023 17:31:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HHVTnV070158; Fri, 17 Mar 2023 17:31:29 GMT (envelope-from git) Date: Fri, 17 Mar 2023 17:31:29 GMT Message-Id: <202303171731.32HHVTnV070158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 95b2d16b38a7 - main - ehci(4): Correct PCI device ID for Zhaoxin USB 2.0 controller List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95b2d16b38a720108a51f9e8ce0685244e3e3ea4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=95b2d16b38a720108a51f9e8ce0685244e3e3ea4 commit 95b2d16b38a720108a51f9e8ce0685244e3e3ea4 Author: Zhenlei Huang AuthorDate: 2023-03-17 17:24:46 +0000 Commit: Zhenlei Huang CommitDate: 2023-03-17 17:30:18 +0000 ehci(4): Correct PCI device ID for Zhaoxin USB 2.0 controller And minor style fixes. Tested by: Weitao Wang Fixes: f9237e1937a4 ehci(4): Add new USB IDs Differential Revision: https://reviews.freebsd.org/D38923 --- sys/dev/usb/controller/ehci_pci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c index a4430aa3a05d..3b332516f933 100644 --- a/sys/dev/usb/controller/ehci_pci.c +++ b/sys/dev/usb/controller/ehci_pci.c @@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$"); #define PCI_EHCI_VENDORID_NVIDIA2 0x10DE #define PCI_EHCI_VENDORID_VIA 0x1106 #define PCI_EHCI_VENDORID_VMWARE 0x15ad -#define PCI_EHCI_VENDORID_ZHAOXIN 0x1d17 +#define PCI_EHCI_VENDORID_ZHAOXIN 0x1d17 static device_probe_t ehci_pci_probe; static device_attach_t ehci_pci_attach; @@ -226,8 +226,8 @@ ehci_pci_match(device_t self) case 0x077015ad: return ("VMware USB 2.0 controller"); - case 0x1d173104: - return ("Zhaoxin ZX-100/ZX-200/ZX-E USB 2.0 controller"); + case 0x31041d17: + return ("Zhaoxin ZX-100/ZX-200/ZX-E USB 2.0 controller"); default: break; @@ -414,9 +414,9 @@ ehci_pci_attach(device_t self) case PCI_EHCI_VENDORID_VMWARE: sprintf(sc->sc_vendor, "VMware"); break; - case PCI_EHCI_VENDORID_ZHAOXIN: - sprintf(sc->sc_vendor, "Zhaoxin"); - break; + case PCI_EHCI_VENDORID_ZHAOXIN: + sprintf(sc->sc_vendor, "Zhaoxin"); + break; default: if (bootverbose) device_printf(self, "(New EHCI DeviceId=0x%08x)\n", From nobody Fri Mar 17 17:31:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdWQC1HJfz3ycYK; Fri, 17 Mar 2023 17:31: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 4PdWQC0lMGz4Q5j; Fri, 17 Mar 2023 17:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679074291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3F6gQmnB81HpKhqd4C2WsuLMbW3skE+e5CzunpHMEoY=; b=q/aMfrcWP6ikvD78nIQb4gm8i7RIRxKx5lpmiF0nl5H+cyCSsKzm5pUzLTNq1gbRBBV+Ow VUxmUcsJUKn4UGx9v5R/ryfKus1h1RCASTXVre40MMm9pUY78q+RkwqloC15csiiEahjOx mYxxENNeXnFYBLSKN0J0XC64s5Yez4Le3itoXwgrcmYvgxVgfzaSVfNipyPyq0byahIoFc pdaretZHOLNesjtSVtB3pXZeOyX94OLI2St3yp7cCJiixKaPE5NoLzgxBplzmx4MEut3Rc cMK9KNKC8oebCZaIabqRuAMrSf17q/wjhwQqBu3twmHqc2ax4kXPo2rX2aI+JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679074291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3F6gQmnB81HpKhqd4C2WsuLMbW3skE+e5CzunpHMEoY=; b=lWUz9aAvLl5YW8wPWwEhmKgp2sX98dDfaVQCeqiNT9vQGHiCMlrKYmcTV1yj3a93t7/LDV RiHJiAv0rFLKCB4tiUZSDBeXreFGOqBZIFakyejxNo47MoeQN08NuOqD+BMH0asNRfl0AD ddRFtbkg6FVFwvfIJTJ5JV5VPFeLz8tK54Y3miXzWUZiLlbgwGJzREnYeoDhd7LebHt8OL EP8d3RR62cVNxKklBetWiljz1iH1LqAH5Sys6G3rULV6HiKzQB9TZ5U7aW2JP5AZaFSFDZ Iw5yegc/u35OWNq9VYuTOu+uw6hiNP1ueaBO7cxsVLlppvm1RmC4S3gA9Q0ofQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679074291; a=rsa-sha256; cv=none; b=arUjGAGpf5QFxXxoGcXu1pmEuqApEuECHs7q86mbLbYmP+b/oMVF0FsmJI5MKSSUEWptfx EhQB3HtkvZGllyTpKExmF59Shr0/xFNge9tZ6S1iRJDXgBGFhEPqTCmte/P+CIEkYmU/KZ sVQlVFRgqkWzf0tTe6EVJiqf8fTSrnvLgBfA1EXLcftq3dOrwlWd2CgT6ocJC185SIqFlS jGUa6tJInrP9iULfDraRkxM20tKWa7OZpGkLuXkoPLhPd0Mrjo8ZaNojoN+uVMGJomrNKA rgcYrwzsAGHTlJrN6c5NZk0SY60hY1/5KLaMgfhUP7gEFaqLter3xZZXfUTqkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdWQB6tVgzZHD; Fri, 17 Mar 2023 17:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HHVUJG070179; Fri, 17 Mar 2023 17:31:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HHVUdW070178; Fri, 17 Mar 2023 17:31:30 GMT (envelope-from git) Date: Fri, 17 Mar 2023 17:31:30 GMT Message-Id: <202303171731.32HHVUdW070178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: b754d7faafd3 - main - uhci(4): Correct PCI device ID for Zhaoxin USB controller List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b754d7faafd3536889bb6078b9fd11ef2e7717d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b754d7faafd3536889bb6078b9fd11ef2e7717d7 commit b754d7faafd3536889bb6078b9fd11ef2e7717d7 Author: Zhenlei Huang AuthorDate: 2023-03-17 17:20:58 +0000 Commit: Zhenlei Huang CommitDate: 2023-03-17 17:30:19 +0000 uhci(4): Correct PCI device ID for Zhaoxin USB controller And minor style fixes. Tested by: Weitao Wang Fixes: 986c7be472bd uhci(4): Add new USB IDs Differential Revision: https://reviews.freebsd.org/D38924 --- sys/dev/usb/controller/uhci_pci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/controller/uhci_pci.c b/sys/dev/usb/controller/uhci_pci.c index 19efb0ef6a5a..22a4c1124f81 100644 --- a/sys/dev/usb/controller/uhci_pci.c +++ b/sys/dev/usb/controller/uhci_pci.c @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); #define PCI_UHCI_VENDORID_HP 0x103c #define PCI_UHCI_VENDORID_VIA 0x1106 #define PCI_UHCI_VENDORID_VMWARE 0x15ad -#define PCI_UHCI_VENDORID_ZHAOXIN 0x1d17 +#define PCI_UHCI_VENDORID_ZHAOXIN 0x1d17 /* PIIX4E has no separate stepping */ @@ -242,8 +242,8 @@ uhci_pci_match(device_t self) case 0x077415ad: return ("VMware USB controller"); - case 0x1d173038: - return ("Zhaoxin ZX-100/ZX-200/ZX-E USB controller"); + case 0x30381d17: + return ("Zhaoxin ZX-100/ZX-200/ZX-E USB controller"); default: break; @@ -338,9 +338,9 @@ uhci_pci_attach(device_t self) case PCI_UHCI_VENDORID_VMWARE: sprintf(sc->sc_vendor, "VMware"); break; - case PCI_UHCI_VENDORID_ZHAOXIN: - sprintf(sc->sc_vendor, "Zhaoxin"); - break; + case PCI_UHCI_VENDORID_ZHAOXIN: + sprintf(sc->sc_vendor, "Zhaoxin"); + break; default: if (bootverbose) { device_printf(self, "(New UHCI DeviceId=0x%08x)\n", From nobody Fri Mar 17 20:18:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdb6w2h0Wz3ynVR; Fri, 17 Mar 2023 20:18: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 4Pdb6w20m3z3lDH; Fri, 17 Mar 2023 20:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679084312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r35x+Bup+KseP81CxuYIH+NueKFq2P/M7rsEUS2hoKQ=; b=wKaxmUiHCqKZ7aMPl3FXtJ9BjGatkW+68ChL2HzRWNqDhVGBNd6DpLpRpouln3U+oQTL2c PKl8iQsV7CTsLHB8VJz44kBorLFOrMk7KkNNUE/ox8cu1NC42K6kgVT955tP6k+2PvKMPH EeUh0bR27eMNRcFGtN6clj50/SqoNE/+rBy79gKflHBwPiShxQGdcFufLZow6oLx4nvTkT Ta3iaperrg39AZZ8LID6pBSpoQ+S0K4/Nnl3C4cZxjDZzzbXVWwInZhM26OSmbQ/bAQIQF hCE67MdkL7nY8/g5a20re3MJ6IfBIusqNo1QYBEK9YaD4wCgYIDQoj+MwhBB6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679084312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r35x+Bup+KseP81CxuYIH+NueKFq2P/M7rsEUS2hoKQ=; b=SfW9ALCF39nvtLdDG4fd0/Y9XtflWjGvMI/YIy5W69WLuylSAJz6JKUU9VGWpaM2YFBUlQ JjKMnhRveGq0uYgZtd+Y4C3YuTbmN2Eg2sebAQ/ursrT4oaFdvN4KXMbgebqtQS2rEqnpL NsKmUyZkXkbPDJz9E8aOSKUmcmbHx4RsjRssRM8cKBX/8iyE0jfmBUE/jY9jCp5EV9JRja 2Cy++uAsDxoW72OrVl/21Eq04dt5qAe/KN5RXuRI9sVvyvjQe8CYIODBYMfgRP+EGY+3Fv pi4qLhXCeods98e+If3MEpeexRlZeNi5aBVgJrQawpndoxIaHYTCkrVRBKSFeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679084312; a=rsa-sha256; cv=none; b=Fw2LCmcNvRUswNWVEG0Xl6NpYP8IwUgipSjCHzw6osFNfPNSJV3SUK/TlpHMgQLNeGNigB M3ZmIRua8Zd6ma+ijPoBB/bzZ4Nf54znQnWBEDkhSIr+XCUu4nB3jci8Ni+ECc9/w+XLJ8 BuAw/7PQS/xH7sOfMJUThAILjLVg15JEftLdiBOvO8VMND+ETBXnnKTX1eiJV/6X7yxrau 5J0PyE0MDB+k2ZK+2JeWsD2xfr8lBDaDp8/n1cuxoSBSnamoPbDF/dbvXWfrovNhzjJMVx 50WQr89tnqcS4DIAP9WcO223bxaNSOD+pd+XGMrHtbqpCTHSwFFF12WgM9EZaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdb6w14gnzfPX; Fri, 17 Mar 2023 20:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HKIWPU036744; Fri, 17 Mar 2023 20:18:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HKIWvr036742; Fri, 17 Mar 2023 20:18:32 GMT (envelope-from git) Date: Fri, 17 Mar 2023 20:18:32 GMT Message-Id: <202303172018.32HKIWvr036742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 84a739406d7a - stable/13 - intrng: sort includes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 84a739406d7abae6b6e081fccb30b88949d35a9e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=84a739406d7abae6b6e081fccb30b88949d35a9e commit 84a739406d7abae6b6e081fccb30b88949d35a9e Author: Mitchell Horne AuthorDate: 2023-02-04 17:04:30 +0000 Commit: Mitchell Horne CommitDate: 2023-03-17 19:55:45 +0000 intrng: sort includes MFC after: 3 days (cherry picked from commit 82e846df5bc20418b792f948fa5b558e523f0746) --- sys/kern/subr_intr.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 16306c78cbd9..078f8e544f10 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -42,31 +42,31 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include #include #include -#include -#include #include +#include #include #include -#include -#include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include #include #ifdef HWPMC_HOOKS #include #endif #include -#include #include +#include #include #include From nobody Fri Mar 17 20:18:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdb6x3V6Dz3ynY1; Fri, 17 Mar 2023 20:18: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 4Pdb6x2tMmz3lDh; Fri, 17 Mar 2023 20:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679084313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHOZNewUsScxdTFAwNGa/H6NFuS3iUOGu7hxeoIWS34=; b=lTOhm1KZPfHDcwUzYeXr4YpvFGXToZPxt3IudIPcsfgkMzTPLBFAsn0tSzu9qwz7Ktqeq+ +yspKNuMuwxgljYgO7l/DtcCkbFhmZPecWfBfflivJLGNJ3EtQl/qO8EqdGPXSS8n0kaO7 htKZtPeb0kBh/6YmGYPXL8hf7f7lP4DC/3npUscak6zBLXm4hwhJsxrNewxkGmplPlbBZC 0a/6dO5+BqGOO5X3ByNlloi+6xXnW9NmMgsk8TgpefUS7IiG7Nptv+N4DzVatC+jFpNXoH 86/7CIargI7Zl2MeM9yuP53DD7emRwGXc/ZA9D/7ms/oL99mgZKG+CTDEWyI6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679084313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHOZNewUsScxdTFAwNGa/H6NFuS3iUOGu7hxeoIWS34=; b=cEB2paD1w5cKJNx06/mQlM3Ow61bw6EJbjwS81vl9xYuC4+87bHkTDdKbzhQ9+MsAbWj67 z6xhckXc/OE7HkFTkJqm5vrC+ANKEfCTB8uOGcolP1rPCXRz72+Sic9OsyFPDcmlVshGcY d3sl85p45FYgVgL158h6FvBCbN1V0q2zT+XPxEaB50WK9zmIUjpP0DNJAwFTCPZ+WoQ+1k 0UXo4zsCt+arhViWSSY4sCYQk9PURj5Vo4bAidgcHmvVoXs6Qfkk95Sk6No0gNYxRKewPN BMAr2qt9Av+AnIX7hoyhecF1FcDq5ZvbIQP943VqVhzMPS6/NgkK2oYwQuX2Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679084313; a=rsa-sha256; cv=none; b=JoZXUqvPf764FulfzVlNWuZjg3lU1PSkCFK2SiKArOhERta2YU3Dc3aofP8TPhAp1jJny3 OQGOvIEM3hCUzS43buAluGieD37nPaALpmjD8o2SDwadPcjcBy3Z2h2uhXR+B5h0oSuQG9 Xn09C1f4qSKBh0PkfR2/YioRO5SLUI4UnwD4pPihjRL1Au4MBsWdGc1eIhDLY+AVqzJWCn e5c6zUrcLvtu9Heolhwobe2UsiJrV/ST3ERz3TqwXL9w1shRmwP4qPkhhtr64HnlKqDRjs N01/ZSVf/oNGqFafAc3EJMgeaB0mjGhXKGuO8efZ++SiUsFKPuIazj09YBgYgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdb6x1ysYzfPY; Fri, 17 Mar 2023 20:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HKIXxn036769; Fri, 17 Mar 2023 20:18:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HKIX6g036768; Fri, 17 Mar 2023 20:18:33 GMT (envelope-from git) Date: Fri, 17 Mar 2023 20:18:33 GMT Message-Id: <202303172018.32HKIX6g036768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ae6e42b59e68 - stable/13 - intrng: track counter allocation with a bitmap List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae6e42b59e6831c8a74620c99120d089a25efa84 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ae6e42b59e6831c8a74620c99120d089a25efa84 commit ae6e42b59e6831c8a74620c99120d089a25efa84 Author: Mitchell Horne AuthorDate: 2023-02-14 18:02:12 +0000 Commit: Mitchell Horne CommitDate: 2023-03-17 19:55:45 +0000 intrng: track counter allocation with a bitmap Crucially, this allows releasing counters, and interrupt sources by extension. Where before we were incrementing intrcnt_index with atomics, now we protect the bitmap using the existing isrc_table_lock mutex. Reviewed by: mmel MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38437 (cherry picked from commit 28137bdb19aa34b8351108de4257795a93c0ba09) --- sys/kern/subr_intr.c | 54 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 078f8e544f10..f44291887e8c 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -152,7 +153,8 @@ u_long *intrcnt; char *intrnames; size_t sintrcnt; size_t sintrnames; -static u_int intrcnt_index; +int nintrcnt; +static bitstr_t *intrcnt_bitmap; static struct intr_irqsrc *intr_map_get_isrc(u_int res_id); static void intr_map_set_isrc(u_int res_id, struct intr_irqsrc *isrc); @@ -166,7 +168,6 @@ static void intr_map_copy_map_data(u_int res_id, device_t *dev, intptr_t *xref, static void intr_irq_init(void *dummy __unused) { - u_int intrcnt_count; SLIST_INIT(&pic_list); mtx_init(&pic_list_lock, "intr pic list", NULL, MTX_DEF); @@ -177,17 +178,21 @@ intr_irq_init(void *dummy __unused) * - 2 counters for each I/O interrupt. * - MAXCPU counters for each IPI counters for SMP. */ - intrcnt_count = intr_nirq * 2; + nintrcnt = intr_nirq * 2; #ifdef SMP - intrcnt_count += INTR_IPI_COUNT * MAXCPU; + nintrcnt += INTR_IPI_COUNT * MAXCPU; #endif - intrcnt = mallocarray(intrcnt_count, sizeof(u_long), M_INTRNG, + intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, M_WAITOK | M_ZERO); - intrnames = mallocarray(intrcnt_count, INTRNAME_LEN, M_INTRNG, + intrnames = mallocarray(nintrcnt, INTRNAME_LEN, M_INTRNG, M_WAITOK | M_ZERO); - sintrcnt = intrcnt_count * sizeof(u_long); - sintrnames = intrcnt_count * INTRNAME_LEN; + sintrcnt = nintrcnt * sizeof(u_long); + sintrnames = nintrcnt * INTRNAME_LEN; + + /* Allocate the bitmap tracking counter allocations. */ + intrcnt_bitmap = bit_alloc(nintrcnt, M_INTRNG, M_WAITOK | M_ZERO); + irq_sources = mallocarray(intr_nirq, sizeof(struct intr_irqsrc*), M_INTRNG, M_WAITOK | M_ZERO); } @@ -266,13 +271,17 @@ isrc_update_name(struct intr_irqsrc *isrc, const char *name) static void isrc_setup_counters(struct intr_irqsrc *isrc) { - u_int index; + int index; + + mtx_assert(&isrc_table_lock, MA_OWNED); /* - * XXX - it does not work well with removable controllers and - * interrupt sources !!! + * Allocate two counter values, the second tracking "stray" interrupts. */ - index = atomic_fetchadd_int(&intrcnt_index, 2); + bit_ffc_area(intrcnt_bitmap, nintrcnt, 2, &index); + if (index == -1) + panic("Failed to allocate 2 counters. Array exhausted?"); + bit_nset(intrcnt_bitmap, index, index + 1); isrc->isrc_index = index; isrc->isrc_count = &intrcnt[index]; isrc_update_name(isrc, NULL); @@ -284,8 +293,11 @@ isrc_setup_counters(struct intr_irqsrc *isrc) static void isrc_release_counters(struct intr_irqsrc *isrc) { + int idx = isrc->isrc_index; - panic("%s: not implemented", __func__); + mtx_assert(&isrc_table_lock, MA_OWNED); + + bit_nclear(intrcnt_bitmap, idx, idx + 1); } #ifdef SMP @@ -298,11 +310,25 @@ intr_ipi_setup_counters(const char *name) u_int index, i; char str[INTRNAME_LEN]; - index = atomic_fetchadd_int(&intrcnt_index, MAXCPU); + mtx_lock(&isrc_table_lock); + + /* + * We should never have a problem finding MAXCPU contiguous counters, + * in practice. Interrupts will be allocated sequentially during boot, + * so the array should fill from low to high index. Once reserved, the + * IPI counters will never be released. Similarly, we will not need to + * allocate more IPIs once the system is running. + */ + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); + if (index == -1) + panic("Failed to allocate %d counters. Array exhausted?", + MAXCPU); + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); for (i = 0; i < MAXCPU; i++) { snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); intrcnt_setname(str, index + i); } + mtx_unlock(&isrc_table_lock); return (&intrcnt[index]); } #endif From nobody Fri Mar 17 21:01:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4L1Rywz3yqbV; Fri, 17 Mar 2023 21:01: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 4Pdc4L0R7cz3pfK; Fri, 17 Mar 2023 21:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+nl4e/8llDu9T3WtywmcKfNWysLbSH0vwQzDPbAR9Q=; b=Ldjf2/UzhXzkR2o1BtPH0lm5BaDS4W+xiJVzIoX3eex0yAAjn+QRF18MqAVxU4g/SsOupY n+vlG5NWya90ZWXk3owHwNuK/2WpjIitdf6m2Y3Vk5NPJkgijLhxW8/yaqAShdj6QVXmxV OWqUh/jQZwQnI5FYYTQsEdCCkQBU0AC/Oqfo6XFSkhgeWRhjlISDny/H7tR8odd9VBhWGx ZacsClJAUtDl3GgId/e219eHsd2SvTqR/Ui3AlqYrmaDMDBUOF023LtOPaE3GVX5/7BCkf UZeLPXPEfSGZ5TiE5aIBSBEL5YZuj7MvGF7nAWGXt6J3UKpABRidazQe4Z/nnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+nl4e/8llDu9T3WtywmcKfNWysLbSH0vwQzDPbAR9Q=; b=YsU7gIdnmuw/trB8FeHBHs165e2VKsIeDUBhvPJltu/IZLEc1iNyfbPudVLVRxKC95EGVs VT2EWL5TExoRXf87/WIC1bWQQ555DTNeqV1cuv+9PxY/kf930lsxOanVNPgOfbzYVwqupA ew0EBz2BV9Ov7ndwtzLh4yT2pozeUCFszdWtTr5c//SOUC/kxNVyCMJI/+gh/HBbu+pJ3G rsPPZjTqJ3ryUpBdOGyV+8A8tO9AT2tMBLhq42KgaczDH8hp6dAWpLuYMQvSCmpSBnKV9a WZX24xlXyRnZyYDtMiQljYZ8Z9RE+mfW1Ko4idf64YAoj/M6z0j2v2+2ize39Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086882; a=rsa-sha256; cv=none; b=vnIW5Rp3auxsZyFfLNm5vQa4e7fRnwqXwKbQDkBiMhuCS32h92Wx5POSR8ExVAqDT2/yDf n4+FVmHCkh4NAnzi3OIbtbCW8ZEfpISzr6jo7g7NE3wBoAdoHhh5/t7eGGhqw36yr/R8im 4K5TK4eqQn3Uhvq3nlhE9m82j9UQm0vRbAgAw7rx5IVQdaK3WSIB8ZiBvgWrVFEEBYBJO9 47ta3wgbMHe2m1oK2SoOPs6v5LDi3hm3JOC4o5f5VF/W9+xRIFShHNBaCJDfD+mNxLmR5v FrxgI+X8JV2iP+idthD6Mn+C8jcMQrkpP98Cz1BeDghIXysAOHGnjq+Epy31aA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4K6bXWzgjq; Fri, 17 Mar 2023 21:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1Lpe014933; Fri, 17 Mar 2023 21:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1LHI014932; Fri, 17 Mar 2023 21:01:21 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:21 GMT Message-Id: <202303172101.32HL1LHI014932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 282e4cf32d4e - stable/13 - daemon: add long_opts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 282e4cf32d4eaf53b746358b83515a333e8b6c72 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=282e4cf32d4eaf53b746358b83515a333e8b6c72 commit 282e4cf32d4eaf53b746358b83515a333e8b6c72 Author: Ihor Antonov AuthorDate: 2023-02-10 04:36:07 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 21:01:01 +0000 daemon: add long_opts Long options improve readability of scripts, makes code comprehension easier. This patch adds long options while preserving the existing CLI interface. Also --help/-h option is added. Reviewed by: allanjude, pauamma (both earlier versions), kevans Differential Revision: https://reviews.freebsd.org/D38244 (cherry picked from commit 0a402ad2e6d6014ed8c622a90153f53b99c1b482) --- usr.sbin/daemon/daemon.8 | 71 +++++++++++++++++++++---------------------- usr.sbin/daemon/daemon.c | 78 ++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 98 insertions(+), 51 deletions(-) diff --git a/usr.sbin/daemon/daemon.8 b/usr.sbin/daemon/daemon.8 index c4f20548d4a2..3b91b9b20f3d 100644 --- a/usr.sbin/daemon/daemon.8 +++ b/usr.sbin/daemon/daemon.8 @@ -57,10 +57,10 @@ log file. .Pp The options are as follows: .Bl -tag -width indent -.It Fl c +.It Fl c , Fl -change-dir Change the current working directory to the root .Pq Dq Pa / . -.It Fl f +.It Fl f , Fl -close-fds Redirect standard input, standard output and standard error to .Pa /dev/null . When this option is used together with any of the options related to file @@ -68,35 +68,35 @@ or syslog output, the standard file descriptors are first redirected to .Pa /dev/null , then stdout and/or stderr is redirected to a file or to syslog as specified by the other options. -.It Fl H +.It Fl H , Fl -sighup Close .Pa output_file and re-open it when signal SIGHUP is received, for interoperability with .Xr newsyslog 1 and similar log rotation / archival mechanisms. If -.Fl o +.Fl -output-file is not specified, this flag is ignored. -.It Fl S +.It Fl S , Fl -syslog Enable syslog output. This is implicitly applied if other syslog parameters are provided. The default values are daemon, notice, and daemon for facility, priority, and tag, respectively. -.It Fl o Ar output_file +.It Fl o , Fl -output-file Ar output_file Append output from the daemonized process to .Pa output_file . If the file does not exist, it is created with permissions 0600. When this option is used together with options -.Fl c +.Fl -change-dir and -.Fl H +.Fl -sighup the absolute path needs to be provided to ensure .Nm can re-open the file after a SIGHUP. -.It Fl m Ar output_mask +.It Fl m , Fl -output-mask Ar output_mask Redirect output from the child process stdout (1), stderr (2), or both (3). This value specifies what is sent to syslog and the log file. The default is 3. -.It Fl p Ar child_pidfile +.It Fl p , Fl -child-pidfile Ar child_pidfile Write the ID of the created process into the .Ar child_pidfile using the @@ -112,9 +112,9 @@ The owner is the user who runs the .Nm regardless of whether the -.Fl u +.Fl -user option is used or not. -.It Fl P Ar supervisor_pidfile +.It Fl P , Fl -supervisor-pidfile Ar supervisor_pidfile Write the ID of the .Nm process into the @@ -132,45 +132,46 @@ The owner is the user who runs the .Nm regardless of whether the -.Fl u +.Fl -user option is used or not. -.It Fl r +.It Fl r , Fl -restart Supervise and restart the program after a one-second delay if it has been terminated. -.It Fl R Ar restart_delay_seconds +.It Fl R , Fl -restart-delay Ar restart_delay_seconds Supervise and restart the program after the specified delay if it has been terminated. -.It Fl t Ar title +.It Fl t , Fl -title Ar title Set the title for the daemon process. The default is the daemonized invocation. -.It Fl u Ar user +.It Fl u , Fl -user Ar user Login name of the user to execute the program under. Requires adequate superuser privileges. -.It Fl s Ar syslog_priority +.It Fl s , Fl -syslog-priority Ar syslog_priority These priorities are accepted: emerg, alert, crit, err, warning, notice, info, and debug. The default is notice. -.It Fl l Ar syslog_facility +.It Fl l , Fl -syslog-facility Ar syslog_facility These facilities are accepted: auth, authpriv, console, cron, daemon, ftp, kern, lpr, mail, news, ntp, security, syslog, user, uucp, and local0, ..., local7. The default is daemon. -.It Fl T Ar syslog_tag +.It Fl T , Fl -syslog-tag Ar syslog_tag Set the tag which is appended to all syslog messages. The default is daemon. .El .Pp If any of the options -.Fl p , -.Fl P , -.Fl r , -.Fl o , -.Fl s , -.Fl T , -.Fl m , -.Fl S , +.Fl -child-pidfile , +.Fl -output-mask , +.Fl -restart , +.Fl -restart-delay , +.Fl -supervisor-pidfile , +.Fl -syslog , +.Fl -syslog-facility +.Fl -syslog-priority , +.Fl -syslog-tag , or -.Fl l +.Fl -output , are specified, the program is executed in a spawned child process. The .Nm @@ -187,21 +188,21 @@ If neither file or syslog output are selected, all output is redirected to the .Nm process and written to stdout. The -.Fl f +.Fl -close-fds option may be used to suppress the stdout output completely. .Pp The -.Fl P +.Fl -supervisor-pidfile option is useful combined with the -.Fl r +.Fl -restart option as .Ar supervisor_pidfile contains the ID of the supervisor not the child. This is especially important if you use -.Fl r +.Fl -restart in an rc script as the -.Fl p +.Fl -child-pidfile option will give you the child's ID to signal when you attempt to stop the service, causing .Nm @@ -229,7 +230,7 @@ cannot be opened for appending, and otherwise 0. If the command cannot be executed, an error message is printed to standard error. The exact behavior depends on the logging parameters and the -.Fl f +.Fl -close-fds flag. .Sh SEE ALSO .Xr nohup 1 , diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index e8cdaa230caa..edcdf3141fcc 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -77,11 +78,64 @@ static void open_pid_files(const char *, const char *, struct pidfh **, struct pidfh **); static void do_output(const unsigned char *, size_t, struct log_params *); static void daemon_sleep(time_t, long); -static void usage(void); static volatile sig_atomic_t terminate = 0, child_gone = 0, pid = 0, do_log_reopen = 0; +static const char shortopts[] = "+cfHSp:P:ru:o:s:l:t:m:R:T:h"; + +static const struct option longopts[] = { + { "change-dir", no_argument, NULL, 'c' }, + { "close-fds", no_argument, NULL, 'f' }, + { "sighup", no_argument, NULL, 'H' }, + { "syslog", no_argument, NULL, 'S' }, + { "output-file", required_argument, NULL, 'o' }, + { "output-mask", required_argument, NULL, 'm' }, + { "child-pidfile", required_argument, NULL, 'p' }, + { "supervisor-pidfile", required_argument, NULL, 'P' }, + { "restart", no_argument, NULL, 'r' }, + { "restart-delay", required_argument, NULL, 'R' }, + { "title", required_argument, NULL, 't' }, + { "user", required_argument, NULL, 'u' }, + { "syslog-priority", required_argument, NULL, 's' }, + { "syslog-facility", required_argument, NULL, 'l' }, + { "syslog-tag", required_argument, NULL, 'T' }, + { "help", no_argument, NULL, 'h' }, + { NULL, 0, NULL, 0 } +}; + +static _Noreturn void +usage(int exitcode) +{ + (void)fprintf(stderr, + "usage: daemon [-cfHrS] [-p child_pidfile] [-P supervisor_pidfile]\n" + " [-u user] [-o output_file] [-t title]\n" + " [-l syslog_facility] [-s syslog_priority]\n" + " [-T syslog_tag] [-m output_mask] [-R restart_delay_secs]\n" + "command arguments ...\n"); + + (void)fprintf(stderr, + " --change-dir -c Change the current working directory to root\n" + " --close-fds -f Set stdin, stdout, stderr to /dev/null\n" + " --sighup -H Close and re-open output file on SIGHUP\n" + " --syslog -S Send output to syslog\n" + " --output-file -o Append output of the child process to file\n" + " --output-mask -m What to send to syslog/file\n" + " 1=stdout, 2=stderr, 3=both\n" + " --child-pidfile -p Write PID of the child process to file\n" + " --supervisor-pidfile -P Write PID of the supervisor process to file\n" + " --restart -r Restart child if it terminates (1 sec delay)\n" + " --restart-delay -R Restart child if it terminates after N sec\n" + " --title -t Set the title of the supervisor process\n" + " --user -u <user> Drop privileges, run as given user\n" + " --syslog-priority -s <prio> Set syslog priority\n" + " --syslog-facility -l <flty> Set syslog facility\n" + " --syslog-tag -T <tag> Set syslog tag\n" + " --help -h Show this help\n"); + + exit(exitcode); +} + int main(int argc, char *argv[]) { @@ -106,7 +160,7 @@ main(int argc, char *argv[]) log_reopen = 0; outfn = NULL; title = NULL; - while ((ch = getopt(argc, argv, "cfHSp:P:ru:o:s:l:t:l:m:R:T:")) != -1) { + while ((ch = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -164,15 +218,18 @@ main(int argc, char *argv[]) case 'u': user = optarg; break; + case 'h': + usage(0); + __builtin_unreachable(); default: - usage(); + usage(1); } } argc -= optind; argv += optind; if (argc == 0) - usage(); + usage(1); if (!title) title = argv[0]; @@ -182,7 +239,7 @@ main(int argc, char *argv[]) if (outfd == -1) err(7, "open"); } - + if (dosyslog) openlog(logtag, LOG_PID | LOG_NDELAY, logfac); @@ -610,14 +667,3 @@ reopen_log(struct log_params *lpp) lpp->outfd = outfd; } -static void -usage(void) -{ - (void)fprintf(stderr, - "usage: daemon [-cfHrS] [-p child_pidfile] [-P supervisor_pidfile]\n" - " [-u user] [-o output_file] [-t title]\n" - " [-l syslog_facility] [-s syslog_priority]\n" - " [-T syslog_tag] [-m output_mask] [-R restart_delay_secs]\n" - "command arguments ...\n"); - exit(1); -} From nobody Fri Mar 17 21:01:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4M2L4hz3yqN6; Fri, 17 Mar 2023 21:01: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 4Pdc4M1kKmz3pQs; Fri, 17 Mar 2023 21:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8HkAOcq8iXCuRJPCuKv44A3sOciagTTQCp9gqw8Mj40=; b=uTjxObWWRHEIK3PWbgw0Cca/7f7CYPTRjjydZ2+7CGrnOuPv3nX5IetzovsMB78UTIw80n caMOA/mGVpxlWyJzP0spqY1S21xwKNuhbFG++tC7NydK+kgq2KCKz/xSYnUwiwe+3ZGux+ lrk/KbculRgV/LWcGOcTMXDScTysvXQCacR1/2jEDd5GFK3pKOjsKAhW/LdXSYFJcteu0/ wdykwcd5OW1vEiX5aCYeeT4tjxOT2J/DQu4UTW2+VHH5dsbJUihyRc4Pas2saBLPAUBa+o cKYD2C6/GQ2qArCgeHNV3L/DysYCZi+ly7HtWfqGMwKF7tzb2ihjN4cyNbpThg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8HkAOcq8iXCuRJPCuKv44A3sOciagTTQCp9gqw8Mj40=; b=ENkPAmwboJSxtLO7k0fONjdMnHfbH933sdwx7jraAOzZdBOWNxotnyUWbCkFNxPY2te6GJ /8j1+Hy1Li/qBkPzTkYjApaTaAz+hj+4wnRVjGvnrigqHeWAyNABYsCIt8vkminl+lPShd xLSX1CkHajtSQmF0f7ZqTe2N/FsMIwv+ZJovo6Z8OUTS3oYi1ozBIX1gGiUOQf6pNlRZui 5is1+P+N0HNS2JJMv46yqNg8O4TpSA7X372ry6BoCTMGwlWF9JeyKCZmeo/wifFXGSl+fb 57wC119K8rU/nYo2GFDPQ693G4w5aY1jhDwx59+pObzFLbe4hEbN/FLgh2Iz9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086883; a=rsa-sha256; cv=none; b=sbNPEF5VH3dXc3QBg6zfGWrKL6yVZwHHLIz+3guYXshslcG3qEPeyjRGd30hnS1gwhWWDh 5G33X2JEbies567Z9Ku6EbZdMYfiU3IfRAfYWYhV5wSwI/GWM6f+UxztdKgqUZY+iltl5e wDHwUM1yYrOhJgT3wzt7o+ZauGBHMnMsh5a3xqXfJBI2lHPmawzQ16K2AMan3/LosI8jd8 HrE2Dz+zSZjdbQZvh+ZIj9wxPU67RAC+GZU3k65oefb1rEUtY1RVIwkI5Nhe8EogfTk3Sd ij8bulG+dL1y4059BooZY+1RhrFTwjHt/P3FWt7CmHEBMBtO+hbKfEeffAyVVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4M0QR3zgNW; Fri, 17 Mar 2023 21:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1Mx1014953; Fri, 17 Mar 2023 21:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1MDk014952; Fri, 17 Mar 2023 21:01:22 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:22 GMT Message-Id: <202303172101.32HL1MDk014952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 488cf4bb6fa1 - stable/13 - daemon: use braces with 'if' consistently List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 488cf4bb6fa1e43dfe923067fdde660a625948c6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=488cf4bb6fa1e43dfe923067fdde660a625948c6 commit 488cf4bb6fa1e43dfe923067fdde660a625948c6 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:41 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:01 +0000 daemon: use braces with 'if' consistently Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 6b4ef4b16a6930d91d0d99c4ceb75cd43a7526c1) --- usr.sbin/daemon/daemon.c | 81 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index edcdf3141fcc..f9c1f73e193c 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -173,14 +173,16 @@ main(int argc, char *argv[]) break; case 'l': logfac = get_log_mapping(optarg, facilitynames); - if (logfac == -1) + if (logfac == -1) { errx(5, "unrecognized syslog facility"); + } dosyslog = 1; break; case 'm': stdmask = strtol(optarg, &p, 10); - if (p == optarg || stdmask < 0 || stdmask > 3) + if (p == optarg || stdmask < 0 || stdmask > 3) { errx(6, "unrecognized listening mask"); + } break; case 'o': outfn = optarg; @@ -196,13 +198,15 @@ main(int argc, char *argv[]) break; case 'R': restart = strtol(optarg, &p, 0); - if (p == optarg || restart < 1) + if (p == optarg || restart < 1) { errx(6, "invalid restart delay"); + } break; case 's': logpri = get_log_mapping(optarg, prioritynames); - if (logpri == -1) + if (logpri == -1) { errx(4, "unrecognized syslog priority"); + } dosyslog = 1; break; case 'S': @@ -228,20 +232,24 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc == 0) + if (argc == 0) { usage(1); + } - if (!title) + if (!title) { title = argv[0]; + } if (outfn) { outfd = open_log(outfn); - if (outfd == -1) + if (outfd == -1) { err(7, "open"); + } } - if (dosyslog) + if (dosyslog) { openlog(logtag, LOG_PID | LOG_NDELAY, logfac); + } ppfh = pfh = NULL; /* @@ -329,8 +337,9 @@ main(int argc, char *argv[]) goto exit; } restart: - if (pipe(pfd)) + if (pipe(pfd)) { err(1, "pipe"); + } /* * Spawn a child to exec the command. */ @@ -356,27 +365,32 @@ restart: /* Now that we are the child, write out the pid. */ pidfile_write(pfh); - if (user != NULL) + if (user != NULL) { restrict_process(user); + } /* * When forking, the child gets the original sigmask, * and dup'd pipes. */ if (pid == 0) { close(pfd[0]); - if (sigprocmask(SIG_SETMASK, &mask_orig, NULL)) + if (sigprocmask(SIG_SETMASK, &mask_orig, NULL)) { err(1, "sigprogmask"); + } if (stdmask & STDERR_FILENO) { - if (dup2(pfd[1], STDERR_FILENO) == -1) + if (dup2(pfd[1], STDERR_FILENO) == -1) { err(1, "dup2"); + } } if (stdmask & STDOUT_FILENO) { - if (dup2(pfd[1], STDOUT_FILENO) == -1) + if (dup2(pfd[1], STDOUT_FILENO) == -1) { err(1, "dup2"); + } } if (pfd[1] != STDERR_FILENO && - pfd[1] != STDOUT_FILENO) + pfd[1] != STDOUT_FILENO) { close(pfd[1]); + } } execvp(argv[0], argv); /* @@ -436,8 +450,9 @@ restart: } } } - if (restart && !terminate) + if (restart && !terminate) { daemon_sleep(restart, 0); + } if (sigprocmask(SIG_BLOCK, &mask_term, NULL)) { warn("sigprocmask"); goto exit; @@ -451,8 +466,9 @@ exit: close(outfd); close(pfd[0]); close(pfd[1]); - if (dosyslog) + if (dosyslog) { closelog(); + } pidfile_remove(pfh); pidfile_remove(ppfh); exit(1); /* If daemon(3) succeeded exit status does not matter. */ @@ -464,8 +480,9 @@ daemon_sleep(time_t secs, long nsecs) struct timespec ts = { secs, nsecs }; while (!terminate && nanosleep(&ts, &ts) == -1) { - if (errno != EINTR) + if (errno != EINTR) { err(1, "nanosleep"); + } } } @@ -507,8 +524,9 @@ get_log_mapping(const char *str, const CODE *c) { const CODE *cp; for (cp = c; cp->c_name; cp++) - if (strcmp(cp->c_name, str) == 0) + if (strcmp(cp->c_name, str) == 0) { return cp->c_val; + } return -1; } @@ -518,11 +536,13 @@ restrict_process(const char *user) struct passwd *pw = NULL; pw = getpwnam(user); - if (pw == NULL) + if (pw == NULL) { errx(1, "unknown user: %s", user); + } - if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL) != 0) + if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL) != 0) { errx(1, "failed to set user environment"); + } setenv("USER", pw->pw_name, 1); setenv("HOME", pw->pw_dir, 1); @@ -546,8 +566,9 @@ listen_child(int fd, struct log_params *logpar) assert(logpar); assert(bytes_read < LBUF_SIZE - 1); - if (do_log_reopen) + if (do_log_reopen) { reopen_log(logpar); + } rv = read(fd, buf + bytes_read, LBUF_SIZE - bytes_read - 1); if (rv > 0) { unsigned char *cp; @@ -568,8 +589,9 @@ listen_child(int fd, struct log_params *logpar) memmove(buf, cp + 1, bytes_read); } /* Wait until the buffer is full. */ - if (bytes_read < LBUF_SIZE - 1) + if (bytes_read < LBUF_SIZE - 1) { return 1; + } do_output(buf, bytes_read, logpar); bytes_read = 0; return 1; @@ -601,16 +623,19 @@ do_output(const unsigned char *buf, size_t len, struct log_params *logpar) assert(len <= LBUF_SIZE); assert(logpar); - if (len < 1) + if (len < 1) { return; - if (logpar->dosyslog) + } + if (logpar->dosyslog) { syslog(logpar->logpri, "%.*s", (int)len, buf); + } if (logpar->outfd != -1) { if (write(logpar->outfd, buf, len) == -1) warn("write"); } - if (logpar->noclose && !logpar->dosyslog && logpar->outfd == -1) + if (logpar->noclose && !logpar->dosyslog && logpar->outfd == -1) { printf("%.*s", (int)len, buf); + } } /* @@ -620,8 +645,9 @@ do_output(const unsigned char *buf, size_t len, struct log_params *logpar) static void handle_term(int signo) { - if (pid > 0 && !child_gone) + if (pid > 0 && !child_gone) { kill(pid, signo); + } terminate = 1; } @@ -662,8 +688,9 @@ reopen_log(struct log_params *lpp) do_log_reopen = 0; outfd = open_log(lpp->outfn); - if (lpp->outfd >= 0) + if (lpp->outfd >= 0) { close(lpp->outfd); + } lpp->outfd = outfd; } From nobody Fri Mar 17 21:01:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4N3hplz3yqmd; Fri, 17 Mar 2023 21:01: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 4Pdc4N2XHtz3pWm; Fri, 17 Mar 2023 21:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RwSGAE5AD2Wrkh8GYdillLVV9WfyMZ0qVwxdu8C0sNI=; b=CxAG2alwfBevkuaI0Me03oVCDscEUeSYqGSl1dCzGWhe8CF26k2S79pGmnfDQoskioJJVg gs97uU/kq3T3uDQ/2NNyW25b30j+4DK2ur6ArOhnBt542JMV9Gw1CmCNuH8ozNXp7yUGvj tcjqeJjoK8S4zqHpv1gCGL1c6jOHCPwCS8rG4YgXPPhb3bsgeGdnE7ny5upe53WLTssOP3 jyrv6367MBIvO3anzHIUFtrIxJOY24cxBbLRXdZkyERLntifa8ypzXMTMvFa6Of3EsMiZe +6Khza2wSAx8nl0M+Rbr+CHTqHy86GZ3+7DreP7C4kDh0Mdo2D/FBjuqWAus4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RwSGAE5AD2Wrkh8GYdillLVV9WfyMZ0qVwxdu8C0sNI=; b=BCd+eYJwJukEiaa6LT7ef3U7NwTH9Jct7odc7AxKHbbIUmiP93Mci5KJzx45vVZ564M7Vi LAPow+D4J+nGM37mu0WKhCCttddB5tceIp+ysCZjC7g0CJCVlAUlTrCMObwTjDRLGOcukQ 0/gp0liuc174GmmzmWQjnl1RZPjbJj1EJcnXU9UQGb/ksPA4Fgao0uSEz5s9FajeGiaBV4 +DUugbNNpuLiPe8FviRGoHzv3TzVPrNVp/PYa2e7kvOjV5sn8zh3XPfd3hNjXCTqt5Dz98 xNB34Jw4ZC/767KfIDesbk2haQygeYtQkP/NGWQaiz/MvUexr6uAgdYZnNjbVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086884; a=rsa-sha256; cv=none; b=k5/M+WVhBf8r7OhlI3A44pH4JLSZhGwS1kTFlg4bb+t2Rw++lZDwAUX0Iq2OT+XLIvGt/c 2aeacq5QOk1YcpAb8P2m1SQwK2hPIgfnaLPXJrq6HJ/1g2DWaUyZLTNulPWyVNX3Z1B+es l0IuXqZb2ufJ7ZFUJ3yVTgvL7ipcy0Gu7mDBZs2FfuMcM4TYj7g/D8vgCR+sLhMUlT5u3u 2EqkYwJENsMN65qOt+zPEaboZmwOtq788DIxRMEDolTWkpfat0bw1zzxfIQo6WKP8HYIO/ LErxKmkhord+frP3J6Cr2DBqJQQPg+Aaw3ynaapTaru74NcC6VOXv2HZV1gTsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4N1GsdzgbP; Fri, 17 Mar 2023 21:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1OCC014979; Fri, 17 Mar 2023 21:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1OJa014978; Fri, 17 Mar 2023 21:01:24 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:24 GMT Message-Id: <202303172101.32HL1OJa014978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: d24c97ebfb86 - stable/13 - daemon: consolidate variable declarations and initializaions List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d24c97ebfb86040436acdc63b9b0e8bc6ef10078 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d24c97ebfb86040436acdc63b9b0e8bc6ef10078 commit d24c97ebfb86040436acdc63b9b0e8bc6ef10078 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:41 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:01 +0000 daemon: consolidate variable declarations and initializaions - improve readability by breaking apart single-line multi-variable declarations - initialize simple variables at declaration site - move other top-level variable initializations closer declarations to avoid potential UB and unclutter the use-site. Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit e745dc2287ac4844c1a21aaa31d0bc3dad6b1b06) --- usr.sbin/daemon/daemon.c | 63 +++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index f9c1f73e193c..c8ccd8f892fa 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -79,8 +79,10 @@ static void open_pid_files(const char *, const char *, struct pidfh **, static void do_output(const unsigned char *, size_t, struct log_params *); static void daemon_sleep(time_t, long); -static volatile sig_atomic_t terminate = 0, child_gone = 0, pid = 0, - do_log_reopen = 0; +static volatile sig_atomic_t terminate = 0; +static volatile sig_atomic_t child_gone = 0; +static volatile sig_atomic_t pid = 0; +static volatile sig_atomic_t do_log_reopen = 0; static const char shortopts[] = "+cfHSp:P:ru:o:s:l:t:m:R:T:h"; @@ -139,27 +141,37 @@ usage(int exitcode) int main(int argc, char *argv[]) { - const char *pidfile, *ppidfile, *title, *user, *outfn, *logtag; - int ch, nochdir, noclose, restart, dosyslog, child_eof; - sigset_t mask_susp, mask_orig, mask_read, mask_term; - struct log_params logpar; - int pfd[2] = { -1, -1 }, outfd = -1; - int stdmask, logpri, logfac, log_reopen; - struct pidfh *ppfh, *pfh; - char *p; - - memset(&logpar, 0, sizeof(logpar)); - stdmask = STDOUT_FILENO | STDERR_FILENO; - ppidfile = pidfile = user = NULL; - nochdir = noclose = 1; - logpri = LOG_NOTICE; - logfac = LOG_DAEMON; - logtag = "daemon"; - restart = 0; - dosyslog = 0; - log_reopen = 0; - outfn = NULL; - title = NULL; + char *p = NULL; + const char *pidfile = NULL; + const char *logtag = "daemon"; + const char *outfn = NULL; + const char *ppidfile = NULL; + const char *title = NULL; + const char *user = NULL; + int ch = 0; + int child_eof = 0; + int dosyslog = 0; + int log_reopen = 0; + int logfac = LOG_DAEMON; + int logpri = LOG_NOTICE; + int nochdir = 1; + int noclose = 1; + int outfd = -1; + int pfd[2] = { -1, -1 }; + int restart = 0; + int stdmask = STDOUT_FILENO | STDERR_FILENO; + struct log_params logpar = { 0 }; + struct pidfh *ppfh = NULL; + struct pidfh *pfh = NULL; + sigset_t mask_orig; + sigset_t mask_read; + sigset_t mask_term; + sigset_t mask_susp; + + sigemptyset(&mask_susp); + sigemptyset(&mask_read); + sigemptyset(&mask_term); + while ((ch = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (ch) { case 'c': @@ -251,7 +263,6 @@ main(int argc, char *argv[]) openlog(logtag, LOG_PID | LOG_NDELAY, logfac); } - ppfh = pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -294,18 +305,15 @@ main(int argc, char *argv[]) sigemptyset(&act_hup.sa_mask); /* Block these when avoiding racing before sigsuspend(). */ - sigemptyset(&mask_susp); sigaddset(&mask_susp, SIGTERM); sigaddset(&mask_susp, SIGCHLD); /* Block SIGTERM when we lack a valid child PID. */ - sigemptyset(&mask_term); sigaddset(&mask_term, SIGTERM); /* * When reading, we wish to avoid SIGCHLD. SIGTERM * has to be caught, otherwise we'll be stuck until * the read() returns - if it returns. */ - sigemptyset(&mask_read); sigaddset(&mask_read, SIGCHLD); /* Block SIGTERM to avoid racing until we have forked. */ if (sigprocmask(SIG_BLOCK, &mask_term, &mask_orig)) { @@ -406,7 +414,6 @@ restart: * might have closed its stdout and stderr, so we must wait for * the SIGCHLD to ensure that the process is actually gone. */ - child_eof = 0; for (;;) { /* * We block SIGCHLD when listening, but SIGTERM we accept From nobody Fri Mar 17 21:01:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4P40FWz3yqdp; Fri, 17 Mar 2023 21:01: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 4Pdc4P35Qvz3pRW; Fri, 17 Mar 2023 21:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QB93CKTVOX02fsA0tcibetOyNM9kqN6+57s0/9FDzJo=; b=WbGWZErtGUTZyoMmyNxUag3julGjy19ZtpqkVQIvdQLihOzX+3ED9UXpv93KpZ6circV6z 9UeAQma2pIf8b11jSaY1118cqqvkkD2Uo3vM7/L+OdH4EdyVe6/bNJOwBMmg5cSGCmIAV2 tTGZCuozK1aOLtvEfYT0lhqyUQDxjUwCxmcK93G2Kt3LtLZ4d1Cz0xa13WzI2l9VGqm6Pw i81PfIWdtgtHwYPqf8ovn2z1KCwVFFgyBgemrm3WTECsXfHktICwEJbMX0WiVoDOcVPed3 gkuZKSCNoqQw8QuZbrSB5C7LULb82Hbw/jzQVVQAWfmvTSBW+EFSRxH4zGgQXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QB93CKTVOX02fsA0tcibetOyNM9kqN6+57s0/9FDzJo=; b=mmzaevY0u+WL12lVp5PmoH4ORbbzdoQUVB/LUxKPqXU1WkcLl5IEYXObJnakjS4qHI/842 mmTPTjBvRytmOmcnv8HuDGYMtezkK7Qc5W86HPWQxSJ6WEHHbEQbn+E2Db4Hlyl/Vu5GDs gy4ACT6aW5JwxhzcCuiuQ68yzfJn7hRTOKyQPn8+Y+REZ1vNi/iQh/0/kBH/2bnv19kHbT JnDXtgAmjDccYdwwCKoSVLFAUybTJi87cE+Byh4oFFhlfeFR7KfYQUVOa6Qf3kXl1dKR0b 8Dw07HSMnZzR16usdaZMzkVSIhcM37UDDcegcUoVfP+fKD/LbDPLgfq5oun4AA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086885; a=rsa-sha256; cv=none; b=rkpAYh7FmZ3Rld2eTqLRxlnNcBtkw6IMGfcPhSDH5gU2Prji7lWeUYRLD3v3egTpRS8X5p nECU8Hd85gdHVvxetaCF7blYFoZUq9gUDlQeqT28q1soPWRuVIG58Y+ZJ0gTwsLNR2raSv iVYdab5YSmI98rVsP0AoKEzDCw/Gj2EN6DNQ+/918vP3NVxDksazQ+aDeh5VughgJDVNB1 jd7cqRV/0iYJ65k/PyngjvApOSqfIZn9vGdIF+t/rQTsuRVN2hu8A5vuKnMBseliSruotz EoM5tQrMyfsqpGeFsAAiUo6NAzy54mJ24Focs634JLZWPuGHhD1Tx6J7kZQgIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4P2BqrzgNX; Fri, 17 Mar 2023 21:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1Pj6014998; Fri, 17 Mar 2023 21:01:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1PFA014997; Fri, 17 Mar 2023 21:01:25 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:25 GMT Message-Id: <202303172101.32HL1PFA014997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: cc123f0dba83 - stable/13 - daemon: initialize mask_orig with sigemptyset() List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cc123f0dba83a403db6978cae2232cbbf6ec7f48 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=cc123f0dba83a403db6978cae2232cbbf6ec7f48 commit cc123f0dba83a403db6978cae2232cbbf6ec7f48 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:41 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:01 +0000 daemon: initialize mask_orig with sigemptyset() consolidation of variable declarations and initializations in previous commit allowed me to detect that one of the signal masks is not properly initialized with sigemptyset (as man 3 sigsetops demands) Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 84866cefdfb78488543056173aea78748b77159b) --- usr.sbin/daemon/daemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index c8ccd8f892fa..9477b2a415e8 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -171,6 +171,7 @@ main(int argc, char *argv[]) sigemptyset(&mask_susp); sigemptyset(&mask_read); sigemptyset(&mask_term); + sigemptyset(&mask_orig); while ((ch = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (ch) { From nobody Fri Mar 17 21:01:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4Q4Pd8z3yqdt; Fri, 17 Mar 2023 21:01: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 4Pdc4Q3lqMz3pjs; Fri, 17 Mar 2023 21:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ae/Hht4QOjnSyORFXAMe0gLrgNG9J0x64makHwXenvg=; b=O8cVuC/sKbZeCiQnXK8ldxjfnshHaHZDOZTThBmasE71HFyTmQ+/79+cFjkYZFI31zSy4J vdax7Ml0tW3MmDA4tTwGuCXbma5ZouPJWCyeRhLgScDIVD6XC0xAwsJovw7nqxRmfOfxUz OuMPtgwPvjwyySZoEXBSU+DCkS8Kbkk8Qpd/Lgc4AOu8J5uKTGwq16r0ieTfhyWtfC9Tnz 7TSCZDgkhH/Fz1SoDiUIeHIzWiXxNFHHGV9LFi+eEreXYirkCpS3awQtWPpuSkqwc0vCPG Ttd4zI3Etoc5rC1pIylmr2Sg7rHouoAWKj8JYweJS1vJyzMnmmVobicKWB3snw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ae/Hht4QOjnSyORFXAMe0gLrgNG9J0x64makHwXenvg=; b=dAIygeiGeaTcZI6tnEETh+w/Heqy9db6OgcVWz03hh0QJKtOKCnNTA0oPf42wDOBvJWW0c iNzuA/0xIgFWGAkFFHsK6KIG6e3mZpdiJn8wE9HM1jDTRbziAseRcEG1DO80ef6v8zj1h2 oa/IAgo01Sv3Z8xS9SOLsw2huISOCnHJdFLolyDxWksBAtJZDrEzaOUGG1c8g57fOWkngD Yh2X/IU8uSDc7enKkxZxHRymCUHjanto/kOsAi8tXLUb2lWKRzQCVH+pitaVZbcnKp+6sH d9qjQRkvifk52/lQmrsr68ZGjul7wBa5i0qPEwmI6QYuu73aOD6jaqIjlR3WZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086886; a=rsa-sha256; cv=none; b=p24PDrAXoZ1HkHE6KBrLUp3T3N9r1K8Gv24MoG9KL/CUHb6UghpYpS8Xj9gvhcidrbszbn 9pHixpJrEikmAZSnXooVuw4pvHNqANCGgf9w/WF4xCj/9m9Men2xdOy3H06dY2zisRTrn5 iNQ7lE/8W8irTD2JMNwbiqrawrvwDsNvjzs3XSgdB74YuwthfISrVNsDI6uCF2n7T+dMbR pMz40GQjPDu/ok/ZxWKum61pbJD8WTQJea7yI7OR012/OQt1EN1PHCKp30Fkln3MPxbPLi 4zWAaaG8F796GBic5Qf1fU24lm5PzC7xGTTgevOxRXGDlFBOgJiy6IUuoohZeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4Q2sxSzgjt; Fri, 17 Mar 2023 21:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1QOW015017; Fri, 17 Mar 2023 21:01:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1Qol015016; Fri, 17 Mar 2023 21:01:26 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:26 GMT Message-Id: <202303172101.32HL1Qol015016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 93871c6cff22 - stable/13 - daemon: fix double init of pid variable List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 93871c6cff22231c94f14455f7896334d0547627 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=93871c6cff22231c94f14455f7896334d0547627 commit 93871c6cff22231c94f14455f7896334d0547627 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:01 +0000 daemon: fix double init of pid variable Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 91b921c7d4684599d1d983f77dcc3df90900adc0) --- usr.sbin/daemon/daemon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 9477b2a415e8..4fe749d9e5fa 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -81,7 +81,7 @@ static void daemon_sleep(time_t, long); static volatile sig_atomic_t terminate = 0; static volatile sig_atomic_t child_gone = 0; -static volatile sig_atomic_t pid = 0; +static volatile sig_atomic_t pid = -1; static volatile sig_atomic_t do_log_reopen = 0; static const char shortopts[] = "+cfHSp:P:ru:o:s:l:t:m:R:T:h"; @@ -286,7 +286,6 @@ main(int argc, char *argv[]) * readable pipe with the child for writing to a log file * and syslog. */ - pid = -1; if (pidfile || ppidfile || restart || outfd != -1 || dosyslog) { struct sigaction act_term, act_chld, act_hup; From nobody Fri Mar 17 21:01:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4R5hJTz3yqsN; Fri, 17 Mar 2023 21:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pdc4R5Fv3z3q0p; Fri, 17 Mar 2023 21:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kd/Tipx5ZMcNf3Cb4aLgnzV57NC5MKrN9h3YEj/UOpI=; b=PBhrrj/vSrPRumyy2M/VgD9pt1reJnE1r4tAtgbZksUm+ZBGa5LPkQ/7BZqB3r3nM8A3UM Tb/gqJ1RVyBDOOz/KkNXUkW2mI20bmM7X6laX3Y4P5VEXNnhNKf0X+0Mh2op37nwq0vkIP abrZ70wg8uMsihNAOj1gPBl5Re5ZAR6jZ4Rlsc7eh43xT1v/0gLlqLkGaf0OP0o/Jh0wHb tztD2Rm71/HQ9bfdObWDz2vBcQF+CySH/1xcHCmRJSSd97UClpz5y1Mzdb0Gfybiuc3SMA COenxCI+nB5vVihLChi2SGPe6VJqkkD6vXiFWs95qCtT+gaqEDbtn7kK9QQGRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kd/Tipx5ZMcNf3Cb4aLgnzV57NC5MKrN9h3YEj/UOpI=; b=k+VFJZjZhwyFK84taNBZhRU/mFUpphNs4ZjbTE/6iGgwsSEdSBp/+PbFtD2rHf0AuIngOz kaVKJNAzw9q61J/sMX+f1cVgcL79WDCIOxkzM58bqvBFsNiJuG7i1XrOqHT1E/R6gDb3uR 6trUHSjPF9STlef7ARVA+3HN/dV02T0JqbYDRDNaHTPCmnZ7H68dBt06uqRiTbEqCTtaKz Pqe/CPuXq3sH6PHcfzlLQtQBEJ9BgPoa0XPHpfBUVIgPAJO8RjQAKhD0M7vyMSkWgXtgJ/ AY1iObLWx1R4EW97DCuBGOt//giuuqHOVj7rBEsQWWx3gv8Xl8PfmZ3EQLsrWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086887; a=rsa-sha256; cv=none; b=eUhk++yskTac2qa12vsJ5O+1DPVaKARyU1Olz5ovxn0sSrjjj1jVq26shovZ+6t/dOPZ1Y V6qe1daFxGL02M8bc9LF30fqL1SFUi356Z+unrKlKyR/Ft4Ji1NdWR4krbu3dM2mqqQ9M1 FZ+WzvG2lpG2z/z9YSyk9SYYZL3ZUHrmaNK7cjSkbodIDxh015k/a4r24aPFXgf24+J046 drUG+6AZlnVRt5HcguYkCO071hY82qNKsgr4+/dmo9ULzw3Uapjdwf64FkC2vQfhtOSS9w fsoNQtVCtTrTySlDzPpWEI14aTkGR2vnhPVNzOPCDU7bszlbVv5U8A8V32RYfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4R43k7zgbR; Fri, 17 Mar 2023 21:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1RX7015036; Fri, 17 Mar 2023 21:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1RTG015035; Fri, 17 Mar 2023 21:01:27 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:27 GMT Message-Id: <202303172101.32HL1RTG015035@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 52f302f1361f - stable/13 - daemon: initialize struct sigaction at declaration site List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 52f302f1361feb0d1888219b897465693bf64177 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=52f302f1361feb0d1888219b897465693bf64177 commit 52f302f1361feb0d1888219b897465693bf64177 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:01 +0000 daemon: initialize struct sigaction at declaration site This improves readability by uncluttering the code Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 259ed21d21f81b656f06447716d41c190576477e) --- usr.sbin/daemon/daemon.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 4fe749d9e5fa..0925d16a27a0 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -287,20 +287,19 @@ main(int argc, char *argv[]) * and syslog. */ if (pidfile || ppidfile || restart || outfd != -1 || dosyslog) { - struct sigaction act_term, act_chld, act_hup; + struct sigaction act_term = { 0 }; + struct sigaction act_chld = { 0 }; + struct sigaction act_hup = { 0 }; /* Avoid PID racing with SIGCHLD and SIGTERM. */ - memset(&act_term, 0, sizeof(act_term)); act_term.sa_handler = handle_term; sigemptyset(&act_term.sa_mask); sigaddset(&act_term.sa_mask, SIGCHLD); - memset(&act_chld, 0, sizeof(act_chld)); act_chld.sa_handler = handle_chld; sigemptyset(&act_chld.sa_mask); sigaddset(&act_chld.sa_mask, SIGTERM); - memset(&act_hup, 0, sizeof(act_hup)); act_hup.sa_handler = handle_hup; sigemptyset(&act_hup.sa_mask); From nobody Fri Mar 17 21:01:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4T2xf6z3yqsR; Fri, 17 Mar 2023 21:01: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 4Pdc4S5sdNz3py8; Fri, 17 Mar 2023 21:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9WEjex8I5tpI4Yyl2DkZvlgR/c8od9wZ+NhvHqHF0bc=; b=oI2uhhMb8uDC+MaRgRX5rCkI29oi2rwzbLOBHAbEBozba0u9uaQwLhIPY3LORccgxQYbem saDvdgBmFYKvGpDVIpkJ/Y49QysTq8S8vVfwChZGp4ln0p2SiU3LL4Ikhr27e1NA3Cm3Jk xdoBrlZUCigxNJtl2LYRd0UmpIQsxUt30vvdu0mLnjbd/ikbrfHo7gl8V4YoPan1PfM4Hm BG98KFCmz2rpIkTc/fTed0euzCtatnKo3be4y8SIHm6yoUFtEu54InzDENQNYjOPE/z2Sy Q9eN4mFAIq33yu6XHhnBtbOrDfmTM41LmxOxFAKpe9yN8x2CObfwdDfwgPrAHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9WEjex8I5tpI4Yyl2DkZvlgR/c8od9wZ+NhvHqHF0bc=; b=e0cMCYeh9bNRcJ5VvHAZSO/za7LtFiYF7KtGaKnEfDJooz39Bcg0b4tBEZQ76B2sT0za7q DK0GUbhTmeRlflWQrtBJYBidaYxYZWa1ausHg2p7c5gxkS36nvnRBDKFFq8I1nrRHdwf+h +yVCopp6oIDLbjgMBzpMxLtT9vbmimdIvAGWDt3m+Ih+A8Ga9Jzot6b9/fnXCAdR3WJdPf Tgg/5ELfIPyBWWLaKzijwtAdDN9biXRPREi9vTGw1GmVOGda8uabLCLNgA2hGWHMMs66yM qUICIYTEX3cXBRwwd7PBMz9NOhdYy8ex5uD92ZYaM/mb6q/8afVAnx/rc4NS8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086888; a=rsa-sha256; cv=none; b=aMS4qCg1YZ2aVKpNCs7gWqKUNefxi+Ahh+jt02FZeJwlxXw4DXnYCywMbSALkn9lf2K6xy AjDR2QZ9aozZfAX0XUOJIkaZtJibc6mT/3LENA8KaRx+9Xobzq2WqQco31U89URpOINwf3 ioSCAlRxiOX2B1dI2bdgTmKsEOO805kLw4FoSKrri1M8523VjkBae869g6buyMD9QC+3ik m+8AjDitAfmb/oXECOg82iPsx0lbdQIhxAqyE+VZiD1C7LBVGouCbj+653u8tpTmuuEj3n m7UGxuAkzx+3+r4v8WsaS3jVS8hihn4bwi/1jo3nFwvWDrohe/rgUxBUH/7Vsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4S4ztdzgrv; Fri, 17 Mar 2023 21:01:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1SkJ015055; Fri, 17 Mar 2023 21:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1SAD015054; Fri, 17 Mar 2023 21:01:28 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:28 GMT Message-Id: <202303172101.32HL1SAD015054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 6f71a684560f - stable/13 - daemon: add supervision_enabled var List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6f71a684560f77086932cfd1403528b212969ddd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6f71a684560f77086932cfd1403528b212969ddd commit 6f71a684560f77086932cfd1403528b212969ddd Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:01 +0000 daemon: add supervision_enabled var explicitly name a bunch of boolean checks that enable supervison mode and improve comments Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 203df05b692b5e2b92c990d8971f5797e3a7a139) --- usr.sbin/daemon/daemon.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 0925d16a27a0..f15a3f567a8c 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <pwd.h> #include <signal.h> #include <stdio.h> +#include <stdbool.h> #include <stdlib.h> #include <unistd.h> #include <string.h> @@ -141,6 +142,7 @@ usage(int exitcode) int main(int argc, char *argv[]) { + bool supervision_enabled = false; char *p = NULL; const char *pidfile = NULL; const char *logtag = "daemon"; @@ -275,18 +277,31 @@ main(int argc, char *argv[]) } /* Write out parent pidfile if needed. */ pidfile_write(ppfh); + /* - * If the pidfile or restart option is specified the daemon - * executes the command in a forked process and wait on child - * exit to remove the pidfile or restart the command. Normally - * we don't want the monitoring daemon to be terminated - * leaving the running process and the stale pidfile, so we - * catch SIGTERM and forward it to the children expecting to - * get SIGCHLD eventually. We also must fork() to obtain a - * readable pipe with the child for writing to a log file - * and syslog. + * Supervision mode is enabled if one of the following options are used: + * --child-pidfile -p + * --supervisor-pidfile -P + * --restart -r / --restart-delay -R + * --syslog -S + * --syslog-facility -l + * --syslog-priority -s + * --syslog-tag -T + * + * In supervision mode daemon executes the command in a forked process + * and observes the child by waiting for SIGCHILD. In supervision mode + * daemon must never exit before the child, this is necessary to prevent + * orphaning the child and leaving a stale pid file. + * To achieve this daemon catches SIGTERM and + * forwards it to the child, expecting to get SIGCHLD eventually. */ - if (pidfile || ppidfile || restart || outfd != -1 || dosyslog) { + supervision_enabled = pidfile != NULL || + ppidfile != NULL || + restart != 0 || + outfd != -1 || + dosyslog != 0; + + if (supervision_enabled) { struct sigaction act_term = { 0 }; struct sigaction act_chld = { 0 }; struct sigaction act_hup = { 0 }; From nobody Fri Mar 17 21:01:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4V0G2Wz3yqvy; Fri, 17 Mar 2023 21:01: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 4Pdc4T6qdVz3pvZ; Fri, 17 Mar 2023 21:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aNNwxT0DVQ0JEIZ6fUmr8RkRo3rCMkgTZo0NY5Fks4w=; b=Kzohgl6qSM/c9IsM5MAAUuyTS72ziMBqaSwUw0m2FfCKhSR6+3AEFw3uf5+iLxLYfqBxSb 40fgahpkgH5qJCDpHzFNeJavbfaWFUAACHwQc+tqqHeIzC5+mZ5a+LI8S9BR7uuibgKOVB 5a+4xWmNhNN+m79BRH8AcHHxFT7E3iqAu+iM3JAVEvCop0MJhDfZhDrL9y/+QRZkgvnP7K 0zYs9bWVtfnpc1rhSpj3EqnJzjprE5KdK69flB1ITmuTnVVoo52jaq8GJOjIjgZwnc9l3t FSLqCajZiycgbU4JWq/uHBtJkVV/Tp7tOQPamvbNc0oST9SzQu1C4IylpQu0AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aNNwxT0DVQ0JEIZ6fUmr8RkRo3rCMkgTZo0NY5Fks4w=; b=CiC2sG3yzxN92eG7rJp3lRmZA+AEmVETFA7dbE8oGrMpkxidUeFcrkl6nFQad9Ypz8uiJP /lW5+8KHi1FL7+A7S7GB8g4XBSsUutO/thUJcxeGJWkUuLUG3SACNwOk7NvbwsCgo4L3eW OUt2NdLhWxFfYcTNgLm0vDA9itVix1Lgk5MKEBhnAj52nTdMKwaZh2r3ig7WmzUQtWLJLx ZmPzIhdLVlJ1UpF/M5zhhkSoc31cT1SKDOtLjyg+ic8EfQJS8IQF9gTanyrRPRL48dn7N6 /2GEMxm1TGNIF/x4VqYoYqFKyp5hkNVE+qkR6EMr98KyolkvnY3o+zVHE8FlNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086890; a=rsa-sha256; cv=none; b=RwK0ixOu2/xU3D5GMounpNRttA2/MvFMQo35XE26MTRQJYp4JwWeKu8biTXfndRdVOzlhx z0Gt3QFVkwtWjmtrB9+6kIGwm0NWu/dHLw3Q7kfI+hsUi3Kn/4VxC2h3YIPYpIXL1LH/EA B7TeYwhXqKsbnie3NSXR8ztPDKFRSi7HIv+M7qGAvu1bwepwW2ODKTyjudDJ9e03LwnkMA 8/BA6aCCVxXDtw0TomsU1lBN796M5c3gThld5Q7/Gxkl0+aCK2nts71p9QGsHesNoyBXji dxeKMEdrKmxDwVZiy2IQVo3md95RmkfqWWO4zEpE9XtzyCk8s/PC5p2XLF3uhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4T5x8gzgcp; Fri, 17 Mar 2023 21:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1TaC015080; Fri, 17 Mar 2023 21:01:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1T7m015079; Fri, 17 Mar 2023 21:01:29 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:29 GMT Message-Id: <202303172101.32HL1T7m015079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: d394c80f4950 - stable/13 - daemon: make dosyslog variable a bool and give it a better name List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d394c80f4950b1aeb4161582dcafaae57d7e5893 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d394c80f4950b1aeb4161582dcafaae57d7e5893 commit d394c80f4950b1aeb4161582dcafaae57d7e5893 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:01 +0000 daemon: make dosyslog variable a bool and give it a better name Following style(9) and C99 recommendation use bool instead of int for boolean operations. Also give the variable a more descriptive name that follows boolean naming convention. Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit f2f9d31d9f9f7f319edb95874b41af0733a26624) --- usr.sbin/daemon/daemon.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index f15a3f567a8c..344b914d464b 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -60,11 +60,11 @@ __FBSDID("$FreeBSD$"); #define LBUF_SIZE 4096 struct log_params { - int dosyslog; int logpri; int noclose; int outfd; const char *outfn; + bool syslog_enabled; }; static void restrict_process(const char *); @@ -143,6 +143,7 @@ int main(int argc, char *argv[]) { bool supervision_enabled = false; + bool syslog_enabled = false; char *p = NULL; const char *pidfile = NULL; const char *logtag = "daemon"; @@ -152,7 +153,6 @@ main(int argc, char *argv[]) const char *user = NULL; int ch = 0; int child_eof = 0; - int dosyslog = 0; int log_reopen = 0; int logfac = LOG_DAEMON; int logpri = LOG_NOTICE; @@ -191,7 +191,7 @@ main(int argc, char *argv[]) if (logfac == -1) { errx(5, "unrecognized syslog facility"); } - dosyslog = 1; + syslog_enabled = true; break; case 'm': stdmask = strtol(optarg, &p, 10); @@ -222,17 +222,17 @@ main(int argc, char *argv[]) if (logpri == -1) { errx(4, "unrecognized syslog priority"); } - dosyslog = 1; + syslog_enabled = true; break; case 'S': - dosyslog = 1; + syslog_enabled = true; break; case 't': title = optarg; break; case 'T': logtag = optarg; - dosyslog = 1; + syslog_enabled = true; break; case 'u': user = optarg; @@ -262,7 +262,7 @@ main(int argc, char *argv[]) } } - if (dosyslog) { + if (syslog_enabled) { openlog(logtag, LOG_PID | LOG_NDELAY, logfac); } @@ -299,7 +299,7 @@ main(int argc, char *argv[]) ppidfile != NULL || restart != 0 || outfd != -1 || - dosyslog != 0; + syslog_enabled == true; if (supervision_enabled) { struct sigaction act_term = { 0 }; @@ -349,7 +349,7 @@ main(int argc, char *argv[]) */ (void)madvise(NULL, 0, MADV_PROTECT); logpar.outfd = outfd; - logpar.dosyslog = dosyslog; + logpar.syslog_enabled = syslog_enabled; logpar.logpri = logpri; logpar.noclose = noclose; logpar.outfn = outfn; @@ -487,7 +487,7 @@ exit: close(outfd); close(pfd[0]); close(pfd[1]); - if (dosyslog) { + if (syslog_enabled) { closelog(); } pidfile_remove(pfh); @@ -647,14 +647,14 @@ do_output(const unsigned char *buf, size_t len, struct log_params *logpar) if (len < 1) { return; } - if (logpar->dosyslog) { + if (logpar->syslog_enabled) { syslog(logpar->logpri, "%.*s", (int)len, buf); } if (logpar->outfd != -1) { if (write(logpar->outfd, buf, len) == -1) warn("write"); } - if (logpar->noclose && !logpar->dosyslog && logpar->outfd == -1) { + if (logpar->noclose && !logpar->syslog_enabled && logpar->outfd == -1) { printf("%.*s", (int)len, buf); } } From nobody Fri Mar 17 21:01:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4W1dz6z3yqcd; Fri, 17 Mar 2023 21:01: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 4Pdc4W0l0Kz3q8H; Fri, 17 Mar 2023 21:01:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZiXzBnoeZbHOrU60uThA+X+42i27pkkiTBqpWfxOy1k=; b=YRLVzPeaSh8UK8ezN0hylFeuF2D7OdCCHqiRexOV1ugVhWorvXc5RpqOD0QPEbXZuD/CMR wWmLbaH9z8qRoRA1F91kDzjd59sE+I1t4jQqy/7Fj8Qfdi2vp7BboELwnhHyxENV9lAVLn r8MfukeiKClgpIque3RuFLI8am1jdAqyiM8A5BjFbjbjEPlfguJwda7/pGieZNaJL+jkZ/ OSfW8ENP/L6vVvP2BaEknINu+bVY8k//n6ZMwkL6AduuA5Bt7Vw80JoUaE2aSpj7pk5IJQ Os728vX7EUm+zWeX4wCzfd583Df/cIaE0FYnAFs+hFO+PshjRuZIUDAhhLKfBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZiXzBnoeZbHOrU60uThA+X+42i27pkkiTBqpWfxOy1k=; b=UmAmyUdEYJ9lwvOxTDbehxDPjpdM24x9dAkweGeICaAlovrAez1nsfZu7ELMK8i03pjxrA WAsLwwj5HVN343t99dpmH7OWulR+o48T3nAUPFhr3AtZzy4jsDFohE45cJ+o+RvPCMCjyT 4WCok23tHBVIFlcoIyV2hhk/RARDioUo6v9/iYJpx2V82qLLIsMKJbdlHVswY8n5qCObk4 fBpW8thinEzafufS7zMGpA5mMuUr5/7M2Gf4mP+o/H6gJ0VBJ0b7YPBmOmP4mMZNLYGgSs qPGG3IEhBqUqjfl1CHwkGr4w7HSrClopSFGdqetg6EBIEHJVxVleg0TXqFpXpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086891; a=rsa-sha256; cv=none; b=PpbMXL3El6WFF5zyCT7SojEfjfYXPojP+YhhK/vVHjJELSzA+SqI/D+xZ3snNYF9wxUdeg BSxwIEcpRp6x9v00eAdVbQvp0iLqrmRj/1SS8RoMVYgFM0ipWuivRSHN3tIBhDcuIXUjO8 E7hDTaOA4vSMlBWKX1mr1ShtDco+1sYpD75+DH/BBIv3ADoQSNiW0UKCeaksSYnjK50EjI JRTNFr8v9TvChPtoCcz3qgUQBj/zvYHLe1jVbHAkl8DgpnGiJsKDeu3rwxZdrGj8fEuuNX /j96PRpudMEsf+nipDHFFukbyMWUcFZXDh/P7zdqWGph9HG1WNaxrR7IJ4aYnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4V6y94zgbS; Fri, 17 Mar 2023 21:01:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1UfD015099; Fri, 17 Mar 2023 21:01:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1UiI015098; Fri, 17 Mar 2023 21:01:30 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:30 GMT Message-Id: <202303172101.32HL1UiI015098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 5e46ebc5d0a4 - stable/13 - daemon: make log_reopen variable a bool List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5e46ebc5d0a4351145338f259d8dbf1fd4210756 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=5e46ebc5d0a4351145338f259d8dbf1fd4210756 commit 5e46ebc5d0a4351145338f259d8dbf1fd4210756 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:02 +0000 daemon: make log_reopen variable a bool Following style(9) and C99 recommendation use bool instead of int for boolean operations. Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 97022e90c3693ad1180bd26ebc909ce27893b227) --- usr.sbin/daemon/daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 344b914d464b..2db2594041e7 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -144,6 +144,7 @@ main(int argc, char *argv[]) { bool supervision_enabled = false; bool syslog_enabled = false; + bool log_reopen = false; char *p = NULL; const char *pidfile = NULL; const char *logtag = "daemon"; @@ -153,7 +154,6 @@ main(int argc, char *argv[]) const char *user = NULL; int ch = 0; int child_eof = 0; - int log_reopen = 0; int logfac = LOG_DAEMON; int logpri = LOG_NOTICE; int nochdir = 1; @@ -184,7 +184,7 @@ main(int argc, char *argv[]) noclose = 0; break; case 'H': - log_reopen = 1; + log_reopen = true; break; case 'l': logfac = get_log_mapping(optarg, facilitynames); From nobody Fri Mar 17 21:01:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4X3HfBz3yqfM; Fri, 17 Mar 2023 21:01: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 4Pdc4X1TmXz3q8Q; Fri, 17 Mar 2023 21:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dKHtV8UeGlqkswGzeoTQZ4YkRLooG7BtkefAdqKg38w=; b=aOQeWyPwMQx1fFbDFHVPlo+iZvkL5o1hHMGl41Ma36ysdMLzMZ54Xq1aoKpM52/NKgXafg H++dvQRs3XYMVDoCO7vJSRKtZyLZnHM1723UifGbBiL9dKU9HEcdCcPJVKAFtFpmW93oji /B9uCLwpruFVIFul6YAdCeLz8YqPu6coP9Xy0ICqZhNO7QIj1+UVibdnVhy1emer/9Uuxd x+QwmksIBh0TQn9reu4hQJ+I+ZhLryvB+wX/jopMV1n9/83fUvEG8uLjDpCbnGX51fTFuH yH68zFmX5+3MF9xYRCZNoeCFzVFc/3gtnzAaggmKSQ2QP3opEQcs7WX2JpWsEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dKHtV8UeGlqkswGzeoTQZ4YkRLooG7BtkefAdqKg38w=; b=S+WJKEnS46iYITUqNggCkSLq0KFFPfshq3SD9EUiPJAlPI2MzPbGbEJZHYU3+iiUunt43x 9nylm/zk39sncaWCxLQzBMYIsm7ejS3e3675+etHXXY1LHmdAVBBqbg9laePUDSpMuwig2 Z36mqPNSrVPfcxjnabEPcPQwyUWUXwfaSwVgFdNrSmETCPVft5nDDnu7nP/OVaU8ogWcCr Bq7Pi1gEM+peuEBXgWkI0/sP4URtqpXAbtzwsFeiX+Q7I391Cl1NcaDN7xZ4Iel5GXPqsJ JbF7MOKlGn6vY/uEcA2oCQQPDE6w1daUN0uv8/fTy5w3qyCZ0p25b+uHqdCXjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086892; a=rsa-sha256; cv=none; b=IWDpMSIRdTeYSErs/dltgWCmtWS4ZNTF1ncK7V/jqBoV0bj4ECXKUfstBajFSbG+1bDA52 uWHmvC0q6EYUbG17BuOu/yqF4UsJZciRMBUQZDX92CuYBt+pFCZnWj3dTj9Gv92dXo9atp ojj7kDhDS5jnK2MmHyUvxhPXaE/9dvRVQec43VxJgpzXhIqy9ZLyhEljkLqLe2gujhqhAQ xmn/4PGhequFmm9UJh5Pht/bCp6EIPuRPTaLG5SZZd5ezhB6ysMs+f++88+YiLar5V62Wt 9Jvee349Yhw2hx5MZWJjIHLYrFb6dfpJCTPFIvRwycDWQKi6kPljBQZRRgqR7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4X0T2jzgjv; Fri, 17 Mar 2023 21:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1VUu015119; Fri, 17 Mar 2023 21:01:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1VsG015118; Fri, 17 Mar 2023 21:01:31 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:31 GMT Message-Id: <202303172101.32HL1VsG015118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: b71a65870f4d - stable/13 - daemon: deduplicate log_params varaibles List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b71a65870f4dc181539157bc004caf889e12d924 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b71a65870f4dc181539157bc004caf889e12d924 commit b71a65870f4dc181539157bc004caf889e12d924 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:02 +0000 daemon: deduplicate log_params varaibles While we're here, sort log_params by size. Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit e70444c622a97e02fb5a76c06f9a48b4a07aa963) --- usr.sbin/daemon/daemon.c | 92 +++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 2db2594041e7..379c31a0a221 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -60,10 +60,10 @@ __FBSDID("$FreeBSD$"); #define LBUF_SIZE 4096 struct log_params { - int logpri; + const char *output_filename; + int syslog_priority; int noclose; - int outfd; - const char *outfn; + int output_fd; bool syslog_enabled; }; @@ -143,26 +143,27 @@ int main(int argc, char *argv[]) { bool supervision_enabled = false; - bool syslog_enabled = false; bool log_reopen = false; char *p = NULL; const char *pidfile = NULL; - const char *logtag = "daemon"; - const char *outfn = NULL; + const char *syslog_tag = "daemon"; const char *ppidfile = NULL; const char *title = NULL; const char *user = NULL; int ch = 0; int child_eof = 0; - int logfac = LOG_DAEMON; - int logpri = LOG_NOTICE; + int syslog_facility = LOG_DAEMON; int nochdir = 1; - int noclose = 1; - int outfd = -1; int pfd[2] = { -1, -1 }; int restart = 0; int stdmask = STDOUT_FILENO | STDERR_FILENO; - struct log_params logpar = { 0 }; + struct log_params logpar = { + .syslog_enabled = false, + .syslog_priority = LOG_NOTICE, + .noclose = 1, + .output_fd = -1, + .output_filename = NULL + }; struct pidfh *ppfh = NULL; struct pidfh *pfh = NULL; sigset_t mask_orig; @@ -181,17 +182,17 @@ main(int argc, char *argv[]) nochdir = 0; break; case 'f': - noclose = 0; + logpar.noclose = 0; break; case 'H': log_reopen = true; break; case 'l': - logfac = get_log_mapping(optarg, facilitynames); - if (logfac == -1) { + syslog_facility = get_log_mapping(optarg, facilitynames); + if (syslog_facility == -1) { errx(5, "unrecognized syslog facility"); } - syslog_enabled = true; + logpar.syslog_enabled = true; break; case 'm': stdmask = strtol(optarg, &p, 10); @@ -200,7 +201,7 @@ main(int argc, char *argv[]) } break; case 'o': - outfn = optarg; + logpar.output_filename = optarg; break; case 'p': pidfile = optarg; @@ -218,21 +219,21 @@ main(int argc, char *argv[]) } break; case 's': - logpri = get_log_mapping(optarg, prioritynames); - if (logpri == -1) { + logpar.syslog_priority = get_log_mapping(optarg, prioritynames); + if (logpar.syslog_priority == -1) { errx(4, "unrecognized syslog priority"); } - syslog_enabled = true; + logpar.syslog_enabled = true; break; case 'S': - syslog_enabled = true; + logpar.syslog_enabled = true; break; case 't': title = optarg; break; case 'T': - logtag = optarg; - syslog_enabled = true; + syslog_tag = optarg; + logpar.syslog_enabled = true; break; case 'u': user = optarg; @@ -255,15 +256,15 @@ main(int argc, char *argv[]) title = argv[0]; } - if (outfn) { - outfd = open_log(outfn); - if (outfd == -1) { + if (logpar.output_filename) { + logpar.output_fd = open_log(logpar.output_filename); + if (logpar.output_fd == -1) { err(7, "open"); } } - if (syslog_enabled) { - openlog(logtag, LOG_PID | LOG_NDELAY, logfac); + if (logpar.syslog_enabled) { + openlog(syslog_tag, LOG_PID | LOG_NDELAY, syslog_facility); } /* @@ -271,7 +272,7 @@ main(int argc, char *argv[]) * to be able to report the error intelligently */ open_pid_files(pidfile, ppidfile, &pfh, &ppfh); - if (daemon(nochdir, noclose) == -1) { + if (daemon(nochdir, logpar.noclose) == -1) { warn("daemon"); goto exit; } @@ -295,11 +296,11 @@ main(int argc, char *argv[]) * To achieve this daemon catches SIGTERM and * forwards it to the child, expecting to get SIGCHLD eventually. */ - supervision_enabled = pidfile != NULL || + supervision_enabled = pidfile != NULL || ppidfile != NULL || - restart != 0 || - outfd != -1 || - syslog_enabled == true; + restart != 0 || + logpar.output_fd != -1 || + logpar.syslog_enabled == true; if (supervision_enabled) { struct sigaction act_term = { 0 }; @@ -348,12 +349,7 @@ main(int argc, char *argv[]) * not have superuser privileges. */ (void)madvise(NULL, 0, MADV_PROTECT); - logpar.outfd = outfd; - logpar.syslog_enabled = syslog_enabled; - logpar.logpri = logpri; - logpar.noclose = noclose; - logpar.outfn = outfn; - if (log_reopen && outfd >= 0 && + if (log_reopen && logpar.output_fd >= 0 && sigaction(SIGHUP, &act_hup, NULL) == -1) { warn("sigaction"); goto exit; @@ -484,10 +480,10 @@ restart: goto restart; } exit: - close(outfd); + close(logpar.output_fd); close(pfd[0]); close(pfd[1]); - if (syslog_enabled) { + if (logpar.syslog_enabled) { closelog(); } pidfile_remove(pfh); @@ -648,13 +644,13 @@ do_output(const unsigned char *buf, size_t len, struct log_params *logpar) return; } if (logpar->syslog_enabled) { - syslog(logpar->logpri, "%.*s", (int)len, buf); + syslog(logpar->syslog_priority, "%.*s", (int)len, buf); } - if (logpar->outfd != -1) { - if (write(logpar->outfd, buf, len) == -1) + if (logpar->output_fd != -1) { + if (write(logpar->output_fd, buf, len) == -1) warn("write"); } - if (logpar->noclose && !logpar->syslog_enabled && logpar->outfd == -1) { + if (logpar->noclose && !logpar->syslog_enabled && logpar->output_fd == -1) { printf("%.*s", (int)len, buf); } } @@ -708,10 +704,10 @@ reopen_log(struct log_params *lpp) int outfd; do_log_reopen = 0; - outfd = open_log(lpp->outfn); - if (lpp->outfd >= 0) { - close(lpp->outfd); + outfd = open_log(lpp->output_filename); + if (lpp->output_fd >= 0) { + close(lpp->output_fd); } - lpp->outfd = outfd; + lpp->output_fd = outfd; } From nobody Fri Mar 17 21:01:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4Y3QPCz3yqp1; Fri, 17 Mar 2023 21:01: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 4Pdc4Y2Wtmz3qFP; Fri, 17 Mar 2023 21:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GmfHdVS21p3BLx0Ymt3efgJxVU37qp2dBaJ51iTRglU=; b=ZuH1jZ0EXYYEJqxcwBBzOy8FiaLz1zQn8DvqyAA2bQkDTcqnudOo0Nnj1KG9Zmzntwv2Kt R2RidmIGDkmA2GCOKycBjQI/h0wVsqqUWx7vCeaVwzWjyKiHRVPUjAtzwwfCTBRjfsv0VM vB6xNNbygCtBm92SeKWKRWFBVaBwZOp9kfrZebIZj6V2YGpwHv0Reo2oxiO7CXqUkOWERM lYp7hv+tXPgjuO9WBm3aQUSNRbD/7tLT8wZVp3WiiD9YZ7TM/UvSRMPHPJNRGvqjI80odT MwcZZcBTnTx47y7wOrUbFpusjkp49p9qI5gyX6kUHggCo9EflV1PQSTi6hj8fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GmfHdVS21p3BLx0Ymt3efgJxVU37qp2dBaJ51iTRglU=; b=gpp9CzZtXvuMxY4a9NpbeAq6s37EFXUYZKnVqQcUseD+0uaZNtZ/73kNUVkLQMLsZG0Dho 2/N2+qdLS7sfjPJnrGgVG7TjVfYxincyTlkd/M3K5x5bZ3esHO0YrcUiavGNXZALiYk1OT VG8NmM7cwfLEpAL0hOWbU2FCadwz2T5C5uYE79Ou8oglxzisNZb2a0iSBcMunDGfokC7nD WVwvV5Qm2ywPH6FIErLkptnVz4YMuIIXoeyoFojxsjx68fo6B4aD0v4me00ODYNdhiS9+p 4SnDKF9eZ5uxPUNnKdFo0M64VMJ1y1bz7DDR+ejrCIUnkfE/pERUjZws3e5OdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086893; a=rsa-sha256; cv=none; b=Im4OQQldDp2eQG8kVXd9ESpxiICUpj3nSZPglS91QRbaSfgvJ+HlsSKDg0+7qZu4MqCMdI s3G/Yys4FpxdnzVlMFywzLgdxdDwapoO9HOAQvBCvhncuyfPJzwVoe2rEawDwUrLEt2Zzo eTowZ4+rQSl42UJUZmnjUnMK5WjqHvnhuaNrWBLs7OybqakrxxsJrchNS5GbNHsxNu1JKq KD69AKj693J5jXrG7BEH7J64S0VDQbofVy8S0jYcKO7/KtvaTE2P8dQL6F4YRAJkP4civr gyTvIlZso0cRvLFZUfDZzdoRI8z2hl41yZJt3T/EIH+t6xr8s1zwcVLktI3I8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4Y1XXQzgcq; Fri, 17 Mar 2023 21:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1X1e015138; Fri, 17 Mar 2023 21:01:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1X49015137; Fri, 17 Mar 2023 21:01:33 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:33 GMT Message-Id: <202303172101.32HL1X49015137@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: d8b8a0316ed7 - stable/13 - daemon: move syslog facility and syslog tag into log_params List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d8b8a0316ed758bf7b5bea78487f2f842433c3d3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d8b8a0316ed758bf7b5bea78487f2f842433c3d3 commit d8b8a0316ed758bf7b5bea78487f2f842433c3d3 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:02 +0000 daemon: move syslog facility and syslog tag into log_params Since struct log_params already contains logging-related varaiables, including syslog-related, move remaining syslog-related variables into struct log_params as well Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 6f0636728b53c74d3327a8da8c51efee810fbff0) --- usr.sbin/daemon/daemon.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 379c31a0a221..6904dfa1896f 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -61,7 +61,9 @@ __FBSDID("$FreeBSD$"); struct log_params { const char *output_filename; + const char *syslog_tag; int syslog_priority; + int syslog_facility; int noclose; int output_fd; bool syslog_enabled; @@ -146,13 +148,11 @@ main(int argc, char *argv[]) bool log_reopen = false; char *p = NULL; const char *pidfile = NULL; - const char *syslog_tag = "daemon"; const char *ppidfile = NULL; const char *title = NULL; const char *user = NULL; int ch = 0; int child_eof = 0; - int syslog_facility = LOG_DAEMON; int nochdir = 1; int pfd[2] = { -1, -1 }; int restart = 0; @@ -160,6 +160,8 @@ main(int argc, char *argv[]) struct log_params logpar = { .syslog_enabled = false, .syslog_priority = LOG_NOTICE, + .syslog_tag = "daemon", + .syslog_facility = LOG_DAEMON, .noclose = 1, .output_fd = -1, .output_filename = NULL @@ -188,8 +190,8 @@ main(int argc, char *argv[]) log_reopen = true; break; case 'l': - syslog_facility = get_log_mapping(optarg, facilitynames); - if (syslog_facility == -1) { + logpar.syslog_facility = get_log_mapping(optarg, facilitynames); + if (logpar.syslog_facility == -1) { errx(5, "unrecognized syslog facility"); } logpar.syslog_enabled = true; @@ -232,7 +234,7 @@ main(int argc, char *argv[]) title = optarg; break; case 'T': - syslog_tag = optarg; + logpar.syslog_tag = optarg; logpar.syslog_enabled = true; break; case 'u': @@ -264,7 +266,7 @@ main(int argc, char *argv[]) } if (logpar.syslog_enabled) { - openlog(syslog_tag, LOG_PID | LOG_NDELAY, syslog_facility); + openlog(logpar.syslog_tag, LOG_PID | LOG_NDELAY, logpar.syslog_facility); } /* From nobody Fri Mar 17 21:01:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4Z3nNYz3yqfS; Fri, 17 Mar 2023 21:01: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 4Pdc4Z2zkkz3q6r; Fri, 17 Mar 2023 21:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hEb/t6YN0hwUTOmv3ykrbKBEevsoxdyixJM3n/fnceA=; b=fUDuTpBQtlWPU7OreIHGVNw+LVxgFzj5yHw7eVZFLROk2PFtvhjVQx50vLvp8uff2+YjvY qnLRBwWW1dwxx/inyecwT1C6zMlJITR1vem4MME2Yi+sRa2NHIu+PPD+tBS6QS6XrQmKck OenuCJJYpMt2Z0BlW3tXs+79OxY5ijBac20ou5LAbDvYZH9hoVyk5YoobPrZzJWgh0s5B1 us6TeNa4IuyHH/GOaOVPHbYT4gICYswL9POrCdhDAxw01bjuVkjhJmctzRoQjaxmIDVjbF 6bHdh3BqeaDcm/oZAo8Q0cGtJaAbLl+5ABrX9KA12dzJH/y0a+33FZcmF0Ecnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hEb/t6YN0hwUTOmv3ykrbKBEevsoxdyixJM3n/fnceA=; b=JnyWcpmLbw8iVp7bilicUdqdOp1bjG7x4OHORzF0oYrqm2GltTtFhglDGBOR8RuJ+4+3y5 rU5oJI9DQ5Ag7pxK//nKLsDVAiL3T178iXqzJW6heHBD/FFCK27mvNjq9vYDeqHpL9Kp2V lDYOR9JW17/neBl84AL/WIAZ4G2x0wRatWl3U8Av+UwVwEZbkT1VZEwlWP/rJHK43QenVw mENnxA/r/dFFXnQRTutAUOj+D7/0Aj6j02W2I5V8I/ZoargjEXX6dFjiHdhyzw/32HUfar r/nVOzROexlkdHgOe6KeNfzK/nPXaSLLCG4UH7e0LdzDMTw7UpM4R/mVLaRRQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086894; a=rsa-sha256; cv=none; b=M/EAKAgLQIRlkjCX+K6PRX2Pp3I5WKQlOnYVY2ZzoIXZU/P35bZ+TwXzCCmf9Jd/V0SIDt jpeIKj8nfId9le1mth9zREaMvSyOQwsd6AUYCwY36RRWo6RiX+Zk7m4EE/0/usnK9QcquC np9lgKxiE7Iajd6YIj6JpcfY+KLGe81SXqV69sxN3KOrNnOcQWllTcPI2/FM+vPO3XiX3G xM8pwhb60U00uB9Pl+IeBSiQYM22qmicmRCuSzEnGyCbUAE48vqRVPPCXibHiKwR1l3u5s SQcwIIEipL9WrdZWGKrtQnPJsmdAxDOIF6CMA96l2wqJYFhyzl+d7+w5dKFhQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4Z24jqzgcr; Fri, 17 Mar 2023 21:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1YE9015157; Fri, 17 Mar 2023 21:01:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1Yq5015156; Fri, 17 Mar 2023 21:01:34 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:34 GMT Message-Id: <202303172101.32HL1Yq5015156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 8eb1e5dd77ca - stable/13 - daemon: more human-friendly variable names List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8eb1e5dd77ca4a631f3114d24b8a8c8a158571ac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8eb1e5dd77ca4a631f3114d24b8a8c8a158571ac commit 8eb1e5dd77ca4a631f3114d24b8a8c8a158571ac Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-02 03:00:43 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:02 +0000 daemon: more human-friendly variable names Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 129ec8f4805ec3f33480873dc9cf3b8404c9ece8) --- usr.sbin/daemon/daemon.c | 94 ++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 6904dfa1896f..af387574c4b5 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -64,7 +64,7 @@ struct log_params { const char *syslog_tag; int syslog_priority; int syslog_facility; - int noclose; + int keep_fds_open; int output_fd; bool syslog_enabled; }; @@ -147,27 +147,27 @@ main(int argc, char *argv[]) bool supervision_enabled = false; bool log_reopen = false; char *p = NULL; - const char *pidfile = NULL; - const char *ppidfile = NULL; + const char *child_pidfile = NULL; + const char *parent_pidfile = NULL; const char *title = NULL; const char *user = NULL; int ch = 0; int child_eof = 0; - int nochdir = 1; + int keep_cur_workdir = 1; int pfd[2] = { -1, -1 }; int restart = 0; int stdmask = STDOUT_FILENO | STDERR_FILENO; - struct log_params logpar = { + struct log_params logparams = { .syslog_enabled = false, .syslog_priority = LOG_NOTICE, .syslog_tag = "daemon", .syslog_facility = LOG_DAEMON, - .noclose = 1, + .keep_fds_open = 1, .output_fd = -1, .output_filename = NULL }; - struct pidfh *ppfh = NULL; - struct pidfh *pfh = NULL; + struct pidfh *parent_pidfh = NULL; + struct pidfh *child_pidfh = NULL; sigset_t mask_orig; sigset_t mask_read; sigset_t mask_term; @@ -181,20 +181,20 @@ main(int argc, char *argv[]) while ((ch = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (ch) { case 'c': - nochdir = 0; + keep_cur_workdir = 0; break; case 'f': - logpar.noclose = 0; + logparams.keep_fds_open = 0; break; case 'H': log_reopen = true; break; case 'l': - logpar.syslog_facility = get_log_mapping(optarg, facilitynames); - if (logpar.syslog_facility == -1) { + logparams.syslog_facility = get_log_mapping(optarg, facilitynames); + if (logparams.syslog_facility == -1) { errx(5, "unrecognized syslog facility"); } - logpar.syslog_enabled = true; + logparams.syslog_enabled = true; break; case 'm': stdmask = strtol(optarg, &p, 10); @@ -203,13 +203,13 @@ main(int argc, char *argv[]) } break; case 'o': - logpar.output_filename = optarg; + logparams.output_filename = optarg; break; case 'p': - pidfile = optarg; + child_pidfile = optarg; break; case 'P': - ppidfile = optarg; + parent_pidfile = optarg; break; case 'r': restart = 1; @@ -221,21 +221,21 @@ main(int argc, char *argv[]) } break; case 's': - logpar.syslog_priority = get_log_mapping(optarg, prioritynames); - if (logpar.syslog_priority == -1) { + logparams.syslog_priority = get_log_mapping(optarg, prioritynames); + if (logparams.syslog_priority == -1) { errx(4, "unrecognized syslog priority"); } - logpar.syslog_enabled = true; + logparams.syslog_enabled = true; break; case 'S': - logpar.syslog_enabled = true; + logparams.syslog_enabled = true; break; case 't': title = optarg; break; case 'T': - logpar.syslog_tag = optarg; - logpar.syslog_enabled = true; + logparams.syslog_tag = optarg; + logparams.syslog_enabled = true; break; case 'u': user = optarg; @@ -258,28 +258,28 @@ main(int argc, char *argv[]) title = argv[0]; } - if (logpar.output_filename) { - logpar.output_fd = open_log(logpar.output_filename); - if (logpar.output_fd == -1) { + if (logparams.output_filename) { + logparams.output_fd = open_log(logparams.output_filename); + if (logparams.output_fd == -1) { err(7, "open"); } } - if (logpar.syslog_enabled) { - openlog(logpar.syslog_tag, LOG_PID | LOG_NDELAY, logpar.syslog_facility); + if (logparams.syslog_enabled) { + openlog(logparams.syslog_tag, LOG_PID | LOG_NDELAY, logparams.syslog_facility); } /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently */ - open_pid_files(pidfile, ppidfile, &pfh, &ppfh); - if (daemon(nochdir, logpar.noclose) == -1) { + open_pid_files(child_pidfile, parent_pidfile, &child_pidfh, &parent_pidfh); + if (daemon(keep_cur_workdir, logparams.keep_fds_open) == -1) { warn("daemon"); goto exit; } /* Write out parent pidfile if needed. */ - pidfile_write(ppfh); + pidfile_write(parent_pidfh); /* * Supervision mode is enabled if one of the following options are used: @@ -298,11 +298,11 @@ main(int argc, char *argv[]) * To achieve this daemon catches SIGTERM and * forwards it to the child, expecting to get SIGCHLD eventually. */ - supervision_enabled = pidfile != NULL || - ppidfile != NULL || + supervision_enabled = child_pidfile != NULL || + parent_pidfile != NULL || restart != 0 || - logpar.output_fd != -1 || - logpar.syslog_enabled == true; + logparams.output_fd != -1 || + logparams.syslog_enabled == true; if (supervision_enabled) { struct sigaction act_term = { 0 }; @@ -351,7 +351,7 @@ main(int argc, char *argv[]) * not have superuser privileges. */ (void)madvise(NULL, 0, MADV_PROTECT); - if (log_reopen && logpar.output_fd >= 0 && + if (log_reopen && logparams.output_fd >= 0 && sigaction(SIGHUP, &act_hup, NULL) == -1) { warn("sigaction"); goto exit; @@ -383,7 +383,7 @@ restart: } if (pid <= 0) { /* Now that we are the child, write out the pid. */ - pidfile_write(pfh); + pidfile_write(child_pidfh); if (user != NULL) { restrict_process(user); @@ -451,7 +451,7 @@ restart: warn("sigprocmask"); goto exit; } - child_eof = !listen_child(pfd[0], &logpar); + child_eof = !listen_child(pfd[0], &logparams); if (sigprocmask(SIG_UNBLOCK, &mask_read, NULL)) { warn("sigprocmask"); goto exit; @@ -482,14 +482,14 @@ restart: goto restart; } exit: - close(logpar.output_fd); + close(logparams.output_fd); close(pfd[0]); close(pfd[1]); - if (logpar.syslog_enabled) { + if (logparams.syslog_enabled) { closelog(); } - pidfile_remove(pfh); - pidfile_remove(ppfh); + pidfile_remove(child_pidfh); + pidfile_remove(parent_pidfh); exit(1); /* If daemon(3) succeeded exit status does not matter. */ } @@ -652,7 +652,7 @@ do_output(const unsigned char *buf, size_t len, struct log_params *logpar) if (write(logpar->output_fd, buf, len) == -1) warn("write"); } - if (logpar->noclose && !logpar->syslog_enabled && logpar->output_fd == -1) { + if (logpar->keep_fds_open && !logpar->syslog_enabled && logpar->output_fd == -1) { printf("%.*s", (int)len, buf); } } @@ -701,15 +701,15 @@ open_log(const char *outfn) } static void -reopen_log(struct log_params *lpp) +reopen_log(struct log_params *logparams) { int outfd; do_log_reopen = 0; - outfd = open_log(lpp->output_filename); - if (lpp->output_fd >= 0) { - close(lpp->output_fd); + outfd = open_log(logparams->output_filename); + if (logparams->output_fd >= 0) { + close(logparams->output_fd); } - lpp->output_fd = outfd; + logparams->output_fd = outfd; } From nobody Fri Mar 17 21:01:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4b6yr1z3yqp5; Fri, 17 Mar 2023 21:01: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 4Pdc4b4G1bz3qLW; Fri, 17 Mar 2023 21:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MuQSO9XtFz7nA02emrJ3OVMI8q5wAwF2kXLu+AmXY5U=; b=U0Ue755ivQt0dYfgFF9/fehaN4QFCvgkkYOxqrUxEXjXXHX9JZf5A2eeV7LTIswv5kWekZ Fylwc9W1uJXSlXyMomFtByBvP324MITIA0RuCWxO4pMDR2LWYMiqYTkO4kdWj9H9OmjEPB 2T+3J9xQsAP9G7rHmXxz4yNc0CDUpvWtrecnAeBXVcsi/2d2gsFrc32Go++em3vKoRMFDP FoZvUIUkhrArvXBofeZMzB5wELMywb6PPJ5c91oPAq6ETIGNQVEYdGtA9hcRjcIeDdIz11 LeAjf1tUyYtsIk7AC18NicF98bCfKohyGlojtkAQRXcprr0AiCYL+gOcYYR6OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MuQSO9XtFz7nA02emrJ3OVMI8q5wAwF2kXLu+AmXY5U=; b=PclT1YCVBp4K/9qCuR24odbaAqwLfp2B7j05ySE9Lm2e/U5TiZSTbyyujPUoZ8+/hnA47w q48nYGvxO5V7td9I3YJ4HMpVJ+tpPISxeZlZyXVieqNtoi0jPZd3rv+4EkT4gJH6KxU4FH km631Rkzs/q3Kc+d4ifE2L7ib0FmSrEzjtFZcTEFO4Zm0Ifh5lySsfG2hn11glMEKSX6pJ VKmWlJHTSPEYV6bq5bwtky4eJ8gcEcFqAzuLCtE0e7fWKelOGD7A+g+m1HwG76NHar4cpJ mU9EolXov3OT9dzWx7zQC+NSlFjx7OH4CYkq7DoHK+Kr7RJu2h3cflsWetoswQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086895; a=rsa-sha256; cv=none; b=XmqIGhSU8LNYWzXMaMjxePhOqWc0jSEvc7Q7aB0glkI6SU3NYRCOmQGqlZLG/+isPBzQGF Sn1pOadowFGvx7sktCr5a9cL+T9O1yHyKbJUGLAwFuz0OEgeVR1Kj3WNfmJxTZxlLW+XPn oJFmgO2oW6i83Aoxrewcwe5DlA+s/AlNwlgxna6dBKCOT8pgK/xU2ILBp1Bqwhn0jpv3si 9YAlkgu2PYsDYK9YIupK04olmFnj5R8dQ5y9HxPHFIz7m2U6+pjQlz89YRdMZIXssNQhY0 j139G9CNz5gQJ/HpgTZ2cmD0A4fxTbuxZg/5KwQTz24DiXflDJQcbgCN2qb4cg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4b34xPzgjy; Fri, 17 Mar 2023 21:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1ZE2015182; Fri, 17 Mar 2023 21:01:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1Zoa015181; Fri, 17 Mar 2023 21:01:35 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:35 GMT Message-Id: <202303172101.32HL1Zoa015181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 05578dd5218d - stable/13 - daemon: style changes List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05578dd5218d3255eee2faccc0d5facd7dff10b5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=05578dd5218d3255eee2faccc0d5facd7dff10b5 commit 05578dd5218d3255eee2faccc0d5facd7dff10b5 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-03 05:17:01 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:02 +0000 daemon: style changes This is not a functional change. - Clean up whitespace (spaces where there should be tabs) - Break up lines that are longer than 80 Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/672 (cherry picked from commit 39ea4280e4c5e41f237e55770f4f62b04b24d899) --- usr.sbin/daemon/daemon.c | 75 ++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index af387574c4b5..16e22efed68e 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -138,7 +138,7 @@ usage(int exitcode) " --syslog-tag -T <tag> Set syslog tag\n" " --help -h Show this help\n"); - exit(exitcode); + exit(exitcode); } int @@ -165,7 +165,7 @@ main(int argc, char *argv[]) .keep_fds_open = 1, .output_fd = -1, .output_filename = NULL - }; + }; struct pidfh *parent_pidfh = NULL; struct pidfh *child_pidfh = NULL; sigset_t mask_orig; @@ -190,17 +190,18 @@ main(int argc, char *argv[]) log_reopen = true; break; case 'l': - logparams.syslog_facility = get_log_mapping(optarg, facilitynames); + logparams.syslog_facility = get_log_mapping(optarg, + facilitynames); if (logparams.syslog_facility == -1) { errx(5, "unrecognized syslog facility"); - } + } logparams.syslog_enabled = true; break; case 'm': stdmask = strtol(optarg, &p, 10); if (p == optarg || stdmask < 0 || stdmask > 3) { errx(6, "unrecognized listening mask"); - } + } break; case 'o': logparams.output_filename = optarg; @@ -218,13 +219,14 @@ main(int argc, char *argv[]) restart = strtol(optarg, &p, 0); if (p == optarg || restart < 1) { errx(6, "invalid restart delay"); - } + } break; case 's': - logparams.syslog_priority = get_log_mapping(optarg, prioritynames); + logparams.syslog_priority = get_log_mapping(optarg, + prioritynames); if (logparams.syslog_priority == -1) { errx(4, "unrecognized syslog priority"); - } + } logparams.syslog_enabled = true; break; case 'S': @@ -240,9 +242,9 @@ main(int argc, char *argv[]) case 'u': user = optarg; break; - case 'h': + case 'h': usage(0); - __builtin_unreachable(); + __builtin_unreachable(); default: usage(1); } @@ -252,22 +254,23 @@ main(int argc, char *argv[]) if (argc == 0) { usage(1); - } + } if (!title) { title = argv[0]; - } + } if (logparams.output_filename) { logparams.output_fd = open_log(logparams.output_filename); if (logparams.output_fd == -1) { err(7, "open"); - } + } } if (logparams.syslog_enabled) { - openlog(logparams.syslog_tag, LOG_PID | LOG_NDELAY, logparams.syslog_facility); - } + openlog(logparams.syslog_tag, LOG_PID | LOG_NDELAY, + logparams.syslog_facility); + } /* * Try to open the pidfile before calling daemon(3), @@ -359,7 +362,7 @@ main(int argc, char *argv[]) restart: if (pipe(pfd)) { err(1, "pipe"); - } + } /* * Spawn a child to exec the command. */ @@ -387,7 +390,7 @@ restart: if (user != NULL) { restrict_process(user); - } + } /* * When forking, the child gets the original sigmask, * and dup'd pipes. @@ -396,21 +399,21 @@ restart: close(pfd[0]); if (sigprocmask(SIG_SETMASK, &mask_orig, NULL)) { err(1, "sigprogmask"); - } + } if (stdmask & STDERR_FILENO) { if (dup2(pfd[1], STDERR_FILENO) == -1) { err(1, "dup2"); - } + } } if (stdmask & STDOUT_FILENO) { if (dup2(pfd[1], STDOUT_FILENO) == -1) { err(1, "dup2"); - } + } } if (pfd[1] != STDERR_FILENO && pfd[1] != STDOUT_FILENO) { close(pfd[1]); - } + } } execvp(argv[0], argv); /* @@ -471,7 +474,7 @@ restart: } if (restart && !terminate) { daemon_sleep(restart, 0); - } + } if (sigprocmask(SIG_BLOCK, &mask_term, NULL)) { warn("sigprocmask"); goto exit; @@ -487,7 +490,7 @@ exit: close(pfd[1]); if (logparams.syslog_enabled) { closelog(); - } + } pidfile_remove(child_pidfh); pidfile_remove(parent_pidfh); exit(1); /* If daemon(3) succeeded exit status does not matter. */ @@ -501,7 +504,7 @@ daemon_sleep(time_t secs, long nsecs) while (!terminate && nanosleep(&ts, &ts) == -1) { if (errno != EINTR) { err(1, "nanosleep"); - } + } } } @@ -545,7 +548,7 @@ get_log_mapping(const char *str, const CODE *c) for (cp = c; cp->c_name; cp++) if (strcmp(cp->c_name, str) == 0) { return cp->c_val; - } + } return -1; } @@ -557,11 +560,11 @@ restrict_process(const char *user) pw = getpwnam(user); if (pw == NULL) { errx(1, "unknown user: %s", user); - } + } if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL) != 0) { errx(1, "failed to set user environment"); - } + } setenv("USER", pw->pw_name, 1); setenv("HOME", pw->pw_dir, 1); @@ -587,7 +590,7 @@ listen_child(int fd, struct log_params *logpar) if (do_log_reopen) { reopen_log(logpar); - } + } rv = read(fd, buf + bytes_read, LBUF_SIZE - bytes_read - 1); if (rv > 0) { unsigned char *cp; @@ -610,7 +613,7 @@ listen_child(int fd, struct log_params *logpar) /* Wait until the buffer is full. */ if (bytes_read < LBUF_SIZE - 1) { return 1; - } + } do_output(buf, bytes_read, logpar); bytes_read = 0; return 1; @@ -644,17 +647,19 @@ do_output(const unsigned char *buf, size_t len, struct log_params *logpar) if (len < 1) { return; - } + } if (logpar->syslog_enabled) { syslog(logpar->syslog_priority, "%.*s", (int)len, buf); - } + } if (logpar->output_fd != -1) { if (write(logpar->output_fd, buf, len) == -1) warn("write"); } - if (logpar->keep_fds_open && !logpar->syslog_enabled && logpar->output_fd == -1) { + if (logpar->keep_fds_open && + !logpar->syslog_enabled && + logpar->output_fd == -1) { printf("%.*s", (int)len, buf); - } + } } /* @@ -666,7 +671,7 @@ handle_term(int signo) { if (pid > 0 && !child_gone) { kill(pid, signo); - } + } terminate = 1; } @@ -709,7 +714,7 @@ reopen_log(struct log_params *logparams) outfd = open_log(logparams->output_filename); if (logparams->output_fd >= 0) { close(logparams->output_fd); - } + } logparams->output_fd = outfd; } From nobody Fri Mar 17 21:01:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4c6T8Xz3yqpB; Fri, 17 Mar 2023 21:01: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 4Pdc4c5RlZz3q7d; Fri, 17 Mar 2023 21:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iqtmyKVnvTQ2nqh12OCTAcNAKCHqg3X9xDb76vVi5CE=; b=MFFQqNmd4t+7nG79RXre94J+Z0kdQN5qjIhm3JXazJ7xGbjNHdt/EZPdAEImwe0UIJVtEt BSUbMuxYlpSFkCLh8RAPfvFjbiCIYCSswo6elv/hc62c0Nj21421KOatjq5M9gvrv2+4cZ yLiPxJwf8rm+iNKBQQZz/1CC3c8kVYLHsq7nnN1qEDofNRyxonI8FFFJ9LgupTq75XdbvJ /YaT0I+sGJ7OS4RkH1lVMTw81uEwy1iPwTcebdDwMiyHUCEMkbO/YfB0hnXxk4UivMnIlc TgtBlAIbplpXNlfxa3CEjI3WkbBtjf1N+IKknFga3vGDEcWXaOAeGaiEQPTJqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iqtmyKVnvTQ2nqh12OCTAcNAKCHqg3X9xDb76vVi5CE=; b=OdEdVrG3GyFSTAsjAxM/PE3X0FHFP6gr2LmVQJ0M/3AWWrckvmpqpg6mMl61Oh+2k+oxRA D0i18YjrodLxIH1bOp/03mcbUO+7NFSuqpOPphJ1uMaQ9hCyG3U/0we2X1qEDGCOH8YERu 5ylkUsL+x+cOZTO4NCr5eJqybsm258RHtBi2iEXCGI7njK3xLRtGcF9iEWvUtga/AlKh9M kPSmrakdSXH2ExznrzWDZNzUV3tQDalt8FyYlZaD4P3aMsdDWzaS9aSB1R6gtUvHvNv9FO 0GyVM5oinIc4HfeXLtP6KOJ3Xla9LHaDZMJHSaMy12MlfhYi2/KG3Zm2G5kRKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086896; a=rsa-sha256; cv=none; b=VZFeexlX2uNbwHEt3CG2tGrhbXfnAsJp0HjaAFA+uPFvn1sf/h16BuaqDzr21JTYwl4x/c 711DqcdY7jO9CbHIqGXvp/aTd7CgQYp+N0kwDu+CU14k6k9mrOMH+MlYGrMStzI2KnMPjI GYnyhYqiBRB/b6nA+6l0ruhq6nF4Ozghl2ApwPa7ywlb2gV/ciB0FL2fnmr8ikoiCz6lAG vjhk3rqWJWbRIVKPshYufi1gDtuUkg1V+e6Zs2R6DL/TfnlYHAUgCseJN5FM1WZvKIu+CN c9Wh2DleACCuro/8faVdpj4sQhCoWeX/csCW7O6EdIChAW3r50yQswEG6LeloA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4c4SCszgcs; Fri, 17 Mar 2023 21:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1aNi015205; Fri, 17 Mar 2023 21:01:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1aNU015204; Fri, 17 Mar 2023 21:01:36 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:36 GMT Message-Id: <202303172101.32HL1aNU015204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 204306b0532a - stable/13 - daemon: flatten and simplify fork() logic List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 204306b0532a9c9d2fdf07b88e33ef71a921cc29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=204306b0532a9c9d2fdf07b88e33ef71a921cc29 commit 204306b0532a9c9d2fdf07b88e33ef71a921cc29 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-03 05:17:02 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:02 +0000 daemon: flatten and simplify fork() logic Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/672 (cherry picked from commit 75f61ca92098941f73020f46674f0c40db7270fb) --- usr.sbin/daemon/daemon.c | 53 ++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 16e22efed68e..964a77deb0f9 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -84,7 +84,7 @@ static void daemon_sleep(time_t, long); static volatile sig_atomic_t terminate = 0; static volatile sig_atomic_t child_gone = 0; -static volatile sig_atomic_t pid = -1; +static volatile sig_atomic_t pid = 0; static volatile sig_atomic_t do_log_reopen = 0; static const char shortopts[] = "+cfHSp:P:ru:o:s:l:t:m:R:T:h"; @@ -368,34 +368,27 @@ restart: */ child_gone = 0; pid = fork(); - if (pid == -1) { - warn("fork"); - goto exit; - } else if (pid > 0) { - /* - * Unblock SIGTERM after we know we have a valid - * child PID to signal. - */ - if (sigprocmask(SIG_UNBLOCK, &mask_term, NULL)) { - warn("sigprocmask"); - goto exit; - } - close(pfd[1]); - pfd[1] = -1; - } } - if (pid <= 0) { - /* Now that we are the child, write out the pid. */ + + /* fork failed, this can only happen when supervision is enabled */ + if (pid == -1) { + warn("fork"); + goto exit; + } + + + /* fork succeeded, this is child's branch or supervision is disabled */ + if (pid == 0) { pidfile_write(child_pidfh); if (user != NULL) { restrict_process(user); } /* - * When forking, the child gets the original sigmask, + * In supervision mode, the child gets the original sigmask, * and dup'd pipes. */ - if (pid == 0) { + if (supervision_enabled) { close(pfd[0]); if (sigprocmask(SIG_SETMASK, &mask_orig, NULL)) { err(1, "sigprogmask"); @@ -416,12 +409,24 @@ restart: } } execvp(argv[0], argv); - /* - * execvp() failed -- report the error. The child is - * now running, so the exit status doesn't matter. - */ + /* execvp() failed - report error and exit this process */ err(1, "%s", argv[0]); } + + /* + * else: pid > 0 + * fork succeeded, this is the parent branch, this can only happen when + * supervision is enabled + * + * Unblock SIGTERM after we know we have a valid child PID to signal. + */ + if (sigprocmask(SIG_UNBLOCK, &mask_term, NULL)) { + warn("sigprocmask"); + goto exit; + } + close(pfd[1]); + pfd[1] = -1; + setproctitle("%s[%d]", title, (int)pid); /* * As we have closed the write end of pipe for parent process, From nobody Fri Mar 17 21:01:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4f00Dmz3yqpD; Fri, 17 Mar 2023 21:01: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 4Pdc4d6FFJz3qSm; Fri, 17 Mar 2023 21:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bMBE/rl556JWR3j1MolKXKDQ36Ip3zhWPivTSoJ8MGo=; b=ONvWIA610E1LuJO8JzEvsH42+oT6Nz70tSnOMqTG9/SyFq8coc+b3RTbGeAYrFGp66myV3 2OrDfEDqio2PMApzRgcuzH1ziTdCathj+0+bFLRhFG4yroKP9zHFggpRin1axLGAfhJ7Lg iNJ2StHpsja3ZBgjquVpEL/qiGodcF/xt+izqXhtTBCHQJNitD3TAdbhaNaa3u7KsaOZpd tjEdZ4/Tiu6//b71L5UOLN7ciemzZoDOz+HSS6PI1LGOT7Kyk5QQXyM4prMRN61bYrLK3I V4vVT9Uy5ki7PAVJh54SulK0DAznNgqNCVGRfTM8VkqAp68aIsVznjO+/mUv0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bMBE/rl556JWR3j1MolKXKDQ36Ip3zhWPivTSoJ8MGo=; b=tMg9F0dUPlxB4Uk2Uu/PZX1WUA6+A71iXvm2c6koIXW4B4mnbtqi8Tkv776da1ybdWn64i uXewe5AoDHS8r38d9baa04ARtW0faJPsBThfB2palVFfY1NDaIjpThGwgXZgFAN5z8ynYP 3NETZRM9C+tFKrovFbX9sf63yl1D+TeNg2LKrRq8dG3kc/qdhh+psBBVBaTWxAfkryIrrC zbvs9qEDmxEebriKt0+tI2CNLZDiiiNR27MHGgcv8H0OfoGY3V9LZvO2T79v7ZMBOt1V0W tBGG7nBlv6ax34oGLd8bcAwUQBbgMAYyuRh0VcqEN1n3mX34shpq4EBkTew9/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086897; a=rsa-sha256; cv=none; b=FD20HSja9YbHtsOZ6/zSoZPu7AkTkrb2pzQflIv++WOadrMH7l+lxb4ZVjL8Htjgrovkef E0Puze21Mi5MpUwoiIOJJUVf/yr2dph+83yJLYxnyE2KspQ9EmW0MpsFXduhi4SIzP4/8N ITw/SwbSBSVOU7+HCN89wLUfXo6J7nWiuwF80PEzThuHYtOEmMoMWe0/smmtrq4Chv3CyX tiyrEdyh01AEa1ephrGntEWTZRudtHjXtqDMw1jt/Bnd6ePLYQvb4k121VOQBz2OFPuFUx ApzbAr99oOoR+8AU/5SlQ5uNf/UfZw/zeXrgp3WIyD0ViftmEnUUMfcSdrbATQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4d5Gc0zgk1; Fri, 17 Mar 2023 21:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1bEb015224; Fri, 17 Mar 2023 21:01:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1baR015223; Fri, 17 Mar 2023 21:01:37 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:37 GMT Message-Id: <202303172101.32HL1baR015223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: bb2e206cae8b - stable/13 - daemon: change type of listen_child() to C99 bool List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bb2e206cae8ba120f9d1ef78149e61ff3f003fb0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bb2e206cae8ba120f9d1ef78149e61ff3f003fb0 commit bb2e206cae8ba120f9d1ef78149e61ff3f003fb0 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-03 05:17:02 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:02 +0000 daemon: change type of listen_child() to C99 bool Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/672 (cherry picked from commit bc43a9a7157a8249a492ee3efd8589369dd94228) --- usr.sbin/daemon/daemon.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 964a77deb0f9..5c636bcd0a03 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -73,9 +73,9 @@ static void restrict_process(const char *); static void handle_term(int); static void handle_chld(int); static void handle_hup(int); -static int open_log(const char *); +static int open_log(const char *); static void reopen_log(struct log_params *); -static int listen_child(int, struct log_params *); +static bool listen_child(int, struct log_params *); static int get_log_mapping(const char *, const CODE *); static void open_pid_files(const char *, const char *, struct pidfh **, struct pidfh **); @@ -146,13 +146,13 @@ main(int argc, char *argv[]) { bool supervision_enabled = false; bool log_reopen = false; + bool child_eof = false; char *p = NULL; const char *child_pidfile = NULL; const char *parent_pidfile = NULL; const char *title = NULL; const char *user = NULL; int ch = 0; - int child_eof = 0; int keep_cur_workdir = 1; int pfd[2] = { -1, -1 }; int restart = 0; @@ -580,10 +580,10 @@ restrict_process(const char *user) * We try to collect whole lines terminated by '\n'. Otherwise we collect a * full buffer, and then output it. * - * Return value of 0 is assumed to mean EOF or error, and 1 indicates to + * Return value of false is assumed to mean EOF or error, and true indicates to * continue reading. */ -static int +static bool listen_child(int fd, struct log_params *logpar) { static unsigned char buf[LBUF_SIZE]; @@ -617,18 +617,18 @@ listen_child(int fd, struct log_params *logpar) } /* Wait until the buffer is full. */ if (bytes_read < LBUF_SIZE - 1) { - return 1; + return true; } do_output(buf, bytes_read, logpar); bytes_read = 0; - return 1; + return true; } else if (rv == -1) { /* EINTR should trigger another read. */ if (errno == EINTR) { - return 1; + return true; } else { warn("read"); - return 0; + return false; } } /* Upon EOF, we have to flush what's left of the buffer. */ @@ -636,7 +636,7 @@ listen_child(int fd, struct log_params *logpar) do_output(buf, bytes_read, logpar); bytes_read = 0; } - return 0; + return false; } /* From nobody Fri Mar 17 21:01:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4g0hbbz3yqtV; Fri, 17 Mar 2023 21:01: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 4Pdc4g0F3Qz3qVQ; Fri, 17 Mar 2023 21:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nMiSD0saxnL2kLczMkwME0tzQCWEhDSBTdHPXvkQrt0=; b=dzjaJETfqwR/toR4UPFYPnlJpbWrB9ZbG9TB2/M3cvSme9sMGCzJhQzUuEzAOuJQuqAN0w XmJ1teJA3bq9T2vVCYy/6p2XZx9AXvcNhxyv/+NLswuYRalCHiFMJheZZbTi5URCNxEGyj d3OwT3FMrA6DKaz1Gm+wyyS0/1/P3FpG9RzDC2ISPcEm27k4TG6T9vbRe+cnYqdOLk4iop EhsaanPNpihzhKPXCL5fKzUn39Tie6HY+QQ+AV2ONR1C3sr/RY4GwYs+SW/KcoQRniaI1u jA3cE1VYsRFxvyFynB0a2QLM2kwMtakajDKLCm2i61+GySx2b4lAqFOT0JpnUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nMiSD0saxnL2kLczMkwME0tzQCWEhDSBTdHPXvkQrt0=; b=R9FMp0QKpQXl5JybzGhOV9nmH9wEQl7xOuJgH0QqYQq6xt4RBPaEHY+1LkWYvgpXu6onjz LTFkhzvw+dZbTpWcIsZVProwyiO9glwuqDVxNxW36kpc4gveOqSx1ZuJM0hyS2yq8EkXpq xKBchZUbcHxeOsVwT38EWihJw6dcL/+FKlS54zWjedGuik4BJJbgdl5Nc2TwBDEW6jh8S7 6WueG4Xcg8kxQTODsTey/JLFK4uLb7DWWYqsP/16hw6lC7ijDxrCTRRoWw302X+I8Emkkb sFAeaSyq1XiXWs4YHrXkyHi/iMYxZdKKnUj2OqWo4goCV68EKuFg7jiuqeVh7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086899; a=rsa-sha256; cv=none; b=hLCkFnk8QyQld3ZAp4P5DLS/0B/LbTKYiQJoAE4hMP3J+4HKsg64lp/VXx2ez/3xMRzIlr bLa4yWXMuedrqYNHT3VdHSKquHH+fCE7FYEv4e6cf36g5szK44uZX20XowP5BYUN+6pYOf mXBR+5tb5WjOIbqeN+3MxE8nh77UdIOSGddV/PWKl2uFGN8t/+xYQPOM6zUFXaZsI+PdFk zebqTxR9hKubEwgKo7elQwmXGq2YgmPmaFT3L5q6De5WOT/+Bll3tTiRcBfpGNKL/tKMb0 PNQHiJxRLfp7uZ8iHr8xWSv/eeZPt1IAsNW7mCZbQ+1kJRNRt06/nuxTx/7QkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4f6K5xzgcw; Fri, 17 Mar 2023 21:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1cGL015246; Fri, 17 Mar 2023 21:01:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1c3x015245; Fri, 17 Mar 2023 21:01:38 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:38 GMT Message-Id: <202303172101.32HL1c3x015245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: bc9d2ee0a7ac - stable/13 - daemon: simplify if/else chain List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bc9d2ee0a7acab55e2625d10f937305b8ba4231a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=bc9d2ee0a7acab55e2625d10f937305b8ba4231a commit bc9d2ee0a7acab55e2625d10f937305b8ba4231a Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-03 05:17:02 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:02 +0000 daemon: simplify if/else chain Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/672 (cherry picked from commit cd1e6e70d001bea9e9e0220bdfdbd8b5dd9922de) --- usr.sbin/daemon/daemon.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 5c636bcd0a03..2274a3e253a0 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -452,22 +452,16 @@ restart: */ if (child_gone && child_eof) { break; - } else if (terminate) { + } + + if (terminate) { goto exit; - } else if (!child_eof) { - if (sigprocmask(SIG_BLOCK, &mask_read, NULL)) { - warn("sigprocmask"); - goto exit; - } - child_eof = !listen_child(pfd[0], &logparams); - if (sigprocmask(SIG_UNBLOCK, &mask_read, NULL)) { - warn("sigprocmask"); - goto exit; - } - } else { + } + + if (child_eof) { if (sigprocmask(SIG_BLOCK, &mask_susp, NULL)) { warn("sigprocmask"); - goto exit; + goto exit; } while (!terminate && !child_gone) sigsuspend(&mask_orig); @@ -475,7 +469,21 @@ restart: warn("sigprocmask"); goto exit; } + continue; + } + + if (sigprocmask(SIG_BLOCK, &mask_read, NULL)) { + warn("sigprocmask"); + goto exit; } + + child_eof = !listen_child(pfd[0], &logparams); + + if (sigprocmask(SIG_UNBLOCK, &mask_read, NULL)) { + warn("sigprocmask"); + goto exit; + } + } if (restart && !terminate) { daemon_sleep(restart, 0); From nobody Fri Mar 17 21:01:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4h5mGFz3yqfb; Fri, 17 Mar 2023 21:01: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 4Pdc4h1jC2z3qQj; Fri, 17 Mar 2023 21:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y8m32qozuw8DixSJgNmvOGNfVDt4L5vJGM6EKLweSJw=; b=rSspsmfPA/FxxPg//DKxK5jxXZdAuySrUu98ywJrKu/CT4lkMXJ74w4YRtzaXi0LrFH5jY aFvK5QzqfypwC+nXEZnBg7c/2/RKvsOalXxziOwylHme/If+X6xtT0y6RFizTOcqJX8uLj tX0d/QuVEqcATwEyZM1i5USswZv80H72VIKn+6jqkZJw2ApnidV/qtTqrjXk/Ma8+1LDBm pFyWlEEL10/8rrf/W+rRdrEJ4/e0TZGu4vIJQgWUx3P57zgic6EkfaPnqMF6uX69kGtwWK EOVMsImfstvA147+EI5QGp2M9Yh/42duHTS7xwFuKm6937KTNYK+/abbKK44fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y8m32qozuw8DixSJgNmvOGNfVDt4L5vJGM6EKLweSJw=; b=Zr+diXwlNSfv1mZKXDJ1B013mHS6MJyIq5oaS7d+f7FOAkB5e9P13lDpfwE578mC54mkln eL5hOG3akYHhu3bmwTEhEbnP6KwBXeg2SpbGporzOt7erXqs9UtCmXo2aMRZAmhjSupsCC Hw6a1PAcYUJL/Iu3tHt5aZRpoBwdt32in9DxCHM6Jlvhe1X8dKIyhPCBPzPiT9JAjg+V+j gcC2Cv/lcBDASeRKZuhwGpVwaSfJPXloWb2Cj8XM6SPo5Sp3D5Gw2Jq7nBMOCmzrx0og39 ZP9Nx640L6pxC2XBMe5nCJxzyjq6JsEoNUedgsWeXh2le6IFIE2y3+ixa5n47A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086900; a=rsa-sha256; cv=none; b=dmVhUIGW37N3n0K21TZoNJpiUEl2nwyfmRrxmsWuLp9y9rQl4tVFy2uFR0pL8mHyaXwwvY j3Kh/EsAySXNPQcYHOjm5Ttll5156NgylzNAE8tEP/iOlqP0GryHVJ7wgjPHcJmRZLdtO1 87Dm3Q0vB2fe1RpW9LqxtGAubkoR1v+Dhy4W4QGTUd22G76d3SKLpD+YAmsYkQosiVH7of H1KRRnOgkpzQNXf2s6vyIHAGUrJdooQCTjKaDHfxE9UFZZ4gwNvx7QXHx7eVc9ZirjPp9j jwYrpsf9AwS737jaUlOYHvvoNMwg36TJ7fHFxRYUyKmHn57aPFt7y5ivRbe4pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4h0Lgqzgcx; Fri, 17 Mar 2023 21:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1d0i015265; Fri, 17 Mar 2023 21:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1dlf015264; Fri, 17 Mar 2023 21:01:39 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:39 GMT Message-Id: <202303172101.32HL1dlf015264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 3f0b048a24bc - stable/13 - daemon: add braces to while loop List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f0b048a24bcd0ea691bca5a012d5c5cd5203f51 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3f0b048a24bcd0ea691bca5a012d5c5cd5203f51 commit 3f0b048a24bcd0ea691bca5a012d5c5cd5203f51 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-03 05:17:02 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:03 +0000 daemon: add braces to while loop Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/672 (cherry picked from commit d6c398d882b61e02e6f061be81886b9675f3fb5c) --- usr.sbin/daemon/daemon.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 2274a3e253a0..d1efebd0fcc2 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -154,7 +154,7 @@ main(int argc, char *argv[]) const char *user = NULL; int ch = 0; int keep_cur_workdir = 1; - int pfd[2] = { -1, -1 }; + int pipe_fd[2] = { -1, -1 }; int restart = 0; int stdmask = STDOUT_FILENO | STDERR_FILENO; struct log_params logparams = { @@ -360,7 +360,7 @@ main(int argc, char *argv[]) goto exit; } restart: - if (pipe(pfd)) { + if (pipe(pipe_fd)) { err(1, "pipe"); } /* @@ -389,23 +389,23 @@ restart: * and dup'd pipes. */ if (supervision_enabled) { - close(pfd[0]); + close(pipe_fd[0]); if (sigprocmask(SIG_SETMASK, &mask_orig, NULL)) { err(1, "sigprogmask"); } if (stdmask & STDERR_FILENO) { - if (dup2(pfd[1], STDERR_FILENO) == -1) { + if (dup2(pipe_fd[1], STDERR_FILENO) == -1) { err(1, "dup2"); } } if (stdmask & STDOUT_FILENO) { - if (dup2(pfd[1], STDOUT_FILENO) == -1) { + if (dup2(pipe_fd[1], STDOUT_FILENO) == -1) { err(1, "dup2"); } } - if (pfd[1] != STDERR_FILENO && - pfd[1] != STDOUT_FILENO) { - close(pfd[1]); + if (pipe_fd[1] != STDERR_FILENO && + pipe_fd[1] != STDOUT_FILENO) { + close(pipe_fd[1]); } } execvp(argv[0], argv); @@ -424,8 +424,8 @@ restart: warn("sigprocmask"); goto exit; } - close(pfd[1]); - pfd[1] = -1; + close(pipe_fd[1]); + pipe_fd[1] = -1; setproctitle("%s[%d]", title, (int)pid); /* @@ -463,8 +463,9 @@ restart: warn("sigprocmask"); goto exit; } - while (!terminate && !child_gone) + while (!terminate && !child_gone) { sigsuspend(&mask_orig); + } if (sigprocmask(SIG_UNBLOCK, &mask_susp, NULL)) { warn("sigprocmask"); goto exit; @@ -477,7 +478,7 @@ restart: goto exit; } - child_eof = !listen_child(pfd[0], &logparams); + child_eof = !listen_child(pipe_fd[0], &logparams); if (sigprocmask(SIG_UNBLOCK, &mask_read, NULL)) { warn("sigprocmask"); @@ -493,14 +494,14 @@ restart: goto exit; } if (restart && !terminate) { - close(pfd[0]); - pfd[0] = -1; + close(pipe_fd[0]); + pipe_fd[0] = -1; goto restart; } exit: close(logparams.output_fd); - close(pfd[0]); - close(pfd[1]); + close(pipe_fd[0]); + close(pipe_fd[1]); if (logparams.syslog_enabled) { closelog(); } From nobody Fri Mar 17 21:01:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4j2xcVz3yqff; Fri, 17 Mar 2023 21:01: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 4Pdc4j1xncz3qYX; Fri, 17 Mar 2023 21:01:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=30CCbIcxp1R/w7MHCneZ2NtTePIrbJ69MdhFFLwgu4E=; b=QHJFc7U2PAjHr2XVgkULdp9gf7LpjXSSYL0jhxwXO/arc0/LbiqeDCrKjtNFdVxCSJYsVP GhEXmrtMrivCaAqZHae7Td4TpTmrPbki1jdUrhv3TPJu5Em3Qacr/Ng7V8BHsoqYBm+6xp guROjGtIvk4x9ev4jYoNSjC5JWpsIO4tc27XSeIt2x0sbCBRMXPVhJM7M6f/6rvPH/10x1 69GoKO8VGzvz783z79Ia4SZGseTcQB8hs/RWSWJHdzCSwJ9uVN7jDt4905UBiQDCmgy9SI pSszcO7RnTBlQrjEnLGEOXoIwZZC7336/ECUn8jjZFdptq8ACUEGtWLZC46OqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=30CCbIcxp1R/w7MHCneZ2NtTePIrbJ69MdhFFLwgu4E=; b=cqkMp8Wo6dyxEskGhKQljvsuIbvhwr8oJj2oe9fOvOCcXzqxu5iFqtyQ4Ftr40LWodQoxC y3OzVYt0b8V71HM5q4Mkt+N1ednamrK+jvOXzZzy9Me2KlybMlCnwPvQbSiRMX1xzgNG4A tr2FaIXd5mNDn04SPUgFgeJDFya+VWy5DZ2HY37x8EYdKc9giTlkylNuirTnIoatUWtr+5 Blr+z6eCvtvWbe6rwsTf8FZSU8jjjj9RnPiLtOxcDgsq3YXPSvOF7j5d1p9MkL4UsiSfnO c4MKRKS7p4syWaF8USAvFfNrBwqBvXQ+yobmLcZeU2lAHwgN3mW1K+7mg2Wp6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086901; a=rsa-sha256; cv=none; b=dn0tCS/+rBpSNIBC9jLvxPVGmV5vsVdCA214JoLgi49yAn2awQQodq0xkoYMhX5aaiI92P sAaSOMYdhk64r7Ziy99fWcl0OLPS3WALI7QzjHFPKkhnOHo2ygAa6FO1So7/2IzfefIefA iCIJd0jkcH2npidmXOPMwZlzkWUTgYKZrg3nG9HG02/NewCO5Skocxm4Eom90KR2e3KkCY FpaYHte/AfM5y26JeMfwthPoBw06bwlkBVZrmFS4z2PmpJcSr4aL8a/VzDsHtRomBp/He1 nfZkj7TpYBXYAC7wmcqsnurpkZvbWxTPLaQSOxbWndSGm2NKccPswe3nh7Infw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4j13FVzgbV; Fri, 17 Mar 2023 21:01:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1fGe015290; Fri, 17 Mar 2023 21:01:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1fOm015289; Fri, 17 Mar 2023 21:01:41 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:41 GMT Message-Id: <202303172101.32HL1fOm015289@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: ec3a7d28289f - stable/13 - daemon: decouple restart variable List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ec3a7d28289f40b55ecbd95bdc6c6e2b008de269 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ec3a7d28289f40b55ecbd95bdc6c6e2b008de269 commit ec3a7d28289f40b55ecbd95bdc6c6e2b008de269 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-03 05:17:02 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:03 +0000 daemon: decouple restart variable The 'restart' variable was responsible for enablement of restart behavior and for restart delay. While it may seem convenient it leads to cluttering the exit/restart logic Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/672 (cherry picked from commit e781739084e9cb120ef4b6657074d2b7336ee405) --- usr.sbin/daemon/daemon.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index d1efebd0fcc2..08ae5c74b8c2 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -147,6 +147,7 @@ main(int argc, char *argv[]) bool supervision_enabled = false; bool log_reopen = false; bool child_eof = false; + bool restart_enabled = false; char *p = NULL; const char *child_pidfile = NULL; const char *parent_pidfile = NULL; @@ -155,7 +156,7 @@ main(int argc, char *argv[]) int ch = 0; int keep_cur_workdir = 1; int pipe_fd[2] = { -1, -1 }; - int restart = 0; + int restart_delay = 1; int stdmask = STDOUT_FILENO | STDERR_FILENO; struct log_params logparams = { .syslog_enabled = false, @@ -213,11 +214,12 @@ main(int argc, char *argv[]) parent_pidfile = optarg; break; case 'r': - restart = 1; + restart_enabled = true; break; case 'R': - restart = strtol(optarg, &p, 0); - if (p == optarg || restart < 1) { + restart_enabled = true; + restart_delay = strtol(optarg, &p, 0); + if (p == optarg || restart_delay < 1) { errx(6, "invalid restart delay"); } break; @@ -303,8 +305,8 @@ main(int argc, char *argv[]) */ supervision_enabled = child_pidfile != NULL || parent_pidfile != NULL || - restart != 0 || - logparams.output_fd != -1 || + restart_enabled == true || + logparams.output_fd != -1 || logparams.syslog_enabled == true; if (supervision_enabled) { @@ -486,14 +488,14 @@ restart: } } - if (restart && !terminate) { - daemon_sleep(restart, 0); + if (restart_enabled && !terminate) { + daemon_sleep(restart_delay, 0); } if (sigprocmask(SIG_BLOCK, &mask_term, NULL)) { warn("sigprocmask"); goto exit; } - if (restart && !terminate) { + if (restart_enabled && !terminate) { close(pipe_fd[0]); pipe_fd[0] = -1; goto restart; From nobody Fri Mar 17 21:01:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdc4k3wSSz3yqrl; Fri, 17 Mar 2023 21:01: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 4Pdc4k36CDz3qcJ; Fri, 17 Mar 2023 21:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fX2RsK0sdXN8orOy04SJ2IhxRmwyBeCcEtKPAg5aNuw=; b=EPX+14EeMRAtm6zoVLq+pX0fAwYOBUV0m74LJsndkH0/O4Y+VQpYgYWZ+MX3pSHRIxdTmA EAvp04dzfJgKwtyLP9n6ypn1VqhSDFsFl8/JE09Lmf+On/o6ZXYo4cyBeiDMzc69CLUpIn llURS3JnQS2xbvWTqgIYmwS2KuGU1+ssh6qHVQP32HYxz/Q1jbEj+IjhYzrBQhiUOmVjZz rXq5w0flh/GxspF8VgL7/LUuc8R1NtifcIY0SAgbQgPl9jLEdU1s2c7ymBZW4mEjUWyVyU +zdKrzO6WB2LaGGP/CFULzMh5ItPIiFnS47P5UF/Ms46flu1w0SeWt3Oc/paJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fX2RsK0sdXN8orOy04SJ2IhxRmwyBeCcEtKPAg5aNuw=; b=mhvew+FNwOJdozGoY8a7btOCa+iDRWuVRYF0+naeHNtxaoBj2jR78HzfK2AKNT9i6oOTJI gXaDsxYgopZwC/EPODBteL/DCljD4NMiC/HnMFXLZ7YHIO3p51VnYo/j8KOx0jGDESpKxS QllgCoWUiOmnB5+SgnTfYsEzUFh9eCgUYxJItfJAe+rRDf3rXaM3dkOBYwfBff6b1YPYpd F2XcG/9E/6jGkufUay33lL+GsB1ytyaWQ2PPuY88ZKV18QqhkCnUvYffvU7MW6cmRHc+Wx /dR6k/2qXqMyrJ6eHoaIjMXRjz2+9tjSRHUxYxvCqEfhMHK/XxpX9aJdOZmkMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086902; a=rsa-sha256; cv=none; b=J/1GHsxD0eqjQTag15XtnGrOVitLuJ5f6Pu5DIE7/HUwpJ/eN986UAzFvz++vYRa1U7nqu MXoYhJ8zU71uLcfcPbcUOSotTzmvgkU/Cj9M0ZJlW3xftMiHnlmDAWfAFboSTbUnYTZMuu vxqFZsiT/ZI/N4lsC8iBTnU+gmvVUpNLrca3XHMwGnhXD//pBEvG81dDqlMw10t9vq4TPQ EfT7foegA54mHUGE/NOR63qvm8Z33esk6+LEx8RoFLnqdNkRHfCjHt3BImDiRfLh+ZtuiR l6NBcycHNjwd552o+/xYrGkrWmANKCTpW24LZdTsT6JO5YqjOZd79mtKSCoY7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdc4k2CKfzgcy; Fri, 17 Mar 2023 21:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32HL1gUH015309; Fri, 17 Mar 2023 21:01:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1gd0015308; Fri, 17 Mar 2023 21:01:42 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:42 GMT Message-Id: <202303172101.32HL1gd0015308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 799d67ec407f - stable/13 - daemon: set supervise_enabled during argument processing List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 799d67ec407f6d93b00b7d8a364a3284aeb5d07f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=799d67ec407f6d93b00b7d8a364a3284aeb5d07f commit 799d67ec407f6d93b00b7d8a364a3284aeb5d07f Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-03 05:17:02 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-17 21:01:03 +0000 daemon: set supervise_enabled during argument processing Now when supervsion mode has it's own variable there is really no reason to set it separately from the rest of the variables. Move initialization of supervise_enabled var to the argument processing switch loop, where it belongs. Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/672 (cherry picked from commit f907027b49d93170ed2e92cf0d183cd643b1f70e) --- usr.sbin/daemon/daemon.c | 54 +++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 08ae5c74b8c2..3bbf092b500c 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -179,6 +179,23 @@ main(int argc, char *argv[]) sigemptyset(&mask_term); sigemptyset(&mask_orig); + /* + * Supervision mode is enabled if one of the following options are used: + * --child-pidfile -p + * --supervisor-pidfile -P + * --restart -r / --restart-delay -R + * --syslog -S + * --syslog-facility -l + * --syslog-priority -s + * --syslog-tag -T + * + * In supervision mode daemon executes the command in a forked process + * and observes the child by waiting for SIGCHILD. In supervision mode + * daemon must never exit before the child, this is necessary to prevent + * orphaning the child and leaving a stale pid file. + * To achieve this daemon catches SIGTERM and + * forwards it to the child, expecting to get SIGCHLD eventually. + */ while ((ch = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (ch) { case 'c': @@ -197,6 +214,7 @@ main(int argc, char *argv[]) errx(5, "unrecognized syslog facility"); } logparams.syslog_enabled = true; + supervision_enabled = true; break; case 'm': stdmask = strtol(optarg, &p, 10); @@ -206,15 +224,25 @@ main(int argc, char *argv[]) break; case 'o': logparams.output_filename = optarg; + /* + * TODO: setting output filename doesn't have to turn + * the supervision mode on. For non-supervised mode + * daemon could open the specified file and set it's + * descriptor as both stderr and stout before execve() + */ + supervision_enabled = true; break; case 'p': child_pidfile = optarg; + supervision_enabled = true; break; case 'P': parent_pidfile = optarg; + supervision_enabled = true; break; case 'r': restart_enabled = true; + supervision_enabled = true; break; case 'R': restart_enabled = true; @@ -230,9 +258,11 @@ main(int argc, char *argv[]) errx(4, "unrecognized syslog priority"); } logparams.syslog_enabled = true; + supervision_enabled = true; break; case 'S': logparams.syslog_enabled = true; + supervision_enabled = true; break; case 't': title = optarg; @@ -240,6 +270,7 @@ main(int argc, char *argv[]) case 'T': logparams.syslog_tag = optarg; logparams.syslog_enabled = true; + supervision_enabled = true; break; case 'u': user = optarg; @@ -286,29 +317,6 @@ main(int argc, char *argv[]) /* Write out parent pidfile if needed. */ pidfile_write(parent_pidfh); - /* - * Supervision mode is enabled if one of the following options are used: - * --child-pidfile -p - * --supervisor-pidfile -P - * --restart -r / --restart-delay -R - * --syslog -S - * --syslog-facility -l - * --syslog-priority -s - * --syslog-tag -T - * - * In supervision mode daemon executes the command in a forked process - * and observes the child by waiting for SIGCHILD. In supervision mode - * daemon must never exit before the child, this is necessary to prevent - * orphaning the child and leaving a stale pid file. - * To achieve this daemon catches SIGTERM and - * forwards it to the child, expecting to get SIGCHLD eventually. - */ - supervision_enabled = child_pidfile != NULL || - parent_pidfile != NULL || - restart_enabled == true || - logparams.output_fd != -1 || - logparams.syslog_enabled == true; - if (supervision_enabled) { struct sigaction act_term = { 0 }; struct sigaction act_chld = { 0 }; From nobody Sat Mar 18 03:44:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdn1k1yndz40FPR; Sat, 18 Mar 2023 03:44:42 +0000 (UTC) (envelope-from vishwin@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pdn1k1WZBz4SLF; Sat, 18 Mar 2023 03:44:42 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679111082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SENS9WzaovDaka1NMeDgXisFXTSNozUM62aT0mvf3xM=; b=yxg4+Ia1x/uQA25CMO6pni/nNheEnPjw7b+NNAWLFoWYfJoTfFP8rNHYuQUKPMFiF1DxHU b27kLKDWGhEV3Pv0F8nb1jKGyeA+s7K3RCOZBMetc+P92QlgprcBLFroXLv6KLX3fHPQ1U pxRVlzy42EY15cCjbs7NWJHlzsCJvSgqfouCaID8bcn2yAC68BHmk/jgs+cAG7Cw6mfy7Z PuCs2I9CyMcgFUkDMUNnA79ViK5G4ZFPN1Uwzert0wmgu+08sxZh3xxwjE5udYvwlZsSho /qAYpOavuHZcAmft1wDVbIGTzgrhBeT4M6y5PbPWNidJEc9M7RRQVXQ1qav/wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679111082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SENS9WzaovDaka1NMeDgXisFXTSNozUM62aT0mvf3xM=; b=cuLhT+cn1ews9C/Go7os6nW53UQtFniTpgWKoaieD4L32XDXOQgZ0hiYWM5TuqV2qf9zm1 1Wx3zRz9JsTnVtMUQSoW0SopK2UAgHxA4XbjKVY7vojcOqyuy/sSwUK+iC/8+xDUA7asMe eR6VKDX7YjhVoNUBjqs6+5V4snDwTinNl7KhrtO1QGG0yukRc/wgR3VfLE444KZktxVqTL P5vYVS8UurpjDDsbqAhzY7P0Yl6FiEBQB98mfXmOGws+SYGNBZjAaNEr4LLN8iu841mMH2 jDIhoBUw7mMeJMP6ECnH67oTJrADHtwSwlvwUsMAU6oF67g/rVxVlP5/F/ZBTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679111082; a=rsa-sha256; cv=none; b=gPHUV6egmH2p74Om3hFJgS5Gf8moK8tDFK8U6wzYSpnPovW8jgYuEWplzUjkcFUcHBrd/w qscx+cM+jq7IMkXMSUhdSyfLQ0vavahWLmDvfur5bQNiQvJu796BwzPVov+n/uo4b/7PD0 H8cT1hmT08NlqrfRl6D61UKQCK0HEYnJUtiK0O93SLhb7PxcVOTJFdXWjLCXI4Twmtagow dxtQzsAva9Hrroug0KQZ5HrgThQwpnzPuBfAgE8RZUxGMcd1Ao0Le7BkpBo1PNnppdvehQ 2WI6MmDpMCJKEaisVXrsE59FVXFql5aVJ9BJ3uaI8ogAad8P1+TDUju7UgwwfA== Received: from [IPV6:2601:98a:602:da0:1fa8:be6c:38d1:bd] (unknown [IPv6:2601:98a:602:da0:1fa8:be6c:38d1:bd]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Pdn1j69wtzJLJ; Sat, 18 Mar 2023 03:44:41 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: <8d3503f3-fd05-5f1c-7470-48cef3c9bd2d@freebsd.org> Date: Fri, 17 Mar 2023 23:44:39 -0400 List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: git: c5c9d980c4b0 - main - libc/csu: rename ignore_init.c to libc_start1.c To: Konstantin Belousov <kib@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202303112320.32BNKoJe039514@gitrepo.freebsd.org> Content-Language: en-GB From: Charlie Li <vishwin@freebsd.org> Organization: FreeBSD Project In-Reply-To: <202303112320.32BNKoJe039514@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------wIyTxjVjnQVXN526XKFW5brK" X-ThisMailContainsUnwantedMimeParts: N This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------wIyTxjVjnQVXN526XKFW5brK Content-Type: multipart/mixed; boundary="------------cfJ03gXY88ylMZ1vHimZkpXs"; protected-headers="v1" From: Charlie Li <vishwin@freebsd.org> To: Konstantin Belousov <kib@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <8d3503f3-fd05-5f1c-7470-48cef3c9bd2d@freebsd.org> Subject: Re: git: c5c9d980c4b0 - main - libc/csu: rename ignore_init.c to libc_start1.c References: <202303112320.32BNKoJe039514@gitrepo.freebsd.org> In-Reply-To: <202303112320.32BNKoJe039514@gitrepo.freebsd.org> --------------cfJ03gXY88ylMZ1vHimZkpXs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 S29uc3RhbnRpbiBCZWxvdXNvdiB3cm90ZToNCj4gICAgICBsaWJjL2NzdTogcmVuYW1lIGln bm9yZV9pbml0LmMgdG8gbGliY19zdGFydDEuYw0KPiAgICAgIA0KPiAgICAgIFRoZSBjdXJy ZW50IG5hbWUgd2FzIGEgaGlzdG9yaWNhbCBjdXJpb3NpdHkgdGhhdCBzdGFydGVkIHdoZW4g aW5pdCBhcnJheQ0KPiAgICAgIHN1cHBvcnQgd2FzIGFkZGVkLCBhbmQgdGhlbiB0aGUgZmls ZSBhcHBlYXJlZCBhIGNvbnZlbmllbnQgcGxhY2UgZm9yIHRoZQ0KPiAgICAgIGFkZGl0aW9u IG9mIHRoZSBNSSBjb21tb24gY29kZSB0byBjc3UuICBJdCBpcyBub3cgcmVmZXJlbmNlZCBi eSBuYW1lIGluDQo+ICAgICAgc2luZ2xlIHBsYWNlIGFuZCB0aGUgcmVuYW1lIGlzIGVhc3ks IHNvIGRvIGl0Lg0KPiAgICAgIA0KPiAgICAgIFNwb25zb3JlZCBieTogICBUaGUgRnJlZUJT RCBGb3VuZGF0aW9uDQo+ICAgICAgTUZDIGFmdGVyOiAgICAgIDMgd2Vla3MNCj4gLS0tDQo+ ICAgbGliL2xpYmMvY3N1L01ha2VmaWxlLmluYyAgICAgICAgICAgICAgICAgICAgIHwgMiAr LQ0KPiAgIGxpYi9saWJjL2NzdS97aWdub3JlX2luaXQuYyA9PiBsaWJjX3N0YXJ0MS5jfSB8 IDANCj4gICAyIGZpbGVzIGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspLCAxIGRlbGV0aW9uKC0p DQo+IA0KU2VlbXMgbGlrZSBhbiBBQkkgYnJlYWsuIEFueXRoaW5nIGNvbXBpbGVkIGFmdGVy IHRoaXMgYnV0IHJhbiBvbiBhbiANCmVhcmxpZXItYnktcmV2aXNpb24tYnV0LXNhbWUgX19G cmVlQlNEX3ZlcnNpb24gY29tcGxhaW5zIHdpdGggJ1VuZGVmaW5lZCANCnN5bWJvbCAiX19s aWJjX3N0YXJ0MUBGQlNEXzEuNyInDQoNCi0tIA0KQ2hhcmxpZSBMaQ0K4oCmbm9wZSwgc3Rp bGwgZG9uJ3QgaGF2ZSBhbiBleGl0IGxpbmUuDQoNCg== --------------cfJ03gXY88ylMZ1vHimZkpXs-- --------------wIyTxjVjnQVXN526XKFW5brK Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEJXd5utNNhpeHcBMx/reFK+KbPocFAmQVM6cFAwAAAAAACgkQ/reFK+KbPocL hhAApqJUq2QFIeRCVaNNr9e9vWtzc38wGPVFzVso+iUZFTErsDw6Mxk6dbtvGM457cFVxqZVMhuu N39stku4d+5oVB9UiCM1cCnljUd+AkiKMPN/BIMgxs5ytGiKJ02TZbXx2wFBXHc0qxs+It/O0uRB 7sqwnUZR/HRFAPnaCEgScvWRau21EN3Ia/OmnBcib+LRMnF7+Qear6vsQqEDZR3Onj9sMzG2JUMB GlO3ySHVwCg3VzTknY9jS3YxeuTHBOuILdWxmf/5xKpTG319qnB76Msc5mJtEPPPtAste4P+LVEY L8etg4Abgwy+GyqEkUPVopsHNx+cnPT7EG0BJyeaA14XypfIM38kyJvKJQahP8bx0l/tl0zbxoIE jicpeYNTFRzg3u1eGJztCedjwKymUF2B85pEGY/6fXRH8t0xIj5BKblhWeAAv5ei6qyhTle8aNZu YmUjdJJOIc0O+NgR0a4jaisInxkTY5LrzF7mjclzFsF7LXKcjc7OwJPnXDNxDS7+suCNDL0mMtwQ 582R3BOR8cJKZCJt5zCfUhQXq9uLC7SFQZ5PJzo8rDSJe4o4gPnQjLRZjFdJ5MpVYrVm321ssZ4S ZxxTEzTqLzjUL+3Omq4teQu/fzWLKQrY/7HnUsjIl/NZW7W9iEBJxB/wsSFIeAHcmlOrZSlxONR/ Ymo= =YgTH -----END PGP SIGNATURE----- --------------wIyTxjVjnQVXN526XKFW5brK-- From nobody Sat Mar 18 03:46:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdn3z3fd6z40FRr for <dev-commits-src-all@mlmmj.nyi.freebsd.org>; Sat, 18 Mar 2023 03:46:39 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pdn3z0hzHz4SdF for <dev-commits-src-all@freebsd.org>; Sat, 18 Mar 2023 03:46:39 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f54.google.com with SMTP id bg16-20020a05600c3c9000b003eb34e21bdfso6161932wmb.0 for <dev-commits-src-all@freebsd.org>; Fri, 17 Mar 2023 20:46:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679111197; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f9/x3Q/rqxkYos+bpxgSfkfYz6BgHO1A55F4lR2EPMo=; b=KmS/5WpkZ5RaeSo8XSLUsnTIh3v2cztiSI9YyB8WAPoO6mK8LCm+5MVQ6/UDjwmBob U6efXxOruZvKdbktGcA5GcYwb4WMY5b2A1Es9zkEqg1oz9hfaHoZwTNqG8J9kMmuUKKt OM5j1srsFz71YDxz6wE7x2kYVOnlU2IWBPFbkW1AI3A9KrPUfLkXEWRmJ6LHEuwNFcEM wSRgjTEtYE8Y+l2M1IX8IkggEOPUtS6/hs1gruDC3E97cOj6AIIQUaHH60xWzN4fXfgk WMn4WcEmc0KEKi1sFl8i64O3D5qODj9ePn25YjPy0opM/JpYEy+vg2VZZMMyd9ooBUgx t4Rw== X-Gm-Message-State: AO0yUKXz+n6rOQ9M2z6A0tt152UNyu8bJtj5BcwKVyNaXB3Y0zXhG3+P JYHW00vTCMXEMtk+Zqf0mSAUrPm0r2732B/LMscYAw== X-Google-Smtp-Source: AK7set/wbmt/a70fvnhJu2m7LxGZSgrs66ASnjl4BXLKrDkU7Ganqht7uH6u1v27CcBrXi79Yy2r1Q== X-Received: by 2002:a05:600c:4587:b0:3df:e468:17dc with SMTP id r7-20020a05600c458700b003dfe46817dcmr25541033wmo.40.1679111197521; Fri, 17 Mar 2023 20:46:37 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id r13-20020a05600c2c4d00b003ed2a3eab71sm3573041wmg.31.2023.03.17.20.46.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2023 20:46:37 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: c5c9d980c4b0 - main - libc/csu: rename ignore_init.c to libc_start1.c From: Jessica Clarke <jrtc27@freebsd.org> In-Reply-To: <8d3503f3-fd05-5f1c-7470-48cef3c9bd2d@freebsd.org> Date: Sat, 18 Mar 2023 03:46:36 +0000 Cc: Konstantin Belousov <kib@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Content-Transfer-Encoding: quoted-printable Message-Id: <137554A7-8067-4E77-96A8-A0B4BF813184@freebsd.org> References: <202303112320.32BNKoJe039514@gitrepo.freebsd.org> <8d3503f3-fd05-5f1c-7470-48cef3c9bd2d@freebsd.org> To: Charlie Li <vishwin@freebsd.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4Pdn3z0hzHz4SdF X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 18 Mar 2023, at 03:44, Charlie Li <vishwin@freebsd.org> wrote: >=20 > Konstantin Belousov wrote: >> libc/csu: rename ignore_init.c to libc_start1.c >> The current name was a historical curiosity that started = when init array >> support was added, and then the file appeared a convenient place = for the >> addition of the MI common code to csu. It is now referenced by = name in >> single place and the rename is easy, so do it. >> Sponsored by: The FreeBSD Foundation >> MFC after: 3 weeks >> --- >> lib/libc/csu/Makefile.inc | 2 +- >> lib/libc/csu/{ignore_init.c =3D> libc_start1.c} | 0 >> 2 files changed, 1 insertion(+), 1 deletion(-) > Seems like an ABI break. Anything compiled after this but ran on an = earlier-by-revision-but-same __FreeBSD_version complains with 'Undefined = symbol "__libc_start1@FBSD_1.7"' It=E2=80=99s not a break, just new ABI. Same as adding a new function, = just everything automatically uses it. It=E2=80=99s true that __FreeBSD_version needs bumping if it hasn=E2=80=99= t already been though. Jess From nobody Sat Mar 18 05:53:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdqtY32Zbz3y8H7; Sat, 18 Mar 2023 05:53: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 4PdqtY2H7Jz3FJ3; Sat, 18 Mar 2023 05:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679118821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yg1uegF9aXREBa9w1tPDQyLXnDItO09oFq81aKwWgaI=; b=fPnciP7OXBPXecfgpK/Ig4KpvwSBYO5RI1apLGeQ0vVptxlwQKMbJ6ElesNZv071kHhcg8 VftWY+r+Zr8lE8L6Kzj0uaRf5NAsiGUIiWNoLIOISVLWK30LzpiEaPOtP246K2Gq4efNIy Qw+YT6D1DFPxULCH6wvZZe/FM04QNUY9MVlZfyhlo97q8DNI2cHsWdGpJ+o6kJ5e08/pXw IGL16DluibEFGjmw2DF+7Kq/wgrrJPFD+klK94YocoqgmjcYNJhkPQmsdXkPSPKFPf2BB3 2ONs2VwJV7ysVSHHZkvDcEZUrAVusIygY4YqnXMkreAukrt8En8sfFZ03OJQnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679118821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yg1uegF9aXREBa9w1tPDQyLXnDItO09oFq81aKwWgaI=; b=AMZqh/mtnkbDvloxYmL3GVdm7r40lQLLKGuXG+k+WWOF6Yfxx6QszEZodDsLG+k/DRWe5f lzIUxKiR0mBqI+71XxUHhevZg3ggufKA6BstlDCbSbPWZlyCx2i7X5iSxS8NJW1M5vi05N TfP7tjmGPK/7br9h+cHh6dOaVKiz9gI87OvBN+JlqKlRvtXH+1EyntFWgB4mJqkQuzyREl 73JhZiuIzB05Emy+T6UcOQfU9K/D91SJ6BgTETwKaAPlAjKtl6EfIWgaswCg485n54lWRj C6g2Rxeq9W6Zsg0AvSbBCBSdWuQNqhGZ04HI0deoSAZGLg2D8VkuKFSp7becjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679118821; a=rsa-sha256; cv=none; b=f/VmXdWa6ABjZc4bM/D73eCuxbPJMjH5kTsNf9NE9mXHFN7KiMa/e00fkWfFvfoFDYBk8V 9RxMlBuI2baHqJB5Bn5z7WXBMNA31qVEQ3pQn2z9dCuVaPQbcitUSSXCEo9mwFjrQKINy8 hDBhiv1QNgpV8DAwjS2d5TKtJ4fIq52EuHmGIauijSoN28feshvalvzMyIs5/SLTe+BMMA JjLsqmRtg5Nx2oJRARYhfkrxJJ9gTvWUm4muJ+X8N8TSSAUmbEqSZ2H548Cf9P+JDKS+2c scHE4WetPVTxQEfb62xRMoH/ll9laLo8ZWAUk9PPf95pvv45yiuRgRX62JYD9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdqtY1LNVzwVR; Sat, 18 Mar 2023 05:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I5rfCj088925; Sat, 18 Mar 2023 05:53:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I5rfRu088924; Sat, 18 Mar 2023 05:53:41 GMT (envelope-from git) Date: Sat, 18 Mar 2023 05:53:41 GMT Message-Id: <202303180553.32I5rfRu088924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: cf6356fd471c - main - daemon: repace goto exit with daemon_terminate() List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf6356fd471cdf4e5c52550f63599881d722962c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=cf6356fd471cdf4e5c52550f63599881d722962c commit cf6356fd471cdf4e5c52550f63599881d722962c Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-18 05:31:12 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-18 05:52:59 +0000 daemon: repace goto exit with daemon_terminate() Start breaking down big main() Remove goto exit label and replace it with a function that does cleanup. Comment re-worded by kevans@. Pull Request: https://github.com/freebsd/freebsd-src/pull/694 --- usr.sbin/daemon/daemon.c | 65 +++++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index b215803cf3c6..2a57d021258e 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -95,6 +95,8 @@ static void open_pid_files(struct daemon_state *); static void do_output(const unsigned char *, size_t, struct daemon_state *); static void daemon_sleep(time_t, long); static void daemon_state_init(struct daemon_state *); +static void daemon_terminate(struct daemon_state *); + static volatile sig_atomic_t terminate = 0; static volatile sig_atomic_t child_gone = 0; @@ -305,7 +307,7 @@ main(int argc, char *argv[]) open_pid_files(&state); if (daemon(state.keep_cur_workdir, state.keep_fds_open) == -1) { warn("daemon"); - goto exit; + daemon_terminate(&state); } /* Write out parent pidfile if needed. */ pidfile_write(state.parent_pidfh); @@ -341,15 +343,15 @@ main(int argc, char *argv[]) /* Block SIGTERM to avoid racing until we have forked. */ if (sigprocmask(SIG_BLOCK, &mask_term, &mask_orig)) { warn("sigprocmask"); - goto exit; + daemon_terminate(&state); } if (sigaction(SIGTERM, &act_term, NULL) == -1) { warn("sigaction"); - goto exit; + daemon_terminate(&state); } if (sigaction(SIGCHLD, &act_chld, NULL) == -1) { warn("sigaction"); - goto exit; + daemon_terminate(&state); } /* * Try to protect against pageout kill. Ignore the @@ -360,7 +362,7 @@ main(int argc, char *argv[]) if (state.log_reopen && state.output_fd >= 0 && sigaction(SIGHUP, &act_hup, NULL) == -1) { warn("sigaction"); - goto exit; + daemon_terminate(&state); } restart: if (pipe(state.pipe_fd)) { @@ -376,7 +378,7 @@ restart: /* fork failed, this can only happen when supervision is enabled */ if (pid == -1) { warn("fork"); - goto exit; + daemon_terminate(&state); } @@ -425,7 +427,7 @@ restart: */ if (sigprocmask(SIG_UNBLOCK, &mask_term, NULL)) { warn("sigprocmask"); - goto exit; + daemon_terminate(&state); } close(state.pipe_fd[1]); state.pipe_fd[1] = -1; @@ -458,34 +460,34 @@ restart: } if (terminate) { - goto exit; + daemon_terminate(&state); } if (state.child_eof) { if (sigprocmask(SIG_BLOCK, &mask_susp, NULL)) { warn("sigprocmask"); - goto exit; + daemon_terminate(&state); } while (!terminate && !child_gone) { sigsuspend(&mask_orig); } if (sigprocmask(SIG_UNBLOCK, &mask_susp, NULL)) { warn("sigprocmask"); - goto exit; + daemon_terminate(&state); } continue; } if (sigprocmask(SIG_BLOCK, &mask_read, NULL)) { warn("sigprocmask"); - goto exit; + daemon_terminate(&state); } state.child_eof = !listen_child(state.pipe_fd[0], &state); if (sigprocmask(SIG_UNBLOCK, &mask_read, NULL)) { warn("sigprocmask"); - goto exit; + daemon_terminate(&state); } } @@ -494,23 +496,14 @@ restart: } if (sigprocmask(SIG_BLOCK, &mask_term, NULL)) { warn("sigprocmask"); - goto exit; + daemon_terminate(&state); } if (state.restart_enabled && !terminate) { close(state.pipe_fd[0]); state.pipe_fd[0] = -1; goto restart; } -exit: - close(state.output_fd); - close(state.pipe_fd[0]); - close(state.pipe_fd[1]); - if (state.syslog_enabled) { - closelog(); - } - pidfile_remove(state.child_pidfh); - pidfile_remove(state.parent_pidfh); - exit(1); /* If daemon(3) succeeded exit status does not matter. */ + daemon_terminate(&state); } static void @@ -601,7 +594,7 @@ listen_child(int fd, struct daemon_state *state) static size_t bytes_read = 0; int rv; - assert(state); + assert(state != NULL); assert(bytes_read < LBUF_SIZE - 1); if (do_log_reopen) { @@ -659,7 +652,7 @@ static void do_output(const unsigned char *buf, size_t len, struct daemon_state *state) { assert(len <= LBUF_SIZE); - assert(state); + assert(state != NULL); if (len < 1) { return; @@ -762,3 +755,25 @@ daemon_state_init(struct daemon_state *state) .output_filename = NULL, }; } + + +static _Noreturn void +daemon_terminate(struct daemon_state *state) +{ + assert(state != NULL); + close(state->output_fd); + close(state->pipe_fd[0]); + close(state->pipe_fd[1]); + if (state->syslog_enabled) { + closelog(); + } + pidfile_remove(state->child_pidfh); + pidfile_remove(state->parent_pidfh); + + /* + * Note that the exit value here doesn't matter in the case of a clean + * exit; daemon(3) already detached us from the caller, nothing is left + * to care about this one. + */ + exit(1); +} From nobody Sat Mar 18 05:53:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdqtZ4zTtz3y8MF; Sat, 18 Mar 2023 05:53: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 4PdqtZ3s3mz3FXn; Sat, 18 Mar 2023 05:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679118822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cw4yfITP5mW/Oo4VS/1XLxnGIL4mdoPliHbvmiN1EtU=; b=DLO4DYcQGr8w+VsMQJq1ipowCmPCg8vGn7fimR9GYDIrRZ8zaWBi6p7dt9iS92y3EqP217 wAs9eEDjZD1+ay5lYVlt23jFpo5B53zBCEu88VyE3ltUPvmsdU6Fz0fLm/ilbHtPqs4DVU wCAIIgoR8Vmsa7jroO/MVS+9iaQsWxzheaJwawl1c3ULVAxNMvdqmpuSe8LLYc7KZ1FpiN Q/axK6P7N8v96Dfvd4yMuBZLbNlDN4nrhyBMeE4XsoAX40x0SliaFZY+GswL2/HyBlHPSb 2jl2g4aticGjcLxjazONoEcSeeSAygHpoFHfu3zF1l7f2l0OIx9Jw8MLziqqkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679118822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cw4yfITP5mW/Oo4VS/1XLxnGIL4mdoPliHbvmiN1EtU=; b=YE2/xujtD9WuBu7WTbenUQDNSIeeLyTVi1E9DXaI6yiMPj66jgke5AWE+BLk8aiLCYbpbd c51sbljfHKt+6Q1w+bavvTTF1KEXQYuV8lt1LQHWWtKaU/566k48oHlTCOa2nfJKaZ8r1o R6DoFvM9l7x1F9Y5kffryaelPEjTRl2MF6CyLcjLT7RULrsZU/3doeZ9eOtxgPHwYnVe8u gNhH5OEmVGb9bmCVEU483lEOERuykXJoKqa7H69ZEGwGPtK2jYjr2+AvcVxLN69/HIxUTn kcCiBt0wGmUVW0Ez7RlQphbkF00jtpPUcTafwY+QajPDTmx0h1CgrLiiHyBiVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679118822; a=rsa-sha256; cv=none; b=n3lNFV6WLaEVJDjbG8Pe1rolN2mJw8YWQvNbeGZ/tfxleQ5r3Hn6j3m3S5W0AFM9yg2Uub IVCIW+ffjT3yBIgLMovpEtYvuwLjEZ/Oxw8lb/uv0Q/TJjLtuXOsDPcyiwvwE+u/kRsMto 7MCd8BW+bXRN9SNO9xTY3M4sSmm1YdrdfUdaDPcw2iBeYZSK0bh/mu3UUl5RJh1B5PCxiI Ms5OABNOWF4ZzLyYM1CCFs0Z/sJF3zTWRaoXE9SBRCDWChkHcY4/DRTGh8reB73QrOW4Ao zDixVXcPtWdy9t2D6hEbNvcYDoBM3kqs0bll3+wXlSHYi/62gfog/R3hNCzCmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdqtZ2VdPzwbj; Sat, 18 Mar 2023 05:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I5rgPR088951; Sat, 18 Mar 2023 05:53:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I5rgZm088950; Sat, 18 Mar 2023 05:53:42 GMT (envelope-from git) Date: Sat, 18 Mar 2023 05:53:42 GMT Message-Id: <202303180553.32I5rgZm088950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 8117ea0a4131 - main - daemon: remove unnecessary memset in daemon_state_init() List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8117ea0a413150dccc05ea376596b98c4b1855e6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8117ea0a413150dccc05ea376596b98c4b1855e6 commit 8117ea0a413150dccc05ea376596b98c4b1855e6 Author: Ihor Antonov <ihor@antonovs.family> AuthorDate: 2023-03-18 05:43:35 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-18 05:52:59 +0000 daemon: remove unnecessary memset in daemon_state_init() Pull Request: https://github.com/freebsd/freebsd-src/pull/694 --- usr.sbin/daemon/daemon.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 2a57d021258e..eb69fc87a827 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -730,7 +730,6 @@ reopen_log(struct daemon_state *state) static void daemon_state_init(struct daemon_state *state) { - memset(state, 0, sizeof(struct daemon_state)); *state = (struct daemon_state) { .pipe_fd = { -1, -1 }, .parent_pidfh = NULL, From nobody Sat Mar 18 05:58:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdqzg4gqHz3y8fm for <dev-commits-src-all@mlmmj.nyi.freebsd.org>; Sat, 18 Mar 2023 05:58:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pdqzg2W3qz3G62 for <dev-commits-src-all@freebsd.org>; Sat, 18 Mar 2023 05:58:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f45.google.com with SMTP id bh21-20020a05600c3d1500b003ed1ff06fb0so4517896wmb.3 for <dev-commits-src-all@freebsd.org>; Fri, 17 Mar 2023 22:58:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679119086; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iai2MH9zXq5Lv30BAY43uEemuKzrDsosDJCMtsRtWKw=; b=1EP+qRITNPM8rBEt6jhGMyTfasaZ/Dblu1TyDBEkB2oxea46dLJrlJ95lNRFUpemy3 r6uZ1I0q07CK9P7Hq4RyBBCOnw4cO+ANq7T6bMGMiQanG+zK5zIq33QudtytNZlLhYMZ y/1HnMMZmS/KEz5kp6FESHEqJA7/4uj9Zg5rt3SkMMUlYoFluOq3KUeIh6QiKw9ooqJT 60GOwUGE3EFCBEqakg+BVTmsCv/qffcZzF6G8OfBL93r3lBAgh1vhVMTc5tS3jtsgaqi 1wKtJwYO5uYgaDi0VRYc923iaOziy7z1JxwxoNQpIe/vZ8lj/SWb/Xxca1orFFS/1DeN Z3/w== X-Gm-Message-State: AO0yUKW4JW0U1LoKpZJW8myzHUZnhVA/lEUa3DV8PSnGQ6NzwW35ZFkU rT35Bv+BadIY8TMtjTc5popB5w== X-Google-Smtp-Source: AK7set+PgZUWbUMMkiprhVt81xozcglhW0pEVtHJruDWUu5zkBzVrY93ryyA14I3vtGvxR34L6TxPw== X-Received: by 2002:a05:600c:3ac8:b0:3eb:3f2d:f237 with SMTP id d8-20020a05600c3ac800b003eb3f2df237mr27188614wms.6.1679119085950; Fri, 17 Mar 2023 22:58:05 -0700 (PDT) Received: from smtpclient.apple (global-5-144.n-2.net.cam.ac.uk. [131.111.5.144]) by smtp.gmail.com with ESMTPSA id r13-20020a05600c2c4d00b003ed2a3eab71sm3810124wmg.31.2023.03.17.22.58.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2023 22:58:05 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: cf6356fd471c - main - daemon: repace goto exit with daemon_terminate() From: Jessica Clarke <jrtc27@freebsd.org> In-Reply-To: <202303180553.32I5rfRu088924@gitrepo.freebsd.org> Date: Sat, 18 Mar 2023 05:58:04 +0000 Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Content-Transfer-Encoding: quoted-printable Message-Id: <FC6F996B-A761-4E1B-BF25-A950D60A44D7@freebsd.org> References: <202303180553.32I5rfRu088924@gitrepo.freebsd.org> To: Kyle Evans <kevans@FreeBSD.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4Pdqzg2W3qz3G62 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 18 Mar 2023, at 05:53, Kyle Evans <kevans@FreeBSD.org> wrote: >=20 > The branch main has been updated by kevans: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dcf6356fd471cdf4e5c52550f63599881= d722962c >=20 > commit cf6356fd471cdf4e5c52550f63599881d722962c > Author: Ihor Antonov <ihor@antonovs.family> > AuthorDate: 2023-03-18 05:31:12 +0000 > Commit: Kyle Evans <kevans@FreeBSD.org> > CommitDate: 2023-03-18 05:52:59 +0000 >=20 > daemon: repace goto exit with daemon_terminate() >=20 > Start breaking down big main() > Remove goto exit label and replace it with a function that does = cleanup. >=20 > Comment re-worded by kevans@. >=20 > Pull Request: https://github.com/freebsd/freebsd-src/pull/694 > --- > usr.sbin/daemon/daemon.c | 65 = +++++++++++++++++++++++++++++------------------- > 1 file changed, 40 insertions(+), 25 deletions(-) >=20 > diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c > index b215803cf3c6..2a57d021258e 100644 > --- a/usr.sbin/daemon/daemon.c > +++ b/usr.sbin/daemon/daemon.c > @@ -95,6 +95,8 @@ static void open_pid_files(struct daemon_state *); > static void do_output(const unsigned char *, size_t, struct = daemon_state *); > static void daemon_sleep(time_t, long); > static void daemon_state_init(struct daemon_state *); > +static void daemon_terminate(struct daemon_state *); > + What=E2=80=99s with the whitespace? >=20 > static volatile sig_atomic_t terminate =3D 0; > static volatile sig_atomic_t child_gone =3D 0; > @@ -305,7 +307,7 @@ main(int argc, char *argv[]) > open_pid_files(&state); > if (daemon(state.keep_cur_workdir, state.keep_fds_open) =3D=3D = -1) { > warn("daemon"); > - goto exit; > + daemon_terminate(&state); > } > /* Write out parent pidfile if needed. */ > pidfile_write(state.parent_pidfh); > @@ -341,15 +343,15 @@ main(int argc, char *argv[]) > /* Block SIGTERM to avoid racing until we have forked. = */ > if (sigprocmask(SIG_BLOCK, &mask_term, &mask_orig)) { > warn("sigprocmask"); > - goto exit; > + daemon_terminate(&state); > } > if (sigaction(SIGTERM, &act_term, NULL) =3D=3D -1) { > warn("sigaction"); > - goto exit; > + daemon_terminate(&state); > } > if (sigaction(SIGCHLD, &act_chld, NULL) =3D=3D -1) { > warn("sigaction"); > - goto exit; > + daemon_terminate(&state); > } > /* > * Try to protect against pageout kill. Ignore the > @@ -360,7 +362,7 @@ main(int argc, char *argv[]) > if (state.log_reopen && state.output_fd >=3D 0 && > sigaction(SIGHUP, &act_hup, NULL) =3D=3D -1) { > warn("sigaction"); > - goto exit; > + daemon_terminate(&state); > } > restart: > if (pipe(state.pipe_fd)) { > @@ -376,7 +378,7 @@ restart: > /* fork failed, this can only happen when supervision is enabled = */ > if (pid =3D=3D -1) { > warn("fork"); > - goto exit; > + daemon_terminate(&state); > } >=20 >=20 > @@ -425,7 +427,7 @@ restart: > */ > if (sigprocmask(SIG_UNBLOCK, &mask_term, NULL)) { > warn("sigprocmask"); > - goto exit; > + daemon_terminate(&state); > } > close(state.pipe_fd[1]); > state.pipe_fd[1] =3D -1; > @@ -458,34 +460,34 @@ restart: > } >=20 > if (terminate) { > - goto exit; > + daemon_terminate(&state); > } >=20 > if (state.child_eof) { > if (sigprocmask(SIG_BLOCK, &mask_susp, NULL)) { > warn("sigprocmask"); > - goto exit; > + daemon_terminate(&state); > } > while (!terminate && !child_gone) { > sigsuspend(&mask_orig); > } > if (sigprocmask(SIG_UNBLOCK, &mask_susp, NULL)) = { > warn("sigprocmask"); > - goto exit; > + daemon_terminate(&state); > } > continue; > } >=20 > if (sigprocmask(SIG_BLOCK, &mask_read, NULL)) { > warn("sigprocmask"); > - goto exit; > + daemon_terminate(&state); > } >=20 > state.child_eof =3D !listen_child(state.pipe_fd[0], = &state); >=20 > if (sigprocmask(SIG_UNBLOCK, &mask_read, NULL)) { > warn("sigprocmask"); > - goto exit; > + daemon_terminate(&state); > } >=20 > } > @@ -494,23 +496,14 @@ restart: > } > if (sigprocmask(SIG_BLOCK, &mask_term, NULL)) { > warn("sigprocmask"); > - goto exit; > + daemon_terminate(&state); > } > if (state.restart_enabled && !terminate) { > close(state.pipe_fd[0]); > state.pipe_fd[0] =3D -1; > goto restart; > } > -exit: > - close(state.output_fd); > - close(state.pipe_fd[0]); > - close(state.pipe_fd[1]); > - if (state.syslog_enabled) { > - closelog(); > - } > - pidfile_remove(state.child_pidfh); > - pidfile_remove(state.parent_pidfh); > - exit(1); /* If daemon(3) succeeded exit status does not matter. = */ > + daemon_terminate(&state); > } >=20 > static void > @@ -601,7 +594,7 @@ listen_child(int fd, struct daemon_state *state) > static size_t bytes_read =3D 0; > int rv; >=20 > - assert(state); > + assert(state !=3D NULL); > assert(bytes_read < LBUF_SIZE - 1); >=20 > if (do_log_reopen) { > @@ -659,7 +652,7 @@ static void > do_output(const unsigned char *buf, size_t len, struct daemon_state = *state) > { > assert(len <=3D LBUF_SIZE); > - assert(state); > + assert(state !=3D NULL); >=20 > if (len < 1) { > return; > @@ -762,3 +755,25 @@ daemon_state_init(struct daemon_state *state) > .output_filename =3D NULL, > }; > } > + > + Ditto. Jess > +static _Noreturn void > +daemon_terminate(struct daemon_state *state) > +{ > + assert(state !=3D NULL); > + close(state->output_fd); > + close(state->pipe_fd[0]); > + close(state->pipe_fd[1]); > + if (state->syslog_enabled) { > + closelog(); > + } > + pidfile_remove(state->child_pidfh); > + pidfile_remove(state->parent_pidfh); > + > + /* > + * Note that the exit value here doesn't matter in the case of a = clean > + * exit; daemon(3) already detached us from the caller, nothing = is left > + * to care about this one. > + */ > + exit(1); > +} From nobody Sat Mar 18 06:05:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdr8h2xcHz3y99H; Sat, 18 Mar 2023 06:05: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 4Pdr8h2P1Rz3HXw; Sat, 18 Mar 2023 06:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679119556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IawcPO9AJVXp23F3tKmfHC7sbC45pZDBurbzDNjPl50=; b=wkMfwMp6JrrZ3Gcz2qQSlVXvb2BF2lpFN7/sd/FJP4fvKx9fwX+CNDrvF7dDGKRNd4hjmo I6mnuVx3H9M8n29GaD45EtoBpLpvDnkz5mcjTTm6o9HZHlcZITY27n3IDbJn2EFZvTR/Z4 0pwRooPQjAMUJYesjdTAQihDOUt6g1JnP8T+Btz3luP/mGjrfjzOzdYRrmyyfWR16FYcqF /6Cm1K3OIV1lWVxJ5AbeUNklXowg2OmwIT40DQk0aSInDmCym+Sq3XpBR/CXl155mrBFi6 C1gcO28mlsHtMuPktkwQxsqwiVbEFlA7MdOVxcyKhXdXu7SQGFGXFfcmr2W91w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679119556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IawcPO9AJVXp23F3tKmfHC7sbC45pZDBurbzDNjPl50=; b=ebihMn2sUoLhnbD3H9oiYsLP6kGp20ja2f/CRi/qm9izTLwjk2+xoYttNPfyeTL3eF8iq2 dgIrxEgVIEDShC3VSPs587rVVasY0dU+IDe/6WrsZCckYmqYuK/zJ/CMbh9Sh59uaQPRlL tESl7WA/NaC7EsBzcw6pj50nsns3xLVnmKa2YbrElTVjpH+NMKw7binaWvbZv0qROmI3xX RnTlb0Ymzcj45/dGKZx2ZwyPm/2Y6YdgucLJJitum7Z9oSLYHimjDeLYdn6Dui6mbUKrMy kgko0tpMRKo34eh+3JYCck9I0/uftdBQuLKUjy0bgu7mdRerqsE5Pm+m1XP5dA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679119556; a=rsa-sha256; cv=none; b=pjt/ZyMrSrcLLpo1/C9/fbCS063v8Aw88wQuWlOcwZ8S4LQXxTgsMDFtg/g4HJ9nUAESNe NVZyagbFz4DiVYvzQvTKWbR15IYscN+ILDmw+aS0xoeTYhPxFW3e6znIGw0jika5hDoI4e XZm9U6/MxjK83ZyhT/3mnZ2AlfeO7APX5Xj5VokfSZIWQ1qceGAoDBoAN4PKqHjTqfwcEC wYkB4qmIS4OKGZi6e2rgsSKwlrrqMuKjC/6VfKqCrN1Xx5fSGMROxcv5mp6uu9glMoIM70 bt2fyO0SNOVDaAzgWyQGVH9N5XzlKyeF0POww9/F690qdkb7k0iVeOAWW/LmOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdr8h1Mw5zw8v; Sat, 18 Mar 2023 06:05:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I65uxH006903; Sat, 18 Mar 2023 06:05:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I65uFe006893; Sat, 18 Mar 2023 06:05:56 GMT (envelope-from git) Date: Sat, 18 Mar 2023 06:05:56 GMT Message-Id: <202303180605.32I65uFe006893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans <kevans@FreeBSD.org> Subject: git: 6b49a630f441 - main - daemon: kill off some stray blank lines List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b49a630f441e1a9e8c8e57d2bb71e589d95872c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6b49a630f441e1a9e8c8e57d2bb71e589d95872c commit 6b49a630f441e1a9e8c8e57d2bb71e589d95872c Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2023-03-18 06:04:35 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-03-18 06:05:43 +0000 daemon: kill off some stray blank lines Overlooked in review; mea culpa. Reported by: jrtc27 --- usr.sbin/daemon/daemon.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index eb69fc87a827..54e2aeea6874 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -97,7 +97,6 @@ static void daemon_sleep(time_t, long); static void daemon_state_init(struct daemon_state *); static void daemon_terminate(struct daemon_state *); - static volatile sig_atomic_t terminate = 0; static volatile sig_atomic_t child_gone = 0; static volatile sig_atomic_t pid = 0; @@ -381,7 +380,6 @@ restart: daemon_terminate(&state); } - /* fork succeeded, this is child's branch or supervision is disabled */ if (pid == 0) { pidfile_write(state.child_pidfh); @@ -755,7 +753,6 @@ daemon_state_init(struct daemon_state *state) }; } - static _Noreturn void daemon_terminate(struct daemon_state *state) { From nobody Sat Mar 18 06:16:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdrPG4NPcz3y9WD; Sat, 18 Mar 2023 06:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PdrPG3Dshz3J49; Sat, 18 Mar 2023 06:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679120210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KvnBmriykkQhc4RGbrj2K574e0gMPLt1tLXQnVFnqRI=; b=HmOT+ZTx4Q4DxDgHoD+bYldzSJ2vac9ITW2b9DRiLi0Z9NxQ45pZKfH77MrQqiauK2Ii9A NW4pRLCXTJpYiJYeujBxBRLuXPBQqvet6DGEykul1/rS7xHNg08bS5PkGv/ZVU1EvqvpQJ fKzWpLn4LYpkWkuFJw9J9+H1cSeZUqSOyyauzgNVCQHmE0+PzdYrsGXB98lXJIviF4WU2f G8dvBmY1hx2dPY16RtkqKmUektY6r3Q2cETIBym5YByATZcgsml5GKnxHUCyEumuEGlrL3 2vem9EQumdahzJxchrINm0oei82FOP4qCRmLf/OX9dPTQBH6M7B9OLDR6FXO3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679120210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KvnBmriykkQhc4RGbrj2K574e0gMPLt1tLXQnVFnqRI=; b=mrgfVfbiGuoG6EKbgUkcg2EcyTrB05eECMJJNLbD83Bf1hpv9qYPAQ+AD4Xd0AYoJAPicr lKEqeM+P2Fx4sCfl1iK8gQY75Rq4SAjNfv69EjCl2JeVOi5rYp4gnWYYygg3bE4gJXxRhi zYSZc79wW/iRrjUF5UUQFFfsVCLcdLkD5lVNhT9olK2g40FUH7xNcFt4FWWfKYhlKZmH3F MxF6wvwS6fmFsoOZ7hPF+kPK91aFbike+6DGRyPbmWRqPw6fQHKIWtlnZrFnKTCwq3zXK8 ZegfX99sim9k9Opmh7TMllgLw69UZr7HbIKCv+rjhXgFgrGNutc/IytsJTpNMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679120210; a=rsa-sha256; cv=none; b=DqrHaaX5anDJTrqD8BJylEFlWRvtyqcmAmmr+Oxz8aBVgO+xlW/gD2nP+c5rkRQWPikR0Z YMZE/gFJW2ICHJrKJI4ob46/b+uK3zARtOgI52focli4F9D6RN8gu7VbEoKDAY5uzGz2Eh iMLXjCWIuMRos9eIK5RNbv8PnNs2aUsxybBQ/6x0T3caoxvFaQebyjaeWXbxzw0eSWjsS6 FG4JhSyp9B1HfgqXbmWwBrNWwgs35t3NWI67rkGBFlZW3HKfW46BVxYJ4fqmRPHYi0QJCB ctFH4MTEiDYalslpsyzYWqruSDe2/SCeTUmpsgkA5XLJNm6UNVBDGWfS7IrxaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdrPG2BxCzwHy; Sat, 18 Mar 2023 06:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I6Go1I023072; Sat, 18 Mar 2023 06:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I6GovC023071; Sat, 18 Mar 2023 06:16:50 GMT (envelope-from git) Date: Sat, 18 Mar 2023 06:16:50 GMT Message-Id: <202303180616.32I6GovC023071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fedor Uporov <fsu@FreeBSD.org> Subject: git: 366da717deda - main - Add root directory entry check. List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 366da717deda3964ae369f1f2fbd62114d14c587 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fsu: URL: https://cgit.FreeBSD.org/src/commit/?id=366da717deda3964ae369f1f2fbd62114d14c587 commit 366da717deda3964ae369f1f2fbd62114d14c587 Author: Fedor Uporov <fsu@FreeBSD.org> AuthorDate: 2023-02-09 09:34:25 +0000 Commit: Fedor Uporov <fsu@FreeBSD.org> CommitDate: 2023-03-18 06:16:22 +0000 Add root directory entry check. Add check that directory entry with ino=EXT2_ROOTINO have correct namelength and name. It is possible to create malicious image which will cause panic if root directory entry have incorrect name. PR: 259068 Reported by: Robert Morris Reviewed by: pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38502 --- sys/fs/ext2fs/ext2_lookup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c index 67409a5e2a17..93a2d172e01f 100644 --- a/sys/fs/ext2fs/ext2_lookup.c +++ b/sys/fs/ext2fs/ext2_lookup.c @@ -818,6 +818,8 @@ ext2_dirbad(struct inode *ip, doff_t offset, char *how) * record must be large enough to contain entry * name is not longer than MAXNAMLEN * name must be as long as advertised, and null terminated + * inode number less then inode count + * if root inode entry, it have correct name */ static int ext2_check_direntry(struct vnode *dp, struct ext2fs_direct_2 *de, @@ -836,6 +838,11 @@ ext2_check_direntry(struct vnode *dp, struct ext2fs_direct_2 *de, error_msg = "directory entry across blocks"; else if (le32toh(de->e2d_ino) > fs->e2fs->e2fs_icount) error_msg = "directory entry inode out of bounds"; + else if (le32toh(de->e2d_ino) == EXT2_ROOTINO && + ((de->e2d_namlen != 1 && de->e2d_namlen != 2) || + (de->e2d_name[0] != '.') || + (de->e2d_namlen == 2 && de->e2d_name[1] != '.'))) + error_msg = "bad root directory entry"; if (error_msg != NULL) { SDT_PROBE5(ext2fs, , trace, ext2_dirbadentry_error, From nobody Sat Mar 18 06:16:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdrPH4RbJz3y9WF; Sat, 18 Mar 2023 06:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PdrPH3hfzz3J8P; Sat, 18 Mar 2023 06:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679120211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HpPQhIk9d8DC2WlWDCTvE/obHRHt8Lz3GMTN0y/1i9c=; b=gPtMKvlrPypVYi8xrxa53RrQ3UFycFyhTJUCHoFVFKFF39/6+mEBPw8GmW1vBOQ1dOMpud zR0rbJIfKV8BHBM51MlGIZ6QDBxVA7YRXACSwG9FSlcNY2RPgZlAGuQofbgG3bRrIGqaUw IM/JDjkwsZMkXry6JUnQZ/PO2p5yw6IyPEXAsjn0kPa6iXjhzh7d1V7UtybHL3cC+f8V2K 9rVvZJ15k68l/sSiczuARkppjBgUyEl3oyTgWzzLcutmgT7SW88v1M+TD7YeKgeGDQ042w V1m3MqaUnMQPkPeTTGy9y3ia8/4HZf1OozrDSGi4pOW5igbKY8c026qHuMhcqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679120211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HpPQhIk9d8DC2WlWDCTvE/obHRHt8Lz3GMTN0y/1i9c=; b=Q2t6yKcpLhYvw9c8Rr6I2fr6Papz3PB+IGzIfmIqrwDuIFeAGP3Lt0nVOj7v9hmQqi0v/1 k51mTFnZGY1+YuvKr7EIPhqKTTO1n2/Rcvh1OjEZxOvk4LD6TiPh5lZNQFnKMs9d/CVBPs nrqLXfy3pANDEahhg8h1d/XD53EvBzG+kH2iIUYvY3K7NL3SvrfmyholSZT3OBq5xL6p1O ukA/CZqS0DQAAdb+mRTomfxn7mUlzAdq+/xJw/fIm1tTe184UeXPJUjie69sPsooXy7Vr2 RTIZvs3dkmwuJU+9K4gMv2FyOHndI4wiDMxYK6mlBQU/yob6nFeBAOlwyQmCdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679120211; a=rsa-sha256; cv=none; b=Wjf4NykrIuU5IM/wSfCNMGogDQt6VJ9KpMJvAw181A15Aqav1MbRVzezLLgTibOE5wOjbH QCg9NKJcTaRfVVptdvEUXDFjnLlQb49sSyo019nigC3FrnmwmNPufzrZEvlcw8r6/4loGt DTBcCctJ88wiqQN2CS/rQVl66neZGvpluMaHRrPo8X/Xqj00P7o5I8an+yzPfp3cMv0lIq Ai/zauo/c8EJJM8Pj3cGetUHo9WnwhE3pwTdis7Vcv6WBhKgnklnZUZnaANF2+x+2eiPu8 tLU9ps9672LrP4v1OFYliErSa1vKAaOrV+qUtctN/ZNzGUaN0fi6CifmQhRVIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdrPH2R1rzwLh; Sat, 18 Mar 2023 06:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I6Gpmp023091; Sat, 18 Mar 2023 06:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I6GpHD023090; Sat, 18 Mar 2023 06:16:51 GMT (envelope-from git) Date: Sat, 18 Mar 2023 06:16:51 GMT Message-Id: <202303180616.32I6GpHD023090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fedor Uporov <fsu@FreeBSD.org> Subject: git: 3c2dc524c333 - main - Do not panic in case of corrupted directory List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c2dc524c333747a8c5deb3f0f88b29a8e36dff4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fsu: URL: https://cgit.FreeBSD.org/src/commit/?id=3c2dc524c333747a8c5deb3f0f88b29a8e36dff4 commit 3c2dc524c333747a8c5deb3f0f88b29a8e36dff4 Author: Fedor Uporov <fsu@FreeBSD.org> AuthorDate: 2023-03-18 06:11:27 +0000 Commit: Fedor Uporov <fsu@FreeBSD.org> CommitDate: 2023-03-18 06:16:24 +0000 Do not panic in case of corrupted directory The panic() will be called under ext2_dirbad() function in case of rw mount. It cause user confusion, like in BZ 265951. PR: 265951 Reviewed by: pfg, mckusick MFC after: 2 week Differential revision: https://reviews.freebsd.org/D38503 --- sys/fs/ext2fs/ext2_lookup.c | 14 +++++--------- sys/fs/ext2fs/ext2_vnops.c | 9 +++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c index 93a2d172e01f..4859d51f8429 100644 --- a/sys/fs/ext2fs/ext2_lookup.c +++ b/sys/fs/ext2fs/ext2_lookup.c @@ -539,8 +539,8 @@ found: if (entryoffsetinblock + EXT2_DIR_REC_LEN(ep->e2d_namlen) > dp->i_size) { ext2_dirbad(dp, i_offset, "i_size too small"); - dp->i_size = entryoffsetinblock + EXT2_DIR_REC_LEN(ep->e2d_namlen); - dp->i_flag |= IN_CHANGE | IN_UPDATE; + brelse(bp); + return (EIO); } brelse(bp); @@ -802,13 +802,9 @@ ext2_dirbad(struct inode *ip, doff_t offset, char *how) struct mount *mp; mp = ITOV(ip)->v_mount; - if ((mp->mnt_flag & MNT_RDONLY) == 0) - panic("ext2_dirbad: %s: bad dir ino %ju at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, - (long)offset, how); - else - SDT_PROBE4(ext2fs, , trace, ext2_dirbad_error, - mp->mnt_stat.f_mntonname, ip->i_number, offset, how); + + SDT_PROBE4(ext2fs, , trace, ext2_dirbad_error, + mp->mnt_stat.f_mntonname, ip->i_number, offset, how); } /* diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index a7da8249ab4d..8ec12f9a7f8f 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -1088,6 +1088,15 @@ abortit: if (namlen != 2 || dirbuf->dotdot_name[0] != '.' || dirbuf->dotdot_name[1] != '.') { + /* + * The filesystem is in corrupted state, + * need to run fsck to fix mangled dir + * entry. From other side this error + * need to be ignored because it is + * too difficult to revert directories + * to state before rename from this + * point. + */ ext2_dirbad(xp, (doff_t)12, "rename: mangled dir"); } else { From nobody Sat Mar 18 06:31:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdrkY58xcz3yBLJ; Sat, 18 Mar 2023 06:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PdrkY4cWQz3LB0; Sat, 18 Mar 2023 06:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679121109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NfvG4xZ5QtGq41E6B1TslCphUz14rdfpv2wb9sJdhyc=; b=dN+eaqEozoHDKla4/0bX7vUIixMdTGOJkfbOW+PXzb+BWcCxj3yQmp1xf1siKdZGeD6p3U aoVJBPL8jx+BtznuE0P2CKaCArYZyV6VJ6JcAZnRAirzI5w2dP/BV4NJxwrOdynLo5VdXP spH2gtxzEX0GBRokxoSeziy9dBgEcLtG/gm6r9R1x4wXKiFkXAGv072PdqymYY1kNrf8oU L3aXy4sJRGTWZSYSJ6JvZep73FdRfqkzVeL3J4yA2oUf5YlLY2NIGHeoI/KHBDzxSLvof6 guGsJIQv7CsouxSPRs+r0xI2FDokNfjtTl+3e/E98IcHi/63QIjbKT2NmDmH+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679121109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NfvG4xZ5QtGq41E6B1TslCphUz14rdfpv2wb9sJdhyc=; b=bYlWm1BC5PTka1Z/T0oRgwQa2TXCrFz26Hi+KwXvkXv1wxvnakpK29umBCFW19IOgwrHmc ogbJcr5nOyddhs/irAO0+xvagAWzuU186w8Gkfa5j40mzt8BhY8LV+SbrG2/VTXzd5y2ys 5JxcaLUlV8WAyy5iX04uKG+awU48Bgoed2uUirpbCtcdYXfOL9UDWVZjW+WfW5MHzB71rL Bg7//0zyhRHGXLHc6YELTShVMhGjpIRWYgUWWcSysJ13qLR2H1g/fkTIBGhSmwKjnhQpNj /e7RgRCJNV629+wC4c/g0wCOv/9gHRWStqD9RQWMF6PdbhgW8LxwZwl7TG02ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679121109; a=rsa-sha256; cv=none; b=IKO0tfN8LBF3GpcaWnzOUn9qO7Eha4Nr8UE9BNE5RGobcItG/LmuoH2xn4U7hlaGfJ93Sx 7Yd9lQMorvLPsGIRvOiI4vGFk9UyPQ7zdCOY/9G35i9wsv6xXsvaSbcDuZLKX8ygjup9bB f6YmPjlhpIdXHKzBLpes1qPexPcS5qslbP1Jxcml5BwHfoTe31oXaUCd3m25mZAj9jDyZ0 HV0Mw+Dz4Pssuc894Tit2Zw6+7xNDPkMnrsyobKGTiaCduYDoPNFjMh3USxzvwt/gjdmLN cdQWrlwubxG9PhFhre1+YMw1JwkqngUyi//Aq6upbnfdCPCqBH7/AHv0amqpwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdrkY3fl3zwxB; Sat, 18 Mar 2023 06:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I6Vnmo052767; Sat, 18 Mar 2023 06:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I6VnIt052766; Sat, 18 Mar 2023 06:31:49 GMT (envelope-from git) Date: Sat, 18 Mar 2023 06:31:49 GMT Message-Id: <202303180631.32I6VnIt052766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: ab3ff87a333a - main - Belately bump __FreeBSD_version for introduction of __libc_start1() List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab3ff87a333ae586e9a2f779ba323eff8e889791 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ab3ff87a333ae586e9a2f779ba323eff8e889791 commit ab3ff87a333ae586e9a2f779ba323eff8e889791 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-03-18 06:21:59 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-03-18 06:31:41 +0000 Belately bump __FreeBSD_version for introduction of __libc_start1() and move of most of the initialization code from csu to libc. Requested by: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 2 weeks --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 353c0243b6d5..a613dbf7f2b1 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400082 +#define __FreeBSD_version 1400083 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Sat Mar 18 06:36:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdrrB5v7qz3yBmP; Sat, 18 Mar 2023 06:36:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PdrrB1rw1z3M1g; Sat, 18 Mar 2023 06:36:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 32I6aZfb034099 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 18 Mar 2023 08:36:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 32I6aZfb034099 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 32I6aYx3034098; Sat, 18 Mar 2023 08:36:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 18 Mar 2023 08:36:34 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Jessica Clarke <jrtc27@freebsd.org> Cc: Charlie Li <vishwin@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org> Subject: Re: git: c5c9d980c4b0 - main - libc/csu: rename ignore_init.c to libc_start1.c Message-ID: <ZBVb8kYDMt57blPQ@kib.kiev.ua> References: <202303112320.32BNKoJe039514@gitrepo.freebsd.org> <8d3503f3-fd05-5f1c-7470-48cef3c9bd2d@freebsd.org> <137554A7-8067-4E77-96A8-A0B4BF813184@freebsd.org> List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <137554A7-8067-4E77-96A8-A0B4BF813184@freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4PdrrB1rw1z3M1g X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sat, Mar 18, 2023 at 03:46:36AM +0000, Jessica Clarke wrote: > On 18 Mar 2023, at 03:44, Charlie Li <vishwin@freebsd.org> wrote: > > > > Konstantin Belousov wrote: > >> libc/csu: rename ignore_init.c to libc_start1.c > >> The current name was a historical curiosity that started when init array > >> support was added, and then the file appeared a convenient place for the > >> addition of the MI common code to csu. It is now referenced by name in > >> single place and the rename is easy, so do it. > >> Sponsored by: The FreeBSD Foundation > >> MFC after: 3 weeks > >> --- > >> lib/libc/csu/Makefile.inc | 2 +- > >> lib/libc/csu/{ignore_init.c => libc_start1.c} | 0 > >> 2 files changed, 1 insertion(+), 1 deletion(-) > > Seems like an ABI break. Anything compiled after this but ran on an earlier-by-revision-but-same __FreeBSD_version complains with 'Undefined symbol "__libc_start1@FBSD_1.7"' > > It’s not a break, just new ABI. Same as adding a new function, just > everything automatically uses it. Well it is break of ABI indeed, but it is backward-compatible. We never guaranteed forward-compatibility, and hopefully never will. Doing so would mean that FreeBSD is frozen. > > It’s true that __FreeBSD_version needs bumping if it hasn’t already > been though. > I bumped the version to please the public, but I do not see much use for this bump, same as for many other instances of the bump. The new interface presence is declared by the export of specifically-versioned symbol in libc, and really this export, instead of some random osversion reported from unrelated software artifact (kernel) is what important. From nobody Sat Mar 18 07:20:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdspn6Xtqz3yDSk; Sat, 18 Mar 2023 07:20: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 4Pdspn5fYxz3PqW; Sat, 18 Mar 2023 07:20:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679124033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Stjp8Qet16wX/ih4Jdzzspmfyf58nkCVXewa3nFMQ0=; b=EF69SPing7+w6uosEKpj1BuUSl4LtY0zBm0wX993F8wTCl+xJjbOlLLv6pZtdB4g5vi7QV P8xBizFrJc+R1QV+aWSNDHYbPFxAP+eR9DHTCz6TDINzQxQ2kShVwmcDjuXKUPN8RmVI5l wDpJhZz5JSTlLweUSGgtl9M6kKZoZVy+gx9FyoLLLctA+nuZ17sr/8yDQ32HXn3oM3Gbbn OuOpa2OKpXLZlkx2OtsfQhcRBsvekmpe+0OA122NvOHwFyoaHv7TcKfHbtA5oL7IXtUxOe ql9CZvlbsrHLbpFN9zwJ82XTUJMQ2opNOrwR3h3Ge+jKOzqkv79tUtV60vKoiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679124033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Stjp8Qet16wX/ih4Jdzzspmfyf58nkCVXewa3nFMQ0=; b=NZLqikSSirPxUWf06Yl6FqZDdUIU2szpN/V3U+sNX26sUqIasMZDsHRqKNo2xXcCAkG2EI 9LmibrXSy5EhoeeWTu75zScGXAW6aPcF3QXQpzZiI7M1VHNQRN11CXbsN/UWu5G7303YmS QWtgEsUVwy6e4ytDMBJHwVaZbCLsRH95Y4LsUVK8fpGQV+nqRcnSVar/+3MY5hMmnKE6g7 KFNYzo8bYeyr9HmBmy8Eky4QR40ZLwFCbeZF6FTc6r4zRvU8Fy9CJONMsffJ1oqnKX3+HY KLF77R2mHc70FlU+mxKCtwLom0nni8I2iUVqy9MUKTiv43KdsDkPQmA1tf43Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679124033; a=rsa-sha256; cv=none; b=xlzcz4d96XolVwKF5D59/9PksJssk2sSUZWs/BNmAn/k6AylHCz6ztims4Ne9gp7FDx+fo gQPQMMN1V8aC2qpVba45nj6CZqjEmf9Zakx5KXm27rMAl4O8WfQT6sdOVhBl/DOreCdoFe JAFYWqtcftGe93eqmiaosf05Yr/Q0MRTdTL49ttF2QrbvqM9tRVPZ2ezJn0XuX6uNtiIx5 xMuWFaqQEV/4uxScUQN+uYDjIId/MAjqR+r46HGQGBBDTn3KaFQ6f34I3XtivStSDEMahR zgEALcHJKLyYSoFoWALCrjyuJ6th7zMwWwNJyrvGan8KvpbSEw7JVdYnWyarqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdspn4dbDzyF5; Sat, 18 Mar 2023 07:20:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I7KX7j030613; Sat, 18 Mar 2023 07:20:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I7KXOc030612; Sat, 18 Mar 2023 07:20:33 GMT (envelope-from git) Date: Sat, 18 Mar 2023 07:20:33 GMT Message-Id: <202303180720.32I7KXOc030612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu <whu@FreeBSD.org> Subject: git: 927358dd98cb - main - amd64 loader: Use efiserialio for Hyper-V booted systems List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 927358dd98cb902160093e0dc0bac002d6b43858 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=927358dd98cb902160093e0dc0bac002d6b43858 commit 927358dd98cb902160093e0dc0bac002d6b43858 Author: Wei Hu <whu@FreeBSD.org> AuthorDate: 2023-03-14 15:13:46 +0000 Commit: Wei Hu <whu@FreeBSD.org> CommitDate: 2023-03-18 07:07:35 +0000 amd64 loader: Use efiserialio for Hyper-V booted systems UEFI provides ConIn/ConOut handles for consoles that it supports, which include the text-video and serial ports. When the serial port is available, use the UEFI driver instead of direct io-port accesses to avoid conflicts between the firmware and direct hardware access, as happens on Hyper-V (Azure) setups. This change enables efiserialio to be built for efi-amd64 and has higher order priority vs comconsole, and only uses efiserialio if the hypervisor is Hyper-V. When efiserialio successfully probes, it will set efi_comconsole_avail=true which will prevent comconsole from probing in this setup. Tested on Hyper-V, ESXi and Azure VMs. PR: 264267 Reviewed by: kevans, whu Tested by: whu Obtained from: Rubicon Communications, LLC (Netgate) MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) --- stand/efi/loader/arch/amd64/Makefile.inc | 1 + stand/efi/loader/bootinfo.c | 11 ++++++-- stand/efi/loader/conf.c | 6 +++++ stand/efi/loader/efiserialio.c | 43 ++++++++++++++++++++++++++++---- stand/i386/libi386/comconsole.c | 14 +++++++++++ 5 files changed, 68 insertions(+), 7 deletions(-) diff --git a/stand/efi/loader/arch/amd64/Makefile.inc b/stand/efi/loader/arch/amd64/Makefile.inc index 0d9e2648cb59..bd89044bd6c7 100644 --- a/stand/efi/loader/arch/amd64/Makefile.inc +++ b/stand/efi/loader/arch/amd64/Makefile.inc @@ -5,6 +5,7 @@ SRCS+= amd64_tramp.S \ elf64_freebsd.c \ trap.c \ multiboot2.c \ + efiserialio.c \ exc.S .PATH: ${BOOTSRC}/i386/libi386 diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 939f2cf4c3fe..d79f59343af1 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -119,10 +119,17 @@ bi_getboothowto(char *kargs) if (tmp != NULL) speed = strtol(tmp, NULL, 0); tmp = getenv("efi_com_port"); - if (tmp == NULL) - tmp = getenv("comconsole_port"); if (tmp != NULL) port = strtol(tmp, NULL, 0); + if (port <= 0) { + tmp = getenv("comconsole_port"); + if (tmp != NULL) + port = strtol(tmp, NULL, 0); + else { + if (port == 0) + port = 0x3f8; + } + } if (speed != -1 && port != -1) { snprintf(buf, sizeof(buf), "io:%d,br:%d", port, speed); diff --git a/stand/efi/loader/conf.c b/stand/efi/loader/conf.c index 863c9188c72c..051e1a3381d1 100644 --- a/stand/efi/loader/conf.c +++ b/stand/efi/loader/conf.c @@ -81,6 +81,9 @@ struct netif_driver *netif_drivers[] = { extern struct console efi_console; extern struct console comconsole; +#if defined(__amd64__) +extern struct console eficomconsole; +#endif #if defined(__amd64__) || defined(__i386__) extern struct console nullconsole; extern struct console spinconsole; @@ -88,6 +91,9 @@ extern struct console spinconsole; struct console *consoles[] = { &efi_console, +#if defined(__amd64__) + &eficomconsole, +#endif &comconsole, #if defined(__amd64__) || defined(__i386__) &nullconsole, diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loader/efiserialio.c index 375e679d2590..5fbc700f6ac2 100644 --- a/stand/efi/loader/efiserialio.c +++ b/stand/efi/loader/efiserialio.c @@ -69,6 +69,11 @@ static int comc_speed_set(struct env_var *, int, const void *); static struct serial *comc_port; extern struct console efi_console; +bool efi_comconsole_avail = false; + +#if defined(__amd64__) +#define comconsole eficomconsole +#endif struct console comconsole = { .c_name = "comconsole", @@ -254,11 +259,22 @@ comc_probe(struct console *sc) char *env, *buf, *ep; size_t sz; +#if defined(__amd64__) + /* + * For x86-64, don't use this driver if not running in Hyper-V. + */ + env = getenv("smbios.bios.version"); + if (env == NULL || strncmp(env, "Hyper-V", 7) != 0) { + return; + } +#endif + if (comc_port == NULL) { comc_port = calloc(1, sizeof (struct serial)); if (comc_port == NULL) return; } + /* Use defaults from firmware */ comc_port->databits = 8; comc_port->parity = DefaultParity; @@ -308,6 +324,10 @@ comc_probe(struct console *sc) comc_port_set, env_nounset); env = getenv("efi_com_speed"); + if (env == NULL) + /* fallback to comconsole setting */ + env = getenv("comconsole_speed"); + if (comc_parse_intval(env, &val) == CMD_OK) comc_port->baudrate = val; @@ -318,8 +338,13 @@ comc_probe(struct console *sc) comc_speed_set, env_nounset); comconsole.c_flags = 0; - if (comc_setup()) + if (comc_setup()) { sc->c_flags = C_PRESENTIN | C_PRESENTOUT; + efi_comconsole_avail = true; + } else { + /* disable being seen as "comconsole" */ + comconsole.c_name = "efiserialio"; + } } static int @@ -489,6 +514,7 @@ comc_setup(void) { EFI_STATUS status; UINT32 control; + char *ev; /* port is not usable */ if (comc_port->sio == NULL) @@ -498,10 +524,17 @@ comc_setup(void) if (EFI_ERROR(status)) return (false); - status = comc_port->sio->SetAttributes(comc_port->sio, - comc_port->baudrate, comc_port->receivefifodepth, - comc_port->timeout, comc_port->parity, - comc_port->databits, comc_port->stopbits); + ev = getenv("smbios.bios.version"); + if (ev != NULL && strncmp(ev, "Hyper-V", 7) == 0) { + status = comc_port->sio->SetAttributes(comc_port->sio, + 0, 0, 0, DefaultParity, 0, DefaultStopBits); + } else { + status = comc_port->sio->SetAttributes(comc_port->sio, + comc_port->baudrate, comc_port->receivefifodepth, + comc_port->timeout, comc_port->parity, + comc_port->databits, comc_port->stopbits); + } + if (EFI_ERROR(status)) return (false); diff --git a/stand/i386/libi386/comconsole.c b/stand/i386/libi386/comconsole.c index ed1f1aa08ed7..3fbb6a292c19 100644 --- a/stand/i386/libi386/comconsole.c +++ b/stand/i386/libi386/comconsole.c @@ -85,6 +85,20 @@ comc_probe(struct console *cp) int speed, port; uint32_t locator; +#if defined(__amd64__) + extern bool efi_comconsole_avail; + + if (efi_comconsole_avail) { + /* + * If EFI provides serial I/O, then don't use this legacy + * com driver to avoid conflicts with the firmware's driver. + * Change c_name so that it cannot be found in the lookup. + */ + comconsole.c_name = "xcomconsole"; + return; + } +#endif + if (comc_curspeed == 0) { comc_curspeed = COMSPEED; /* From nobody Sat Mar 18 07:20:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdspq35f8z3yDlN; Sat, 18 Mar 2023 07:20: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 4Pdspp6TB4z3Pcg; Sat, 18 Mar 2023 07:20:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679124034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JJlWaoZ5p2JG8xMS5pYI3Zo+WKYqe2+4VpFzZTAFUlY=; b=CinMG0nXdV0L1IO3lH1IZYvWOmtpBWyzxS0Mu0DyLgtH8SjpfXfcMGlyqkxN+Iu1B2IN5E cZkTIHcex5cU49ourwvvPImoRaKrCMISlQAgcxrKYyOWux4SIUeFwZTAS1ErUxMJp/TDjj kotEuVT/U6lIUPYeH94ldxquSpaK56OzwXdLtd1q9m2UhEhaZM6dv+ZdQoDIU9BV/JjxZ9 bd4u9aI4yhpLvpVIIjglrsyd26q+igAZcF59RO4CZUVEnQJ2ZhpZzNTVXE/lI14ebn63DY Yv1Zw6UDx5Jvi6oxe6ux3BOfoMuSTQ02xRQ+vBN07TDZl2Cj8268ZWsyv/rUJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679124034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JJlWaoZ5p2JG8xMS5pYI3Zo+WKYqe2+4VpFzZTAFUlY=; b=gZaxxXWiTiafD94aET1sahMSK5YwJXCdMEBauT3tvFi+Z3NvoXQ6vMT39W5U2RPmW6E+pX hXsQqk3m/TXiyYbfUpkg3CAMX+JjqpN6pS97zuATIQB1JvHZqk1DQ3KWqztIQ87KYHiQxA 7IPui6OuxMkvfuXMR8hH97T5dYxBkhRwPAmE0OSgH260eCerTgsGgXvdRnAmThkbpDxQKO vxQpW4TnC6szIsV0aFj83om5H/uYRPFKUXaPeGHxue3D/1AJdecSGLpwH0xJq02d+bEwmP TQYXboQDOhGE3kgM0J9I9+2WFtXxLp43T61SxHvItas6/lVHoD4glxyOcqE0VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679124034; a=rsa-sha256; cv=none; b=Z0LyOMWIMdIUE1euEB63xRpvXKhbPWVlJCMNTp19HT69Lbg+4BFJkseQKzG2NU7ps0CfEo hQTaHBhf/U+y2YsgGBmVtGvNdlVoW+BIAlsxrasvCRK4iLW184vxx8aa2tGTvAmZCZOwZG hBltZoJJ5xvAWQQFiTLXqpQGZ5F+Hg0h8KnYNc0xAxYDyj2kmXmoh3ToevK0Nlx0T2ykwl jPbLkOPGrgeA4guDCuG/QnK/DPXLY0iJY642l9SSWc5zd6z1ri5u6bC95maNd8b+lWJtI9 ttmnRGsPx9AMnnFuH49LJFlEAcOI+cpeoHdqWpirObhZJgj9ghR+yJBmanWJnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdspp5GtgzyZq; Sat, 18 Mar 2023 07:20:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I7KYrf030633; Sat, 18 Mar 2023 07:20:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I7KYlc030632; Sat, 18 Mar 2023 07:20:34 GMT (envelope-from git) Date: Sat, 18 Mar 2023 07:20:34 GMT Message-Id: <202303180720.32I7KYlc030632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu <whu@FreeBSD.org> Subject: git: 8ea7fa16d9fe - main - uart: Don't change settings or throttle putc for Hyper-V List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ea7fa16d9fe5acb7d42a223efbfa23627aa5e0c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=8ea7fa16d9fe5acb7d42a223efbfa23627aa5e0c commit 8ea7fa16d9fe5acb7d42a223efbfa23627aa5e0c Author: Wei Hu <whu@FreeBSD.org> AuthorDate: 2023-03-14 15:49:33 +0000 Commit: Wei Hu <whu@FreeBSD.org> CommitDate: 2023-03-18 07:07:54 +0000 uart: Don't change settings or throttle putc for Hyper-V Azure setup does not like it when FreeBSD overrides the settings of the UART device. When Hyper-V is detected, don't do this and also don't throttle putc() output. This is a workaround for the early boot hang of FreeBSD on Azure. Tested on Azure, ESXi (VM with serial port), and SG-8200 PR: 264267 Reviewed by: kevans, whu Tested by: whu Obtained from: Rubicon Communications, LLC (Netgate) MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) --- sys/dev/uart/uart_dev_ns8250.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index 475ab5d4425e..2c44e9e34b8b 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -249,6 +249,10 @@ ns8250_param(struct uart_bas *bas, int baudrate, int databits, int stopbits, int divisor; uint8_t lcr; + /* Don't change settings when running on Hyper-V */ + if (vm_guest == VM_GUEST_HV) + return (0); + lcr = 0; if (databits >= 8) lcr |= LCR_8BITS; @@ -374,9 +378,11 @@ ns8250_putc(struct uart_bas *bas, int c) { int limit; - limit = 250000; - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0 && --limit) - DELAY(4); + if (vm_guest != VM_GUEST_HV) { + limit = 250000; + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0 && --limit) + DELAY(4); + } uart_setreg(bas, REG_DATA, c); uart_barrier(bas); } @@ -532,15 +538,15 @@ ns8250_bus_attach(struct uart_softc *sc) #endif if (!resource_int_value("uart", device_get_unit(sc->sc_dev), "flags", &ivar)) { - if (UART_FLAGS_FCR_RX_LOW(ivar)) + if (UART_FLAGS_FCR_RX_LOW(ivar)) ns8250->fcr |= FCR_RX_LOW; - else if (UART_FLAGS_FCR_RX_MEDL(ivar)) + else if (UART_FLAGS_FCR_RX_MEDL(ivar)) ns8250->fcr |= FCR_RX_MEDL; - else if (UART_FLAGS_FCR_RX_HIGH(ivar)) + else if (UART_FLAGS_FCR_RX_HIGH(ivar)) ns8250->fcr |= FCR_RX_HIGH; else ns8250->fcr |= FCR_RX_MEDH; - } else + } else ns8250->fcr |= FCR_RX_MEDH; /* Get IER mask */ From nobody Sat Mar 18 09:03:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdw5J3m6Wz3yKZX; Sat, 18 Mar 2023 09:03: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 4Pdw5J3HhYz3nQ0; Sat, 18 Mar 2023 09:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679130196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mjj05+38Vqn8wkterGk2tV3h2S3WOltwrzPbq8J7CIs=; b=BllEjzuYv6sKlBmlSgO8HkoeJlsrhSw1RvnyoeQq2F+yKMCo9SR3+h0PoVppuP+1HRaNRU pVPuFTpNWx4UUy97txYxDfzgataxH32qSEfhQHRhrGrRTUj692LJLmH64lqLt8SIqak1vj i6TZPAN0Lu3a9lBYf6LFGR9gYswZnylfHhWNGq09Uw4tqE3FobQcoSEbDvokaUkqv2ycYb N5f4lyz+5OBvYJp+PUO8Q7D7+jd7nG4OnsnGQ1oret2HTq6Mw77ljHwbPnq7Qb3IIuSzB1 Sgg7umd02ZBdBYYVJacYJAG8JUV66rczMzzOW8m3YDUWWWqL/9VXAYKjifovLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679130196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mjj05+38Vqn8wkterGk2tV3h2S3WOltwrzPbq8J7CIs=; b=F5UydiLDIcf01QFgCsGFFSsXvfnHoGjTPrZ161x9qzmMwjtThG6VaPfpjbdW3LdShTIPeM 7++N+7WLHiST2dxHC1l9Tm9SRIAU6GEwbu75Yjblm4zUbOEQxdoOZPbtIWRgUkqC8f5OaR kdik/KWiOJ3WyiVh5ybDMubb3EA2Uy0XfLudEE7GVKsmpKi6j8qGPOb9WdUz1vWB8dzT5I RbT2SsDJAAvdt7tBRHgkebHu3XJNZRvDUZT0Sy55B57t+f6bdAJP9eg0fkKmQCFHW4X57P NoLZdijBoH2nMTybK9cHM8rU1tTV+6C/xvkfrBRc94VPTd+rlatSxTJ8jgE7/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679130196; a=rsa-sha256; cv=none; b=XQQu+jb6wx6mnH2WkRZfsnUAKC1FE9avUlujI7S6jJhIou8S2+KijcX9BBtwzCAkoT2rWF VkaHJQzVLdY2Kr+4y/XRp41xqqe6t6wAhE2Pq35fOGsnjZ9C88dPC4/VwoJfVC/d7BsuLh Iy8aqd9noVDaSMaq/09pbZubMGd1pI90k1CAEL1COUz+GBeFcD39cJXZA/SWkjhQ3lzuWx QWtvvoOS/89iO+E8WSeR/KMXm4Cb+UqiJsPJ2Xd1ocGIylm4LNZPN2dgobfkN+6A9CCMzi tgXDjXBhEAQXabg/73FBSRckAOfIahjs1YZWFNZkEM3eHAYpXgI3nbG7Bs3VDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdw5J2LBpz11mt; Sat, 18 Mar 2023 09:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I93Gtt001467; Sat, 18 Mar 2023 09:03:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I93Ges001466; Sat, 18 Mar 2023 09:03:16 GMT (envelope-from git) Date: Sat, 18 Mar 2023 09:03:16 GMT Message-Id: <202303180903.32I93Ges001466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling <gbe@FreeBSD.org> Subject: git: ac6bc808f516 - main - smbfs.5: Us .An -nosplit for the AUTHORS section List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac6bc808f51654414cb7a72f6849b3e61b1fb172 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=ac6bc808f51654414cb7a72f6849b3e61b1fb172 commit ac6bc808f51654414cb7a72f6849b3e61b1fb172 Author: Gordon Bergling <gbe@FreeBSD.org> AuthorDate: 2023-03-18 09:02:59 +0000 Commit: Gordon Bergling <gbe@FreeBSD.org> CommitDate: 2023-03-18 09:02:59 +0000 smbfs.5: Us .An -nosplit for the AUTHORS section Use .An -nosplit for the AUTHORS section, so that it renders without an unnecessary newline. No .Dd bump since it isn't a content change. MFC after: 3 days --- share/man/man5/smbfs.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man5/smbfs.5 b/share/man/man5/smbfs.5 index 79eaa9b20b39..7db97df14c1f 100644 --- a/share/man/man5/smbfs.5 +++ b/share/man/man5/smbfs.5 @@ -64,7 +64,6 @@ Users are advised to evaluate the .Pa sysutils/fusefs-smbnetfs port instead. .Ef -.Pp .Sh SEE ALSO .Xr smbutil 1 , .Xr mount_smbfs 8 @@ -90,6 +89,7 @@ The device driver first appeared in .Fx 4.4 . .Sh AUTHORS +.An -nosplit The .Nm device driver was written by From nobody Sat Mar 18 09:32:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdwkZ4QChz3yMW4; Sat, 18 Mar 2023 09:32: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 4PdwkZ13zxz3pj2; Sat, 18 Mar 2023 09:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679131926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ortqTlTmvjNOdqBOgwPxJBUS+PrTkJRMAzK/e5X2KwA=; b=iVcojRMCgmbv7YTCs0vkT5WM2Djs/y64EAGHgzw8SvoCKrF6ycf1his0V+3/X4LYn7nqsP lmXT2tQ/konCmBOETNq3zNpNn4QIhhSvuX975ojXnk2XlJGBz0HWRw3d2jkhLaexnfLNE4 rQHRC/+nHTZ+w3N0D/yLiT2olseLB5ZLF/2rz09vY5Qiqm4YXvvhXAghB4cB+AAg5nbqs6 UOuC9jWWKyhBIXUt3X8O4N3XsoLswp4/Tsb1NU4DsLgzwi2xXYxPY4feQvgSnu4+5Z5Wb9 3ia3Mgb16HQbn3p/2d0P7aKzNqgK41vgpwq5uECGO2Q1AVhsPaT2HZZthHVYoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679131926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ortqTlTmvjNOdqBOgwPxJBUS+PrTkJRMAzK/e5X2KwA=; b=onigkoYJRPvJyroxCtOkVnFiNlHg2vOrMbJiKUwTf0qo/u3C2GlpVrgSzvtE8HUKgmRQrA uAroLAsQU6rRQUghF+8VH0G52jM3Y3vejQ3xBa3CkFzMsLknwEIQ+Tb56iyLbdGIu+BqWE 1xSFb+mHPKToVyQ4jXQg+3nEt+AiQu60Gkct5Pi9kwRVKCETwvx8czGwnKsptL/LW1ShK5 6Bc0cT3zcDVuXS7LEVx/XVOEsRuytmgNh1f4YZBkrh/nLHKLNaP1WzC67gRz8eZZr7q4+B SVL6kPOaslxpmsJYc7F6YbTr0hmvoSgL+sXxSZsxwhokPoK0DF7C1y2g0SbQ5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679131926; a=rsa-sha256; cv=none; b=j8klJjwwYcWNBYhZHOcVG9AbxlfLgQ8iufGjteiY/ePw6A9ZaHILGGA9vlpNn+/oce+oRf NPut0GCiruD79kz9kHSoY4YNbIt77Z5jg6SbxAuYS01qsGiNsvS1SIkKdwb2CvQX+orwOC EYvaSGBadox/Mx2xYCwrl0P8OXkZ0RYl0AIPtWM47LySwqrdJ3tYhsCHjcqmdoj7bz+RQ4 wIOJ9VlpcckBnv+dV9CohIbpnq3VudC2AZ+9LrhAvOgIgp8ANTIMQ12hTRyrWDtcH7B630 67VQZPeAntjcfKlfCrwRLTqCpZ5tMiNfg0lXdPnXBoI1p7rJTcWjkwnsrMDEIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdwkZ09kjz127P; Sat, 18 Mar 2023 09:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32I9W5U8047127; Sat, 18 Mar 2023 09:32:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32I9W5ED047126; Sat, 18 Mar 2023 09:32:05 GMT (envelope-from git) Date: Sat, 18 Mar 2023 09:32:05 GMT Message-Id: <202303180932.32I9W5ED047126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm <pho@FreeBSD.org> Subject: git: bce30c896db6 - main - stress2: Added two syzkaller reproducers List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bce30c896db6ffbc1bf2bbd1507c154818202ae0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=bce30c896db6ffbc1bf2bbd1507c154818202ae0 commit bce30c896db6ffbc1bf2bbd1507c154818202ae0 Author: Peter Holm <pho@FreeBSD.org> AuthorDate: 2023-03-18 09:31:31 +0000 Commit: Peter Holm <pho@FreeBSD.org> CommitDate: 2023-03-18 09:31:31 +0000 stress2: Added two syzkaller reproducers --- tools/test/stress2/misc/all.exclude | 1 + tools/test/stress2/misc/syzkaller64.sh | 328 +++++++++++++++++++++++++++++++++ tools/test/stress2/misc/syzkaller65.sh | 82 +++++++++ 3 files changed, 411 insertions(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index 8c63a8fc7143..2f4e04473eff 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -66,6 +66,7 @@ syzkaller50.sh panic: Assertion done != job_total_nbytes failed at ... 2022040 syzkaller54.sh panic: td 0xfffffe014f7193a0 is not suspended 20220527 syzkaller55.sh panic: Counter goes negative 20220525 syzkaller59.sh Page fault 20220625 +syzkaller65.sh Waiting for fix 20230318 truss3.sh WiP 20200915 unionfs9.sh https://people.freebsd.org/~pho/stress/log/log0404.txt 20230110 diff --git a/tools/test/stress2/misc/syzkaller64.sh b/tools/test/stress2/misc/syzkaller64.sh new file mode 100755 index 000000000000..c9a88f2184a6 --- /dev/null +++ b/tools/test/stress2/misc/syzkaller64.sh @@ -0,0 +1,328 @@ +#!/bin/sh + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +[ "`sysctl -in kern.features.kasan`" != "1" ] && exit 0 + +. ../default.cfg +prog=$(basename "$0" .sh) +cat > /tmp/$prog.c <<EOF +// https://syzkaller.appspot.com/bug?id=749aa1fdb67018e9c0179373a60d523511bff02c +// autogenerated by syzkaller (https://github.com/google/syzkaller) +// Reported-by: syzbot+5cb51285603332d9be11@syzkaller.appspotmail.com + +#define _GNU_SOURCE + +#include <sys/types.h> + +#include <errno.h> +#include <pthread.h> +#include <pwd.h> +#include <setjmp.h> +#include <signal.h> +#include <stdarg.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/endian.h> +#include <sys/resource.h> +#include <sys/syscall.h> +#include <sys/wait.h> +#include <time.h> +#include <unistd.h> + +static __thread int clone_ongoing; +static __thread int skip_segv; +static __thread jmp_buf segv_env; + +static void segv_handler(int sig, siginfo_t* info, void* ctx __unused) +{ + if (__atomic_load_n(&clone_ongoing, __ATOMIC_RELAXED) != 0) { + exit(sig); + } + uintptr_t addr = (uintptr_t)info->si_addr; + const uintptr_t prog_start = 1 << 20; + const uintptr_t prog_end = 100 << 20; + int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0; + int valid = addr < prog_start || addr > prog_end; + if (sig == SIGBUS) + valid = 1; + if (skip && valid) { + _longjmp(segv_env, 1); + } + exit(sig); +} + +static void install_segv_handler(void) +{ + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sa.sa_sigaction = segv_handler; + sa.sa_flags = SA_NODEFER | SA_SIGINFO; + sigaction(SIGSEGV, &sa, NULL); + sigaction(SIGBUS, &sa, NULL); +} + +#define NONFAILING(...) \ + ({ \ + int ok = 1; \ + __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ + if (_setjmp(segv_env) == 0) { \ + __VA_ARGS__; \ + } else \ + ok = 0; \ + __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ + ok; \ + }) + +static void kill_and_wait(int pid, int* status) +{ + kill(pid, SIGKILL); + while (waitpid(-1, status, 0) != pid) { + } +} + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i = 0; + for (; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static void sandbox_common() +{ + struct rlimit rlim; + rlim.rlim_cur = rlim.rlim_max = 128 << 20; + setrlimit(RLIMIT_AS, &rlim); + rlim.rlim_cur = rlim.rlim_max = 8 << 20; + setrlimit(RLIMIT_MEMLOCK, &rlim); + rlim.rlim_cur = rlim.rlim_max = 1 << 20; + setrlimit(RLIMIT_FSIZE, &rlim); + rlim.rlim_cur = rlim.rlim_max = 1 << 20; + setrlimit(RLIMIT_STACK, &rlim); + rlim.rlim_cur = rlim.rlim_max = 0; + setrlimit(RLIMIT_CORE, &rlim); + rlim.rlim_cur = rlim.rlim_max = 256; + setrlimit(RLIMIT_NOFILE, &rlim); +} + +static void loop(); + +static int do_sandbox_none(void) +{ + sandbox_common(); + loop(); + return 0; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void execute_one(void) +{ + int i, call, thread; + for (call = 0; call < 5; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + event_timedwait(&th->done, 50); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); +} + +static void execute_one(void); + +#define WAIT_FLAGS 0 + +static void loop(void) +{ + int iter = 0; + for (;; iter++) { + int pid = fork(); + if (pid < 0) + exit(1); + if (pid == 0) { + execute_one(); + exit(0); + } + int status = 0; + uint64_t start = current_time_ms(); + for (;;) { + if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) + break; + sleep_ms(1); + if (current_time_ms() - start < 5000) + continue; + kill_and_wait(pid, &status); + break; + } + } +} + +void execute_call(int call) +{ + switch (call) { + case 0: + syscall(SYS_thr_new, 0ul, 0ul); + break; + case 1: + syscall(SYS_setloginclass, 0ul); + break; + case 2: + syscall(SYS_vfork); + break; + case 3: + NONFAILING(*(uint32_t*)0x20001880 = 4); + syscall(SYS_sysarch, 8ul, 0x20001880ul); + break; + case 4: + syscall(SYS_getsid, 0); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + install_segv_handler(); + do_sandbox_none(); + return 0; +} +EOF +mycc -o /tmp/$prog -Wall -Wextra -O0 /tmp/$prog.c -lpthread || exit 1 + +(cd /tmp; timeout 2m ./$prog) + +rm -rf /tmp/$prog /tmp/$prog.c /tmp/syzkaller.* +exit 0 diff --git a/tools/test/stress2/misc/syzkaller65.sh b/tools/test/stress2/misc/syzkaller65.sh new file mode 100755 index 000000000000..8806a55e2733 --- /dev/null +++ b/tools/test/stress2/misc/syzkaller65.sh @@ -0,0 +1,82 @@ +#!/bin/sh + +# panic: in_pcblookup_hash_locked: invalid local address +# cpuid = 11 +# time = 1678303805 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0657e466d0 +# vpanic() at vpanic+0x152/frame 0xfffffe0657e46720 +# panic() at panic+0x43/frame 0xfffffe0657e46780 +# in_pcblookup_hash_locked() at in_pcblookup_hash_locked+0x4e2/frame 0xfffffe0657e467f0 +# in_pcb_lport_dest() at in_pcb_lport_dest+0x28a/frame 0xfffffe0657e468a0 +# in_pcbconnect_setup() at in_pcbconnect_setup+0x31b/frame 0xfffffe0657e46940 +# udp_send() at udp_send+0x68b/frame 0xfffffe0657e46a50 +# udp6_send() at udp6_send+0x287/frame 0xfffffe0657e46c10 +# sosend_dgram() at sosend_dgram+0x327/frame 0xfffffe0657e46c70 +# sousrsend() at sousrsend+0x7e/frame 0xfffffe0657e46cd0 +# kern_sendit() at kern_sendit+0x1bc/frame 0xfffffe0657e46d60 +# sendit() at sendit+0xba/frame 0xfffffe0657e46db0 +# sys_sendto() at sys_sendto+0x4d/frame 0xfffffe0657e46e00 +# amd64_syscall() at amd64_syscall+0x15a/frame 0xfffffe0657e46f30 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe0657e46f30 +# --- syscall (0, FreeBSD ELF64, syscall), rip = 0x822a3a31a, rsp = 0x8208224d8, rbp = 0x820822500 --- +# KDB: enter: panic +# [ thread pid 47141 tid 357973 ] +# Stopped at kdb_enter+0x32: movq $0,0x12906d3(%rip) +# db> x/s version +# FreeBSD 14.0-CURRENT #0 main-n261389-109abf744bf76: Wed Mar 8 06:10:24 CET 2023 +# pho@mercat1.netperf.freebsd.org:/usr/src/sys/a +# db> + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +prog=$(basename "$0" .sh) +cat > /tmp/$prog.c <<EOF +// https://syzkaller.appspot.com/bug?id=7cae38958ddfe2c338548b4217587bd6d89b43e2 +// autogenerated by syzkaller (https://github.com/google/syzkaller) +// Reported-by: syzbot+c8e3dac881bba85bc029@syzkaller.appspotmail.com + +#define _GNU_SOURCE + +#include <pwd.h> +#include <stdarg.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/endian.h> +#include <sys/syscall.h> +#include <unistd.h> + +uint64_t r[1] = {0xffffffffffffffff}; + +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + intptr_t res = 0; + res = syscall(SYS_socket, 0x1cul, 2ul, 0); + if (res != -1) + r[0] = res; + *(uint32_t*)0x200001c0 = 0; + syscall(SYS_setsockopt, r[0], 0x29, 0x1b, 0x200001c0ul, 4ul); + *(uint8_t*)0x20000000 = 0x1c; + *(uint8_t*)0x20000001 = 0x1c; + *(uint16_t*)0x20000002 = htobe16(0x4e22); + *(uint32_t*)0x20000004 = 0; + memset((void*)0x20000008, 0, 10); + memset((void*)0x20000012, 255, 2); + *(uint32_t*)0x20000014 = htobe32(0); + *(uint32_t*)0x20000018 = 0; + syscall(SYS_sendto, r[0], 0ul, 0ul, 0ul, 0x20000000ul, 0x1cul); + return 0; +} +EOF +mycc -o /tmp/$prog -Wall -Wextra -O0 /tmp/$prog.c -lpthread || exit 1 + +(cd /tmp; timeout 2m ./$prog) + +rm -rf /tmp/$prog /tmp/$prog.c /tmp/syzkaller.* +exit 0 From nobody Sat Mar 18 11:36:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PdzVG2gybz3yTcF; Sat, 18 Mar 2023 11:36: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 4PdzVG267Qz40Lx; Sat, 18 Mar 2023 11:36:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679139398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CvDhIJq09GcOKhIW/uDFeW6Fhyo8dDFxO+mxsRvpBYM=; b=UzHmAKkDoJmQctz1WGd46OGibi2odBHJD53KevLwVprvC1KYhYWjJvFzNOgD5nrbUt54at 2d2LlY4T0frJ22iq+MLIzojI2FcNuhoc3tYlcMjKjVaoK1yzExIe+G9SQQEOUCsPQHpeHc kL39PoFHSZUpBGrnbWomBYuYYZrFV2BtmOpN0NhpWY6hEJ9vIu3+X36DdFp4HSatfv1e7l PvmUERJDM9mbS1nhqxdmEdeMZorlzrNfrncRVkWvGj4OzNF2Q3rKVDW4VBHHP/Yo+7VfJt HRZwa0Hag1Q4eN23pSop4V1W8WTpyl17deePEjvWjUlHONPO3Ho/uQ8iDdxqnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679139398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CvDhIJq09GcOKhIW/uDFeW6Fhyo8dDFxO+mxsRvpBYM=; b=i5iF74hDu7kXvLT0nQM2A1HzApUHYMwCGVYhO+mCeCV5C40XfB2YU53feycfD2oLXUEE4M uQY2ACUus6Y3wmICXfE74V/alOwfYSmNIN+3ySX6yu0gPdOojBbtCmcuvQvByAEJ9l3MVP cyGOLXSPke/+hUwFGWu/2TvNLUtD1cQDxC7LnyQonQ1aNurIabI23kzDR8cyh+dtxVNA9g GWjZ2hoz/k2hVxgLJARGvv0nJAeZwnePXnA3kPN7+WW4gqzZEV8Nljvut3SEJI2INfd4ZH /XLVsXkZ8dXxbB6ucWGxOtqFDhsngp8RA2qbwLpgN3KYUDH/4Knw5+Pq4v8mPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679139398; a=rsa-sha256; cv=none; b=heKAQqShJ95ClXaAu+LCwQHN5xdWygqt4YCeqPZlkV3Y7qIZtZzYLFBuI/kJsjvjYU/aBf OILMF78PmkDGXGvL+X8X6sgQueTZSBLFNDBjyOMDx2BWYVlwDTG7sr2OjMbU0bkVT6hpcG LDA1z68WmU1bAsJzQNCV1F8fVfIE5r46fwO6Jh7j0dDcPGJoVBMNKC85u4/v6cT0GuqYqF +zo3ZdIhPMoV5w5Jiezqy3blHGznNrnp5VoMDb4PzDkWHPXpSxoz6ETRRLB4Z3lz7tsfmL K56V3R9b3BTjnJRike3UU/pF1TJRG1J5/X1baoY4gW/wGPFvCrEhVJOPGl2ojA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdzVG17Blz15ZR; Sat, 18 Mar 2023 11:36:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IBacSZ047605; Sat, 18 Mar 2023 11:36:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IBacG0047604; Sat, 18 Mar 2023 11:36:38 GMT (envelope-from git) Date: Sat, 18 Mar 2023 11:36:38 GMT Message-Id: <202303181136.32IBacG0047604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> Subject: git: 568a645ba55a - main - netlink: fix capped uncapped ack handling in snl(3). List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 568a645ba55a1c3fc4fc74735cb0fab08bfe4cbf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=568a645ba55a1c3fc4fc74735cb0fab08bfe4cbf commit 568a645ba55a1c3fc4fc74735cb0fab08bfe4cbf Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-03-17 14:27:08 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-03-18 11:35:56 +0000 netlink: fix capped uncapped ack handling in snl(3). Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D39144 MFC after: 2 weeks --- sys/netlink/netlink_snl.h | 52 ++++++++++++++---- tests/sys/netlink/test_snl.c | 126 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+), 11 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index be512b67c7ec..935012885362 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -388,18 +388,25 @@ snl_parse_attrs(struct snl_state *ss, struct nlmsghdr *hdr, int hdrlen, return (snl_parse_attrs_raw(ss, nla_head, len, ps, pslen, target)); } -static inline bool -snl_parse_header(struct snl_state *ss, void *hdr, int len, - const struct snl_hdr_parser *parser, void *target) +static inline void +snl_parse_fields(struct snl_state *ss, struct nlmsghdr *hdr, int hdrlen __unused, + const struct snl_field_parser *ps, int pslen, void *target) { - /* Extract fields first (if any) */ - for (int i = 0; i < parser->fp_size; i++) { - const struct snl_field_parser *fp = &parser->fp[i]; + for (int i = 0; i < pslen; i++) { + const struct snl_field_parser *fp = &ps[i]; void *src = (char *)hdr + fp->off_in; void *dst = (char *)target + fp->off_out; fp->cb(ss, src, dst); } +} + +static inline bool +snl_parse_header(struct snl_state *ss, void *hdr, int len, + const struct snl_hdr_parser *parser, void *target) +{ + /* Extract fields first (if any) */ + snl_parse_fields(ss, hdr, parser->hdr_off, parser->fp, parser->fp_size, target); struct nlattr *nla_head = (struct nlattr *)(void *)((char *)hdr + parser->hdr_off); bool result = snl_parse_attrs_raw(ss, nla_head, len - parser->hdr_off, @@ -575,13 +582,20 @@ snl_field_get_uint32(struct snl_state *ss __unused, void *src, void *target) *((uint32_t *)target) = *((uint32_t *)src); } +static inline void +snl_field_get_ptr(struct snl_state *ss __unused, void *src, void *target) +{ + *((void **)target) = src; +} + struct snl_errmsg_data { - uint32_t nlmsg_seq; + struct nlmsghdr *orig_hdr; int error; - char *error_str; uint32_t error_offs; + char *error_str; struct nlattr *cookie; }; + #define _IN(_field) offsetof(struct nlmsgerr, _field) #define _OUT(_field) offsetof(struct snl_errmsg_data, _field) static const struct snl_attr_parser nla_p_errmsg[] = { @@ -592,7 +606,7 @@ static const struct snl_attr_parser nla_p_errmsg[] = { static const struct snl_field_parser nlf_p_errmsg[] = { { .off_in = _IN(error), .off_out = _OUT(error), .cb = snl_field_get_uint32 }, - { .off_in = _IN(msg.nlmsg_seq), .off_out = _OUT(nlmsg_seq), .cb = snl_field_get_uint32 }, + { .off_in = _IN(msg), .off_out = _OUT(orig_hdr), .cb = snl_field_get_ptr }, }; #undef _IN #undef _OUT @@ -609,6 +623,22 @@ static const struct snl_field_parser nlf_p_donemsg[] = { #undef _OUT SNL_DECLARE_PARSER(snl_donemsg_parser, struct nlmsgerr, nlf_p_donemsg, nla_p_donemsg); +static inline bool +snl_parse_errmsg(struct snl_state *ss, struct nlmsghdr *hdr, struct snl_errmsg_data *e) +{ + if ((hdr->nlmsg_flags & NLM_F_CAPPED) != 0) + return (snl_parse_nlmsg(ss, hdr, &snl_errmsg_parser, e)); + + const struct snl_hdr_parser *ps = &snl_errmsg_parser; + struct nlmsgerr *errmsg = (struct nlmsgerr *)(hdr + 1); + int hdrlen = sizeof(int) + NLMSG_ALIGN(errmsg->msg.nlmsg_len); + struct nlattr *attr_head = (struct nlattr *)(void *)((char *)errmsg + hdrlen); + int attr_len = hdr->nlmsg_len - sizeof(struct nlmsghdr) - hdrlen; + + snl_parse_fields(ss, (struct nlmsghdr *)errmsg, hdrlen, ps->fp, ps->fp_size, e); + return (snl_parse_attrs_raw(ss, attr_head, attr_len, ps->np, ps->np_size, e)); +} + static inline bool snl_read_reply_code(struct snl_state *ss, uint32_t nlmsg_seq, struct snl_errmsg_data *e) { @@ -617,7 +647,7 @@ snl_read_reply_code(struct snl_state *ss, uint32_t nlmsg_seq, struct snl_errmsg_ if (hdr == NULL) { e->error = EINVAL; } else if (hdr->nlmsg_type == NLMSG_ERROR) { - if (!snl_parse_nlmsg(ss, hdr, &snl_errmsg_parser, e)) + if (!snl_parse_errmsg(ss, hdr, e)) e->error = EINVAL; return (e->error == 0); } @@ -636,7 +666,7 @@ snl_read_reply_multi(struct snl_state *ss, uint32_t nlmsg_seq, struct snl_errmsg if (hdr == NULL) { e->error = EINVAL; } else if (hdr->nlmsg_type == NLMSG_ERROR) { - if (!snl_parse_nlmsg(ss, hdr, &snl_errmsg_parser, e)) + if (!snl_parse_errmsg(ss, hdr, e)) e->error = EINVAL; } if (hdr->nlmsg_type == NLMSG_DONE) { snl_parse_nlmsg(ss, hdr, &snl_donemsg_parser, e); diff --git a/tests/sys/netlink/test_snl.c b/tests/sys/netlink/test_snl.c index 85bdff7fb163..8c6d72f6893b 100644 --- a/tests/sys/netlink/test_snl.c +++ b/tests/sys/netlink/test_snl.c @@ -44,6 +44,129 @@ ATF_TC_BODY(snl_verify_route_parsers, tc) } +ATF_TC(snl_parse_errmsg_capped); +ATF_TC_HEAD(snl_parse_errmsg_capped, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests snl(3) correctly parsing capped errors"); +} + +ATF_TC_BODY(snl_parse_errmsg_capped, tc) +{ + struct snl_state ss; + struct snl_writer nw; + + require_netlink(); + + if (!snl_init(&ss, NETLINK_ROUTE)) + atf_tc_fail("snl_init() failed"); + + int optval = 1; + ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_CAP_ACK, &optval, sizeof(optval)) == 0); + + snl_init_writer(&ss, &nw); + + struct nlmsghdr *hdr = snl_create_msg_request(&nw, 255); + ATF_CHECK(hdr != NULL); + ATF_CHECK(snl_reserve_msg_object(&nw, struct ifinfomsg) != NULL); + snl_add_msg_attr_string(&nw, 143, "some random string"); + ATF_CHECK(snl_finalize_msg(&nw) != NULL); + + ATF_CHECK(snl_send_message(&ss, hdr)); + + struct nlmsghdr *rx_hdr = snl_read_reply(&ss, hdr->nlmsg_seq); + ATF_CHECK(rx_hdr != NULL); + ATF_CHECK(rx_hdr->nlmsg_type == NLMSG_ERROR); + + struct snl_errmsg_data e = {}; + ATF_CHECK(rx_hdr->nlmsg_len == sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr)); + ATF_CHECK(snl_parse_errmsg(&ss, rx_hdr, &e)); + ATF_CHECK(e.error != 0); + ATF_CHECK(!memcmp(hdr, e.orig_hdr, sizeof(struct nlmsghdr))); +} + +ATF_TC(snl_parse_errmsg_capped_extack); +ATF_TC_HEAD(snl_parse_errmsg_capped_extack, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests snl(3) correctly parsing capped errors with extack"); +} + +ATF_TC_BODY(snl_parse_errmsg_capped_extack, tc) +{ + struct snl_state ss; + struct snl_writer nw; + + require_netlink(); + + if (!snl_init(&ss, NETLINK_ROUTE)) + atf_tc_fail("snl_init() failed"); + + int optval = 1; + ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_CAP_ACK, &optval, sizeof(optval)) == 0); + optval = 1; + ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_EXT_ACK, &optval, sizeof(optval)) == 0); + + snl_init_writer(&ss, &nw); + + struct nlmsghdr *hdr = snl_create_msg_request(&nw, 255); + ATF_CHECK(hdr != NULL); + ATF_CHECK(snl_reserve_msg_object(&nw, struct ifinfomsg) != NULL); + snl_add_msg_attr_string(&nw, 143, "some random string"); + ATF_CHECK(snl_finalize_msg(&nw) != NULL); + + ATF_CHECK(snl_send_message(&ss, hdr)); + + struct nlmsghdr *rx_hdr = snl_read_reply(&ss, hdr->nlmsg_seq); + ATF_CHECK(rx_hdr != NULL); + ATF_CHECK(rx_hdr->nlmsg_type == NLMSG_ERROR); + + struct snl_errmsg_data e = {}; + ATF_CHECK(snl_parse_errmsg(&ss, rx_hdr, &e)); + ATF_CHECK(e.error != 0); + ATF_CHECK(!memcmp(hdr, e.orig_hdr, sizeof(struct nlmsghdr))); + + ATF_CHECK(e.error_str != NULL); +} + +ATF_TC(snl_parse_errmsg_uncapped_extack); +ATF_TC_HEAD(snl_parse_errmsg_uncapped_extack, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests snl(3) correctly parsing errors with extack"); +} + +ATF_TC_BODY(snl_parse_errmsg_uncapped_extack, tc) +{ + struct snl_state ss; + struct snl_writer nw; + + require_netlink(); + + ATF_CHECK(snl_init(&ss, NETLINK_ROUTE)); + + int optval = 1; + ATF_CHECK(setsockopt(ss.fd, SOL_NETLINK, NETLINK_EXT_ACK, &optval, sizeof(optval)) == 0); + + snl_init_writer(&ss, &nw); + + struct nlmsghdr *hdr = snl_create_msg_request(&nw, 255); + ATF_CHECK(hdr != NULL); + ATF_CHECK(snl_reserve_msg_object(&nw, struct ifinfomsg) != NULL); + snl_add_msg_attr_string(&nw, 143, "some random string"); + ATF_CHECK(snl_finalize_msg(&nw) != NULL); + + ATF_CHECK(snl_send_message(&ss, hdr)); + + struct nlmsghdr *rx_hdr = snl_read_reply(&ss, hdr->nlmsg_seq); + ATF_CHECK(rx_hdr != NULL); + ATF_CHECK(rx_hdr->nlmsg_type == NLMSG_ERROR); + + struct snl_errmsg_data e = {}; + ATF_CHECK(snl_parse_errmsg(&ss, rx_hdr, &e)); + ATF_CHECK(e.error != 0); + ATF_CHECK(!memcmp(hdr, e.orig_hdr, hdr->nlmsg_len)); + + ATF_CHECK(e.error_str != NULL); +} + ATF_TC(snl_list_ifaces); ATF_TC_HEAD(snl_list_ifaces, tc) { @@ -105,6 +228,9 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, snl_verify_core_parsers); ATF_TP_ADD_TC(tp, snl_verify_route_parsers); + ATF_TP_ADD_TC(tp, snl_parse_errmsg_capped); + ATF_TP_ADD_TC(tp, snl_parse_errmsg_capped_extack); + ATF_TP_ADD_TC(tp, snl_parse_errmsg_uncapped_extack); ATF_TP_ADD_TC(tp, snl_list_ifaces); return (atf_no_error()); From nobody Sat Mar 18 11:45:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdzh41xkFz3yV6g; Sat, 18 Mar 2023 11:45: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 4Pdzh40xzWz41hq; Sat, 18 Mar 2023 11:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679139908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kxKpjRUKAzxZPVvl22CLLuGAniVIbVrujotF+7R2gHs=; b=EStKqnXMFFXi4jYKiagyd5ZA750Z14JN1su0D8NK8Pq53YjRq+1RLwJVCKyd55pY/JHLiE SaMiXvgjGAB37zh/R89K1rdNjXfnNySpSGPYc/0dFOMlPkONdueimh8MoYDopmAZqhIkwI G/h7gsMADvTDMzHYhRvLvm87eZg2sU4Jzj4QcjtIeRfvvFjbIGB6ylGq7qVlkc4CYaZUg/ f4VZb1mCg61XCUtA4j4QDmbns4OQbT9WKtbKQgbXB+v1XMv11maWLSAlhc6TBfdPWJ1qHf RKdvFhND4o4tb7YD5GqaGb8EVgtRYEvMOQZIW0NuO6FtFg4Mdua5Eat2ZGg2ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679139908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kxKpjRUKAzxZPVvl22CLLuGAniVIbVrujotF+7R2gHs=; b=JY4g1+h3GNmZpmJpaw58rSbJVkxfsumjeviXBzM9mErn0sCmdlQkPJDDjnqhU3g3ioLY/X XFf0xnxo6o6j9B2CjZ+NoFQGm/G4/vlyYyHqoJ3XYtedGFzR+N82ZqrFnmABHqhaEVHUmT fIMb8zAXhjNJRhaseI0e6QQkNcFOBTvIfFIs4LuwTw2Q2QjSLILbSA3NCwPLHQ+P8ac5ld 7ukboI0edyiaWJYwzkjq/Ih2ixSI4d3V6HyjGovlQlxeSyYu1WgdMrTLh+H6fKyyw8U6P4 +4gaGoCply1YEJGkF3srXOrkK6g7JqTjzjCqoFB2fG7zoIDYRJZ2Y2+kwyw6JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679139908; a=rsa-sha256; cv=none; b=wdXYOUZ3KLutYDcYQqY+6lzRFiRzj2YgazHvSqGxDoEXvKIpnRQ/MofTxJeXHgV7eu8Q6m 4cUsKvTC5YzJI9XOySMTSku+8KViIGjtPAH+jkOhbDWfIbdHRm05Ioy4J5eLT63FXviEW5 4dL3T51QVhFTZ1d0rRjIDdA1miR6jOqY9Y1DvC/ZfIc8qB08M/llE165fBxPj/GBL6/R/4 TOATG5wv2vwTGrfi/4XSsaszgmaT1bvgkzpXKX/AJvDN4PnnEYWPsiqWlUhofeWjF/ImYH gHOA4a2HnGu1/DV6XV+gathZzs/DVm6aQheEXHS7sUNGaQ+/jzgP/+ewaY1Yyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pdzh370kyz15Wf; Sat, 18 Mar 2023 11:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IBj7pt063513; Sat, 18 Mar 2023 11:45:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IBj7fm063512; Sat, 18 Mar 2023 11:45:07 GMT (envelope-from git) Date: Sat, 18 Mar 2023 11:45:07 GMT Message-Id: <202303181145.32IBj7fm063512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> Subject: git: 046acc2bfd13 - main - netlink: add public ucred accessor for nlp. List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 046acc2bfd13f0caaf5132c1ad34877917db1a38 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=046acc2bfd13f0caaf5132c1ad34877917db1a38 commit 046acc2bfd13f0caaf5132c1ad34877917db1a38 Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-03-18 11:44:29 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-03-18 11:44:29 +0000 netlink: add public ucred accessor for nlp. MFC after: 2 weeks --- sys/netlink/netlink_ctl.h | 1 + sys/netlink/netlink_domain.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sys/netlink/netlink_ctl.h b/sys/netlink/netlink_ctl.h index 1310a5a5493a..8cd29cf56d10 100644 --- a/sys/netlink/netlink_ctl.h +++ b/sys/netlink/netlink_ctl.h @@ -80,6 +80,7 @@ bool netlink_unregister_proto(int proto); /* Common helpers */ bool nl_has_listeners(int netlink_family, uint32_t groups_mask); bool nlp_has_priv(struct nlpcb *nlp, int priv); +struct ucred *nlp_get_cred(struct nlpcb *nlp); /* netlink_generic.c */ struct genl_cmd { diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index 01023f7244b6..2704974173b4 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -212,6 +212,12 @@ nlp_has_priv(struct nlpcb *nlp, int priv) return (priv_check_cred(nlp->nl_cred, priv) == 0); } +struct ucred * +nlp_get_cred(struct nlpcb *nlp) +{ + return (nlp->nl_cred); +} + static uint32_t nl_find_port(void) { From nobody Sat Mar 18 13:11:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pf1bc3Nbnz3yYlp; Sat, 18 Mar 2023 13:11: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 4Pf1bc2pJfz47cJ; Sat, 18 Mar 2023 13:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679145084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XZG0xpekrlW31EwDLbstbMjsOfdDJJEas2QJG1hoZss=; b=YCVI2YORniWylA/dwy81pZHiruFmRgoFmr20GAyv2m+W2sJev7pBnrYelNPUSXq6h/XAyj a3JU7yJytpiknRMFbylQ1rc03KjR+qSZPXjCe/Yb90+tCB4ajuJxuuBQg2VdR9SgowJHEP PZeDD0yO95AMPzbMjEbkIxn4srwOJ9FuB10kXZcOGPogEe4jyfq2cRhG7yF9ygXQdKG30X i0+LX8+xEM+wpntdvIAN/V9FEUrT8cVQd75/40kvf5i+chDYJqFWJN4wzp0nWF5bHDx6bS hTplDO6QVdRqpA+RtRK2Ht1IRY+6oUUm/H6/bzhUsYih4/nYed5I+SeQAkSX6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679145084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XZG0xpekrlW31EwDLbstbMjsOfdDJJEas2QJG1hoZss=; b=Vepc7i6BPIUYeZVfqQkKB5IujI8P+/PLcNu1pTqfnMVcKRk2k/crNNvAZ5yxFEfyflEdnt 0T+RUxp8Rhb35rquH+wWtsr03M3YXN7ug06YpdY/t3sQEjo/cPRio8r3/NsjzPeqEZTjWW f0PnFsX5QiGhdMqWyi5pi5R4B2oqE+a779YAMevwmy/07YkJJQOeqmEE9TNpOobmfCZZeM Z1JPVd+DFbJn7MTzofO8emb06ylmKQZCSSHiHjpwlghLanL9fVjYu+Yzgdq6BndKbhXOWC KE8i5neX6g6tuVNx7+j3N6r2euSd9T0kX1bstuGhBjPkU0HftxMWlnVMYTHINA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679145084; a=rsa-sha256; cv=none; b=n2gQZusUmI7GqWwWUU3ql5l8bsOEH9QFtD7/xkakEXtX3CqCCvQ48PTD6LoobRh0Ro8tq0 DLnWCyJ0FGmy4RTPVXesDPyO6jnKSLuLauO7bcF29Dm2I7hxnSxTLNi0h5K5/VdIGE0zcM po4RT5A4xeJI8miNnh9LwbhCJkDYdGk8R3a8uMa0YqHOq6D1Q9fSWXA5Gw332lnsyw7D0x FXrluHMMcZQDWKxPuyVYW3Autkpr7sZrjlrH4y5rpl8MZ5JAyIByP8JLXZpx36TRUVo6YF SWphj5/6bSFGZII9lvR4X9RAaVVgN2kvfxjfRtTRybQj/zkynVhc8QVRPifkNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pf1bc1n3mz1710; Sat, 18 Mar 2023 13:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IDBOiC009805; Sat, 18 Mar 2023 13:11:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IDBOld009804; Sat, 18 Mar 2023 13:11:24 GMT (envelope-from git) Date: Sat, 18 Mar 2023 13:11:24 GMT Message-Id: <202303181311.32IDBOld009804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> Subject: git: aee2f11bf4b4 - main - netstat: simplify netlink route printing code. List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aee2f11bf4b44b286a88b6726347bd7466c5e750 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=aee2f11bf4b44b286a88b6726347bd7466c5e750 commit aee2f11bf4b44b286a88b6726347bd7466c5e750 Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-03-18 13:05:41 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-03-18 13:05:41 +0000 netstat: simplify netlink route printing code. A number of improvements has commited to snl(3) recently. A notable one is snl(3) build-in parsers for all of the objects exported by the kernel. This change updates netlink handling code to the latest available snl(3) API. --- usr.bin/netstat/route_netlink.c | 207 ++++------------------------------------ 1 file changed, 17 insertions(+), 190 deletions(-) diff --git a/usr.bin/netstat/route_netlink.c b/usr.bin/netstat/route_netlink.c index ea50d8076182..3546603ca1cc 100644 --- a/usr.bin/netstat/route_netlink.c +++ b/usr.bin/netstat/route_netlink.c @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include <netlink/netlink_route.h> #include <netlink/netlink_snl.h> #include <netlink/netlink_snl_route.h> +#include <netlink/netlink_snl_route_parsers.h> +#include <netlink/netlink_snl_route_compat.h> #include <netinet/in.h> #include <netgraph/ng_socket.h> @@ -75,25 +77,6 @@ static void p_rtentry_netlink(struct snl_state *ss, const char *name, struct nlm static struct ifmap_entry *ifmap; static size_t ifmap_size; -struct nl_parsed_link { - uint32_t ifi_index; - uint32_t ifla_mtu; - char *ifla_ifname; -}; - -#define _IN(_field) offsetof(struct ifinfomsg, _field) -#define _OUT(_field) offsetof(struct nl_parsed_link, _field) -static struct snl_attr_parser ap_link[] = { - { .type = IFLA_IFNAME, .off = _OUT(ifla_ifname), .cb = snl_attr_get_string }, - { .type = IFLA_MTU, .off = _OUT(ifla_mtu), .cb = snl_attr_get_uint32 }, -}; -static struct snl_field_parser fp_link[] = { - {.off_in = _IN(ifi_index), .off_out = _OUT(ifi_index), .cb = snl_field_get_uint32 }, -}; -#undef _IN -#undef _OUT -SNL_DECLARE_PARSER(link_parser, struct ifinfomsg, fp_link, ap_link); - /* Generate ifmap using netlink */ static struct ifmap_entry * prepare_ifmap_netlink(struct snl_state *ss, size_t *pifmap_size) @@ -108,7 +91,7 @@ prepare_ifmap_netlink(struct snl_state *ss, size_t *pifmap_size) }; msg.hdr.nlmsg_len = sizeof(msg); - if (!snl_send(ss, &msg, sizeof(msg))) { + if (!snl_send_message(ss, &msg.hdr)) { snl_free(ss); return (NULL); } @@ -116,15 +99,12 @@ prepare_ifmap_netlink(struct snl_state *ss, size_t *pifmap_size) struct ifmap_entry *ifmap = NULL; uint32_t ifmap_size = 0; struct nlmsghdr *hdr; - while ((hdr = snl_read_message(ss)) != NULL && hdr->nlmsg_type != NLMSG_DONE) { - if (hdr->nlmsg_seq != msg.hdr.nlmsg_seq) - continue; -/* - if (hdr->nlmsg_type == NLMSG_ERROR) - break; -*/ - struct nl_parsed_link link = {}; - if (!snl_parse_nlmsg(ss, hdr, &link_parser, &link)) + struct snl_errmsg_data e = {}; + + while ((hdr = snl_read_reply_multi(ss, msg.hdr.nlmsg_seq, &e)) != NULL) { + struct snl_parsed_link_simple link = {}; + + if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_link_parser_simple, &link)) continue; if (link.ifi_index >= ifmap_size) { size_t size = roundup2(link.ifi_index + 1, 32) * sizeof(struct ifmap_entry); @@ -144,140 +124,6 @@ prepare_ifmap_netlink(struct snl_state *ss, size_t *pifmap_size) return (ifmap); } -struct rta_mpath_nh { - struct sockaddr *gw; - uint32_t ifindex; - uint8_t rtnh_flags; - uint8_t rtnh_weight; - uint32_t rtax_mtu; - uint32_t rta_rtflags; -}; - -#define _IN(_field) offsetof(struct rtnexthop, _field) -#define _OUT(_field) offsetof(struct rta_mpath_nh, _field) -static const struct snl_attr_parser nla_p_mp_rtmetrics[] = { - { .type = NL_RTAX_MTU, .off = _OUT(rtax_mtu), .cb = snl_attr_get_uint32 }, -}; -SNL_DECLARE_ATTR_PARSER(metrics_mp_parser, nla_p_mp_rtmetrics); - -static const struct snl_attr_parser psnh[] = { - { .type = NL_RTA_GATEWAY, .off = _OUT(gw), .cb = snl_attr_get_ip }, - { .type = NL_RTA_METRICS, .arg = &metrics_mp_parser, .cb = snl_attr_get_nested }, - { .type = NL_RTA_RTFLAGS, .off = _OUT(rta_rtflags), .cb = snl_attr_get_uint32 }, - { .type = NL_RTA_VIA, .off = _OUT(gw), .cb = snl_attr_get_ipvia }, -}; - -static const struct snl_field_parser fpnh[] = { - { .off_in = _IN(rtnh_flags), .off_out = _OUT(rtnh_flags), .cb = snl_field_get_uint8 }, - { .off_in = _IN(rtnh_hops), .off_out = _OUT(rtnh_weight), .cb = snl_field_get_uint8 }, - { .off_in = _IN(rtnh_ifindex), .off_out = _OUT(ifindex), .cb = snl_field_get_uint32 }, -}; -#undef _IN -#undef _OUT - -SNL_DECLARE_PARSER(mpath_parser, struct rtnexthop, fpnh, psnh); - -struct rta_mpath { - int num_nhops; - struct rta_mpath_nh nhops[0]; -}; - -static bool -nlattr_get_multipath(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) -{ - int data_len = nla->nla_len - sizeof(struct nlattr); - struct rtnexthop *rtnh; - - int max_nhops = data_len / sizeof(struct rtnexthop); - size_t sz = (max_nhops + 2) * sizeof(struct rta_mpath_nh); - - struct rta_mpath *mp = snl_allocz(ss, sz); - mp->num_nhops = 0; - - for (rtnh = (struct rtnexthop *)(nla + 1); data_len > 0; ) { - struct rta_mpath_nh *mpnh = &mp->nhops[mp->num_nhops++]; - - if (!snl_parse_header(ss, rtnh, rtnh->rtnh_len, &mpath_parser, mpnh)) - return (false); - - int len = NL_ITEM_ALIGN(rtnh->rtnh_len); - data_len -= len; - rtnh = (struct rtnexthop *)((char *)rtnh + len); - } - if (data_len != 0 || mp->num_nhops == 0) { - return (false); - } - - *((struct rta_mpath **)target) = mp; - return (true); -} - - -struct nl_parsed_route { - struct sockaddr *rta_dst; - struct sockaddr *rta_gw; - struct nlattr *rta_metrics; - struct rta_mpath *rta_multipath; - uint32_t rta_expires; - uint32_t rta_oif; - uint32_t rta_expire; - uint32_t rta_table; - uint32_t rta_knh_id; - uint32_t rta_nh_id; - uint32_t rta_rtflags; - uint32_t rtax_mtu; - uint32_t rtax_weight; - uint8_t rtm_family; - uint8_t rtm_type; - uint8_t rtm_protocol; - uint8_t rtm_dst_len; -}; - -#define _IN(_field) offsetof(struct rtmsg, _field) -#define _OUT(_field) offsetof(struct nl_parsed_route, _field) -static const struct snl_attr_parser nla_p_rtmetrics[] = { - { .type = NL_RTAX_MTU, .off = _OUT(rtax_mtu), .cb = snl_attr_get_uint32 }, -}; -SNL_DECLARE_ATTR_PARSER(metrics_parser, nla_p_rtmetrics); - -static const struct snl_attr_parser ps[] = { - { .type = NL_RTA_DST, .off = _OUT(rta_dst), .cb = snl_attr_get_ip }, - { .type = NL_RTA_OIF, .off = _OUT(rta_oif), .cb = snl_attr_get_uint32 }, - { .type = NL_RTA_GATEWAY, .off = _OUT(rta_gw), .cb = snl_attr_get_ip }, - { .type = NL_RTA_METRICS, .arg = &metrics_parser, .cb = snl_attr_get_nested }, - { .type = NL_RTA_MULTIPATH, .off = _OUT(rta_multipath), .cb = nlattr_get_multipath }, - { .type = NL_RTA_KNH_ID, .off = _OUT(rta_knh_id), .cb = snl_attr_get_uint32 }, - { .type = NL_RTA_WEIGHT, .off = _OUT(rtax_weight), .cb = snl_attr_get_uint32 }, - { .type = NL_RTA_RTFLAGS, .off = _OUT(rta_rtflags), .cb = snl_attr_get_uint32 }, - { .type = NL_RTA_TABLE, .off = _OUT(rta_table), .cb = snl_attr_get_uint32 }, - { .type = NL_RTA_VIA, .off = _OUT(rta_gw), .cb = snl_attr_get_ipvia }, - { .type = NL_RTA_EXPIRES, .off = _OUT(rta_expire), .cb = snl_attr_get_uint32 }, - { .type = NL_RTA_NH_ID, .off = _OUT(rta_nh_id), .cb = snl_attr_get_uint32 }, -}; - -static const struct snl_field_parser fprt[] = { - {.off_in = _IN(rtm_family), .off_out = _OUT(rtm_family), .cb = snl_field_get_uint8 }, - {.off_in = _IN(rtm_type), .off_out = _OUT(rtm_type), .cb = snl_field_get_uint8 }, - {.off_in = _IN(rtm_protocol), .off_out = _OUT(rtm_protocol), .cb = snl_field_get_uint8 }, - {.off_in = _IN(rtm_dst_len), .off_out = _OUT(rtm_dst_len), .cb = snl_field_get_uint8 }, -}; -#undef _IN -#undef _OUT -SNL_DECLARE_PARSER(rtm_parser, struct rtmsg, fprt, ps); - -#define RTF_UP 0x1 -#define RTF_GATEWAY 0x2 -#define RTF_HOST 0x4 -#define RTF_REJECT 0x8 -#define RTF_DYNAMIC 0x10 -#define RTF_STATIC 0x800 -#define RTF_BLACKHOLE 0x1000 -#define RTF_PROTO2 0x4000 -#define RTF_PROTO1 0x8000 -#define RTF_PROTO3 0x40000 -#define RTF_FIXEDMTU 0x80000 -#define RTF_PINNED 0x100000 - static void ip6_writemask(struct in6_addr *addr6, uint8_t mask) { @@ -309,17 +155,6 @@ gen_mask(int family, int plen, struct sockaddr *sa) } } -struct sockaddr_dl_short { - u_char sdl_len; /* Total length of sockaddr */ - u_char sdl_family; /* AF_LINK */ - u_short sdl_index; /* if != 0, system given index for interface */ - u_char sdl_type; /* interface type */ - u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */ - u_char sdl_alen; /* link level address length */ - u_char sdl_slen; /* link layer selector length */ - char sdl_data[8]; /* unused */ -}; - static void add_scopeid(struct sockaddr *sa, int ifindex) { @@ -331,7 +166,7 @@ add_scopeid(struct sockaddr *sa, int ifindex) } static void -p_path(struct nl_parsed_route *rt, bool is_mpath) +p_path(struct snl_parsed_route *rt, bool is_mpath) { struct sockaddr_in6 mask6; struct sockaddr *pmask = (struct sockaddr *)&mask6; @@ -398,8 +233,8 @@ static void p_rtentry_netlink(struct snl_state *ss, const char *name, struct nlmsghdr *hdr) { - struct nl_parsed_route rt = {}; - if (!snl_parse_nlmsg(ss, hdr, &rtm_parser, &rt)) + struct snl_parsed_route rt = {}; + if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_route_parser, &rt)) return; if (rt.rtax_weight == 0) rt.rtax_weight = rt_default_weight; @@ -424,9 +259,9 @@ p_rtentry_netlink(struct snl_state *ss, const char *name, struct nlmsghdr *hdr) return; } - struct sockaddr_dl_short sdl_gw = { + struct sockaddr_dl sdl_gw = { .sdl_family = AF_LINK, - .sdl_len = sizeof(struct sockaddr_dl_short), + .sdl_len = sizeof(struct sockaddr_dl), .sdl_index = rt.rta_oif, }; if (rt.rta_gw == NULL) @@ -438,21 +273,15 @@ p_rtentry_netlink(struct snl_state *ss, const char *name, struct nlmsghdr *hdr) xo_close_instance(name); } -static const struct snl_hdr_parser *all_parsers[] = { - &link_parser, &metrics_mp_parser, &mpath_parser, &metrics_parser, &rtm_parser -}; - bool p_rtable_netlink(int fibnum, int af) { int fam = AF_UNSPEC; int need_table_close = false; struct nlmsghdr *hdr; - + struct snl_errmsg_data e = {}; struct snl_state ss = {}; - SNL_VERIFY_PARSERS(all_parsers); - if (!snl_init(&ss, NETLINK_ROUTE)) return (false); @@ -474,16 +303,14 @@ p_rtable_netlink(int fibnum, int af) }; msg.hdr.nlmsg_len = sizeof(msg); - if (!snl_send(&ss, &msg, sizeof(msg))) { + if (!snl_send_message(&ss, &msg.hdr)) { snl_free(&ss); return (false); } xo_open_container("route-table"); xo_open_list("rt-family"); - while ((hdr = snl_read_message(&ss)) != NULL && hdr->nlmsg_type != NLMSG_DONE) { - if (hdr->nlmsg_seq != msg.hdr.nlmsg_seq) - continue; + while ((hdr = snl_read_reply_multi(&ss, msg.hdr.nlmsg_seq, &e)) != NULL) { struct rtmsg *rtm = (struct rtmsg *)(hdr + 1); /* Only print family first time. */ if (fam != rtm->rtm_family) { From nobody Sat Mar 18 14:02:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pf2l33YJZz3ycY6; Sat, 18 Mar 2023 14:02: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 4Pf2l331mPz4FFc; Sat, 18 Mar 2023 14:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679148175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9G6zUXNnwVv9Yvtcbojz3/DYDFsb8JYghAUmyMQVTJI=; b=NPipmIcf+6QqOkUq8FnVM8s0ao7JhMAPhRQG6206fAkzmZxrOtDSFEVAII0VVlAA5ZvPW1 nIfgz9G2DXrv4g85j5j78k3k2vuEzFJUadN1uJqS5/TQXAt+j38rdJNZVW/5ia8/KyrhW2 3ATyMddFyQgU5791rGepyfvX4T5s5Yta4fLg2blxHCASHySmMVmANAcI/REr8DgsMD5jrb DapAsPC5/yNYERyJTXKmPYY8t9FmM60aw/BORKdRTRuo+DH2aw0SJx4XSbffrMqBdkKL40 zzKlK2Gt/gJFrEcxR+pw42EJfY9xArnylWutaLIgyfxtC5mNfiYkPR4FszFNpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679148175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9G6zUXNnwVv9Yvtcbojz3/DYDFsb8JYghAUmyMQVTJI=; b=lD5aL+h00NgUFloit/Ag4w++vFfFRZzZZ8vPVg9NpsQ0jmElh6zpKNXoqQAhrEuabkb50/ FbcOXkmYp8LMB6C+/LoMhoTEf7Bq65zI0Hb2Qilzz1d21NrfBITnGeW/VVg6kYcoMeQOQG MdSjY+j6LF6V7IbCl7lcpu8t4ocvhbqJv44pGVKEFCiOD5UiqxMZm6sTENskbLjriGiMzh ro/7Cciy2eJ5sDdGtbbcK753SYC3RdeyltthBRierI/XI5e1Kpqr7LR9MGLcJnuhp7d5gn 4jwNgLXFZQHTvOwdzfu6Bhtc1KA0rOTjZzLsmX6dEYue9W0sC5M41Q5sSXe9gQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679148175; a=rsa-sha256; cv=none; b=Xqp8pVgDYhqhRhsxfl2rVkocLSWQ4JCspYT0MDDibcpDbDx+kQ6YFbxsOj0vatcq0YEI7L JV05SkQiHYVH80nCsp4lSRUY5Hw3ExZ2DFqy15NER5bDVLafBi4aOCQByP4y1zzUky2JrM EsRMPw89HMhqNoxOaxyn0LIAEDlZFiXqvt384ZDEaiWg1FJey3DoGCx5L6xEo3bjlvSpPv zlH1eQRXCLXNVDpJoSF+PbXFOZ/O4KNASWoYlZ/cojs8BrGGzR3m1ekxVQkQKN06QU79n3 H4UPYFJXenfIRSTzxFfIgNu4jhFv5+i9seE060eEjrH5JlSQ/5HErC+iGe5KuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pf2l324n3z18vX; Sat, 18 Mar 2023 14:02:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IE2tCC093939; Sat, 18 Mar 2023 14:02:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IE2tdR093938; Sat, 18 Mar 2023 14:02:55 GMT (envelope-from git) Date: Sat, 18 Mar 2023 14:02:55 GMT Message-Id: <202303181402.32IE2tdR093938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> Subject: git: 9ee6278b7885 - main - netstat: fix double-free in netlink error code path. List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ee6278b78859e8a9e303ec4a037b4e76d6ed89a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=9ee6278b78859e8a9e303ec4a037b4e76d6ed89a commit 9ee6278b78859e8a9e303ec4a037b4e76d6ed89a Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-03-18 14:01:46 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-03-18 14:01:46 +0000 netstat: fix double-free in netlink error code path. CID: 1504382 --- usr.bin/netstat/route_netlink.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr.bin/netstat/route_netlink.c b/usr.bin/netstat/route_netlink.c index 3546603ca1cc..6e7e505c9619 100644 --- a/usr.bin/netstat/route_netlink.c +++ b/usr.bin/netstat/route_netlink.c @@ -91,10 +91,8 @@ prepare_ifmap_netlink(struct snl_state *ss, size_t *pifmap_size) }; msg.hdr.nlmsg_len = sizeof(msg); - if (!snl_send_message(ss, &msg.hdr)) { - snl_free(ss); + if (!snl_send_message(ss, &msg.hdr)) return (NULL); - } struct ifmap_entry *ifmap = NULL; uint32_t ifmap_size = 0; @@ -286,6 +284,10 @@ p_rtable_netlink(int fibnum, int af) return (false); ifmap = prepare_ifmap_netlink(&ss, &ifmap_size); + if (ifmap == NULL) { + snl_free(&ss); + return (false); + } struct { struct nlmsghdr hdr; From nobody Sat Mar 18 15:40:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pf4vb57h0z3yjBP; Sat, 18 Mar 2023 15:40: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 4Pf4vb4V1gz4QLv; Sat, 18 Mar 2023 15:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679154027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mtdarEQTuNyXaLDp5XRxpePzE7HyAE4mzuEAy2WzP3U=; b=Wy9rf69Ed2va3exbp/i8nRv4XWVXDiu6/nbn3dR+3xhFSW7xrM9mSyodtjTRtsGYOKfoFq lAh7QEmQlIpZCzk6ygt4rSrv47ZOdJUCtMme3MCpTVLFkdlRYRfEPD7PtLSAtN50SPqTwq CIasWaV3tHIlTntmppd8U3tBSuJugnlcMUwEswK1Jxc26SygTt1lwYyKoaLnrmwSZaE63i KOPZSPCOBvID1uBpQUhVC9ibp7jEjlZQ6SSeMiOCabyLe3isnrL4kEJNweEVSw0czyCji4 HvMEHg0gqzZlJeZA9xUABAeSla6qSQ1RJ8UBQD+E1307n+CMU30Oy1wgPN27lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679154027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mtdarEQTuNyXaLDp5XRxpePzE7HyAE4mzuEAy2WzP3U=; b=Wb4nWZ4kBzSBGwROzpglHz/CgiqMZAc1XjdjUJ046Dkhld2MHgEBpm0uU6XEO8YjX7Su7s 2HwM+2j4NHlkyFby+42PD9s4z8QUKdRrRDttEDAU+J7ZIdeb82V9SCV1CwTkJxkXsOcE3L J0FR1FduZ0Bc2krwpHgHuuMqAWRVblwbterpdsBMgkOvCQikWNt99Sz/ckrXM04lThE7IP 8/E9Wc29/TGsnPkhtKDFfRQKT3Xpbioy5l2n3RL87l+vVEO4n9AHIvXU7FjpagxyN2GgSs CNjIaqjnWpRVfYcGWYtI5xh10GtQKW5fk5nYY+GO+TdclWfl7LPEPJ78uxXi0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679154027; a=rsa-sha256; cv=none; b=aH4p56g7j9EduvpaWBc3T1A39FvdxMJE0kvJ1q88FD3qw5V+VExSZGB4P57JYbP3LsGpOv 5DGgD93+aO9mXFnI8sqBE6r/O659N6C1rBPIYcJcaFInWPfRWqEUiah88SEbIhp+8z5oan T3caoaIl9R8zU/VwhWcZiA2bUhJQXdXCgC6bv1x0rjvV6SFMOaLUs5FxhqL5msxpc7IQyY oS8FXJmE3ECUjdz1I1qEAamReuptkw5DsOlHRkIHReDvmmhjjaC+w/klFhIMadLNu5ZWVw gi4SXwIWMuCycMijaHn12Gc6M1KztHcb3C6T8xbaoBnIyBFW/hCD7IdG72eZ3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pf4vb3Wzkz1CL1; Sat, 18 Mar 2023 15:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IFeRMj052612; Sat, 18 Mar 2023 15:40:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IFeR0r052611; Sat, 18 Mar 2023 15:40:27 GMT (envelope-from git) Date: Sat, 18 Mar 2023 15:40:27 GMT Message-Id: <202303181540.32IFeR0r052611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: 02904a06c76b - main - amd64: properly recalculate mitigations knobs after resume List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02904a06c76be857307b78184863654b9e7b88ab Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=02904a06c76be857307b78184863654b9e7b88ab commit 02904a06c76be857307b78184863654b9e7b88ab Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-03-17 13:02:03 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-03-18 15:40:05 +0000 amd64: properly recalculate mitigations knobs after resume Revision r333125 AKA 986c4ca38772f72 forced clear cpu_stdext_feature3 on suspend, since at that time microcode update was not reloaded early on resume. Then, revision 050f5a8405c63 started re-reading cpu_stdext_feature3 again. Since modern CPUs do not require mitigations from the Skylake era, this went unnoticed for some time. Keep zeroing cpu_stdext_feature3 on suspend, but re-read it in more controlled way on resume after microcode is reloaded, and recalculate active workarounds based on actual microcode capabilities. Reported and tested by: romain Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39146 --- sys/amd64/acpica/acpi_wakeup.c | 14 ++++++++++++++ sys/amd64/amd64/initcpu.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index 9601a88e11a4..1afbdc3a3bec 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -288,6 +288,20 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, if (!CPU_EMPTY(&suspcpus)) resume_cpus(suspcpus); #endif + + /* + * Re-read cpu_stdext_feature3, which was zeroed-out + * in acpi_sleep_machdep, after the microcode was + * reloaded. Then recalculate the active mitigations + * knobs that depend on the microcode and + * cpu_stdext_feature3. + */ + identify_cpu_ext_features(); + hw_ibrs_recalculate(true); + hw_ssb_recalculate(true); + amd64_syscall_ret_flush_l1d_recalc(); + x86_rngds_mitg_recalculate(true); + mca_resume(); if (vmm_resume_p != NULL) vmm_resume_p(); diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index 16780a9e069b..8d4c9d9cbe64 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -313,7 +313,7 @@ initializecpu(void) } load_cr4(cr4); /* Reload cpu ext features to reflect cr4 changes */ - if (IS_BSP()) + if (IS_BSP() && cold) identify_cpu_ext_features(); if (IS_BSP() && (amd_feature & AMDID_NX) != 0) { msr = rdmsr(MSR_EFER) | EFER_NXE; From nobody Sat Mar 18 15:48:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pf54y0zF0z3yjDH; Sat, 18 Mar 2023 15:48: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 4Pf54y0RPzz3Bsj; Sat, 18 Mar 2023 15:48:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679154514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1XrAGaDcIbVRktTzQo2zYBU9kw24M6DsPGN8f1HNuG4=; b=iLSEGwAziX6YvYhAWbg+F0uLEx/6MzY9SfmMa9guxPHGdGrhvNbssTK9jyjJ6Fze+Wy6lY 0DYCKRjgiVuAmJAndPe95fO3offODEWBXSRM69j60WOuR/UynunG/zIypZC/d3oaz5BxXt aebNWpYN0hjz7TzaI5MpDi3yL+xG+mp5wfqIHOkjBfWsR9lm+EVPR2h/Vq2nb9ZHKx/BhV 1F5gY5PmoQOIWpZEXTocJqWzLGiTquzoG7/XvFa2MbydDlVF7nYQPgy0yjL7jAkjGXJbfb ifwdZABS074s03TrtfDazBtfKi4fNQitR1H8ZfhdgBHBZ/sU5Hc2mBJoz3WEiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679154514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1XrAGaDcIbVRktTzQo2zYBU9kw24M6DsPGN8f1HNuG4=; b=EGM+nZSoA1JIn/zT11SgRDPia2+vWYu9F49iA3efJWBGKbrfbzZxfkNvxxkQNzgCAfD+YG qG3hVlAZZIG9gXVs+mYSrWH/8WV6adY8SOftaCiCNtO/Wp4Jma2SnmSCehORVdmurppYYk hLBHX5SPHGkKg6zWboqvrGJjDM4OwQq1cNsR89WeeSORcwqnqfxD8cq12Rp4UP760VHg7V cSA/ahlv/UB7FWciCWS0pQOQoe/+u6aJ47gs+wXDP/Z0AzgLxGF7DICjSnidoSMg3wImKS VKUHjy8obWu3wXfiFdO5Ru/qrLepQGnoV1EHfcFoHKLqlJyHSHLhe6cFCN5S0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679154514; a=rsa-sha256; cv=none; b=xFb/FzZePyypFBlTQ0PjuD8FAQzpD9wPpUTS7u/ZOrf2J1SKWh7m1xfcSTCxzFG1l51Ij6 ql7hm1L6CLv4xKCkiNb8DdDl6pl3Gju8U5fg+lnudJYed2z2wlBQescm0RjqxEMxgkZodi YeRhdc6M6Q0yMJjkY9bCDTDYK5wEx1flVT8G3nlNb21NXn1JoQJojXembzundBcadIgG/y oDgoBxQqbtNWatf0U9ezCm2GgI5safac0kOobMOQENzxa0Fmn/6ZOyvevVoWbnfTQiirli P99bgqPBW04fNz47Fb2oA3ZibOQUQtPf6QOMrmdxDW+pRfbgGyZFzfL/ZXVjow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pf54x6WHFz1C78; Sat, 18 Mar 2023 15:48:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IFmXrP059901; Sat, 18 Mar 2023 15:48:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IFmX3S059900; Sat, 18 Mar 2023 15:48:33 GMT (envelope-from git) Date: Sat, 18 Mar 2023 15:48:33 GMT Message-Id: <202303181548.32IFmX3S059900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: 2b4b3789f877 - main - acpi_wakeup.c: apply the reviewer' editorial corrections to the comment text. List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b4b3789f877918e9e89a217d3b25d854d1a2267 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2b4b3789f877918e9e89a217d3b25d854d1a2267 commit 2b4b3789f877918e9e89a217d3b25d854d1a2267 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-03-18 15:45:49 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-03-18 15:47:19 +0000 acpi_wakeup.c: apply the reviewer' editorial corrections to the comment text. Fixes: 02904a06c76be857307b78184863654b9e7b88ab MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39146 --- sys/amd64/acpica/acpi_wakeup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index 1afbdc3a3bec..3df4457550d6 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -291,8 +291,8 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, /* * Re-read cpu_stdext_feature3, which was zeroed-out - * in acpi_sleep_machdep, after the microcode was - * reloaded. Then recalculate the active mitigations + * in acpi_sleep_machdep(), after the microcode was + * reloaded. Then recalculate the active mitigation * knobs that depend on the microcode and * cpu_stdext_feature3. */ From nobody Sat Mar 18 20:57:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PfCxL3d50z401k8; Sat, 18 Mar 2023 20:57: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 4PfCxL2t6mz3wR0; Sat, 18 Mar 2023 20:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679173046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhQF4k7pIUQLp4fPTjUk2BKbAaj3rFuQ/XjaBSPcxKk=; b=l3qGlm3qPU4n+fT2gLuhRdhlmSuCZj0moboqCK9ii2O6BzJuN7HDprEu6OYplGU1mF4e5B 37CDJnPiYCajETaLX/tNGXUq6m5nXpB6qjdQ+B9Nlyhoa8j6TsP6LtHra/u62MoghQoawd EddhPquPEjGH/lMhjk6Oqfq6aP9OyflsqgfJiRQ2jdfxq9y8DyNfT9yIwTR+E8STkz6Vih E9xlqfgim6smBqvyiDllcH+6Wx9Ichm/II9nUa/MyK0RUHISSOE2QFpPujhmCBmUjrKEr/ 3BZgJX/3Qwrk3AX13DvirAarZDQf2kn+yfAZTmuvYdnPfL2J7YSPu+gJZ3cixw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679173046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhQF4k7pIUQLp4fPTjUk2BKbAaj3rFuQ/XjaBSPcxKk=; b=xyhT7Qkh7l/KhAFuNYJQAUDqQNAe3bapoeXREGsB3yNYGwS0AS1qo9Pp/S7PZRo4b5xSre 14EMvR3Vhx+R+tJNXoQ0+PAe1hI5vGnalG8VsQZFB0vRsKBWomMySbztxxwd5542jUmdSC +/rEImWrrp+asnkrtn46QByIBQTnjlX2FkKMdqNNsTMhRV5og3kxn2xXzSMkuDS+Cmh34T wwSdSKmcNJ8XeEiGS/5cEFA/KpZFjXHC1Y0rUpIIsu4QSeyWIZxikAAIvsRix1nG9atzeH kfcSpC46antaGsxaUJbUatuGb/sbyPoo+8Zcva3NCPr6C/4tKuq7TglTRlVt0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679173046; a=rsa-sha256; cv=none; b=cl+6VE5zaP/aygitEuA2ZU9j8W+DMpovGvI96cS2sG8oTLrdKKHqzbKSjxOQiPTmFnxE9u Lffv4s1AhSsUYnLFA4cKHFuuvE0DJ7tK8bAp+5fqvfr//UnERghb285vWEWFKSqVcdEjj9 l2h1SsxVsd+L3aN73MjlrU/q+RvLJiR/avvhYYxPVbFFA4hT4uUCTm/F6BGz9DQ57kTD+r 30hATyCLMKuHZTGkKXBhIHNa2S3ILZ4/y/scaJPMdwemoppkdZEafG9DjllM30acInDBvR Kb+uUL9vUooL5AONS8FHU08IpmAalkU8+iJA5jJZDr2GFs5KnGy28oJNLDw+Fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PfCxL1wp7zMs6; Sat, 18 Mar 2023 20:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IKvQ5Q067647; Sat, 18 Mar 2023 20:57:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IKvQH3067646; Sat, 18 Mar 2023 20:57:26 GMT (envelope-from git) Date: Sat, 18 Mar 2023 20:57:26 GMT Message-Id: <202303182057.32IKvQH3067646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: bad8f86843fa - main - netgraph tests: Serialize List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bad8f86843fa34bf4d4d2bfb8183331c02ced87f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bad8f86843fa34bf4d4d2bfb8183331c02ced87f commit bad8f86843fa34bf4d4d2bfb8183331c02ced87f Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2023-03-18 14:57:36 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2023-03-18 20:57:11 +0000 netgraph tests: Serialize Some tests share names for netgraph nodes, so they cannot be run in parallel. MFC after: 1 week --- tests/sys/netgraph/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/netgraph/Makefile b/tests/sys/netgraph/Makefile index f397e66a22bc..5a5e2ba13081 100644 --- a/tests/sys/netgraph/Makefile +++ b/tests/sys/netgraph/Makefile @@ -7,6 +7,8 @@ BINDIR= ${TESTSDIR} TAP_TESTS_SH+= ng_macfilter_test +# Serialize tests since some share netgraph node names. +TEST_METADATA+= is_exclusive=true TEST_METADATA.ng_macfilter_test+= required_user="root" TEST_METADATA.ng_macfilter_test+= required_programs="perl" From nobody Sat Mar 18 22:38:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PfG9r6VQhz406Hd; Sat, 18 Mar 2023 22:38: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 4PfG9r53gFz44n1; Sat, 18 Mar 2023 22:38:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679179104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zMTaX/uKYS82Pl/5D+MwAypchN37u8/AMQOEiGpZ4n8=; b=DxJ3ItPtLrkYlzvsdHlol/JzPXVKVi9kuAcRGa2W+o18QAbayrC/ux2Sq9Evcw/RFEstWN CnRwSEISOPqw5AE1yTKEp8aMxk7uuHpsNdVlXCtszxOeIzNH5S3V6UoTj8bzYA+1hfegL6 eLTQrNg5l/TXXGUz84jS90IW0Q3C7YAjKkjN12Hg0nW5aVMwaestAxExLMjwRBwfRnJ+fJ Lg5KcxGwY7Cadb3I+FQpmmK2CjyZDNibn+L4toQY+fEzDxNkrLU4g2/3sAlS683S+3jrj9 MtIdj0PUsgozqqIWNr6qcVuEItbAarGaDLN6u6naCGG114tDXW8BDqG8lHIT9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679179104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zMTaX/uKYS82Pl/5D+MwAypchN37u8/AMQOEiGpZ4n8=; b=aS+84Wny92I4B/rMpZAXxwBNSRUwj59vIRk1FsKuJd0S3TZ10QyoaCsqWm5YqWrNhrusK4 zbyRoAlFIMWeizxWCQrLruTMfmP+JqMVZycSIo+RZbwvZeO85ZXzKoPZ9Iga++NwZg0pid lR04/x1ONv8CL6lJ4eodz5Pelio7sq8scqFzuARjJJws2Sm4erICQBOuUzR6zKhh+RZryw J9eiUtVwP4/w+G/Z6pc62Hw6TV6IsQHd5+45FJhhJBtOIZDP5QiutebjHB/aKd3Vrh+vxQ KfArDxqIXX5ZrqFlTLCee7vN/Z/ithejmqbePqwlQDVgCwN0eVtIwzJVObHslA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679179104; a=rsa-sha256; cv=none; b=Onb3TOqAaDQBL6CPEw6OHMagCbKV/r1V5lqVRG2dX7QrqOvbAGzGd67+232UPs0Srox1hy Ncb5dd/0nwkiuTfCQJtzxrcbgYEvCRqXgYOII50Q8UYFprXhAgNOfl6D9VjGMPy6f3j0eb molA6ubLY8t1U2Xce1rJ5uq/8tEXi+MndlFJ7dOD9uLiUUjMT2Iz7Fl4HtgUDw69axtuSV 5pSrMQjimfQpBDXVLEYXeYiKD8xBxgAxbBw9WEpngD7FLggic7AaVqF6zFMeFjts3VlVI2 KUvXpiScYOVcggaBK9y706nNfP8TfJDSMg2v2ii/EgnLP2tNfxE3wDaYXOyQyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PfG9r45X2zQB1; Sat, 18 Mar 2023 22:38:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IMcOlL032845; Sat, 18 Mar 2023 22:38:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IMcOAb032844; Sat, 18 Mar 2023 22:38:24 GMT (envelope-from git) Date: Sat, 18 Mar 2023 22:38:24 GMT Message-Id: <202303182238.32IMcOAb032844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick <mckusick@FreeBSD.org> Subject: git: 069767091e54 - main - Do not panic in case of corrupted UFS/FFS directory. List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 069767091e54a2537ae509dcdf3005fb0f50ab84 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=069767091e54a2537ae509dcdf3005fb0f50ab84 commit 069767091e54a2537ae509dcdf3005fb0f50ab84 Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2023-03-18 22:36:54 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2023-03-18 22:37:58 +0000 Do not panic in case of corrupted UFS/FFS directory. Historically the system panic'ed when it encountered a corrupt directory. This change recovers well enough to continue operations. This change is made in response to a similar change made in the ext2 filesystem as described in the cited Differential Revision. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38503 --- sys/ufs/ufs/ufs_lookup.c | 18 +++++------------- sys/ufs/ufs/ufs_vnops.c | 4 +++- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 4c390f4c42ef..cabd04a50bfd 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -548,9 +548,8 @@ found: */ if (i_offset + DIRSIZ(OFSFMT(vdp), ep) > dp->i_size) { ufs_dirbad(dp, i_offset, "i_size too small"); - dp->i_size = i_offset + DIRSIZ(OFSFMT(vdp), ep); - DIP_SET(dp, i_size, dp->i_size); - UFS_INODE_SET_FLAG(dp, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); + brelse(bp); + return (EIO); } brelse(bp); @@ -758,17 +757,10 @@ found: void ufs_dirbad(struct inode *ip, doff_t offset, char *how) { - struct mount *mp; - mp = ITOV(ip)->v_mount; - if ((mp->mnt_flag & MNT_RDONLY) == 0) - panic("ufs_dirbad: %s: bad dir ino %ju at offset %ld: %s", - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, - (long)offset, how); - else - (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, - (long)offset, how); + (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", + ITOV(ip)->v_mount->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, + (long)offset, how); } /* diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index ae6d963920f3..54046c285fd7 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1730,7 +1730,9 @@ relock: /* Journal must account for each new link. */ softdep_setup_dotdot_link(tdp, fip); SET_I_OFFSET(fip, mastertemplate.dot_reclen); - ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0); + if (ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0) != 0) + ufs_dirbad(fip, mastertemplate.dot_reclen, + "rename: missing ".." entry"); cache_purge(fdvp); } error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); From nobody Sat Mar 18 22:47:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PfGNF6973z406x4; Sat, 18 Mar 2023 22:47:25 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PfGND0qFfz45bM; Sat, 18 Mar 2023 22:47:24 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:f82b:3d0e:59d9:3576]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id 8A52672826400; Sat, 18 Mar 2023 23:47:10 +0100 (CET) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: 069767091e54 - main - Do not panic in case of corrupted UFS/FFS directory. From: tuexen@freebsd.org In-Reply-To: <202303182238.32IMcOAb032844@gitrepo.freebsd.org> Date: Sat, 18 Mar 2023 23:47:09 +0100 Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Content-Transfer-Encoding: quoted-printable Message-Id: <4D960CCC-8D07-4CAB-853C-11185548A2D2@freebsd.org> References: <202303182238.32IMcOAb032844@gitrepo.freebsd.org> To: Kirk McKusick <mckusick@FreeBSD.org> X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4PfGND0qFfz45bM X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On 18. Mar 2023, at 23:38, Kirk McKusick <mckusick@FreeBSD.org> wrote: >=20 > The branch main has been updated by mckusick: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D069767091e54a2537ae509dcdf3005fb= 0f50ab84 >=20 > commit 069767091e54a2537ae509dcdf3005fb0f50ab84 > Author: Kirk McKusick <mckusick@FreeBSD.org> > AuthorDate: 2023-03-18 22:36:54 +0000 > Commit: Kirk McKusick <mckusick@FreeBSD.org> > CommitDate: 2023-03-18 22:37:58 +0000 >=20 > Do not panic in case of corrupted UFS/FFS directory. >=20 > Historically the system panic'ed when it encountered a corrupt > directory. This change recovers well enough to continue operations. > This change is made in response to a similar change made in the ext2 > filesystem as described in the cited Differential Revision. >=20 > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D38503 > --- > sys/ufs/ufs/ufs_lookup.c | 18 +++++------------- > sys/ufs/ufs/ufs_vnops.c | 4 +++- > 2 files changed, 8 insertions(+), 14 deletions(-) >=20 > diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c > index 4c390f4c42ef..cabd04a50bfd 100644 > --- a/sys/ufs/ufs/ufs_lookup.c > +++ b/sys/ufs/ufs/ufs_lookup.c > @@ -548,9 +548,8 @@ found: > */ > if (i_offset + DIRSIZ(OFSFMT(vdp), ep) > dp->i_size) { > ufs_dirbad(dp, i_offset, "i_size too small"); > - dp->i_size =3D i_offset + DIRSIZ(OFSFMT(vdp), ep); > - DIP_SET(dp, i_size, dp->i_size); > - UFS_INODE_SET_FLAG(dp, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); > + brelse(bp); > + return (EIO); > } > brelse(bp); >=20 > @@ -758,17 +757,10 @@ found: > void > ufs_dirbad(struct inode *ip, doff_t offset, char *how) > { > - struct mount *mp; >=20 > - mp =3D ITOV(ip)->v_mount; > - if ((mp->mnt_flag & MNT_RDONLY) =3D=3D 0) > - panic("ufs_dirbad: %s: bad dir ino %ju at offset %ld: %s", > - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, > - (long)offset, how); > - else > - (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", > - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, > - (long)offset, how); > + (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", > + ITOV(ip)->v_mount->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, > + (long)offset, how); > } >=20 > /* > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > index ae6d963920f3..54046c285fd7 100644 > --- a/sys/ufs/ufs/ufs_vnops.c > +++ b/sys/ufs/ufs/ufs_vnops.c > @@ -1730,7 +1730,9 @@ relock: > /* Journal must account for each new link. */ > softdep_setup_dotdot_link(tdp, fip); > SET_I_OFFSET(fip, mastertemplate.dot_reclen); > - ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0); > + if (ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0) !=3D 0) > + ufs_dirbad(fip, mastertemplate.dot_reclen, > + "rename: missing ".." entry"); This breaks compilation for me: /usr/home/tuexen/freebsd-src/sys/ufs/ufs/ufs_vnops.c:1735:27: error: = expected identifier "rename: missing ".." entry"); ^ Best regards Michael > cache_purge(fdvp); > } > error =3D ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); From nobody Sat Mar 18 23:00:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PfGgY4p8qz407SV; Sat, 18 Mar 2023 23:00: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 4PfGgY4DRxz46fJ; Sat, 18 Mar 2023 23:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679180441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UYVDhy9Dpgq5Em0PJNLOL7cmpe4mVsd7FRqsnvM9uzA=; b=fMA7bN4UH0Dfyw9ywcugGRc/OO/iAu/S/G96f4RxEksxQ1VVIL/KpqAgI4I4MpaS/mbQG7 Gwkn6F/EgHtAtGQogLV38qhnIvgNzv9vOKwIgiL/snLhsRGaEj7ImnwNc7nRJcCKGJZkmb BtGP9Sp4SDBdEs1qHsrbM+WPw9f1VjY/Ce2sScJv9CJ8ZJa/3uwiwAp4gJuoxy0FVlfhFH EbTodga17XlONAmtfxNety0e/y5sNLGBiZiXRb1oh8lFUW1W7FtvkQaY76Nv6MO5hynDKd ro8QSMPCKIhVikfQFkJTfz0KhxdOxIaQx7hCCfVwk7EmirYOTbH86cQPdfgZqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679180441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UYVDhy9Dpgq5Em0PJNLOL7cmpe4mVsd7FRqsnvM9uzA=; b=uq98wK5/2ngngFfmsjC5QlU3sArJGJgUfBEZxF+s1fc03O4rB+NunaqeZ+cRGG4WW/01qg nDY1W+GdidXN6DnQyBi5jsgCWMLCslb0Z9e6FYagsatXCg2R7LB5G/RExVxz86IowvJRMk dDYEyWtAS28PoApMetw4glwLbl2aN8T+5gve9xbHbTM5/1izS7Pyiu9DCDWP3umIN6NE3W dJeWB3m/2Me2kZ9S3QQ7nvWEQrLTBYfZ3oPPcfxysyZdHuZS8I419fQ/WWDbG3MArHP4ml ULCQ54tml89/m2D1o88Ie9VHPqN2oQ6YovCZ3B8oijL3SRN5PcXQnOaW7hDzMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679180441; a=rsa-sha256; cv=none; b=yLdDnWycuZK8Yo1y3v/yvFhyALcp8hbRtFGiNjsZSS+ZE0BcrlpH1+kMmvhEMLdF1DHybv PPcQD4IizVLkfut1yk1n3d84zzq5gkw30h/lOILDuVEjA7VdLzqhgCaZvY2DY9HzHtcnuv c/kEQrlAU7gu1J4HPA5oFmcDWYloJauTqnkiTjCB7QFDU3WxLfcZqkIsw9cVpkdOo7gSya umVcdL9oNLJNfjC9CiD7KOJY5Ct8P2pzfCeQ/sMCQH0ggC4ulZmdzt6s77zJzkF2iobauF BDvJIhxXpyBdoOTds2JPGyzNUOkS48i0kuC0AEihv112QsxfCfhUBKI8F/G45A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PfGgY3KDszQVF; Sat, 18 Mar 2023 23:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32IN0fgU075434; Sat, 18 Mar 2023 23:00:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IN0fUs075433; Sat, 18 Mar 2023 23:00:41 GMT (envelope-from git) Date: Sat, 18 Mar 2023 23:00:41 GMT Message-Id: <202303182300.32IN0fUs075433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen <tuexen@FreeBSD.org> Subject: git: 48345048cd1d - main - sctp: fix typo in assignment List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: <mailto:dev-commits-src-all+help@freebsd.org> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org> Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48345048cd1dc4f9304334606d99e95a521b36db Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=48345048cd1dc4f9304334606d99e95a521b36db commit 48345048cd1dc4f9304334606d99e95a521b36db Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2023-03-18 22:58:50 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2023-03-18 22:58:50 +0000 sctp: fix typo in assignment --- sys/netinet/sctp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 2ce05336482a..3b9a06b72d8a 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -8428,7 +8428,7 @@ again_one_more_time: * flight size since this little guy * is a control only packet. */ - use_zero_crc = asoc->zero_checksum = 2; + use_zero_crc = asoc->zero_checksum == 2; if (asconf) { sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, net); use_zero_crc = false;