From nobody Sat Mar 11 23:20:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 13:59:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:48:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 10:18:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 14:51:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 16:16:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbKV92Fqvz3xdG1 for ; Tue, 14 Mar 2023 03:57:21 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.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 4PbKV82TsWz43w7 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.54 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wr1-f54.google.com with SMTP id p4so6911452wre.11 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=kE82KtKGimij9nD9IZ/p684f+3xvA9iA1GUlCRDHZOW4j0PFLSTNz8t9XPg9auy68W M8zOtuHLUXjnjV9D5gaOa00KJtGjgukegfBTKAEn+4tUu2aeKVgI+0AM/YUjUzUkOgtt qVlN/C02QR/1VXjLSYtuTQbSgMbHx9agJERCIKCeGt9kpQjpOLIZtsQm9feUPiJbvnPD w++Q/t7hmeCr60u68R34igO+zlCjv3PgyXVBu8T+xqg4zVVK8hmn1lZ8rhw7Fb+wVtrq cQ4klVPAHwuc8MFcB4DXEHedZG1nPUuu4VxtwyBkSyfpBgWLl1w0k/nWkBR+6w/oeUN0 Tkaw== X-Gm-Message-State: AO0yUKVQOliFsUX4mWdIrTO3otdSRK2fIxEH2FE6cBC5I5CwsJ3EqTHf H1a+KXq9pn9bxAr+fRFrfzf25w== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@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.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-main@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.54:from] X-Rspamd-Queue-Id: 4PbKV82TsWz43w7 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbKfQ38mVz3xdRF for ; Tue, 14 Mar 2023 04:04:30 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 4PbKfP3qwwz44hV 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.53 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wm1-f53.google.com with SMTP id r19-20020a05600c459300b003eb3e2a5e7bso9215257wmo.0 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=WaekpAU4Dw7p69AmIu7XMGehy1mcqfQScRJgq9pN3nFmPcfdRJT0mJKQMs+ItZNKq2 FtUPOG2I1Wxtsu2vNvZjzEnmRTQAvm5JpTLtXY1mEL1tiN0WU4UyfShWtGwXA8JkRwDI XCRtcVmVkWXZoaHWgsMr+DySTNrMr2EbY7t6soHHGjGjh3PsvQOTBlD/mgrdxECPi/0I JKfnoH6qq8FtXCkRr8jaNkK+pHm+T34/hyOsaZw2euh+Sn3joDhmq77QAb4PVZItNTzf PYOlmcmR7nh9SSecqh62Svs3w/oZrOAVRkG8SsIXt7MgCvjE/kgh8YzrQztnQ8JXpbJZ rPPg== X-Gm-Message-State: AO0yUKU++gQGd7p/ktT89GUNeXZKLGhO+BeIEPsK0GvdFTqi62Nw5NQ1 XaFi00u/AM86KfRwITCgrQ0J1g== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@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.53:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@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.53:from] X-Rspamd-Queue-Id: 4PbKfP3qwwz44hV 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbL2Q45RYz3xfMS for ; Tue, 14 Mar 2023 04:21:50 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 4PbL2Q1l4zz46P2 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-f41.google.com with SMTP id v16so13176464wrn.0 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=dIlKMN64ytVMSd/JnMJV922LEFwKyAVmb5GtiRVOITrjJNJGnTguwvKDxdagL79ddg wqGllpjt7x3zZAm2I9SSZDEBD5qqV/qHSlLWpsXsfvTFSoONdh9Woy+0Rtz2RhnabJI3 mUZahXCMr9BmT5IW6nE1KSwOy/TGnpdQ4ZB+fTouPR1wS958ECkLBsFIIiKmUz/2mTfO b0XOflRl88zmz3Fnmme3cXk1PsacNiTaEotSVWwuLJrbnWeTJkKwqDe9oyXgBWDmrmt/ XktxOVd2E/CjC222NoEL+Gow68cgfs2ysWDrZpKxmd+94rqL1dEZMSTPBw223REvkfBv X8Xg== X-Gm-Message-State: AO0yUKVfL6Mp83eEhx4WlAmoaiDnlNxcFIg5n4sVIyWA5F87wXhJQAaY 3C9h/xisuBY66veouFnR5ItQGQ== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4PbL2Q1l4zz46P2 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbLDG6lbxz3xg17 for ; Tue, 14 Mar 2023 04:30:22 +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 4PbLDG6LCPz47Hr 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-f46.google.com with SMTP id y14so463732wrq.4 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=HNwQXgxA9aN8B+S+FUbqSxIKVK9UrU7CaShS2RVoJ1fRyDP9QhM/Hc83N0gMrWDgj3 /f8OVEcLC7Ihm28sW9QvnmrNjBVoVoPCokgd9oeg/GOH3jgd9ovBtH0bseVyZkWeeFTx LTD8VgFiNybR+gzWgqZuKsSw9FM6OzlVzFgG0Yg2BsKHpwzvJ9VS5ijjNArB3QISVJxA mua8jtLfcHS5yCCWe/ZByEsRoQQ1MmBh3Q9M1TnDgtn677mRzvsRJaP1KYl2h/jIWE1v fRCoYyKMKAyEwWgDt2WwMLk5wReBBIAmYmm6rdZv5aTBzPvcxYwoYZ8xJdiud37mSs4L x6/Q== X-Gm-Message-State: AO0yUKUfBX0fBioYR7J/MElKr57dkem+C7Ogxu1SWXCTUPjYMbud7PtM NHzc+uEmztjcmj2qldD6pkMNuA== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4PbLDG6LCPz47Hr 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbLNK5Mt9z3xgjj for ; Tue, 14 Mar 2023 04:37:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 4PbLNK2YWDz48bb for ; Tue, 14 Mar 2023 04:37:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52f.google.com with SMTP id cy23so56931461edb.12 for ; Mon, 13 Mar 2023 21:37:21 -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=fGuNzGfVan6hm2q58t24XpKKCdE4SWIuELyhTkUs6IP9a2z6wCOATAP78uWX6Ij7sj 484ZTDwWNQq3Hu57z5c3luneJxG8OKkbNW+cBX5fF98NeOpMDPNTBe/SWbA5OacuWoHC MV0pywP9XCJH0T0BykDiNJTevgI2zSPc3+SPWevYxG7vP7wp+rcYQ2YxZf8LgPvA1vo5 i2lrbK3Ml2UrQvN+5Ny7S3dThslSbexIvoIjwi+DgvPs/p0/gLRV4Ckzm5hH0MyDCrXI ljr6TwKDzf4G5Bm0k5a5tIIIOCcsbVQcG1ZMXPUfFByvCpUzrsh/rctreJdU2cM0z1bT rF0A== X-Gm-Message-State: AO0yUKXzGsAH+5zqs6FqKYkalgszw3JduK3GjOdhzjn4XqXzmAThhhBm qzHbOomefSpYsibPcXjrrZXvmlUzf1Hna07CUVeKyA== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4PbLNK2YWDz48bb 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbLYJ2Blpz3xhQk for ; Tue, 14 Mar 2023 04:45:08 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 4PbLYJ0N5Zz4BLJ for ; Tue, 14 Mar 2023 04:45:08 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f49.google.com with SMTP id bh21-20020a05600c3d1500b003ed1ff06fb0so3807931wmb.3 for ; Mon, 13 Mar 2023 21:45:08 -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=q3KLL/FdZymgtCGUiDBPysmRgfKtEtr+5xw3vccuLBI0lOVyr8Vm9IuiqBgmMaCTYb FwYdGD7Pq2IAUMM/HSrYEXo/xl6i14aU5+xmnYa0qs7bmQCI+tyf2hMqC22Vy0PgXMGR 4KOFRLfI+gMzpitdt1ESQEvSVC9ccgIiKmPmzrZSrey9dscAVXhFxS5N1FZMGHqiFwOO e6D6/TEwUhwkk1vlZg9MBupqE1W9QsNUo/EZ405dJPhIDgB6ZQzi/zszuiPQic95BGzK xf+lkHfcXbVa5b6Dz3VOUcSLnJLN33TaVfTDoWrRhkpGQMgr6En/4eIalQGrJlb5YkQ4 OqbA== X-Gm-Message-State: AO0yUKXjRJvlW7kQmftZn+ccWClxyYA+GVfdiUnF1it4DZiYTlnGqz2Q 81KxUv5pXHfA0D6QQBXWSuRqUg== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4PbLYJ0N5Zz4BLJ 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbLyp0dWJz3xjT8 for ; Tue, 14 Mar 2023 05:03:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (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 4PbLyn3ZRzz4DPL 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-x52c.google.com with SMTP id x3so57120989edb.10 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=cDO1RKB3Y3Uj6fJtJnuiONWmdW6ff53ZKXtfT4XJtTfnmqFSnl+2y0pqRRKcAf5hmG nvYpN4Gj7d26C0fpJD/GVpLy0IjwaO0vcyxaSsTFAtBlKiV8hEBZh4ZsMNNSkCJPdviY P2MEi0WsWspJazmEjbVu7WdUzyhb/BacjlOIUIN5ki/ViqDzTfWfTobd3JDC+flN6+RP EEafe6Juq9xrK3wIwa0R6r0IVz/cz4RdhEpRZsB11ZFMo9hbkZuW0wGItRxuOffU2suV +p1BpZJO+tJD1zznz91QdfaFeVlGZ1eH5y1OWLwVw0krjK3ARuV8ryaZglCJtGSc7lXp W2cw== X-Gm-Message-State: AO0yUKV2I+tgTJdiQZxF82UKEqlQPCJuZyt8N39I4Y1vUjFpssnfu6mp o2qMG4NBfhpkEuEIGgs19DN/kwiccDI8oaQHyWaK/g== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4PbLyn3ZRzz4DPL 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 07:27:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbQ8v66Jbz3xs4f for ; Tue, 14 Mar 2023 07:27:43 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic310-20.consmr.mail.gq1.yahoo.com (sonic310-20.consmr.mail.gq1.yahoo.com [98.137.69.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbQ8t0bHWz4PQs for ; Tue, 14 Mar 2023 07:27:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=Wtjk8UWX; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.146 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678778860; bh=XgdhSkWgAvX1JcJ8Ke5ULisHm+WGTxGNxThsE19WsKE=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=Wtjk8UWXGmoYKNmJ0stgRkmEegqjqRaXYDNDlDj1ANsBdUn2JMPiDMBhm3rMtYE/Of2k42+TjD97bgr/LSC2NTZ2IfXw2Ia/oWS5VZB3RAHnaacEJJwGn6cv7z4YNvHv8Nntm+hS/bzu+456gId6Zh9UCduBqPuQa1GkhO9CYbjay9a8wFjY7pqj0/Ueo5WXtRzrDaG9N4+sFJlhzN7u/TLG2tMY9juPWURRJNZC7mU4oH/ORBcgdLLGwcfBJCQsWdIdJ5Y9vo2/i5YkIShTg7p1S3l4SXSo3TX9KqLDeFh0hfIjFhTgLHwxGazJBr4Pui45by/jK5/18lbvLqqHvA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678778860; bh=W728BswqJowAFkD8RTOI/E4eAatb1iROnaxm3Dx776d=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=mduxxcmd0Vz1OSRxpnbBfvxoDi7/SgA+qPRprZ1f8wf3oKhALpAYGgBPQKGNHiozLoav4aaG1HLhft2KgZeeUq4hR5bmtUr/1YM1ELEMYjnBdqm4CQ8yJuXLGp7dG2AwUbaRaR5sETF8eVIBQQInReLMqx4VeUdkDfJKqIVKk9ciJXB6ttxJE1SYxgcUJl9jB+YZKXy0NLMRgz/ja6vHTkCmdtwRfXN7b1ci2IDunLNfhW2IaLxErIKOPw68aViAqaLudJAT5BgfQiUEO3O3XhcqJNW9TmbvpNcDX8mDA5RD0P8Xf0NjLLNfiObQdVH7LgdXljeS9GQ4gpZRKhI1KA== X-YMail-OSG: Owjm.6oVM1n4ws5caVd9qSWlEVqQfGm2DATXdLBl4nk0zmVnBmwS4ppMkKh.NLD jV5Aq_Z9W_L0.jUgxi_.PKd8TGlPVogmsx.T0t2Nya69A5UybTh9wMWsEdBtJvbRdQBtNQo5HiA8 7IM2O296BcMSG0i5SEtirJvR_h4auBaG6ZXi3zGggQcQc7958F5po2j77T2_frHXu2wjJSgLu1OO 5lkP31WxxRTwH_q7rLNToG8QjO5PxDEOfG7hQAeiCzSs9t4iKltrHu_rIF45.nvUAcgzkb_E9uQg ULpQie2VKkAYFar7JZOhAOw6emTjeO_R9I5ROZQ5dvjAcugysjScUBd_jEhQGpS_Qj4EwZ77ZWey zStsxPabDPSxSn0uv0GrWhALq1dx53AZcYNt.n4OAaM87vaj3GU3vYRJ62IHIitC4p28hhnWWhTM 2uZc7BIITccwmS92.YzZDGzfj0qxvgIKu3lJ2YU013i9IWk74bxSX9v7n2S3Wp7fHNTwFVSMoWyG EDh1sQijYolzzSlOqeGnj6BvmcOjynCUU.Uj0t3CGtq4LuMkJKPYERNS_ZE2miPyTyHBuI379W9f GXLK.8aPLejACxwubh2pYpGD_F5uTWD78RAMFwpgEXxqgYFIcjt8A5plD_lGwGAJGf2MK2MR81h6 asJ9Qr1JTGSY6CV39_b0xgyVwQsOaPCdebdU5SZJZorlko8v.Yh3FLeIK.AfHdGDllGqsA3CrIFF NPAN7d8rjKGxWG8c_wCHk99X5TbqzSjUjpXoJwqT_65LS_qjqboPND7_0L1Uv3CZh.tS.un3hzOH qe4zSLJ6wU_Z4TE_YgPdKuUcCDfYiy32UvIscXVVW96hgpCWvxPUxjT2JB79.V2IKOjFXc_CTvS7 eKkA2nPW5RbPWVtf8vqGCMg83A2nKd2uYJhynJBLegejz.hS4kLJQcgRcLcf_bFRAYFcPa.gR8Ku CA1plkmiemi4KoxoSjAoFeF3FmwjMVTRogiN4PFaBbRQ_.ZYWyrkkq2EzzNWC0lZ2P7_LUyGrHz7 TYl7uKzic0h1oWUiIUtB5hev1uyxc88QQjzVOZjphhqGCNLUzdiuwvAI8XidjeehjOTyIv2rzHu1 HOqZxJU0uCEBMH77psCdXnQGkgDzZyFtlMoahcB7rIKrcw9X9Ii.b2P0VHk3jbcPkvoDer7mLo8V pfPubwxv.VFQ9nROkGNxK.vKySewmawbxlnwEO6c1fWSyPsJXT8DpMK7fENmSj75SemWPZSrM8A6 3ii1JeW6x2eheBq4TZ_dOskpq5ApcSuv1lMfCy5tvmBSxzGOACqpH1F6GLKGqmTJAsKiBWF7PfZL TNClIW9O5C39sM.TTZpsZZMCnPGedE7FPQxe6DDzXapvWxkwkjcLCFq9fqoZbhG9Yk.ab.DlL8Qp pBStrpvZkDR3s5Z.m5gG7fKj25iqmw8MAhAfyfx_0t6BRmx53M7IOIAybes9RZr3HA_WY7KAJvr4 bgRuipmQt2LcQ4zEx.i5A34_xWElnHkDNWz7UkyyCapJ18y49MVGdZ8cmqADKa6oC5vqnm7rHI_u Xre9MMyVvhlsrI.vnlyrxQQMHhYUBftDf2nqFhNIVk_Ocinpz20OamlhJFr9emO3XYAqFGIu_UTl a.NhTtcuAmqkk39prASPO2zhupb6ziiWFoYsonOXjTV6QKkuXud3P2o8J9fWLw1hnWXUrQzG.pgq rNTxTpa1M7zT9CPf_7TCiUIx_BGlzO7uUYeAwijruLjruNwfAWiLcrtxi5PSeNgto7gZS7hv.Ia9 30PW7fqlKdrpaslZl2ZtCLJTcWX5IlMvryPRP1REJ.fHMCv28l5XdglXzmXPSOTjUWWH7Foi4_Pr Oke4vJxeBvPwgdiGjaXpkPooQGhT78KQU3C.RmZbGGHAtJ9.iOBGXCsIi2325DmrZqr_HRbw9HY1 XTTZMq4jDg6qVZqk8I317UaizeFjHScglxtIV0e9SP2d3MF3KOdMDvsd08gmQ0DQ9S2vJ0w0V_u4 faoOhF4V2DHCj7_we5Q7vO81kyJSJv8IDEfeT.BhoUxBDkMZD8Nb2OVXkd825oRN_rJvIV.SjiLi n5tognL9STGmZPn_rmQq5fdtceTAjIVN62kOHC4AJZqykcYBQ5U1PcTEEp5UMp4MVfR8MckhnTOv AYaMm00bt22NJ5jFNaYx_AVg0E.QT3FE_LsPXfD4oD908gIzVgPjTyPWDpoz3FokRZN6zDWQakcd r0i0cZORWTKRJ99NCYBq9J8bgp67_O0Fk6gPOS6MoVSSjK90VpzRsXJK5UyCYyoCaj8TOcw-- X-Sonic-MF: X-Sonic-ID: a3e5f454-80a9-4f3e-a46f-570fe1b9cfcf Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Tue, 14 Mar 2023 07:27:40 +0000 Received: by hermes--production-gq1-6cf7749bc8-vl5z2 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f626fe84dd06571b9c159c4b50997bef; Tue, 14 Mar 2023 07:27:35 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv Message-Id: Date: Tue, 14 Mar 2023 00:27:24 -0700 To: Warner Losh , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.400.51.1.1) References: X-Spamd-Result: default: False [-3.49 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.993]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.146:from]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; DKIM_TRACE(0.00)[yahoo.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org] X-Rspamd-Queue-Id: 4PbQ8t0bHWz4PQs X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Warner Losh wrote on Date: Tue, 14 Mar 2023 05:03:33 UTC : > We need to do a pass to use rfc language. style(9) looks to have about: 8 "must"s. 11 "may"s. 56 "should"s. I can not tell for sure if RFC 2119 interpretations are/were (always) intended or not, especially for the "should"s. Part of this is the lack of the capitalization used in the RFC to make the special uses stand out vs. possible normal english usage also being present/intended in some places. For returns statements, "the full implications must be understood and carefully weighed before choosing a different course" (a.k.a. "should") likely is too strong at this point. For a style guide, the RFC 2119 "Guidance in the use of these Imperatives" not specific to each word is not a good fit: "they MUST only be used where it is actually required for interoperation or to limit behavior which has potential for causing harm (e.g., limiting retransmisssions) For example, they must not be used to try to impose a particular method on implementors where the method is not required for interoperability" (the "sparingly" criteria). === Mark Millard marklmi at yahoo.com From nobody Tue Mar 14 09:01:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 11:09:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 14:19:37 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:58:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:30:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbfD125NPz3ySjx for ; Tue, 14 Mar 2023 16:31:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 4PbfD04Qstz4K73 for ; Tue, 14 Mar 2023 16:31:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x532.google.com with SMTP id j11so64405424edq.4 for ; Tue, 14 Mar 2023 09:31:11 -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=SKcgrYuieHyi3k4IREuBYek7RpEYxp4DFTsmAn1gJviIb2BrnzQZW7HV4r50iiouMZ o+v10s3T2x55y2qvlbWLufmWhNdmliS5bc42R+4g0W/nhxk/S+6P5NqYLHV7VXr96nT7 uQQjmVPsOi7MKdsIvw4e5PG41lBMYSE69VneiI+xC3dPOmYVWhe1q+7SoUIcbbMX5ZoT 6K96GDVOSL/UNZXPtIqxGGb1orNp0zxMLH2s2zt2Uqw04PITL3AhYviQk0No6Eu4tPao w5+rK3mqW5H1PZ1B/L615DsFT5AtNhLXoqLyrhCzIm6oHFSNE7Z+4WsTP/rEt3XBuO/Q MolA== X-Gm-Message-State: AO0yUKVeyARNPgunBq0q8keEleVXQPb0XPqf6pHLvjcPEQ9UlacoYpBO jqvK8iIAuTwYFfnv6xGKIal2U2R+a5U78IuxHv6Idw== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4PbfD04Qstz4K73 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbfxS31DMz3yV0B for ; Tue, 14 Mar 2023 17:03:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 4PbfxS0wgPz4N7K 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-x530.google.com with SMTP id o12so64788701edb.9 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=dnsaJZjs1P7AQpCDJ00lIVRHBmWatd3iBhoha5RjXtA+HQfnui+pwu0cizt0xAHv36 1587VlkziHmkFBe0i9wRX73cXFtIwXJ26sqsvOzRfFp/XYkBhvjh/CLYi5qIymNTvpAv 3cuN3LGjHiE086aCWaFM4PHInBxGnkjAvu5C5E1GYsF6WUpQVx/XYZDhmJJC1XOn12x9 2utt1XyK4axmi0BnyAdEhN3nP9LxaIAfwKYyONwbk46aAYWvkr6bxZtqQ5/nKUj93t3U /NGYC296FPj/YvYpeX99ZeQyGj9ya5DYEZCRJLyTCHxm5dmJ7u44AhHEyfcfKhtg9mk8 0mDw== X-Gm-Message-State: AO0yUKWgWuFBrsjQBmph8x/OXWxfipPXc/QiRqlZ3kf2qEv+WmZ/xWOi +fhTlIiaizH3WaLKOFgWkztjm3qnTTlE9BasTyUWSg== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4PbfxS0wgPz4N7K 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 22:04:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 01:58:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbx9f2wwDz3xwWp for ; Wed, 15 Mar 2023 03:45:10 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.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 4Pbx9f0h4Jz3JnN 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-f45.google.com with SMTP id l12so7837566wrm.10 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=GO15pLkFWZJT7RS+YK7XzP1v7IF81pIGQFK+GZRoeWweGhX3Zrca+oHXcxrVkwWDTO 7w/5Db3Jj0cxmETvAlHOZ4rmE5LRHqawiMGalxg4dJ17MrCVP2ecG0YcIY8aSj0FVpko uK3qaVnhCaqgb3Qvlb9439bbqM5nMf2RfGzKgIm9J82FxYn3WFpQPiHYixB+2/mA+qcp Sl3PvQCoAG2rVBLULVvPieJ7ialZ5geuqDYvvmwFYbFAIcFAvPGXAOlACa8H+J7vMRQL X86Fkq5b7r1ECUXN7k6PXu4nT0aHVLi0ItU+sMtX3uHNbvFQFUXBMOjb1C4cSWvTp3JZ +dDQ== X-Gm-Message-State: AO0yUKUbp5vIFhFi3u/5aUJPncRhKQzUK9DLapLyef7fi5+ljYdCgIN2 4vSmvOpodxdLJQJiqqUuRK2iDv9vTsvmdCkA0zdqPg== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4Pbx9f0h4Jz3JnN 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pbxjy1td6z3xxXd for ; Wed, 15 Mar 2023 04:09:42 +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 4Pbxjx6924z3Lxf 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-x529.google.com with SMTP id x13so23162787edd.1 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=h1Ad3TeogvGoqRKgw6cmgwsHpFsYqmIhlkM8Eb/zO222IeaxzCzeHT0gs5WIGEXWQV NZReCIFAoWdPzB+AYJugWJxfEVHiMkjZZqXGRWQeU1kjM/JnRnHQhZyJHUf3Orxl9yZD 2Fb6WeYCI1DhthjIVhGMFScgeG4KVoQ++jMgRhawIYK78Y2Pu43M+szqCefH0Fztl+Cx uzEjhQRrc2qg82tqFaxW4OEVvNyrAmDyWjVh9KV2mUIjAIW3ULjBI8B7dhaHf48zRHeZ nTHH6wg/+8TLKWbtuAlKcgI1mJy1CvQvUTXwWt/fAJNKtF1nc1UAOp0APvPUEOBNiWgW nl/g== X-Gm-Message-State: AO0yUKXsEP+CdpOfAUzPQGKgtMGDrl0EZo9MHPoYcfsb/XM4YV2V1uV/ zcOho5UCM0a+ihD1JQ06ODWqOo8J7baIInup3HBfDQ== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4Pbxjx6924z3Lxf 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 15:44:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:05:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcLxH5mMTz3xjBq for ; Wed, 15 Mar 2023 20:05:55 +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 4PcLxG0fXMz3qjZ; Wed, 15 Mar 2023 20:05:54 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org; dmarc=none Received: by glebi.us (Postfix, from userid 1000) id 1E5EF2DBB9; Wed, 15 Mar 2023 13:05:47 -0700 (PDT) Date: Wed, 15 Mar 2023 13:05:47 -0700 From: Gleb Smirnoff To: Alexander Chernikov Cc: Kristof Provost , "dev-commits-src-main@freebsd.org" Subject: Re: git: 7e5bf68495cc - main - netlink: add netlink support Message-ID: References: <202210011419.291EJ3aa000309@gitrepo.freebsd.org> <3D3095AE-60CC-4CCD-8C8A-A6E53EEB6A8A@FreeBSD.org> <2F410705-A141-49B4-8395-3B39D3EF1C3E@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2F410705-A141-49B4-8395-3B39D3EF1C3E@freebsd.org> X-Spamd-Result: default: False [0.50 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[glebius]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4PcLxG0fXMz3qjZ X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N On Thu, Mar 09, 2023 at 05:45:50PM +0000, Alexander Chernikov wrote: A> > So, really fun thing here, we also have #define NETLINK_GENERIC 0 in sys/net/if_mib.h. (And that’s exposed to userspace, and used there, so we can’t just change that.) A> > A> Wow. Thanks for pointing it out - it wasn’t defined in the kernel headers so I missed it. A> That looks like something FreeBSD-specific. Both NetBSD / OpenBSD doesn’t have it. A> It seem to provide: A> - iteration over the list of the interfaces A> - some basic interface traffic statistics A> - copy of the ’struct ifdata’ (basic interface properties and some interface traffic statistics) A> - Link-specific data (IFDATA_LINKSPECIFIC), not used by anything in base A> - Original “driver name” (IFDATA_DRIVERNAME) A> A> Most of this is already provided by either getifaddr(3) or netlink or even rtsock. I’m thinking of deprecating it in mid-term in favour of Netlink. A> A> I see the following options: A> 1) Remove usage of if_mib.h from ifconfig A> A> 2) Add compat layer: A> *) Rename NETLINK_GENERIC to NET_LINK_GENERIC (which is the right name de-facto) A> *) Add conditional define for NETLINK_GENERIC to if_mib and set it to 16 A> *) Define another tree in if_mib.c under net.link .generic16 with value 16 Let's request exp-run with NETLINK_GENERIC removed or renamed to NET_LINK_GENERIC. Very likely deprecating this name would go fairly easy. -- Gleb Smirnoff From nobody Wed Mar 15 20:53:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 Thu Mar 16 04:15:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 13:00:04 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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:17:10 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:31:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:51:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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:19:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 05:56:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 08:35:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 11:07:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 Sat Mar 18 03:44:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 , 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 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 To: Konstantin Belousov , 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdn3z3jZgz40F5J for ; Sat, 18 Mar 2023 03:46:39 +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 4Pdn3z0s5Bz4SRv for ; Sat, 18 Mar 2023 03:46:39 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f45.google.com with SMTP id bh21-20020a05600c3d1500b003ed1ff06fb0so4441736wmb.3 for ; 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=SGlCc/Z0CxAVcmn3zy3TYRazy19VhZ19yzNiVRuGZRr0E0LjZyb6uXvqjiRhBrjFXJ 89EDYXeqHsbNX806ZtS5Hj/hUOP21ngmzgeLEyGt/00Y6kOedbftY8FDAjW9ZjNVe3L9 JhVsfOf8CwFxnrteSN+TENw883X33FJkTXkO56VP6XmVpnHcYahKdyYRrMk/XypprXl3 aRznYOLqpZZ//bmJTJl0TEJ9ozJXHBzV8V5OmmuWa1aReE8b4Hu470xRr3pZp79JLhjQ 9aHiHNd+J0e//Z9uIyC9t6kxlIBKMuRurmt9C7BJWVyUYWbEHDugBjMcnNs4ST4uty5Z K17Q== X-Gm-Message-State: AO0yUKUk6TDCWOSCurNs9rvAUQoLilX8bjFKrm06pbrl85OW+1SBo2da Qf0CCf44Iafl4v/vkf2krNxnvQ== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 In-Reply-To: <8d3503f3-fd05-5f1c-7470-48cef3c9bd2d@freebsd.org> Date: Sat, 18 Mar 2023 03:46:36 +0000 Cc: Konstantin Belousov , "src-committers@freebsd.org" , "dev-commits-src-all@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 X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4Pdn3z0s5Bz4SRv 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 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 04:33:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdp6m4Vn5z3y3Zj for ; Sat, 18 Mar 2023 04:34:08 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-8.consmr.mail.gq1.yahoo.com (sonic307-8.consmr.mail.gq1.yahoo.com [98.137.64.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pdp6l3F4dz4Z3J for ; Sat, 18 Mar 2023 04:34:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=N+tMnmpG; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1679114044; bh=axIe89XvwLYqkKTEMT48PsBDsPcdxH7+CpjsmGSMsDo=; h=From:Subject:Date:Cc:To:References:From:Subject:Reply-To; b=N+tMnmpGKLbc5OFWvNrNLqtgmO5vScDqE/6gW+kyXrzG01o46Z6uggiWLJiOYfnoAFjZPiCwKiUwM381AZzsNgDzc/rHQQB92rQHaprc2g6vVMZJ1nnarNrm6RxJajNJONOLbowcKHqFdvguYQmJh6wWGrmmFPUWYpJUx+crbiru5SfEDE9FkP+e/nrOu3tzHgXgoiomJQ7SSQXv+u5X2jBheDrPqNN7HdL6d4q1tr6zAsMVsMjHWcuWcXG0XkohWcrjHRW+fIuP7SZF8yLpglfTqSw2CSwkZBE7IdyzR0sMzlfwVwQz96AeVSh0G4eyT281Ahp1ANrl75ORoH8NlQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1679114044; bh=2XTDtH5H+x13kE0+6gXRgRrz77GPB4nxLhvjyJyCStL=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=KKkVogPfbWZIhNtRDxFZrzIuAk/UvkVQHBBCV+L5lqFeO6mit/oWbSDpcy4DsoQp3xbWWjlg6EfOMzALCx1QTFuf+nK+Rm4ICDseQ+V9we2HbgYn90oagdCIkkE6RESYSSjAIqS02ivkvdmyI05hZyq++xlkSZLK1734BdOkXwQsuFt6WK7mvqdHWlYrQOOcJwCSGhorTIHNhT20yylMhjP5+fGG5o0vh56/SoCxbiPn7YdK2dTSlnv1almqeTN3+oWdOlifvR77KiHXcR5UqZrIvq+KAxDUqlwB94tXLB8RTa+NHj8h2nwPz+RbN1dns1WZet4CE8ZTNuPi09Tl7Q== X-YMail-OSG: 2dsJDMIVM1ludYko4YCuPG7GtGa1IBp59ADnALccP_ENH18u7IezsmvDaFtNsvv wz0XN9y01c_QYGhd3gxYWLvqYZDeBbSAlQ1br3W7j8Wp4k.3p5H2SxZ2UzH7vqC404AbbAd9ip5s Lm7c7.kOXzIPtJC_fngFBNfSoitIubxfR5QlpQbXO.E8jW9pOUiMrtE6x9aDXC8IrQpei.HG32ct 1RdCC5S0g2w6K0QooYAae.3trQzFChtDzThsH0OSBnyvFa78SyAvRkVKa9RLvfjJQq_oZgWI5T4s NOpMuZXU6OXukqxJfbJl5bmQEdoYGGdTBfa2ZXGbLniK.jj184jcJ8dotxNVbr9iKMkiTEvuTFbf FwJZzHYfeyfDcIYEVWIW8Huj8YRoSwRT4UYGVNCse3qb0lUe4EeKiSTq6PZwrat0SYkJkm6aTQfD vRsM4.3G1P2Afr9gYyaDp0giR0rGTOtnwZGg4yOA9Rb021uNIP3R4XMFphBvVqNUB2P3CNVRLAw. 77Jeuq3ZcCmAUF53Sv7jF91a39Sd8p_uvabFz9sBsOde9RGXY1gX_PX.Zfsae1mfdZy3H9kyNiBG ixHxvLkAE099UnHbIamjaOFIqx0u3XCJItwEr65jEYAZbsFBWU0dFvFB3NcCmFiTPyaxBzq.1JFA M_ugGqAOYzQ8PZqzp3UjK2fyN6tnp63nGqLawQZ1M2Y5ykjnyj5bqc17S16V6.alA3WzZiR1dgUv RUKeYStdgg9WSptn7MM7XpXiqqshqZdK12lIYgrM8nAyn0Ni7OVedm8UK7PDxZSfJq7GdDLb6xbo pm404whhQ02BHUCUK6NtoipUuHsR9Dy5WLMojgmkBmzxuTRXkWh7saSAe7vomp0tQDtFg9gnzqNt eQlyKCKZGNHRuztSlMxsqzJEGi89.ujyZ3xhl0wq53ULz6YsmDB2pJEc8OUbUxR.GayLX3Fu5njM LKRyzFoR0keU.sfT0uuGJD13mbdE.9Kyo3p_7F1gkWrVRURCmDXsYDDcDuygS_cytIchMFj0RtOi yPFDa5FJ6WdyFDsZr09ou_IqF0qzHZqxc8wDf1QloyQHs9.nzeA6UUDkdpKdwTPbl1ZJrCr6vqA0 t0ftdMYDoia99oSBssjS1a0ojLWDrjYW1KlITyBEbqLMdWibBjHo2M_Vmwv0yA4tlbYWb1npMwwK YzzHZlxZAFocA_gk5umASU8Db8MS6y4Ef27kt7YF1fa_kJKV9N6VfpY.mx._NWYzxB4u80xpr4nb hqyps0ef2XbBefALQ5f7.l5LqtsFCtd4vNLm4yI6XR3fbuoAva4x1tbSF0e12kw.awO0eowLUmI2 iDpyvjvnoadNbwBNNSegv.Sp1suQtXn8.lNGI8A6oBTauhs4Pnc6TzNYOW4cK1p8yV5sv0nvjGVB 6sAxqhCUoEKuc_yrRFlTnY9bHTC_JScHTED9yZcW3ZB1wYcqXPaCIn._AEM3GAuiAhjuCTzUcZvQ rKRcvoIkeyK.JY6Pj_OnQSKMWTObaEPIDTSO738IRa73ypjK47.oMQPlATYJg28pzLcD4cG4VC2g 7RlPg2ReRoiRbCiil8QXqTCCrHU1N0jvqNZV3.qjWgTcXV7K52rqkDOTK.5wmjpc..sdvqilcHnd vz8.__bOcpZNZOJ3fSzn616W6Zcxcfq0NsJMuATv9qYtVDU5UFIT.ri4XUddKMU.OEuEaE8cMuLQ CMP3fvU2absWJH6UCG3Lbn3OYM1X4UCC1cSMb6FrGZ2G67Rcua5S6bU_arfed2F8ClGt0wf6si6V RSfGhJHDIv_mOUm7Q5Fb_Oiu1BUYPnMGxXaytf2NzzfkF7MJ2vIqot9AaZBn3BrsxFxTPIW58J.z msTHV5Tw26kM9pY1Ln7bYUNyYSKS7LYO2QEyzYErtAVnLyHHJb2IzxwX7URbYsTasYRaHZwHh9Kr JSpjC0obiIht68Y.oEg2i9eYLbmf1SFbDCFjXEEt8JTyuVuLzY6WJjHulgpFacc9o6XmFwLphMSK exc5gjzv7ZE306y0Da.IikVwqMbD2lr_KQp1__XcTIBScrVaGIH7oQcv1FLMJ0VuWyC_2fALoz5u 5zG5g.3Fp_3ypNZYflqz8OpBGHS6eo2KJkurtRVWtH1YEoj7DUfCvemJZPDvlwtWNbHhFNbbYD5_ kuegV6iQA7MWyXqqidR.qG68L3sUp.htxoq4BHOUjzBMI0IViFCbWUoNcpazV.fmJCoHcNNx9X3B OeFHo5EgtrCf5Ch86zhp5WpHq6xGXjBFIXMQFgTJ2QXZu6GzoT.Ifwtip94pKiJqBsgn_y0FHlG1 FceO6ry3CIA-- X-Sonic-MF: X-Sonic-ID: a7002ebc-a9c0-4fae-9ae2-17991a6f811e Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Sat, 18 Mar 2023 04:34:04 +0000 Received: by hermes--production-bf1-777648578f-286lr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 2285f14af6e5c96f5da179df33a47a53; Sat, 18 Mar 2023 04:34:02 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: RE: git: c5c9d980c4b0 - main - libc/csu: rename ignore_init.c to libc_start1.c Message-Id: <6DAFA692-CA74-4F0B-A1C7-F5D67EEC30CC@yahoo.com> Date: Fri, 17 Mar 2023 21:33:49 -0700 Cc: vishwin@freebsd.org To: jrtc27@freebsd.org, dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.400.51.1.1) References: <6DAFA692-CA74-4F0B-A1C7-F5D67EEC30CC.ref@yahoo.com> X-Spamd-Result: default: False [-3.44 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.94)[-0.945]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.32:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.32:from] X-Rspamd-Queue-Id: 4Pdp6l3F4dz4Z3J X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Jessica Clarke wrote on Date: Sat, 18 Mar 2023 03:46:36 UTC : On 18 Mar 2023, at 03:44, Charlie Li 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 Note the above: this looks to not be limited to main [so: 14] going forward. > >> --- > >> 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"' >=20 > It=E2=80=99s not a break, just new ABI. I'm unsure about the MFC ABI status. > Same as adding a new function, just > everything automatically uses it. >=20 > It=E2=80=99s true that __FreeBSD_version needs bumping if it hasn=E2=80=99= t already > been though. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Sat Mar 18 05:53:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: cf6356fd471c - main - daemon: repace goto exit with daemon_terminate() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 AuthorDate: 2023-03-18 05:31:12 +0000 Commit: Kyle Evans 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 8117ea0a4131 - main - daemon: remove unnecessary memset in daemon_state_init() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 AuthorDate: 2023-03-18 05:43:35 +0000 Commit: Kyle Evans 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pdqzg4kvzz3y8F4 for ; Sat, 18 Mar 2023 05:58:07 +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 4Pdqzg2W1Xz3GM6 for ; Sat, 18 Mar 2023 05:58:07 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f42.google.com with SMTP id m35so4475078wms.4 for ; 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=OlasfWzRIbxIP5vmtcyUjlYgZtaYKZ5Wnls/4plr7uMdnUctB6/XidncuWYWHYvD9i wZdb9Nuq2M88uqJ6jPjoYKchghpvhdD/yv9/yZcI/v1BgbDCzWAQ3U6meYOl33suFDw0 hEbSIl+rskQ0HmAgXj/UIuhkCvhq4itqN/awhgGj0vHak9t781XwyKLC/ZDFXiFt+3WH akQ/cCPti+6Z4QrLdlhcL8iaec1IN/W+FMCToFNlw7tk2X2g922ZZRwoVBDqiuAILV7A HzuVbS8TbD1rzGQKX0QtqRKGhQr1v4L1tL6bp1n8jy/gU2L+ipetxGuau46b6wWPbGmb 2nZQ== X-Gm-Message-State: AO0yUKVmu7XIcIR6ldcVtY9lFAztrTip8hRRW7PyS1u2OJwdDX61yxVO ia//6HP6z9EAeJnhenB/NS1eMI1BpJ7P914H6BjRFw== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 In-Reply-To: <202303180553.32I5rfRu088924@gitrepo.freebsd.org> Date: Sat, 18 Mar 2023 05:58:04 +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: <202303180553.32I5rfRu088924@gitrepo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4Pdqzg2W1Xz3GM6 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 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 > AuthorDate: 2023-03-18 05:31:12 +0000 > Commit: Kyle Evans > 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 6b49a630f441 - main - daemon: kill off some stray blank lines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 AuthorDate: 2023-03-18 06:04:35 +0000 Commit: Kyle Evans 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 366da717deda - main - Add root directory entry check. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-02-09 09:34:25 +0000 Commit: Fedor Uporov 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 3c2dc524c333 - main - Do not panic in case of corrupted directory List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-18 06:11:27 +0000 Commit: Fedor Uporov 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: ab3ff87a333a - main - Belately bump __FreeBSD_version for introduction of __libc_start1() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 AuthorDate: 2023-03-18 06:21:59 +0000 Commit: Konstantin Belousov 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 To: Jessica Clarke Cc: Charlie Li , "src-committers@freebsd.org" , "dev-commits-src-all@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: 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 927358dd98cb - main - amd64 loader: Use efiserialio for Hyper-V booted systems List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-14 15:13:46 +0000 Commit: Wei Hu 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 8ea7fa16d9fe - main - uart: Don't change settings or throttle putc for Hyper-V List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-14 15:49:33 +0000 Commit: Wei Hu 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: ac6bc808f516 - main - smbfs.5: Us .An -nosplit for the AUTHORS section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-18 09:02:59 +0000 Commit: Gordon Bergling 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: bce30c896db6 - main - stress2: Added two syzkaller reproducers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-18 09:31:31 +0000 Commit: Peter Holm 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 < + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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 < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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" Subject: git: 568a645ba55a - main - netlink: fix capped uncapped ack handling in snl(3). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-17 14:27:08 +0000 Commit: Alexander V. Chernikov 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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" Subject: git: 046acc2bfd13 - main - netlink: add public ucred accessor for nlp. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-18 11:44:29 +0000 Commit: Alexander V. Chernikov 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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" Subject: git: aee2f11bf4b4 - main - netstat: simplify netlink route printing code. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-18 13:05:41 +0000 Commit: Alexander V. Chernikov 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 #include #include +#include +#include #include #include @@ -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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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" Subject: git: 9ee6278b7885 - main - netstat: fix double-free in netlink error code path. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-18 14:01:46 +0000 Commit: Alexander V. Chernikov 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 02904a06c76b - main - amd64: properly recalculate mitigations knobs after resume List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 AuthorDate: 2023-03-17 13:02:03 +0000 Commit: Konstantin Belousov 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 2b4b3789f877 - main - acpi_wakeup.c: apply the reviewer' editorial corrections to the comment text. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 AuthorDate: 2023-03-18 15:45:49 +0000 Commit: Konstantin Belousov 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: bad8f86843fa - main - netgraph tests: Serialize List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 AuthorDate: 2023-03-18 14:57:36 +0000 Commit: Mark Johnston 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 069767091e54 - main - Do not panic in case of corrupted UFS/FFS directory. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 AuthorDate: 2023-03-18 22:36:54 +0000 Commit: Kirk McKusick 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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" , "dev-commits-src-all@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 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 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 > AuthorDate: 2023-03-18 22:36:54 +0000 > Commit: Kirk McKusick > 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 Subject: git: 48345048cd1d - main - sctp: fix typo in assignment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 AuthorDate: 2023-03-18 22:58:50 +0000 Commit: Michael Tuexen 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;