From nobody Mon Jan 15 02:24:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCwvH5nHDz57LBX; Mon, 15 Jan 2024 02:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TCwvH4qYZz3x98; Mon, 15 Jan 2024 02:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7A6eO/xH3YkbKV+Jh/30nOi5guEGkB0IPo00BRzlHGk=; b=EzeMASGy34tmZTWxwxxiG7sUM/KFGzZI2LMhibomkWALwF5q58+7aBCYlpdiaijRq/By2h T/BYQ+f8sRjnmc3Q0JiLdTf/JvvfXt1btw8CoBEQcTnch496foYiUZJMfIWNC+jg+w2M4H IhqDEeNbnk/KVmrBMWMZ3hlU/9Znl+EOvIrjlwef6k8yAWXeX15JSVMG7AY90ZFUnXBJTy 9oaXyO8HhyX+d42DjD94rZHZMEGKmPvS9QrLOZFv6HRIhy5b6msKhqSGsUtALU4F0j1d2Q x2YMTSGp8DneWWqdRIOot3c2KX3avV4JFkQb6q3RF1zJcEHU8nvQVJ4tUq4Nog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7A6eO/xH3YkbKV+Jh/30nOi5guEGkB0IPo00BRzlHGk=; b=CQiH34JWk26Pvh55OWVkOnvhfNZjDcg3n63a8DukQkWKpQSRnLmrJ7L6BQr8IdTYpXT2GE xNZI252D2bwsJReplukIvWjR6jSeFDofScSRgsEnpDgDJddvK1eIOFss8BcfD8kEDwjop9 +4KL6hW5eeLg+Mj5EIelDrAPMTIYUmjlSj+z8asyzuoQyARZH5/oIibK3plEKbZxQXl1qk ijbSTSRpq9qQgeGVdZCQYG22ITKRSP0ht7LIwBRs0+92EcrjuMA4gtdjXo19OH5cRLfW/r Wedz/sqAqFf5uiyWe7zTGMUC7yeOIka7SnbvgO/b0IXUuqmthvd8avZOt5Xayg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705285467; a=rsa-sha256; cv=none; b=XYYG5LXTXLBxy8fb1BlCEa6NBrCKg/E3hVP8GVUF/jEEKi/qFjVWIZ8Dmf8XOtVmzqIIPB Yv8b/28hW70aWumHp7SaD+XxUlBzam3umL8BFyvtb3br6S4rVwtiZSMUPRR1Vlk8vydS6Z w+Ja0JJkuIcEtcR+8RphiyXiJ9+LZVxjCAj9Fq93GjN7yaa6w9TFK88moY0oIgNJ37gYL4 NaH+221ZqSgS+lumCh0kfxgDaX6TBuesy5Fzti7JjxnY9X6XE086iwjaCSiAo3Gx1Q0oJP R5K0H28n5r9BqIHMuL2+IAyVFOMGt0HZ4n4tKHXUMWS6lYFDYG/4ei8DLy0FjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TCwvH3sN3zdyq; Mon, 15 Jan 2024 02:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40F2ORCm093487; Mon, 15 Jan 2024 02:24:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40F2OR6f093484; Mon, 15 Jan 2024 02:24:27 GMT (envelope-from git) Date: Mon, 15 Jan 2024 02:24:27 GMT Message-Id: <202401150224.40F2OR6f093484@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: 3d939d967ad4 - main - build: Use ls -i | cut rather than stat -f %i to extract inode List-Id: Commit messages for the main 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: 3d939d967ad49f747b8b9db4fdec8086a7067582 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3d939d967ad49f747b8b9db4fdec8086a7067582 commit 3d939d967ad49f747b8b9db4fdec8086a7067582 Author: Warner Losh AuthorDate: 2023-05-02 20:51:09 +0000 Commit: Warner Losh CommitDate: 2024-01-15 02:23:45 +0000 build: Use ls -i | cut rather than stat -f %i to extract inode ls -i dates back to 5th edition Unix and is more portable than the stat command, though %% is a newer shellism, it works on any shell that FreeBSD builds with. Sponsored by: Netflix --- Makefile.inc1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 34b49ee319ec..8a0073547ed0 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1059,8 +1059,8 @@ _cleanworldtmp: .PHONY .if ${USING_SYSTEM_COMPILER} == "yes" .for cc in cc c++ if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \ - inum=$$(stat -f %i ${WORLDTMP}/usr/bin/${cc}); \ - find ${WORLDTMP}/usr/bin -inum $${inum} -delete; \ + inum=$$(ls -i ${WORLDTMP}/usr/bin/${cc}); \ + find ${WORLDTMP}/usr/bin -inum $${inum%% *} -delete; \ fi .endfor .endif # ${USING_SYSTEM_COMPILER} == "yes" From nobody Mon Jan 15 02:24:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCwvK0NWtz57Lms; Mon, 15 Jan 2024 02:24: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 4TCwvJ5sv2z3x2D; Mon, 15 Jan 2024 02:24:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w6Gj5ZuPWrjrTIGgBPusMnMF79Vzi0kyOME3HP1ZAbs=; b=yZTN03Yayv6bqs/AJxdtLoJuYY6BS4NW22B7Ey7GWsjh2dt1UGVZXDL3nVULJAmLBcDn97 S+5PCewZBZ+TdkQFsyIYYC4PiaNua3tp78OpCdQtPAAto4K0R7ukCkyO93DWZSbCu1V0fl 5RN42DfI0U4v+V6oupnTDNtjABG/5qir7NlEC5eFW7vZWqb7ztKZUp4YsY/CknqKZUeK3/ Kd789zFFaspzPrkaw70RefaJwJYZvCgE1TCC4Xg0wy//+6TNyu/zhTgNxOTFBaQKZA3/TW UB3i2uWYUS98KCDArDls/mSsU/vt3DMEl8pJP+WXWrElcZCVL2Ir0qZxtBLxNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w6Gj5ZuPWrjrTIGgBPusMnMF79Vzi0kyOME3HP1ZAbs=; b=ZGxQYM9R7o+UPGenRjH3SWCqZ2MOWbXOQLLF+MAiuwqpklsgrR2/cSaZ6LYtjaL+iArYJh 0DyFRXSmP9mVS9StmY6L+T27YRlbZrKVZ2pwXPzHt5km1kJrV+YN2RJ1klRnKH9y+zJ94E VnMYbgOUBHWxSptDOTEIkLEiEPs/dZ9tuI1xWumPfthgPPaoFsdeOwXLp3OgbGrnls28co XG7dg+roHiFfkX/cNDXvnwG09zZEsVLU+f822DX/sG9T3nvSc1U2Z7PZW7C5Io5p6bPUVy e4T5Ik8oX+xsUksJ6LgfGWbJnTScnhiUjntSfEhHClBPSWNSUHr34VCvpenPwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705285468; a=rsa-sha256; cv=none; b=Jl6Qejp9oUlHnczAH6G0qEb9IivEfyvh5w+WpP3cSke9DjNiwk3a14dODc/34NYhQw9PS6 M0Q7HRS0HVe+A2BGs/eHG5y6oLltBHb6YQMWZAQ8FBKbFTZp3WuYKfOF03W3TqSqgxyR3D c3m6VO4gKO2SD+os+AHQ4od3j5QjnUhEfGt0bC5ZAXwbg/G5rFKVwjS187FO8Y5yWiUWUg uSkqlXmsYzD5/ONelCLET2x3hkMdeISxF/jrMykwSynRhMfLtoTlMVi0ncHPwu8jViDakt ROXPI2Tx5+vkGXgzbChKpJGhtp/KZ4QDn5p01rQVfs9ImxhFdm9MWGtpi0EVFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TCwvJ4q25zfNq; Mon, 15 Jan 2024 02:24:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40F2OSZu093540; Mon, 15 Jan 2024 02:24:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40F2OSBS093537; Mon, 15 Jan 2024 02:24:28 GMT (envelope-from git) Date: Mon, 15 Jan 2024 02:24:28 GMT Message-Id: <202401150224.40F2OSBS093537@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: df834e06bbc7 - main - git-arc: Just strip escape sequences form arc log List-Id: Commit messages for the main 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: df834e06bbc78c03cb6b35f074ae43673c9ce463 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=df834e06bbc78c03cb6b35f074ae43673c9ce463 commit df834e06bbc78c03cb6b35f074ae43673c9ce463 Author: Warner Losh AuthorDate: 2024-01-15 02:22:04 +0000 Commit: Warner Losh CommitDate: 2024-01-15 02:23:45 +0000 git-arc: Just strip escape sequences form arc log Just strip escape sequences and Warning: lines from 'arc list' output. I upgraded and they changed and git arc list broke. This restores its functionality. Note: jhb didn't like this, so if others object, I'll fix... Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D36553 --- tools/tools/git/git-arc.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index d06d6be3d41e..a207899d5fbe 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -142,6 +142,15 @@ __EOF__ exit 1 } +# +# Filter the output of arc list to remove the warnings as above, as well as any +# stray escape sequences that are in the list (it interferes with the parsing) +# +arc_list() +{ + arc list "$@" | sed 's/\x1b\[[0-9;]*m//g' | grep -v '^Warning: ' +} + diff2phid() { local diff @@ -194,8 +203,7 @@ title2diff() local title title=$(echo $1 | sed 's/"/\\"/g') - # arc list output always includes ANSI escape sequences, strip them. - arc list | sed 's/\x1b\[[0-9;]*m//g' | \ + arc_list | awk -F': ' '{ if (substr($0, index($0, FS) + length(FS)) == "'"$title"'") { print substr($1, match($1, "D[1-9][0-9]*")) @@ -406,7 +414,7 @@ gitarc__list() local chash commit commits diff openrevs title commits=$(build_commit_list "$@") - openrevs=$(arc list) + openrevs=$(arc_list) for commit in $commits; do chash=$(git show -s --format='%C(auto)%h' "$commit") @@ -422,7 +430,7 @@ gitarc__list() # differently and keep the entire status. title=$(git show -s --format=%s "$commit") diff=$(echo "$openrevs" | \ - awk -F'D[1-9][0-9]*:\.\\[m ' \ + awk -F'D[1-9][0-9]*: ' \ '{if ($2 == "'"$(echo $title | sed 's/"/\\"/g')"'") print $0}') if [ -z "$diff" ]; then echo "No Review : $title" From nobody Mon Jan 15 02:24:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCwvL13t2z57Ldy; Mon, 15 Jan 2024 02:24: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 4TCwvK6pX4z3xG5; Mon, 15 Jan 2024 02:24:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hjy0uhVrUh1wagB5XSK0UE1s7g8RkLbTY85xDTlCfg4=; b=WYuT/L4A9pBoxmAHdkG8Izny8TpfqdPfiS/2HxFylpcMiyBNgWVPNfN56+9usSInSFY/iQ Kzu8IhDLjqLWxdYBDpto3eaaHr3evdSrtq8Lstc1RXnYu0YALAr+vNc2n2QAJuO82jF0E7 7RBTyzZK4OAWF6cWAWvf9NxuslGqwO8IvAdZfVDD8x42+8znKIcxTqC3pys5dijLY6/xFX n/06HUUeIJEWy5OxInJyfPrDPfe7cx3k2IgQmqhlvQ4tB6rcV9ujCUtJk/BjZyA+6+AXVg OGPNXUvZSnzyu/z5qN5y3R7w1/gXRSI13bB7gCU/PNmQxY/2wFcATz2VzYLxBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hjy0uhVrUh1wagB5XSK0UE1s7g8RkLbTY85xDTlCfg4=; b=Y3yXmW/cOCRlWzSVOQzie0XCt06p5Jv+eDMfE04E09SlyeAJ343tOZ+4JV4opXnTBNboyz M6kKbLRLE/bBktwaqh51Aaw7JflyWubJH6+LkEHnJ1pddytNneWjyFTw+rPWuC2YtBnnxL GenjFmSk3Jkohh4BOny4Q1X+1KqBkAxPsaktmUr2q7SJiqlH67jn/dbl1u8jo3+9K2CRtd xYw3dYm0W1kkGv4Lo4HHdECh670dlegyVpJq1yuH9oSE+hYthyx16imjIXd0Vp0rQ24zIw 6ANrgcqndQ7tsOtM9iMyeQOHGtLepXDD+FI2r/COh8QkRqrfqODhcSrAXsOsIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705285470; a=rsa-sha256; cv=none; b=SmpdaNyB4MrKtWzDNET3iRWfF1r6QOaiGDHE5PDtzZdzhOxJFRQqi8lUi3qQfU8vZoJlwo sZBPCAKdGVpiP+THF7JESxZjpOCpHnmImgldOoRJTO2sUJTsSOTgz5FUiiCalCoIqf5KMm TpPEhM0nQ+V5o3fl3hMsoN5JW3klAC+KXVJdsj+e17iSly2aKEUTSATTNnlKKyIHl9Juxv 2l9zd9WUgf8Vcjr9fSUAFFNiAy/Tq6w62qZSA+RUWbLWLjv7XutLmua6ELhBDF411VfM3h V/9+RqTvhX4/n1krkk3HiCaj4tPK+FHwCQi2Qd9CgGzfFiwTVTGCaCPdPvALUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TCwvK5pt3zdk3; Mon, 15 Jan 2024 02:24:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40F2OT3Q093582; Mon, 15 Jan 2024 02:24:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40F2OT8A093579; Mon, 15 Jan 2024 02:24:29 GMT (envelope-from git) Date: Mon, 15 Jan 2024 02:24:29 GMT Message-Id: <202401150224.40F2OT8A093579@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: 9f48ef1fcae5 - main - git-arc: Cope with extra output List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 9f48ef1fcae58fe8aa41da4cc59cc93136fe70dd Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9f48ef1fcae58fe8aa41da4cc59cc93136fe70dd commit 9f48ef1fcae58fe8aa41da4cc59cc93136fe70dd Author: Warner Losh AuthorDate: 2024-01-15 02:22:49 +0000 Commit: Warner Losh CommitDate: 2024-01-15 02:23:45 +0000 git-arc: Cope with extra output On my machine, for reasons beyond my understanding, I get this warning two times when running arc: Warning: Module "openssl" is already loaded in Unknown on line 0 so grep -v ^Warning: on all the arc call-conduit calls to filter them out so we can properly parse the JSON with jq. Sponsored by: Netflix Reviewed by: markj, jhb Differential Revision: https://reviews.freebsd.org/D36583 --- tools/tools/git/git-arc.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index a207899d5fbe..f88cf4b01102 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -142,6 +142,17 @@ __EOF__ exit 1 } +# +# Filter the output of call-conduit to remove the warnings that are generated +# for some installations where openssl module is mysteriously installed twice so +# a warning is generated. It's likely a local config error, but we should work +# in the face of that. +# +arc_call_conduit() +{ + arc call-conduit "$@" | grep -v '^Warning: ' +} + # # Filter the output of arc list to remove the warnings as above, as well as any # stray escape sequences that are in the list (it interferes with the parsing) @@ -161,7 +172,7 @@ diff2phid() fi echo '{"names":["'"$diff"'"]}' | - arc call-conduit -- phid.lookup | + arc_call_conduit -- phid.lookup | jq -r "select(.response != []) | .response.${diff}.phid" } @@ -176,7 +187,7 @@ diff2status() tmp=$(mktemp) echo '{"names":["'"$diff"'"]}' | - arc call-conduit -- phid.lookup > "$tmp" + arc_call_conduit -- phid.lookup > "$tmp" status=$(jq -r "select(.response != []) | .response.${diff}.status" < "$tmp") summary=$(jq -r "select(.response != []) | .response.${diff}.fullName" < "$tmp") @@ -280,7 +291,7 @@ create_one_review() "value": ["'"${parentphid}"'"] } ]}' | - arc call-conduit -- differential.revision.edit >&3 + arc_call_conduit -- differential.revision.edit >&3 fi rm -f "$msg" return 0 @@ -298,13 +309,13 @@ diff2reviewers() "constraints": {"phids": ["'"$reviewid"'"]}, "attachments": {"reviewers": true} }' | - arc call-conduit -- differential.revision.search | + arc_call_conduit -- differential.revision.search | jq '.response.data[0].attachments.reviewers.reviewers[] | select(.status == "accepted").reviewerPHID') if [ -n "$userids" ]; then echo '{ "constraints": {"phids": ['"$(echo -n "$userids" | tr '[:space:]' ',')"']} }' | - arc call-conduit -- user.search | + arc_call_conduit -- user.search | jq -r '.response.data[].fields.username' fi } From nobody Mon Jan 15 02:24:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCwvM3kzWz57Lsn; Mon, 15 Jan 2024 02:24: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 4TCwvM0ckQz3x78; Mon, 15 Jan 2024 02:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y5d5dlBY500CGhIZoNt2tzabXmEx2s/72hDCVOpoSxc=; b=WmdQx3DT2REME2p64eu6AWs3qoLcZOCCY2VMigo+jT3m0/qNx/olRuwn7GPDVoYS1wYf2w Q6mk5qe71YuNG3Eodwevkajxa9juJsewefWT4bFDDprkNpidN4mhaBPjXEkBphGT+02/Ms 7YXeQoGbavxMEBx7D/S3DPLMtD/27vywYB/69Kt3KCLgPxsnZmHiyNWMlq5j92nlYqFYcR N6ZM/6IQZQ8fg1S6PtEv0RkT/IYx9fkoqi4eyG4OeH0ZXIuEmYJ4i9X/g1lrUqtMc6q7bx ZvvFkfvNRWdf6ARfMNl9W9/sMBPoNhbNSzsulRiF9+LS0Zi4Pq3QKHlBSpx3Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705285471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y5d5dlBY500CGhIZoNt2tzabXmEx2s/72hDCVOpoSxc=; b=u6eDTG20/xBmkFIVsSPb3SfLLQfSiG+agMxGaA+imOMfaKQ/MEGROxrG7LQDN9pcTvPUGh xB2nVNCIjlTmNTV8R0bZIsX/g/d3AirsSF5RDWMEdmlgpymlhUlIO1xID0nDdU6EoxkZ/R XqY14Y6IBTxycKy5562yfjcN/WKYB2f1/iraCJyTNCYQjV16uVsK6QM2BwI1eDUj+BpgZX vJ2yxfeK7kvaiGiWlGMPRheLEazRbQkQc7QwoEdj0uuBeNQOgObawClA4uc9yurteb8v+I /GIPDuzrUTCINwAHPfVGwLIkexK9+riR4H9cNeaqICjgIzGFlESHIGI8MW90WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705285471; a=rsa-sha256; cv=none; b=BfecekBmOCG59InjsyeouJHoyE5Os/N9Omcg3RS51aL0T0/8LBykdg3uLefj3RhO/CSaWQ GdsYXGjg2C0tB5SXIoN2H84f2WhMGAc17v7mZuvhBCS20uq4Mj1QU7zLfGNDjuAUePBZct i55PCVevaR8iV+w4nLKrbSq9EHwPcF1SoWRlT9YV9j8kn7NREps5zIVeEpGU8IRlA7aYet 1QnMQP6DXzGxFjH5P+k49wPslsUOUdQNZtNcT9OoFFL88f4bhX5L+0Decrr3DuKKbZVkVt X/wUPd4wkvUCKrs7QLfU8uNjKHHVKrrqhIJg1VorLpnnbYrtbiZEGFWTyTZFag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TCwvL6qDjzfNr; Mon, 15 Jan 2024 02:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40F2OUFO093646; Mon, 15 Jan 2024 02:24:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40F2OUvg093643; Mon, 15 Jan 2024 02:24:30 GMT (envelope-from git) Date: Mon, 15 Jan 2024 02:24:30 GMT Message-Id: <202401150224.40F2OUvg093643@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: 787cb30d20ac - main - git-arc: Add -c flag to patch to commit the change List-Id: Commit messages for the main 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: 787cb30d20ac2031283c6dc2ec829f190997e581 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=787cb30d20ac2031283c6dc2ec829f190997e581 commit 787cb30d20ac2031283c6dc2ec829f190997e581 Author: Warner Losh AuthorDate: 2024-01-15 02:23:02 +0000 Commit: Warner Losh CommitDate: 2024-01-15 02:23:46 +0000 git-arc: Add -c flag to patch to commit the change git arc patch -c D1234 will download differential D1234, try to apply it to the tree, and if successful will ask phab for the title and summary. It will construct a commit message with that, the reviewers, and the differential revision. It also tries its best to deduce the proper 'author' to use for the commit, and warn if it thinks it has made a bad choice. Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D39992 --- tools/tools/git/git-arc.1 | 13 +++- tools/tools/git/git-arc.sh | 153 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 163 insertions(+), 3 deletions(-) diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 index c816de672984..e449875c5043 100644 --- a/tools/tools/git/git-arc.1 +++ b/tools/tools/git/git-arc.1 @@ -41,7 +41,9 @@ .Nm .Cm list Ar commit ... Ns | Ns Ar commit-range .Nm -.Cm patch Ar diff1 Ns Op Cm \&, Ns Ar diff2 +.Cm patch +.Op Fl c +.Ar diff1 Ns Op Cm \&, Ns Ar diff2 .Nm .Cm stage .Op Fl b Ar branch @@ -211,6 +213,15 @@ and stage it: $ git arc patch D12345 .Ed .Pp +Apply the patch in review D23456 to the currently checked-out tree, +and commit it to the tree with the commit message in the review and +make the best guess for what to use for author. +If the guess is considered unreliable, the user is prompted to see +if they wish to use it (or abort). +.Bd -literal -offset indent +$ git arc patch -c D23456 +.Ed +.Pp List the status of reviews for all the commits in the branch .Dq feature : .Bd -literal -offset indent diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index f88cf4b01102..316e160abeed 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -51,7 +51,7 @@ Usage: git arc [-vy] Commands: create [-l] [-r [,...]] [-s subscriber[,...]] [|] list | - patch [ ...] + patch [-c] [ ...] stage [-b branch] [|] update [-m message] [|] @@ -133,6 +133,11 @@ Examples: $ git arc patch D12345 + Apply the patch in review D12345 to the currently checked-out tree, and + commit it using the review's title, summary and author. + + $ git arc patch -c D12345 + List the status of reviews for all the commits in the branch "feature": $ git arc list main..feature @@ -455,18 +460,162 @@ gitarc__list() done } +# Try to guess our way to a good author name. The DWIM is strong in this +# function, but these heuristics seem to generally produce the right results, in +# the sample of src commits I checked out. +find_author() +{ + local addr name email author_addr author_name + + addr="$1" + name="$2" + author_addr="$3" + author_name="$4" + + # The Phabricator interface doesn't have a simple way to get author name and + # address, so we have to try a number of heuristics to get the right result. + + # Choice 1: It's a FreeBSD committer. These folks have no '.' in their phab + # username/addr. Sampled data in phab suggests that there's a high rate of + # these people having their local config pointing at something other than + # freebsd.org (which isn't surprising for ports committers getting src + # commits reviewed). + case "${addr}" in + *.*) ;; # external user + *) + echo "${name} <${addr}@FreeBSD.org>" + return + ;; + esac + + # Choice 2: author_addr and author_name were set in the bundle, so use + # that. We may need to filter some known bogus ones, should they crop up. + if [ -n "$author_name" -a -n "$author_addr" ]; then + echo "${author_name} <${author_addr}>" + return + fi + + # Choice 3: We can find this user in the FreeBSD repo. They've submited + # something before, and they happened to use an email that's somewhat + # similar to their phab username. + email=$(git log -1 --author "$(echo ${addr} | tr _ .)" --pretty="%aN <%aE>") + if [ -n "${email}" ]; then + echo "${email}" + return + fi + + # Choice 4: We know this user. They've committed before, and they happened + # to use the same name, unless the name has the word 'user' in it. This + # might not be a good idea, since names can be somewhat common (there + # are two Andrew Turners that have contributed to FreeBSD, for example). + if ! (echo "${name}" | grep -w "[Uu]ser" -q); then + email=$(git log -1 --author "${name}" --pretty="%aN <%aE>") + if [ -n "$email" ]; then + echo "$email" + return + fi + fi + + # Choice 5: Wing it as best we can. In this scenario, we replace the last _ + # with a @, and call it the email address... + # Annoying fun fact: Phab replaces all non alpha-numerics with _, so we + # don't know if the prior _ are _ or + or any number of other characters. + # Since there's issues here, prompt + a=$(printf "%s <%s>\n" "${name}" $(echo "$addr" | sed -e 's/\(.*\)_/\1@/')) + echo "Making best guess: Truning ${addr} to ${a}" + if ! prompt; then + echo "ABORT" + return + fi + echo "${a}" +} + +patch_commit() +{ + local diff reviewid review_data authorid user_data user_addr user_name author + local tmp author_addr author_name + + diff=$1 + reviewid=$(diff2phid "$diff") + # Get the author phid for this patch + review_data=$(echo '{ + "constraints": {"phids": ["'"$reviewid"'"]} + }' | + arc_call_conduit -- differential.revision.search) + authorid=$(echo "$review_data" | jq -r '.response.data[].fields.authorPHID' ) + # Get metadata about the user that submitted this patch + user_data=$(echo '{ + "constraints": {"phids": ["'"$authorid"'"]} + }' | + arc call-conduit -- user.search | grep -v ^Warning: | + jq -r '.response.data[].fields') + user_addr=$(echo "$user_data" | jq -r '.username') + user_name=$(echo "$user_data" | jq -r '.realName') + # Dig the data out of querydiffs api endpoint, although it's deprecated, + # since it's one of the few places we can get email addresses. It's unclear + # if we can expect multiple difference ones of these. Some records don't + # have this data, so we remove all the 'null's. We sort the results and + # remove duplicates 'just to be sure' since we've not seen multiple + # records that match. + diff_data=$(echo '{ + "revisionIDs": [ '"${diff#D}"' ] + }' | arc_call_conduit -- differential.querydiffs | + jq -r '.response | flatten | .[]') + author_addr=$(echo "$diff_data" | jq -r ".authorEmail?" | sort -u) + author_name=$(echo "$diff_data" | jq -r ".authorName?" | sort -u) + author=$(find_author "$user_addr" "$user_name" "$author_addr" "$author_name") + + # If we had to guess, and the user didn't want to guess, abort + if [ "${author}" = "ABORT" ]; then + warn "Not committing due to uncertainty over author name" + exit 1 + fi + + tmp=$(mktemp) + echo "$review_data" | jq -r '.response.data[].fields.title' > $tmp + echo >> $tmp + echo "$review_data" | jq -r '.response.data[].fields.summary' >> $tmp + echo >> $tmp + # XXX this leaves an extra newline in some cases. + reviewers=$(diff2reviewers "$diff" | sed '/^$/d' | paste -sd ',' - | sed 's/,/, /g') + if [ -n "$reviewers" ]; then + printf "Reviewed by:\t%s\n" "${reviewers}" >> "$tmp" + fi + # XXX TODO refactor with gitarc__stage maybe? + printf "Differential Revision:\thttps://reviews.freebsd.org/%s\n" "${diff}" >> "$tmp" + git commit --author "${author}" --file "$tmp" + rm "$tmp" +} + gitarc__patch() { - local rev + local rev commit if [ $# -eq 0 ]; then err_usage fi + commit=false + while getopts c o; do + case "$o" in + c) + require_clean_work_tree "patch -c" + commit=true + ;; + *) + err_usage + ;; + esac + done + shift $((OPTIND-1)) + for rev in "$@"; do arc patch --skip-dependencies --nocommit --nobranch --force "$rev" echo "Applying ${rev}..." [ $? -eq 0 ] || break + if ${commit}; then + patch_commit $rev + fi done } From nobody Mon Jan 15 02:28:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCx0N2d8Bz57MGt for ; Mon, 15 Jan 2024 02:28:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 4TCx0N0DdZz3ynf for ; Mon, 15 Jan 2024 02:28:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a2c67be31edso398883666b.0 for ; Sun, 14 Jan 2024 18:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705285730; x=1705890530; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bmUaf03EbXUaPkwZs1c7KZXMR+LvXzch5KTB0s7L5Ms=; b=z2M92Zcki2AaZdmU3SLBcOO/1TRDHNKBVewPCSwkWqc7qrqNiUQ1BZfiq7uLOAntac Ik9jLtnextEAbfUl11LV/kiFCCorq/3nva0pPk87YDkGECFVZYRkMbKjaz+9qyWz7eOB OjnKpR8zEQsFY/EXsSZZ3SB6c255sTpRxaSlcsYa870y7pi+XGbKXv5SPSuS1L2eEKMX eo4khFb/mmSQsy6SiorX7hUMEi8lFedRPvR6l9/WgPIl91Fg9wbSTbIkfSOJrNF0bhiw 0oxcAJUTXzDAERA+J+nxYs1mY03BIGgWFyBRMago+4ydEIq9NiBopsGM5PX+SmKbilx9 ap0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705285730; x=1705890530; 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=bmUaf03EbXUaPkwZs1c7KZXMR+LvXzch5KTB0s7L5Ms=; b=mwEKVvVKFFV31udivTj1Btl9LzAYi1Pcj8MW4Oi4sq5PpnaQ6KWPgRGUAYUa7cbbOS 0A/TRQ4uTKtDFwRh3L6KwWTWmwt9LYdWBWq4lW4OSCzEVGRCMWVqxYvlOcJqH7Z1cGPF DQDYSNvIKgm/TMgaiC1Tpg7HktRIV0p8S2UZXzYI4/Z935gr4ORHCRh/Ava/MAkQuGLc AWieJb0vQAGe0xmKtBDyR7pWr+2Ub+Bohq6C5EgqwyWmwr7W6ZN6H8Hh/RpT4iH5jKlO ZhcdDqsrwYSdWTPUk2A4IEsWUXaHe3DoVN9MBlqP04r2q50N+wdvJqz6+ObX/QR4IEA5 AkhA== X-Gm-Message-State: AOJu0Yx3w+l7BVSbbpk8NTdwaQVf8ih/GQG76vw2GS2TLZdACy5ag7wW W7eST73WpO36UM4sw7nO3sZhUJWSmbUbVCTfbxLwvBJ989X7Ig== X-Google-Smtp-Source: AGHT+IHXjbr/Qx/M+9UFHIXLElqu/ZgZepweOwFzSsFx3N/L3qHWryNWrU7l4M8MLRC/1x6O3ch+qbz1uDCtBlEiWVc= X-Received: by 2002:a17:907:d046:b0:a2d:60a:2ae9 with SMTP id vb6-20020a170907d04600b00a2d060a2ae9mr852810ejc.52.1705285730373; Sun, 14 Jan 2024 18:28:50 -0800 (PST) List-Id: Commit messages for the main 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: <202401150224.40F2OR6f093484@gitrepo.freebsd.org> In-Reply-To: <202401150224.40F2OR6f093484@gitrepo.freebsd.org> From: Warner Losh Date: Sun, 14 Jan 2024 19:28:39 -0700 Message-ID: Subject: Re: git: 3d939d967ad4 - main - build: Use ls -i | cut rather than stat -f %i to extract inode To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000033219b060ef2c66e" X-Rspamd-Queue-Id: 4TCx0N0DdZz3ynf X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --00000000000033219b060ef2c66e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 14, 2024 at 7:24=E2=80=AFPM Warner Losh wrote= : > The branch main has been updated by imp: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D3d939d967ad49f747b8b9db4fdec808= 6a7067582 > > commit 3d939d967ad49f747b8b9db4fdec8086a7067582 > Author: Warner Losh > AuthorDate: 2023-05-02 20:51:09 +0000 > Commit: Warner Losh > CommitDate: 2024-01-15 02:23:45 +0000 > > build: Use ls -i | cut rather than stat -f %i to extract inode > > ls -i dates back to 5th edition Unix and is more portable than the st= at > command, though %% is a newer shellism, it works on any shell that > FreeBSD builds with. > > Sponsored by: Netflix > Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D43443 Warner --- > Makefile.inc1 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Makefile.inc1 b/Makefile.inc1 > index 34b49ee319ec..8a0073547ed0 100644 > --- a/Makefile.inc1 > +++ b/Makefile.inc1 > @@ -1059,8 +1059,8 @@ _cleanworldtmp: .PHONY > .if ${USING_SYSTEM_COMPILER} =3D=3D "yes" > .for cc in cc c++ > if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \ > - inum=3D$$(stat -f %i ${WORLDTMP}/usr/bin/${cc}); \ > - find ${WORLDTMP}/usr/bin -inum $${inum} -delete; \ > + inum=3D$$(ls -i ${WORLDTMP}/usr/bin/${cc}); \ > + find ${WORLDTMP}/usr/bin -inum $${inum%% *} -delete; \ > fi > .endfor > .endif # ${USING_SYSTEM_COMPILER} =3D=3D "yes" > --00000000000033219b060ef2c66e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Jan 14, 2024 at 7:24=E2=80=AF= PM Warner Losh <imp@freebsd.org&g= t; wrote:
The br= anch main has been updated by imp:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3D3d939d967ad49f747b8b9db4fdec8086a7067582
commit 3d939d967ad49f747b8b9db4fdec8086a7067582
Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-05-02 20:51:09 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-01-15 02:23:45 +0000

=C2=A0 =C2=A0 build: Use ls -i | cut rather than stat -f %i to extract inod= e

=C2=A0 =C2=A0 ls -i dates back to 5th edition Unix and is more portable tha= n the stat
=C2=A0 =C2=A0 command, though %% is a newer shellism, it works on any shell= that
=C2=A0 =C2=A0 FreeBSD builds with.

=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Netflix=

Reviewed by: arichardson
Dif= ferential Revision:=C2=A0htt= ps://reviews.freebsd.org/D43443

Warner

---
=C2=A0Makefile.inc1 | 4 ++--
=C2=A01 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 34b49ee319ec..8a0073547ed0 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1059,8 +1059,8 @@ _cleanworldtmp: .PHONY
=C2=A0.if ${USING_SYSTEM_COMPILER} =3D=3D "yes"
=C2=A0.for cc in cc c++
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0inum=3D$$(stat -f %= i ${WORLDTMP}/usr/bin/${cc}); \
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0find ${WORLDTMP}/us= r/bin -inum $${inum} -delete; \
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0inum=3D$$(ls -i ${W= ORLDTMP}/usr/bin/${cc}); \
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0find ${WORLDTMP}/us= r/bin -inum $${inum%% *} -delete; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fi
=C2=A0.endfor
=C2=A0.endif # ${USING_SYSTEM_COMPILER} =3D=3D "yes"
--00000000000033219b060ef2c66e-- From nobody Mon Jan 15 10:29:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TD7gN1pNvz56Zg2; Mon, 15 Jan 2024 10:29: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 4TD7gN1QfQz45Hr; Mon, 15 Jan 2024 10:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705314592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwFS5Fw111U+ZOTor+ujjAoysbgfaK/9J7JrBFrGX+o=; b=X171l7Co3Rg6ecwgpAAVbOImNo8X2WcJJApvI3ia6GRhBpINkO7bRgYfqJQ+rSBnpcwR6d VNMu+u6GuObKqISRQvVDoo547U2OmIqULTvMTasEiQHDjh2HoT6kIQzteBCznrTryHwCOl ivC7/1uykgaoIBCxR5emEocZw8+lt2cTcNwTmV4QiuN8TABFNNn8nS95Zh2DypK1anDmpE glsBl2f+YKU9WXTAx2GpFioSN4elipJa6Jr+VTg4ZhHomuDoSWBN2TO916vLvkQCzXzIEJ BLb64ucGm7XOBEkf9PD81/GJzY/tNQOdTsbOh+sk5GCb0sHHcY71ESSPFd2giQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705314592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwFS5Fw111U+ZOTor+ujjAoysbgfaK/9J7JrBFrGX+o=; b=A13qn8M8BkrA4NcTHQUu8v0WX5yTRPuAasNifu/L8l6zfFWex2xMrGwqEMjO/KbXVqasyx Iyzumo/Hi8hXjtwYPIaQNSQB8xut4HJKBJLaWXPQ+KTaCQHA4AiFwIx1yxv6sTJau5QydF +F54aJ1PSEEB/Wblzvk29K62yqN2KvW84j3vg2lmMuJLdEDDtj/Xwsrtm0zZign8rxCxVO SnbAvSTYGhzp0Qm8xp5sIAjKa51fbibYCtjKB7D4jVTElhZg+K56nWKV1UzV2S8y3Cpj99 E3TvouRyv3L6RDr1LbTctDj/D3fMFVMdcBJj81Yh1PyG93Th8f4KJeJdfB1Q2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705314592; a=rsa-sha256; cv=none; b=FG4g/iaFKr1VU1ee3L8rk1acNRtGei0ERPA3qrLoeyiGciibis9b89FKhoYPiUnCS64sfn KgLkH2o+9EefmTn85AgAoWReK14e+RqSYya5GBCX1xAXYA6Q4SPaUN9Dc59VlCBGhoGgvv 72hl371KsERlljdpoChhUX2CeGz8uKQoevTMYiTIP73U9zXEizmQrNfoZdsl7Esn2jx2cX 2TNtI9Qjphh8c8wgl/d0r3NqGwACh11y7REmykXoPVcLk+BdRXPMPgjjtKCQ4o0SEkrBv2 A2LOnbP5wzmg6H6+ShrnAtODh2mEAP+SMsYhrq14XTE/Y2nPSMd3uk/GPmbKOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TD7gN0TfKzsgf; Mon, 15 Jan 2024 10:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FATqPn004063; Mon, 15 Jan 2024 10:29:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FATq1E004060; Mon, 15 Jan 2024 10:29:52 GMT (envelope-from git) Date: Mon, 15 Jan 2024 10:29:52 GMT Message-Id: <202401151029.40FATq1E004060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: d7fde2c9eccf - main - snd_hdspe(4): One pcm device per physical ADAT port. List-Id: Commit messages for the main 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: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7fde2c9eccf90b2a889e92800f3bc07376e84f6 Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=d7fde2c9eccf90b2a889e92800f3bc07376e84f6 commit d7fde2c9eccf90b2a889e92800f3bc07376e84f6 Author: Florian Walpen AuthorDate: 2024-01-15 10:21:57 +0000 Commit: Ruslan Bukin CommitDate: 2024-01-15 10:26:41 +0000 snd_hdspe(4): One pcm device per physical ADAT port. ADAT connections transport 8, 4 or 2 audio channels depending on the sample rate. Instead of splitting each physical ADAT port into 4 (potentially unmapped) stereo pcm devices, create just one pcm device of variable channel width for every ADAT port. Depending on the sample rate and channel width selected, the pcm channels may be only partially mapped to ADAT channels and vice versa. Added flexibility of the new channel mapping is also prerequisite to introduce more pcm device layouts in follow-up commits. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D43393 --- share/man/man4/snd_hdspe.4 | 11 +- sys/dev/sound/pci/hdspe-pcm.c | 462 +++++++++++++++++++++++++++++++++++------- sys/dev/sound/pci/hdspe.c | 52 ++--- sys/dev/sound/pci/hdspe.h | 36 +++- 4 files changed, 443 insertions(+), 118 deletions(-) diff --git a/share/man/man4/snd_hdspe.4 b/share/man/man4/snd_hdspe.4 index 4b925b14aef6..6023cd3d2ccd 100644 --- a/share/man/man4/snd_hdspe.4 +++ b/share/man/man4/snd_hdspe.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 30, 2023 +.Dd January 8, 2024 .Dt SND_HDSPE 4 .Os .Sh NAME @@ -59,6 +59,13 @@ RME HDSPe AIO .It RME HDSPe RayDAT .El +.Pp +By default, each +.Xr pcm 4 +device corresponds to a physical port on the sound card. +For ADAT ports, 8 channel, 4 channel and 2 channel formats are supported. +Depending on sample rate and channel format selected, not all pcm channels can +be mapped to ADAT channels and vice versa. .Sh SYSCTL TUNABLES These settings and informational values can be accessed at runtime with the .Xr sysctl 8 @@ -111,3 +118,5 @@ The .Nm driver was written by .An Ruslan Bukin . +.An Florian Walpen +contributed clock source settings and restructured the pcm device mapping. diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index b3daed4d9599..d9d40c9877ad 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2012-2021 Ruslan Bukin + * Copyright (c) 2023-2024 Florian Walpen * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -78,6 +79,152 @@ static struct hdspe_rate rate_map[] = { { 0, 0 }, }; +static uint32_t +hdspe_channel_play_ports(struct hdspe_channel *hc) +{ + return (hc->ports & (HDSPE_CHAN_AIO_ALL | HDSPE_CHAN_RAY_ALL)); +} + +static uint32_t +hdspe_channel_rec_ports(struct hdspe_channel *hc) +{ + return (hc->ports & (HDSPE_CHAN_AIO_ALL_REC | HDSPE_CHAN_RAY_ALL)); +} + +static unsigned int +hdspe_adat_width(uint32_t speed) +{ + if (speed > 96000) + return (2); + if (speed > 48000) + return (4); + return (8); +} + +static uint32_t +hdspe_port_first(uint32_t ports) +{ + return (ports & (~(ports - 1))); /* Extract first bit set. */ +} + +static uint32_t +hdspe_port_first_row(uint32_t ports) +{ + uint32_t ends; + + /* Restrict ports to one set with contiguous slots. */ + if (ports & HDSPE_CHAN_AIO_LINE) + ports = HDSPE_CHAN_AIO_LINE; /* Gap in the AIO slots here. */ + else if (ports & HDSPE_CHAN_AIO_ALL) + ports &= HDSPE_CHAN_AIO_ALL; /* Rest of the AIO slots. */ + else if (ports & HDSPE_CHAN_RAY_ALL) + ports &= HDSPE_CHAN_RAY_ALL; /* All RayDAT slots. */ + + /* Ends of port rows are followed by a port which is not in the set. */ + ends = ports & (~(ports >> 1)); + /* First row of contiguous ports ends in the first row end. */ + return (ports & (ends ^ (ends - 1))); +} + +static unsigned int +hdspe_channel_count(uint32_t ports, uint32_t adat_width) +{ + unsigned int count = 0; + + if (ports & HDSPE_CHAN_AIO_ALL) { + /* AIO ports. */ + if (ports & HDSPE_CHAN_AIO_LINE) + count += 2; + if (ports & HDSPE_CHAN_AIO_PHONE) + count += 2; + if (ports & HDSPE_CHAN_AIO_AES) + count += 2; + if (ports & HDSPE_CHAN_AIO_SPDIF) + count += 2; + if (ports & HDSPE_CHAN_AIO_ADAT) + count += adat_width; + } else if (ports & HDSPE_CHAN_RAY_ALL) { + /* RayDAT ports. */ + if (ports & HDSPE_CHAN_RAY_AES) + count += 2; + if (ports & HDSPE_CHAN_RAY_SPDIF) + count += 2; + if (ports & HDSPE_CHAN_RAY_ADAT1) + count += adat_width; + if (ports & HDSPE_CHAN_RAY_ADAT2) + count += adat_width; + if (ports & HDSPE_CHAN_RAY_ADAT3) + count += adat_width; + if (ports & HDSPE_CHAN_RAY_ADAT4) + count += adat_width; + } + + return (count); +} + +static unsigned int +hdspe_channel_offset(uint32_t subset, uint32_t ports, unsigned int adat_width) +{ + uint32_t preceding; + + /* Make sure we have a subset of ports. */ + subset &= ports; + /* Include all ports preceding the first one of the subset. */ + preceding = ports & (~subset & (subset - 1)); + + if (preceding & HDSPE_CHAN_AIO_ALL) + preceding &= HDSPE_CHAN_AIO_ALL; /* Contiguous AIO slots. */ + else if (preceding & HDSPE_CHAN_RAY_ALL) + preceding &= HDSPE_CHAN_RAY_ALL; /* Contiguous RayDAT slots. */ + + return (hdspe_channel_count(preceding, adat_width)); +} + +static unsigned int +hdspe_port_slot_offset(uint32_t port, unsigned int adat_width) +{ + /* Exctract the first port (lowest bit) if set of ports. */ + switch (hdspe_port_first(port)) { + /* AIO ports */ + case HDSPE_CHAN_AIO_LINE: + return (0); + case HDSPE_CHAN_AIO_PHONE: + return (6); + case HDSPE_CHAN_AIO_AES: + return (8); + case HDSPE_CHAN_AIO_SPDIF: + return (10); + case HDSPE_CHAN_AIO_ADAT: + return (12); + + /* RayDAT ports */ + case HDSPE_CHAN_RAY_AES: + return (0); + case HDSPE_CHAN_RAY_SPDIF: + return (2); + case HDSPE_CHAN_RAY_ADAT1: + return (4); + case HDSPE_CHAN_RAY_ADAT2: + return (4 + adat_width); + case HDSPE_CHAN_RAY_ADAT3: + return (4 + 2 * adat_width); + case HDSPE_CHAN_RAY_ADAT4: + return (4 + 3 * adat_width); + default: + return (0); + } +} + +static unsigned int +hdspe_port_slot_width(uint32_t ports, unsigned int adat_width) +{ + uint32_t row; + + /* Count number of contiguous slots from the first physical port. */ + row = hdspe_port_first_row(ports); + return (hdspe_channel_count(row, adat_width)); +} + static int hdspe_hw_mixer(struct sc_chinfo *ch, unsigned int dst, unsigned int src, unsigned short data) @@ -103,11 +250,34 @@ hdspe_hw_mixer(struct sc_chinfo *ch, unsigned int dst, static int hdspechan_setgain(struct sc_chinfo *ch) { + struct sc_info *sc; + uint32_t port, ports; + unsigned int slot, end_slot; + unsigned short volume; + + sc = ch->parent->sc; + + /* Iterate through all physical ports of the channel. */ + ports = ch->ports; + port = hdspe_port_first(ports); + while (port != 0) { + /* Get slot range of the physical port. */ + slot = + hdspe_port_slot_offset(port, hdspe_adat_width(sc->speed)); + end_slot = slot + + hdspe_port_slot_width(port, hdspe_adat_width(sc->speed)); + + /* Treat first slot as left channel. */ + volume = ch->lvol * HDSPE_MAX_GAIN / 100; + for (; slot < end_slot; slot++) { + hdspe_hw_mixer(ch, slot, slot, volume); + /* Subsequent slots all get the right channel volume. */ + volume = ch->rvol * HDSPE_MAX_GAIN / 100; + } - hdspe_hw_mixer(ch, ch->lslot, ch->lslot, - ch->lvol * HDSPE_MAX_GAIN / 100); - hdspe_hw_mixer(ch, ch->rslot, ch->rslot, - ch->rvol * HDSPE_MAX_GAIN / 100); + ports &= ~port; + port = hdspe_port_first(ports); + } return (0); } @@ -126,10 +296,10 @@ hdspemixer_init(struct snd_mixer *m) mask = SOUND_MASK_PCM; - if (scp->hc->play) + if (hdspe_channel_play_ports(scp->hc)) mask |= SOUND_MASK_VOLUME; - if (scp->hc->rec) + if (hdspe_channel_rec_ports(scp->hc)) mask |= SOUND_MASK_RECLEV; snd_mtxlock(sc->lock); @@ -181,7 +351,9 @@ hdspechan_enable(struct sc_chinfo *ch, int value) { struct sc_pcminfo *scp; struct sc_info *sc; + uint32_t row, ports; int reg; + unsigned int slot, end_slot; scp = ch->parent; sc = scp->sc; @@ -193,9 +365,22 @@ hdspechan_enable(struct sc_chinfo *ch, int value) ch->run = value; - hdspe_write_1(sc, reg + (4 * ch->lslot), value); - if (AFMT_CHANNEL(ch->format) == 2) - hdspe_write_1(sc, reg + (4 * ch->rslot), value); + /* Iterate through rows of ports with contiguous slots. */ + ports = ch->ports; + row = hdspe_port_first_row(ports); + while (row != 0) { + slot = + hdspe_port_slot_offset(row, hdspe_adat_width(sc->speed)); + end_slot = slot + + hdspe_port_slot_width(row, hdspe_adat_width(sc->speed)); + + for (; slot < end_slot; slot++) { + hdspe_write_1(sc, reg + (4 * slot), value); + } + + ports &= ~row; + row = hdspe_port_first_row(ports); + } } static int @@ -253,56 +438,152 @@ hdspe_stop_audio(struct sc_info *sc) hdspe_write_4(sc, HDSPE_CONTROL_REG, sc->ctrl_register); } -/* Multiplex / demultiplex: 2.0 <-> 2 x 1.0. */ +static void +buffer_mux_write(uint32_t *dma, uint32_t *pcm, unsigned int pos, + unsigned int samples, unsigned int slots, unsigned int channels) +{ + int slot; + + for (; samples > 0; samples--) { + for (slot = 0; slot < slots; slot++) { + dma[slot * HDSPE_CHANBUF_SAMPLES + pos] = + pcm[pos * channels + slot]; + } + pos = (pos + 1) % HDSPE_CHANBUF_SAMPLES; + } +} + +static void +buffer_mux_port(uint32_t *dma, uint32_t *pcm, uint32_t subset, uint32_t ports, + unsigned int pos, unsigned int samples, unsigned int adat_width, + unsigned int pcm_width) +{ + unsigned int slot_offset, slots; + unsigned int channels, chan_pos; + + /* Translate DMA slot offset to DMA buffer offset. */ + slot_offset = hdspe_port_slot_offset(subset, adat_width); + dma += slot_offset * HDSPE_CHANBUF_SAMPLES; + + /* Channel position of the port subset and total number of channels. */ + chan_pos = hdspe_channel_offset(subset, ports, pcm_width); + pcm += chan_pos; + channels = hdspe_channel_count(ports, pcm_width); + + /* Only copy as much as supported by both hardware and pcm channel. */ + slots = hdspe_port_slot_width(subset, MIN(adat_width, pcm_width)); + + /* Let the compiler inline and loop unroll common cases. */ + if (slots == 2) + buffer_mux_write(dma, pcm, pos, samples, 2, channels); + else if (slots == 4) + buffer_mux_write(dma, pcm, pos, samples, 4, channels); + else if (slots == 8) + buffer_mux_write(dma, pcm, pos, samples, 8, channels); + else + buffer_mux_write(dma, pcm, pos, samples, slots, channels); +} + +static void +buffer_demux_read(uint32_t *dma, uint32_t *pcm, unsigned int pos, + unsigned int samples, unsigned int slots, unsigned int channels) +{ + int slot; + + for (; samples > 0; samples--) { + for (slot = 0; slot < slots; slot++) { + pcm[pos * channels + slot] = + dma[slot * HDSPE_CHANBUF_SAMPLES + pos]; + } + pos = (pos + 1) % HDSPE_CHANBUF_SAMPLES; + } +} + +static void +buffer_demux_port(uint32_t *dma, uint32_t *pcm, uint32_t subset, uint32_t ports, + unsigned int pos, unsigned int samples, unsigned int adat_width, + unsigned int pcm_width) +{ + unsigned int slot_offset, slots; + unsigned int channels, chan_pos; + + /* Translate port slot offset to DMA buffer offset. */ + slot_offset = hdspe_port_slot_offset(subset, adat_width); + dma += slot_offset * HDSPE_CHANBUF_SAMPLES; + + /* Channel position of the port subset and total number of channels. */ + chan_pos = hdspe_channel_offset(subset, ports, pcm_width); + pcm += chan_pos; + channels = hdspe_channel_count(ports, pcm_width); + + /* Only copy as much as supported by both hardware and pcm channel. */ + slots = hdspe_port_slot_width(subset, MIN(adat_width, pcm_width)); + + /* Let the compiler inline and loop unroll common cases. */ + if (slots == 2) + buffer_demux_read(dma, pcm, pos, samples, 2, channels); + else if (slots == 4) + buffer_demux_read(dma, pcm, pos, samples, 4, channels); + else if (slots == 8) + buffer_demux_read(dma, pcm, pos, samples, 8, channels); + else + buffer_demux_read(dma, pcm, pos, samples, slots, channels); +} + + +/* Copy data between DMA and PCM buffers. */ static void buffer_copy(struct sc_chinfo *ch) { struct sc_pcminfo *scp; struct sc_info *sc; - int ssize, dsize; - int src, dst; - int n; - int i; + uint32_t row, ports; + unsigned int pos; + unsigned int n; + unsigned int adat_width, pcm_width; scp = ch->parent; sc = scp->sc; n = AFMT_CHANNEL(ch->format); /* n channels */ - if (ch->dir == PCMDIR_PLAY) { - src = sndbuf_getreadyptr(ch->buffer); - } else { - src = sndbuf_getfreeptr(ch->buffer); - } - - src /= 4; /* Bytes per sample. */ - dst = src / n; /* Destination buffer n-times smaller. */ - - ssize = ch->size / 4; - dsize = ch->size / (4 * n); + /* Let pcm formats differ from current hardware ADAT width. */ + adat_width = hdspe_adat_width(sc->speed); + if (n == hdspe_channel_count(ch->ports, 2)) + pcm_width = 2; + else if (n == hdspe_channel_count(ch->ports, 4)) + pcm_width = 4; + else + pcm_width = 8; - /* - * Use two fragment buffer to avoid sound clipping. - */ + if (ch->dir == PCMDIR_PLAY) + pos = sndbuf_getreadyptr(ch->buffer); + else + pos = sndbuf_getfreeptr(ch->buffer); - for (i = 0; i < sc->period * 2 /* fragments */; i++) { - if (ch->dir == PCMDIR_PLAY) { - sc->pbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->lslot] = - ch->data[src]; - sc->pbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->rslot] = - ch->data[src + 1]; - - } else { - ch->data[src] = - sc->rbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->lslot]; - ch->data[src+1] = - sc->rbuf[dst + HDSPE_CHANBUF_SAMPLES * ch->rslot]; - } + pos /= 4; /* Bytes per sample. */ + pos /= n; /* Destination buffer n-times smaller. */ - dst+=1; - dst %= dsize; - src += n; - src %= ssize; + /* Iterate through rows of ports with contiguous slots. */ + ports = ch->ports; + if (pcm_width == adat_width) + row = hdspe_port_first_row(ports); + else + row = hdspe_port_first(ports); + + while (row != 0) { + if (ch->dir == PCMDIR_PLAY) + buffer_mux_port(sc->pbuf, ch->data, row, ch->ports, pos, + sc->period * 2, adat_width, pcm_width); + else + buffer_demux_port(sc->rbuf, ch->data, row, ch->ports, + pos, sc->period * 2, adat_width, pcm_width); + + ports &= ~row; + if (pcm_width == adat_width) + row = hdspe_port_first_row(ports); + else + row = hdspe_port_first(ports); } } @@ -312,17 +593,30 @@ clean(struct sc_chinfo *ch) struct sc_pcminfo *scp; struct sc_info *sc; uint32_t *buf; + uint32_t row, ports; + unsigned int offset, slots; scp = ch->parent; sc = scp->sc; buf = sc->rbuf; - if (ch->dir == PCMDIR_PLAY) { + if (ch->dir == PCMDIR_PLAY) buf = sc->pbuf; - } - bzero(buf + HDSPE_CHANBUF_SAMPLES * ch->lslot, HDSPE_CHANBUF_SIZE); - bzero(buf + HDSPE_CHANBUF_SAMPLES * ch->rslot, HDSPE_CHANBUF_SIZE); + /* Iterate through rows of ports with contiguous slots. */ + ports = ch->ports; + row = hdspe_port_first_row(ports); + while (row != 0) { + offset = hdspe_port_slot_offset(row, + hdspe_adat_width(sc->speed)); + slots = hdspe_port_slot_width(row, hdspe_adat_width(sc->speed)); + + bzero(buf + offset * HDSPE_CHANBUF_SAMPLES, + slots * HDSPE_CHANBUF_SIZE); + + ports &= ~row; + row = hdspe_port_first_row(ports); + } return (0); } @@ -344,13 +638,29 @@ hdspechan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, num = scp->chnum; ch = &scp->chan[num]; - ch->lslot = scp->hc->left; - ch->rslot = scp->hc->right; + + if (dir == PCMDIR_PLAY) + ch->ports = hdspe_channel_play_ports(scp->hc); + else + ch->ports = hdspe_channel_rec_ports(scp->hc); + ch->run = 0; ch->lvol = 0; ch->rvol = 0; - ch->size = HDSPE_CHANBUF_SIZE * 2; /* max size */ + /* Support all possible ADAT widths as channel formats. */ + ch->cap_fmts[0] = + SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 2), 0); + ch->cap_fmts[1] = + SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 4), 0); + ch->cap_fmts[2] = + SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 8), 0); + ch->cap_fmts[3] = 0; + ch->caps = malloc(sizeof(struct pcmchan_caps), M_HDSPE, M_NOWAIT); + *(ch->caps) = (struct pcmchan_caps) {32000, 192000, ch->cap_fmts, 0}; + + /* Allocate maximum buffer size. */ + ch->size = HDSPE_CHANBUF_SIZE * hdspe_channel_count(ch->ports, 8); ch->data = malloc(ch->size, M_HDSPE, M_NOWAIT); ch->buffer = b; @@ -430,8 +740,7 @@ hdspechan_getptr(kobj_t obj, void *data) snd_mtxunlock(sc->lock); pos = ret & HDSPE_BUF_POSITION_MASK; - if (AFMT_CHANNEL(ch->format) == 2) - pos *= 2; /* Hardbuf twice bigger. */ + pos *= AFMT_CHANNEL(ch->format); /* Hardbuf with multiple channels. */ return (pos); } @@ -456,6 +765,10 @@ hdspechan_free(kobj_t obj, void *data) free(ch->data, M_HDSPE); ch->data = NULL; } + if (ch->caps != NULL) { + free(ch->caps, M_HDSPE); + ch->caps = NULL; + } snd_mtxunlock(sc->lock); return (0); @@ -580,9 +893,8 @@ hdspechan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) /* First look for equal latency. */ for (i = 0; latency_map[i].period != 0; i++) { - if (latency_map[i].period == blocksize) { + if (latency_map[i].period == blocksize) hl = &latency_map[i]; - } } /* If no match, just find nearest. */ @@ -615,20 +927,12 @@ end: return (sndbuf_getblksz(ch->buffer)); } -static uint32_t hdspe_rfmt[] = { - SND_FORMAT(AFMT_S32_LE, 2, 0), - 0 -}; - -static struct pcmchan_caps hdspe_rcaps = {32000, 192000, hdspe_rfmt, 0}; - -static uint32_t hdspe_pfmt[] = { - SND_FORMAT(AFMT_S32_LE, 1, 0), +static uint32_t hdspe_bkp_fmt[] = { SND_FORMAT(AFMT_S32_LE, 2, 0), 0 }; -static struct pcmchan_caps hdspe_pcaps = {32000, 192000, hdspe_pfmt, 0}; +static struct pcmchan_caps hdspe_bkp_caps = {32000, 192000, hdspe_bkp_fmt, 0}; static struct pcmchan_caps * hdspechan_getcaps(kobj_t obj, void *data) @@ -642,8 +946,10 @@ hdspechan_getcaps(kobj_t obj, void *data) device_printf(scp->dev, "hdspechan_getcaps()\n"); #endif - return ((ch->dir == PCMDIR_PLAY) ? - &hdspe_pcaps : &hdspe_rcaps); + if (ch->caps != NULL) + return (ch->caps); + + return (&hdspe_bkp_caps); } static kobj_method_t hdspechan_methods[] = { @@ -695,13 +1001,21 @@ hdspe_pcm_attach(device_t dev) char status[SND_STATUSLEN]; struct sc_pcminfo *scp; char desc[64]; - int i, err; + int err; + int play, rec; scp = device_get_ivars(dev); scp->ih = &hdspe_pcm_intr; bzero(desc, sizeof(desc)); - snprintf(desc, sizeof(desc), "HDSPe AIO [%s]", scp->hc->descr); + if (scp->hc->ports & HDSPE_CHAN_AIO_ALL) + snprintf(desc, sizeof(desc), "HDSPe AIO [%s]", + scp->hc->descr); + else if (scp->hc->ports & HDSPE_CHAN_RAY_ALL) + snprintf(desc, sizeof(desc), "HDSPe RayDAT [%s]", + scp->hc->descr); + else + snprintf(desc, sizeof(desc), "HDSPe ? [%s]", scp->hc->descr); device_set_desc_copy(dev, desc); /* @@ -710,19 +1024,21 @@ hdspe_pcm_attach(device_t dev) */ pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); - err = pcm_register(dev, scp, scp->hc->play, scp->hc->rec); + play = (hdspe_channel_play_ports(scp->hc)) ? 1 : 0; + rec = (hdspe_channel_rec_ports(scp->hc)) ? 1 : 0; + err = pcm_register(dev, scp, play, rec); if (err) { device_printf(dev, "Can't register pcm.\n"); return (ENXIO); } scp->chnum = 0; - for (i = 0; i < scp->hc->play; i++) { + if (play) { pcm_addchan(dev, PCMDIR_PLAY, &hdspechan_class, scp); scp->chnum++; } - for (i = 0; i < scp->hc->rec; i++) { + if (rec) { pcm_addchan(dev, PCMDIR_REC, &hdspechan_class, scp); scp->chnum++; } diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 8a7cac87fc1a..e0197d1e981a 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2012-2016 Ruslan Bukin + * Copyright (c) 2023-2024 Florian Walpen * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,47 +70,22 @@ static struct hdspe_clock_source hdspe_clock_source_table_aio[] = { }; static struct hdspe_channel chan_map_aio[] = { - { 0, 1, "line", 1, 1 }, - { 6, 7, "phone", 1, 0 }, - { 8, 9, "aes", 1, 1 }, - { 10, 11, "s/pdif", 1, 1 }, - { 12, 16, "adat", 1, 1 }, - - /* Single or double speed. */ - { 14, 18, "adat", 1, 1 }, - - /* Single speed only. */ - { 13, 15, "adat", 1, 1 }, - { 17, 19, "adat", 1, 1 }, - - { 0, 0, NULL, 0, 0 }, + { HDSPE_CHAN_AIO_LINE, "line" }, + { HDSPE_CHAN_AIO_PHONE, "phone" }, + { HDSPE_CHAN_AIO_AES, "aes" }, + { HDSPE_CHAN_AIO_SPDIF, "s/pdif" }, + { HDSPE_CHAN_AIO_ADAT, "adat" }, + { 0, NULL }, }; static struct hdspe_channel chan_map_rd[] = { - { 0, 1, "aes", 1, 1 }, - { 2, 3, "s/pdif", 1, 1 }, - { 4, 5, "adat", 1, 1 }, - { 6, 7, "adat", 1, 1 }, - { 8, 9, "adat", 1, 1 }, - { 10, 11, "adat", 1, 1 }, - - /* Single or double speed. */ - { 12, 13, "adat", 1, 1 }, - { 14, 15, "adat", 1, 1 }, - { 16, 17, "adat", 1, 1 }, - { 18, 19, "adat", 1, 1 }, - - /* Single speed only. */ - { 20, 21, "adat", 1, 1 }, - { 22, 23, "adat", 1, 1 }, - { 24, 25, "adat", 1, 1 }, - { 26, 27, "adat", 1, 1 }, - { 28, 29, "adat", 1, 1 }, - { 30, 31, "adat", 1, 1 }, - { 32, 33, "adat", 1, 1 }, - { 34, 35, "adat", 1, 1 }, - - { 0, 0, NULL, 0, 0 }, + { HDSPE_CHAN_RAY_AES, "aes" }, + { HDSPE_CHAN_RAY_SPDIF, "s/pdif" }, + { HDSPE_CHAN_RAY_ADAT1, "adat1" }, + { HDSPE_CHAN_RAY_ADAT2, "adat2" }, + { HDSPE_CHAN_RAY_ADAT3, "adat3" }, + { HDSPE_CHAN_RAY_ADAT4, "adat4" }, + { 0, NULL }, }; static void diff --git a/sys/dev/sound/pci/hdspe.h b/sys/dev/sound/pci/hdspe.h index 58362641cb01..d5d8dd46e580 100644 --- a/sys/dev/sound/pci/hdspe.h +++ b/sys/dev/sound/pci/hdspe.h @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2012-2016 Ruslan Bukin + * Copyright (c) 2023-2024 Florian Walpen * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -116,12 +117,34 @@ #define HDSPE_CHANBUF_SIZE (4 * HDSPE_CHANBUF_SAMPLES) #define HDSPE_DMASEGSIZE (HDSPE_CHANBUF_SIZE * HDSPE_MAX_SLOTS) +#define HDSPE_CHAN_AIO_LINE (1 << 0) +#define HDSPE_CHAN_AIO_PHONE (1 << 1) +#define HDSPE_CHAN_AIO_AES (1 << 2) +#define HDSPE_CHAN_AIO_SPDIF (1 << 3) +#define HDSPE_CHAN_AIO_ADAT (1 << 4) +#define HDSPE_CHAN_AIO_ALL_REC (HDSPE_CHAN_AIO_LINE | \ + HDSPE_CHAN_AIO_AES | \ + HDSPE_CHAN_AIO_SPDIF | \ + HDSPE_CHAN_AIO_ADAT) +#define HDSPE_CHAN_AIO_ALL (HDSPE_CHAN_AIO_ALL_REC | \ + HDSPE_CHAN_AIO_PHONE) \ + +#define HDSPE_CHAN_RAY_AES (1 << 5) +#define HDSPE_CHAN_RAY_SPDIF (1 << 6) +#define HDSPE_CHAN_RAY_ADAT1 (1 << 7) +#define HDSPE_CHAN_RAY_ADAT2 (1 << 8) +#define HDSPE_CHAN_RAY_ADAT3 (1 << 9) +#define HDSPE_CHAN_RAY_ADAT4 (1 << 10) +#define HDSPE_CHAN_RAY_ALL (HDSPE_CHAN_RAY_AES | \ + HDSPE_CHAN_RAY_SPDIF | \ + HDSPE_CHAN_RAY_ADAT1 | \ + HDSPE_CHAN_RAY_ADAT2 | \ + HDSPE_CHAN_RAY_ADAT3 | \ + HDSPE_CHAN_RAY_ADAT4) + struct hdspe_channel { - uint32_t left; - uint32_t right; + uint32_t ports; char *descr; - uint32_t play; - uint32_t rec; }; /* Clock sources */ @@ -150,10 +173,11 @@ struct sc_chinfo { struct sc_pcminfo *parent; /* Channel information */ + struct pcmchan_caps *caps; + uint32_t cap_fmts[4]; uint32_t dir; uint32_t format; - uint32_t lslot; - uint32_t rslot; + uint32_t ports; uint32_t lvol; uint32_t rvol; From nobody Mon Jan 15 12:13:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TD9zM3w7Xz56nqq; Mon, 15 Jan 2024 12:13:51 +0000 (UTC) (envelope-from bz@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 4TD9zM3Ng5z4Psv; Mon, 15 Jan 2024 12:13:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705320831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1JJ3cuuxUBssWeohnRnVmy+GJff+CuI1mg+8DhCPDwY=; b=hGzyO/hMKKeABq0Q6skZtgaNyi5/qbIB040NrIPih9Sdk93N+o1VdH7bOMpXRlpdTmF/i4 J8TedtfzRsaG00QnuKaN0cw+1DzWe2D58O9+r+02AwzajbbxyhsqqEZS7o3CQIU34v1qar KJ35eijBbOFlYndFfd+FTcfifaaqX097GaSxDd0+IjMDataEwzZMUI373Dk3L39AkvS/3B 8Wq3vzVOVCHAI9Yy5jKnqc2BOirk3RTl7TO6m8Dfy8cIN9SPIldlmWyHM6g0Cdi9JTOZi+ cNMAf3Jo8XHWcN0WOlfI+pO4Hn/Xwitci9X/jTnEx8hcIRnBOB+3SlRmrEXgfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705320831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1JJ3cuuxUBssWeohnRnVmy+GJff+CuI1mg+8DhCPDwY=; b=hhp2dnduEmLwM5wR/Kd4Mt/sn8Wk4hS8JCqMvzl8CJfu3Fi0GWRuX5uznwjdmTLoXBMOYB u7YlVhN/2XUpwY333mu6wS7Kmq0RVLAcK3PPV+h1miokCVatkBLzUWm25EG9c7LJLwPbG5 +k1jR1KMsSJmbqeYRh/Ox/YRXT0v9rxwgRTCctPJzLXsCtnatWs+6usGONe+ZNgQqhmXBH wae6rfTdBrcjHwQ+tQN/7ZcKj/Mnz4HWYWUnZ90Re7t8+RT34fgf3yxnBJxT6o9nDz6mXs MriDhOPnkyA2BWVlOQ1EkB0XmAnbBcwkb/UmOPMx86Kz/2ZX5YUO4s9N1MwJKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705320831; a=rsa-sha256; cv=none; b=OSnxgA+Qju/MktJz3rYhXB7oenDz90EebtyZ6yQM83GScCjUfxL3Bhg/LkxdFFC9OZ11Xc hAnU3uqdJdt/sKCCAaNvBTZ6L6uUBSbL3s/s936f+4Dg42lPi8JMBSJEQ+wgnL68u/z3eG i1PCaIfA1cSxIsl44uaUb5Z5YQMjVyaEl+1MYn3+eGrmd5oKrMuf4pim/0K/aVlsFk1xB6 jKUxgte9ea/u79HWtUSkpoP/p70vVoMa2ayKahmNRyGUQAaRP2qbPk+XcRvGMHdz9GBHYS Wx2CLXD14OdO5x2rtZgk3IBWt7E8u6fIWZbwXBbJKeK8aj0veF6ilmlUUlLpeg== 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)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4TD9zM18TTzF1W; Mon, 15 Jan 2024 12:13:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 C50088D4A17B; Mon, 15 Jan 2024 12:13:49 +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 ADD4D2D029D8; Mon, 15 Jan 2024 12:13:48 +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 hL9T5AFQxrYw; Mon, 15 Jan 2024 12:13:47 +0000 (UTC) Received: from strong-aiccu0.sbone.de (strong-aiccu0.sbone.de [IPv6:fde9:577b:c1a9:f491::2]) (using 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 45B932D029D2; Mon, 15 Jan 2024 12:13:47 +0000 (UTC) Date: Mon, 15 Jan 2024 12:13:46 +0000 (UTC) From: "Bjoern A. Zeeb" To: Mark Johnston cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: b0e13f785b33 - main - netinet: Define IPv6 ECN mask In-Reply-To: <202401031832.403IWu1A018909@gitrepo.freebsd.org> Message-ID: <6o0q4p2s-qsp0-qs68-95q5-p67o7rn07070@SerrOFQ.bet> References: <202401031832.403IWu1A018909@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 On Wed, 3 Jan 2024, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b0e13f785b336670bdf39b83a78435b00d00f43c > > commit b0e13f785b336670bdf39b83a78435b00d00f43c > Author: Jose Luis Duran > AuthorDate: 2023-10-28 02:50:18 +0000 > Commit: Mark Johnston > CommitDate: 2024-01-03 17:56:28 +0000 > > netinet: Define IPv6 ECN mask > > Define a mask for the code point used for ECN in the Traffic Class field > (2 bits) of an IPv6 header. > > BE: 0 0 3 0 0 0 0 0 > Bit: 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > |Version| Traffic Class | Flow Label | > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > | ... | > > For BE (Big Endian), or network-byte order, this corresponds to 0x00300000. > For Little Endian, it corresponds to 0x00003000. I would really appreciate if these (supposedly excepts) came with a reference to an RFC (ideally with section). > Reviewed by: imp, markj > MFC after: 1 week > Pull Request: https://github.com/freebsd/freebsd-src/pull/879 > --- > sys/netinet/ip6.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h > index 9807e6a1780a..2f61d594e59d 100644 > --- a/sys/netinet/ip6.h > +++ b/sys/netinet/ip6.h > @@ -95,10 +95,12 @@ struct ip6_hdr { > #if BYTE_ORDER == BIG_ENDIAN > #define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */ > #define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */ > +#define IPV6_ECN_MASK 0x00300000 /* ECN code point (2 bits) */ > #else > #if BYTE_ORDER == LITTLE_ENDIAN > #define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */ > #define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */ > +#define IPV6_ECN_MASK 0x00003000 /* ECN code point (2 bits) */ > #endif /* LITTLE_ENDIAN */ > #endif > #define IPV6_FLOWLABEL_LEN 20 > -- Bjoern A. Zeeb r15:7 From nobody Mon Jan 15 12:13:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TD9zX0SSbz56ngG; Mon, 15 Jan 2024 12:14: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 4TD9zW4pG6z4Q3n; Mon, 15 Jan 2024 12:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705320839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mcA6OPHYcrI1/Oxw0hFMD9ctChuAIe3madERnRepnhg=; b=IPlxGKtydfD2AN5YbhVQckFTu9QJSq+XmWtwNcsvU92NI3Y9BlKUghx+w5iHkpTVTGIr/3 lxlMlndK3k0FUdaqw3y4rouyC+dt5WGeuDFCJ4fdMFveJJ2xgKiKoFqZf35LLuA2KIFhBl A1iziOpqSAOkkPgbEkXwmfByBtAJYjp8Bvs1ytHzoUJ7x82xOfU6oBJmLEnfnIs6OdFAPC 20G3IwBbYNiUCBLjwDzddKKT4TcdkFTF8GgNt1V0c4MbgtsOERd6on2u8SS4X9zx8S2yGE FKIQiIsP5s0ZGYVCT43CVhmdfzu7APtt4TsUc04cF9bMz/zxGSIj2TB8s+soBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705320839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mcA6OPHYcrI1/Oxw0hFMD9ctChuAIe3madERnRepnhg=; b=tDfLfPbFlb6cuOpOJwxK3gC09VePZBm9PT/z5xA5M1tXECVK6aKDZ/YZx4EVWdoIfZUnuR rjwdorbUn4bpRW6sDccDdrdNScNAmbR8T44Xu3JtoR6n9zCm0efnqKlKGgHUvOkq+XNYlZ fCzNnXrehSY71NvfE/nlL1KMngSDn/LGrBnaOa3to1IP8paI1BrsmgtFda3NV3d4D9kOMe V4X+agO7pGt2dv+PwQQ1onChW1OPCUFCGLCvmAZRO6O+ifo8xhBzTg8qRfHZyxukvmFjuD KEqaI193z3b5UZNmyVJfTnR/0ysrSNrcotsVpE01Vj0z0z05JpB3vlvgMbw2dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705320839; a=rsa-sha256; cv=none; b=SpUepE9WnZDsbjJ+kTAWEhedsF8yB55+2PzlmRuazvLCGRugFgW2oOGUtI3dPJWiDa5+Xi bX5NH9dtGmPO3VdavOmlcuo7yosddegDZY0ZLsz71a7EZtDHNjjvqPL73dXu+A+4rR4dRY NWMmcV0AoKP8P2ihxQSR0ntFEy6hvdR3ef7+Enq1cVtbt4eZs0v3/7GcfaxI7hPlCM/gO/ eFqxgSlNjERf7nbnMrc+fg0f28MwMe3T6F10PHlxG2xaXNRxoVPANqrJn58wG6VQHZKBa5 NNdQE856fqUhPwJ8D03lccYq965hypv8Vbw2yWYPI3XCb7g+lj5kCLLL4CpS4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TD9zW3v69zwG0; Mon, 15 Jan 2024 12:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FCDxRq090527; Mon, 15 Jan 2024 12:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FCDxMb090524; Mon, 15 Jan 2024 12:13:59 GMT (envelope-from git) Date: Mon, 15 Jan 2024 12:13:59 GMT Message-Id: <202401151213.40FCDxMb090524@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: 4958df5dabce - main - linuxkpi: correct zone item size for linux_mm_zone List-Id: Commit messages for the main 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: 4958df5dabce62ef4e9e96b0d1bf62f3a6cce689 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4958df5dabce62ef4e9e96b0d1bf62f3a6cce689 commit 4958df5dabce62ef4e9e96b0d1bf62f3a6cce689 Author: Konstantin Belousov AuthorDate: 2024-01-14 21:00:18 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-15 11:59:50 +0000 linuxkpi: correct zone item size for linux_mm_zone Reviewed by: manu, markj Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43455 --- sys/compat/linuxkpi/common/src/linux_current.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index 04ad4e30aa54..64b5b8be4c6a 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -315,7 +315,7 @@ linux_current_init(void *arg __unused) uma_zone_reserve(linux_current_zone, lkpi_task_resrv); uma_prealloc(linux_current_zone, lkpi_task_resrv); linux_mm_zone = uma_zcreate("lkpimm", - sizeof(struct task_struct), NULL, NULL, NULL, NULL, + sizeof(struct mm_struct), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); uma_zone_reserve(linux_mm_zone, lkpi_task_resrv); uma_prealloc(linux_mm_zone, lkpi_task_resrv); From nobody Mon Jan 15 13:04:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDC5g2Rw8z56tvK; Mon, 15 Jan 2024 13:04: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 4TDC5g0jVQz4VHM; Mon, 15 Jan 2024 13:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705323863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MCv2Rankv861ZjkLLWZwQwzBBCHNlTG/JXX59z3ht8=; b=vD+EjuJad6/fY/ditojW65KVJer2g8Gc85ddglECwo5x30ei8pfMGL39JaDnhuosnEr8SN AQEocQ+AtKas74KxWvZxrzGtPycCpcN3IvZlbDOsSHJymU1tRiu14q4lsr7MiNBiquruQi GXkmH9J2LGnHiwOLOVO7E3778ME8czlJJaz/JkJWenbvhxRI7XPGlyenun9YlBGMfeacX4 g0LEvq//m2uJjlfKB0KO3weTR/yxEMxh73vkUG1BFXtTtlpG2ilI7ZtN6zINaJN9ZpsAy4 HMVA+uX72/GmlOY41b5F8A7M9Ruvph0EK+HkzuKK7LQ4YwMHVCz/S1CWsZeK1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705323863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MCv2Rankv861ZjkLLWZwQwzBBCHNlTG/JXX59z3ht8=; b=CNin0QSa/MRQQakYniEtMyoBwiBFS8Nkqha1z9vK48DY2WVhX/6Y0g1qtWV7P2rVyTtq5h B7lDOABw2YMwUWRcfws4uc9nb+JKzDWmBBNU9EXj8ckrvi/YzMtr++BIyyZ6qumAHDDKl5 OXgTn/imn7M09zNCGCtLCEZRDXWkay32n0I4cNTvZk6KvumuDAk/aCO2w2ktYvb+UVlvW+ 2D8jK/2tosPQvRAwDdJn9vQWJscD76DwnyVapxHaNRGFPhSBQQ9sLkhS1kvkTRYmB+3Yot AkktmG6wKf+KquM1p5s86hVFBQSLulxZs3890ALwLVe3bnGjBgR9e9Hy2dn1RQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705323863; a=rsa-sha256; cv=none; b=NPb7mZwj8X55HRo3vIjAIheglDsm8GcgTFMdzg3Cnp3oTFqgJ2UyrIdsuAify4VQOBvbUd 9wqgop1jHoCRvjYEQSPWzU5R6seJfVpI5pCFK73S1OCAmu6yxaUxjb8XcU87RG9ALapqBT nLwHeYz6Yg3B9EfVaEx3lFov6+j3qVs2IETPLOzh2ewgzIXjc8nHV9EwHSiIgbuZHivBOk IU8gBHNOYWfw+mkhHwIk5298NVEjB/jP2dHvA5xNPg0Cs2Ox/+6AphS7E6bpwQS0rn5Yak oz72bVu3aa4ep6mhVhUhMBYQ0q8EqQ0UZ+ZT4JoMvO3DMt9MuuqC5lRLkXxDNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDC5f6tCrzxqG; Mon, 15 Jan 2024 13:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FD4M2m074845; Mon, 15 Jan 2024 13:04:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FD4MQ2074842; Mon, 15 Jan 2024 13:04:22 GMT (envelope-from git) Date: Mon, 15 Jan 2024 13:04:22 GMT Message-Id: <202401151304.40FD4MQ2074842@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: 7cbaab712f98 - main - pf: remove unused struct definition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 7cbaab712f98f868a1f069c00bdf705f77b06f6a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7cbaab712f98f868a1f069c00bdf705f77b06f6a commit 7cbaab712f98f868a1f069c00bdf705f77b06f6a Author: Kristof Provost AuthorDate: 2024-01-09 16:02:50 +0000 Commit: Kristof Provost CommitDate: 2024-01-15 13:02:02 +0000 pf: remove unused struct definition Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_nl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 4cda42404400..23c4249714fe 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -646,10 +646,6 @@ pf_handle_addrule(struct nlmsghdr *hdr, struct nl_pstate *npt) return (error); } -struct nl_parsed_getrules { - char *anchor; - uint8_t action; -}; #define _IN(_field) offsetof(struct genlmsghdr, _field) #define _OUT(_field) offsetof(struct pfioc_rule, _field) static const struct nlattr_parser nla_p_getrules[] = { From nobody Mon Jan 15 13:04:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDC5h2Q1Mz56tmr; Mon, 15 Jan 2024 13:04: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 4TDC5h1yGSz4VBN; Mon, 15 Jan 2024 13:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705323864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2acJHeV7CLMjz2pw7/VAKloJEWsd8zJyGirH3Db93p8=; b=xCZ6MHpDcWu8WbLr4AxKJjxUJ7B9BSsrVNZRdX5gLSI5kO67dnxPtj5AdxcJqfMUf8fYOB znbOi3iqHu9L15Yx9pH7TDpdoJMVGg78waZTTfK3zbZBZnJh8UKMZp1gj5+UcGadL3Iptm sBnrgtyXqBfPNlb5cW1sMWEqmCtHtgHRgv6FGZTNy4AZNo5XMxPBTkfIQL2+ZRoK2F9rzR dLXdpbmQDds0p3o6Du98yDFrrTgnJ/HHWP2CjS461LiL55POGSJGbTrm8AebmeNYXIldA4 kjVY8Mr42kvjJa1VEeYMHR2YzzuUhNq/YqAqkpWshNt47qxA9GfRPEf7NDqJuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705323864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2acJHeV7CLMjz2pw7/VAKloJEWsd8zJyGirH3Db93p8=; b=UG8yHzytjD+H7ibL1E80yh3TJ1FDtwSvhCIyHYr7ZbjxWVfu3CQYHtwvhWtX0btK4T8XWa SLAHvp1c1xW62wmQaYVpQDjuXVycsF1Uh9hOTXXJLYe8YrTU99OtRv3FSU1qDj7hNcn0CQ iqAKffCvw6FIYGBLxS8XyVlwi8gR8Jb8ncQsGe46Ynm3sjEPvTPNQnAQyAHIZzNtCjAbth FkTYeQ2TjkKVezgLSx6onORwvDopXVgyQd+ATlvA26uWr1tQW5khJLZ4q/RC3AwMpZVTAt o5YoTa298lbEVCfaK2pKSU2tSxVVDuUnI3SOpoekKt7gTi84zzzCseueLcnrzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705323864; a=rsa-sha256; cv=none; b=JZgKLjaYKBl74+AiiVPTWWsdWMuKY3cPpszrH3XebG3Luzwoo7NC5ue+M2NOXtGkxujk1A 52HAzpYNmk64h8s+/2B9ERDEK3QfdmMlUiC8oOx3kPez2bOu0spgk+87JH4CT+tSUwqNal ExzZRnS7iLdZpY0g/MV6XFi9oKuUf8dgsw7acJRif/G52SpQcQKu3xxoOJgx5silRx9EQt TAp96GUpa3rZAdnXLxsF7RxcvS4pVCJSJ1LSrjas7cZzCQxMezMLN9oXbbMWqr73yjQ48v zmaI1ip3xAyAr5Wz9cVoxfQSp8FfxLyPmZCMDm8Ic+2Mp79YswxLh5mWi4F/cA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDC5h11L4zxxD; Mon, 15 Jan 2024 13:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FD4Ouj074891; Mon, 15 Jan 2024 13:04:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FD4OPV074888; Mon, 15 Jan 2024 13:04:24 GMT (envelope-from git) Date: Mon, 15 Jan 2024 13:04:24 GMT Message-Id: <202401151304.40FD4OPV074888@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: 24c0058a9b59 - main - pf tests: test reassembly with dummynet List-Id: Commit messages for the main 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: 24c0058a9b594bcc4f207924ca60d891c87fdfde Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=24c0058a9b594bcc4f207924ca60d891c87fdfde commit 24c0058a9b594bcc4f207924ca60d891c87fdfde Author: Kristof Provost AuthorDate: 2024-01-12 13:15:42 +0000 Commit: Kristof Provost CommitDate: 2024-01-15 13:02:02 +0000 pf tests: test reassembly with dummynet Ensure that if we pass packets through a dummynet pipe we still reassemble as expected. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/fragmentation_pass.sh | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/sys/netpfil/pf/fragmentation_pass.sh b/tests/sys/netpfil/pf/fragmentation_pass.sh index 5e92bb2d9a97..737977bfd9cf 100644 --- a/tests/sys/netpfil/pf/fragmentation_pass.sh +++ b/tests/sys/netpfil/pf/fragmentation_pass.sh @@ -468,6 +468,44 @@ reassemble_slowpath_cleanup() pft_cleanup } +atf_test_case "dummynet" "cleanup" +dummynet_head() +{ + atf_set descr 'dummynet + reassembly test' + atf_set require.user root +} + +dummynet_body() +{ + pft_init + dummynet_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b inet 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + jexec alcatraz dnctl pipe 1 config bw 600Byte/s + jexec alcatraz dnctl pipe 2 config bw 700Byte/s + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set reassemble yes" \ + "block" \ + "pass inet proto icmp all icmp-type echoreq dnpipe (1, 2)" + + atf_check -s exit:0 -o ignore ping -s 2000 -c 1 192.0.2.2 +} + +dummynet_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "too_many_fragments" @@ -479,4 +517,5 @@ atf_init_test_cases() atf_add_test_case "reassemble" atf_add_test_case "no_df" atf_add_test_case "reassemble_slowpath" + atf_add_test_case "dummynet" } From nobody Mon Jan 15 13:04:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDC5j5pHhz56v1h; Mon, 15 Jan 2024 13:04: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 4TDC5j3qnTz4Vc2; Mon, 15 Jan 2024 13:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705323865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y9HnDnlcDkzvLuIAmc7ZkiqKzDvZhZkE4uHNsamaAu0=; b=K/HodA8HpG+qTpOxquUFZGXykx/HbtwIY5gUtDnKMSQU4GmaLB2xYWQQIf7VmHqsz8bkpf gs0jhca8L2nj/hih+29SbS8myfvJxUfscG0yXj0tzVQDMMAvqD3bVbhYD2IfJ1vfkl53G1 ITkyO8ep54QHKNhPNn8Ds+m8QK9zz66TUUXxc1tpKgshIPV1771/TYBaEJoD63EkBJhZ5B i6USsB/r9jLKvYOFRZTqt5qRnhKBdbTpLZKd78o7GLzzbDFqUz+zuGPBtQVUYVKI6xo3CN lidPpF28NJ+9MtR8n0mKSaX9KDjytObrGmwY/uIbwZTkkvLI5M55vJoKLDa+Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705323865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y9HnDnlcDkzvLuIAmc7ZkiqKzDvZhZkE4uHNsamaAu0=; b=Ys0Rgdbv1+mu2xWjwBzgxPBdUfQ1W7J9f+2xM32NJ7pxk+U9aUl10fnebScd1RWRuSeOc6 qwb8Q3pxd0edhi/PoT6A8rVF9Tkzv9IZ7kvrsUEpr3XzwQolrN+flCcfhlDYUPc9S2noK3 UBP57kjjQQdueE5JhWZ7Ll86FnefHVagpg4Oa8dQM3MhirwJLO7hxIGlrm7qQZf9juMRtU kkWXczuNqBDQ4zIxzQFqvVDZnyCQRjpdCpGjfwosgnCWTgiAK9ktMzuNTYFKqihTq6qEhS dMzvSSdE4Koh4ZlKBFxKYwHOX1so0JPaYUR96S9tiRpSzUOWwsS++aw5H272hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705323865; a=rsa-sha256; cv=none; b=EnqMiegzS83AHID1e3QVHF3i3/7nqxMkxGvrtfkjCU0g+8ifgbpMhoS92819t1YZRjiMyg Y6QTTumsNBy+NAG9UtmLALsLNasVK+Dnn9tZfV7aOA1/mvO/3AUg8pmjJClemG+p9L7WNk VyV4z1JoCToIpeqb3Mwx19500GGBYEGZ89RxBkD5F3MADNQ21CfgZNCS/WMupBlUofR726 8CXyt2pgLCl67wHVfhhMQl7KvoEUUlZ2kaBcF1npZG3T4ymAj5BZLcPuR269pLaW/a7wzi MujKg9J+wckkmhTksCkSFL49XqMuGahrDpgtVDKcVUBB05VTEYJ/1GdyQLDAmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDC5j220Szy6w; Mon, 15 Jan 2024 13:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FD4P5U074942; Mon, 15 Jan 2024 13:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FD4PLl074939; Mon, 15 Jan 2024 13:04:25 GMT (envelope-from git) Date: Mon, 15 Jan 2024 13:04:25 GMT Message-Id: <202401151304.40FD4PLl074939@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: 3f9a6e0b85d4 - main - pf tests: dummynet + nat fragmentation test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 3f9a6e0b85d418b49b3a3b859b9992e407cb66d5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3f9a6e0b85d418b49b3a3b859b9992e407cb66d5 commit 3f9a6e0b85d418b49b3a3b859b9992e407cb66d5 Author: Kristof Provost AuthorDate: 2024-01-12 16:09:52 +0000 Commit: Kristof Provost CommitDate: 2024-01-15 13:02:02 +0000 pf tests: dummynet + nat fragmentation test Ensure that we do the right thing when we reassemble fragmented packet and send it through a dummynet pipe. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/fragmentation_pass.sh | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/sys/netpfil/pf/fragmentation_pass.sh b/tests/sys/netpfil/pf/fragmentation_pass.sh index 737977bfd9cf..d505accba5f2 100644 --- a/tests/sys/netpfil/pf/fragmentation_pass.sh +++ b/tests/sys/netpfil/pf/fragmentation_pass.sh @@ -506,6 +506,53 @@ dummynet_cleanup() pft_cleanup } +atf_test_case "dummynet_nat" "cleanup" +dummynet_nat_head() +{ + atf_set descr 'Test dummynet on NATed fragmented traffic' + atf_set require.user root +} + +dummynet_nat_body() +{ + pft_init + dummynet_init + + epair_one=$(vnet_mkepair) + ifconfig ${epair_one}a 192.0.2.1/24 up + + epair_two=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair_one}b ${epair_two}a + jexec alcatraz ifconfig ${epair_one}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair_two}a 198.51.100.1/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + + vnet_mkjail singsing ${epair_two}b + jexec singsing ifconfig ${epair_two}b 198.51.100.2/24 up + jexec singsing route add default 198.51.100.1 + + route add 198.51.100.0/24 192.0.2.2 + + jexec alcatraz dnctl pipe 1 config bw 1600Byte/s + jexec alcatraz dnctl pipe 2 config bw 1700Byte/s + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set reassemble yes" \ + "nat on ${epair_two}a from 192.0.2.0/24 -> (${epair_two}a)" \ + "block in" \ + "pass in inet proto icmp all icmp-type echoreq dnpipe (1, 2)" + + atf_check -s exit:0 -o ignore ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore ping -c 1 -s 2000 198.51.100.2 +} + +dummynet_nat_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "too_many_fragments" @@ -518,4 +565,5 @@ atf_init_test_cases() atf_add_test_case "no_df" atf_add_test_case "reassemble_slowpath" atf_add_test_case "dummynet" + atf_add_test_case "dummynet_nat" } From nobody Mon Jan 15 13:30:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDCgD4rgnz56xKJ; Mon, 15 Jan 2024 13:30: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 4TDCgD2pMlz4ZMd; Mon, 15 Jan 2024 13:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705325400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghbijmKpb9IqN5uAk0vfV9nvLok5HxV9XIZBpph9Mr4=; b=rPWwXXkKvFB7h30NqvwJCybLgXKw0vdGP3+6Z1pTbac/HeYg30CsyugB1JpBemsxs440AC 4XYO/H7DsNnXGXTPH6T92bgyE/TCYfZGYQUySFpzJJ74CnhCq05FjrVve6rfhrRXQPaWcA xe8/eyptFot5+d+Pk1JF8OFPmrQhBr42rsIujxj+o29nkpzA1tkkJ4G+M3dinr3UQ9JmLh ADV6eAuDtVZl4MjKyE2WRS5o92lNv4xqNTpVSlLNr9qx4y+6QpKL2F+zi9P6/BrzWtBO5e CLmY+cfO9qtkwskMuYOnAKwrl0C/zZjWqdxa67D2KFzm/M2snN+1XKINLnlWVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705325400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghbijmKpb9IqN5uAk0vfV9nvLok5HxV9XIZBpph9Mr4=; b=aqazUWmUII5jyfe+AEVz5EJ0xC5LjKYziEFGQKXiwzjFBOlgrE/M8HQAjZ/TcNQYa+VHnz dVKCRiuZirjXH5WrXzFmFDL2j1xiaZ+2dvaSo/aSyfT5ckFO7GAiC417o5xz/bc/1CX1gN s2qtUjRJ4Xq+lydYyQqzIXnZS9nvxmkz1Yd+d748GSwrx34T3CdCjKVJ+D8cBZCWwyIBk4 XnArGVsxrzc3wZnPY6R8yUHWVkRxo200DebZSoTUYheZXRhGch3oq0/3eA3C5shJCPgn3m F6dpgKQblBfZ/gqIEaRk523mB/c9a+uimKxUQPZfiJ/v6Zc9ymc/lRfkV3YFlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705325400; a=rsa-sha256; cv=none; b=qG39S5zePpj+vCbi8XUNRUe+A9vPec3Q5cJ3grD0ouWRK22uxK0H908cyy+vwsZi9SQSGR 57gyQt5mhsvcSdem+6hXmJCu/5wHwthDVP5lbYfn8HjsJfWfyHRtPZd/4A26W3ZYuGH697 ZkeUHHv02TILqPHdPJiVpFKzTANO6PW2ReL+6xMcH8G3tCAIyJYOvIbo74o9/c9WSvQxT4 h8D6wHIzaeNcS+R5qEgFfdTf/Lkd4DG7AtKDM78pY39CzmczQKw6R3Y7TWJM5ZvtB7wsF1 RtLPeqKFGfaa37pQrRYo1RDNr0I4VPCze60w5uDdEbBrrLIZ+8d7+nBhuKo1Gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDCgD1mJqzxyp; Mon, 15 Jan 2024 13:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FDU0Nc009327; Mon, 15 Jan 2024 13:30:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FDU0q9009324; Mon, 15 Jan 2024 13:30:00 GMT (envelope-from git) Date: Mon, 15 Jan 2024 13:30:00 GMT Message-Id: <202401151330.40FDU0q9009324@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 6137b5f7b8c1 - main - Increase the size of riscv GENERICSD images to 6 GB List-Id: Commit messages for the main 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: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3 Auto-Submitted: auto-generated The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3 commit 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3 Author: Mike Karels AuthorDate: 2024-01-14 17:01:19 +0000 Commit: Mike Karels CommitDate: 2024-01-15 13:28:53 +0000 Increase the size of riscv GENERICSD images to 6 GB The stable/13 snapshot this week failed to build the riscv GENERICSD image because it ran out of space. Checking main and stable/14 snapshots, they are also low on space, around 100% or more of capacity. Increase them all from 5 GB to 6 GB. Note, this is the only riscv image configuration. Discussed with: cperciva --- release/riscv/GENERICSD.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/riscv/GENERICSD.conf b/release/riscv/GENERICSD.conf index d0b1ee32743c..7bd58bc9f97b 100644 --- a/release/riscv/GENERICSD.conf +++ b/release/riscv/GENERICSD.conf @@ -7,7 +7,7 @@ EMBEDDED_TARGET="riscv" EMBEDDEDBUILD=1 FAT_SIZE="54m -b 8m" FAT_TYPE="16" -IMAGE_SIZE="5120M" +IMAGE_SIZE="6144M" KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" PART_SCHEME="GPT" From nobody Mon Jan 15 15:17:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDG3s64bwz578pW for ; Mon, 15 Jan 2024 15:18:01 +0000 (UTC) (envelope-from gordon@tetlows.org) Received: from mr85p00im-ztdg06011901.me.com (mr85p00im-ztdg06011901.me.com [17.58.23.198]) (using TLSv1.3 with cipher TLS_AES_256_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 4TDG3s0vhcz4rVw for ; Mon, 15 Jan 2024 15:18:01 +0000 (UTC) (envelope-from gordon@tetlows.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tetlows.org header.s=sig1 header.b="hX/rWFP7"; dmarc=pass (policy=quarantine) header.from=tetlows.org; spf=pass (mx1.freebsd.org: domain of gordon@tetlows.org designates 17.58.23.198 as permitted sender) smtp.mailfrom=gordon@tetlows.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tetlows.org; s=sig1; t=1705331842; bh=rzyhz+tqBHmKeHIV8m6+jKLOAwG/levWiLJtjJmKGCg=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=hX/rWFP7muEy4I1ntHbm59nnPJipmczhU5aancfLXNLNGTnwHqsd1L4gkMHtq0kN7 wUJKdKBMEloUKyKnc3eQR9HtOu8wUk1d0yKmtFHht2EArtI/p+Muu7Zz9KcmxlB4VX iUZizjdE7uqddwsT5dBcHK8zN8MX+IK1uuC+O96zZx1lGJIwTLOdDJ3Bw0i53CR0JE XJvcwM5S6K81nYXjN8+rHkWCqlYFsyeqryhpdpNxb+yulSpJ7/vcOXvS98f19Rr5rN 2h2MdYhyA8Y0mJEZBsLXy1cWnAqF0X9yVIjxg5fyhrULfMWNnyuhUwEicRizK0T7D9 Gk2czfjf8/6Lg== Received: from smtpclient.apple (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-ztdg06011901.me.com (Postfix) with ESMTPSA id A8AEE90048F; Mon, 15 Jan 2024 15:17:20 +0000 (UTC) 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.700.6\)) Subject: Re: git: cb350ba7bf7c - main - kerberos: Fix numerous segfaults when using weak crypto From: Gordon Tetlow In-Reply-To: <20240113141953.E79B716E@slippy.cwsent.com> Date: Mon, 15 Jan 2024 07:17:08 -0800 Cc: Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , FreeBSD Security Officer Content-Transfer-Encoding: quoted-printable Message-Id: <75357052-F1AF-4E48-B2A8-5FE23EFB2B54@tetlows.org> References: <202401111331.40BDVZfn015429@gitrepo.freebsd.org> <20240112071106.C72D8235@slippy.cwsent.com> <20240112074339.A581B23D@slippy.cwsent.com> <20240113141123.01FCD22B@slippy.cwsent.com> <20240113141953.E79B716E@slippy.cwsent.com> To: Cy Schubert X-Mailer: Apple Mail (2.3731.700.6) X-Proofpoint-GUID: CuTlx4CXOrMhjd0aAaSI8eTVx51CwUEM X-Proofpoint-ORIG-GUID: CuTlx4CXOrMhjd0aAaSI8eTVx51CwUEM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-15_10,2024-01-15_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 phishscore=0 clxscore=1030 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2401150111 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.20 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[tetlows.org,quarantine]; RWL_MAILSPIKE_VERYGOOD(-0.20)[17.58.23.198:from]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; R_DKIM_ALLOW(-0.20)[tetlows.org:s=sig1]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[17.58.23.198:from]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[tetlows.org:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:714, ipnet:17.58.16.0/20, country:US]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEFALL_USER(0.00)[gordon]; MID_RHS_MATCH_FROM(0.00)[]; APPLE_MAILER_COMMON(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: 4TDG3s0vhcz4rVw > On Jan 13, 2024, at 6:19 AM, Cy Schubert = wrote: >=20 > In message <20240113141123.01FCD22B@slippy.cwsent.com>, Cy Schubert = writes: >> In message <20240112074339.A581B23D@slippy.cwsent.com>, Cy Schubert = writes: >>>=20 >>> I think the correct approach would be to separate the new=20 >>> fbsd_ossl_provider_load() and unload functions into their own = library=20 >>> (instead of libroken). This avoids the less desirable option of = including=20 >>> bsd.cpu.mk in secure/lib/Makefile.common, which does build but could = affect >>=20 >>> future work. >>=20 >> The alternative approach also requires secure/lib/libcrypto (because = of=20 >> libkrb5) being built during prebuild phase. Either way bsd.cpu.mk = will need=20 >> to be included in the secure/lib/libcrypto/Makefile.common. Both of = these=20 >> similar approaches, attempting to limit the change to local to = Heimdal only=20 >> result in the same Linux MacOS failure. This leaves us with enabling = legacy=20 >> (weak) crypto globally, like this: >>=20 >> diff --git a/crypto/openssl/apps/openssl.cnf = b/crypto/openssl/apps/openssl.c >> nf >> index 7996120cc67e..659c0b21abbd 100644 >> --- a/crypto/openssl/apps/openssl.cnf >> +++ b/crypto/openssl/apps/openssl.cnf >> @@ -57,6 +57,7 @@ providers =3D provider_sect >> # List of providers to load >> [provider_sect] >> default =3D default_sect >> +legacy =3D legacy_set >> # The fips section name should match the section name inside the >> # included fipsmodule.cnf. >> # fips =3D fips_sect >> @@ -70,8 +71,10 @@ default =3D default_sect >> # OpenSSL may not work correctly which could lead to significant = system >> # problems including inability to remotely access the system. >> [default_sect] >> -# activate =3D 1 >> +activate =3D 1 >>=20 >> +[legacy_sect] >> +activate =3D 1 >>=20 >> #################################################################### >> [ ca ] >>=20 >> Would this be acceptable or would we prefer to add bsd.cpu.mk to=20 >> secure/libcrypto/Makefile.inc? >=20 > Adding so@freebsd.org. Globally enabling weak crypto to serve the needs of a cross-building = issue in software that less than 1% users use is a bad idea. Let=E2=80=99s= find a different path please. Best, Gordon Hat: security-officer.= From nobody Mon Jan 15 15:21:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDG7q2zRXz5791y; Mon, 15 Jan 2024 15:21: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 4TDG7q2WWXz4rvj; Mon, 15 Jan 2024 15:21:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705332087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dFpSseDuGBzzFeBh9oRrUHXfRXbnGScRXI7KtjbZsCM=; b=CHiWEwTQ7jyUXZlJkuUMJSvdHxcRsfFlYl4G0VPlr15In0QSHt9shHI1v4vJ7v4pQpAdM7 yyjUmCuoTQvRdDHNkWc8737o93ThsKzJjhdocPFddRWGJlss5dz58iX02PBPsckibKzPdd bdId6k0gX3Q7gLbvbkRMETq49tb+E3y3UA6/blLJhlCB2yt42fMeyvlaYhuKb/FlpLsNXs IK3MfOjHFtVK4Wgtj4CEkgUA/2RQae9RrG6EL+LX2iur8lOv+kxTka4NtWTHZdh0ALMa+J 8F3X9lEnkuO+Hlb16HtsLsklEM4RvwTh5RBTN+rvcxnD5ZLhtVIn7ruKFIxJcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705332087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dFpSseDuGBzzFeBh9oRrUHXfRXbnGScRXI7KtjbZsCM=; b=tinCgw+Hzca3skjyUBMDWxVRd23UyeRGCUwTUqkDeZkLb47MuJ6kpy1EkEATIouwmQR0kf cfZPN41a5K5FqY4wuyW/BcAfeXDu6DZhntBwoC4YOy7XTqdmix8+WGWMFV7Xaz7gJqGjRc 5ICLuCDO8e7wBkj8UlRYaqN0PzqMDw6s102p3zpCWNCCCsnE8nLy6XZeu09wnPB9QnVx8c CpQtPYwCHAJM1J9f7n+NW3szPumQIG6qMUJ4BBALNOf1df0O4aINZF9QLqJdm4NlISTV8x WsBrefLVy3Uu4fqaml7cZa+tO9rQA6H6yzuIMDoY2tAHD7HovbaMs9j2QUTiQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705332087; a=rsa-sha256; cv=none; b=uZLVSaMA94BA2gEGiSQ46rWeWdoooMKLgTWXphxSiGGXZkboiKYYfSyyCBRH4h4pjuIcLN 5Z64drsR8Er9xxitDvCKse+i1Wkbj1s3uAbS77FjSTGrAyF1BihF3qsbHkw9ZxYjjPJRh7 a672dHaa2Gq0gN+YSFOzoACXnpptTQshrqWE1v0dE6M3IiwDyqKsbfozL567cqQHhPbcN8 jcHCtNBKBWZA72ceOjFiYsJiTr7CqW44d+JWKGzN1+iBp707B/ZyeEAJppx1A5ZkhAlWXE z6GVgTaEjorWvmT34NS4uAa5XLRG+Ao5bA335ZuztmAnPxyVxeyei4ff6weAGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDG7q1c4Mz12Ls; Mon, 15 Jan 2024 15:21:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FFLR1C003410; Mon, 15 Jan 2024 15:21:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FFLRtQ003407; Mon, 15 Jan 2024 15:21:27 GMT (envelope-from git) Date: Mon, 15 Jan 2024 15:21:27 GMT Message-Id: <202401151521.40FFLRtQ003407@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: 503f72a828c7 - main - ncl_bioread(): check for vp->v_object before accessing it List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 503f72a828c7d0d938ec73ffbf62406038c69d47 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=503f72a828c7d0d938ec73ffbf62406038c69d47 commit 503f72a828c7d0d938ec73ffbf62406038c69d47 Author: Konstantin Belousov AuthorDate: 2024-01-15 11:49:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-15 15:19:58 +0000 ncl_bioread(): check for vp->v_object before accessing it Reported by: cy Reviewed by: rmacklem Fixes: 70dc6b2ce314a0f32755005ad02802fca7ed186e MFC after: 3 days --- sys/fs/nfsclient/nfs_clbio.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index c027d7d7c3fd..1cf45bb0c924 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -414,6 +414,18 @@ out: return (error); } +static bool +ncl_bioread_dora(struct vnode *vp) +{ + vm_object_t obj; + + obj = vp->v_object; + if (obj == NULL) + return (true); + return (!vm_object_mightbedirty(vp->v_object) && + vp->v_object->un_pager.vnp.writemappings == 0); +} + /* * Vnode op for read using bio */ @@ -486,9 +498,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) * unlocked read by nfsiod could obliterate changes * done by userspace. */ - if (nmp->nm_readahead > 0 && - !vm_object_mightbedirty(vp->v_object) && - vp->v_object->un_pager.vnp.writemappings == 0) { + if (nmp->nm_readahead > 0 && ncl_bioread_dora(vp)) { for (nra = 0; nra < nmp->nm_readahead && nra < seqcount && (off_t)(lbn + 1 + nra) * biosize < nsize; nra++) { rabn = lbn + 1 + nra; @@ -675,9 +685,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) * directory offset cookie of the next block.) */ NFSLOCKNODE(np); - if (nmp->nm_readahead > 0 && - !vm_object_mightbedirty(vp->v_object) && - vp->v_object->un_pager.vnp.writemappings == 0 && + if (nmp->nm_readahead > 0 && ncl_bioread_dora(vp) && (bp->b_flags & B_INVAL) == 0 && (np->n_direofoffset == 0 || (lbn + 1) * NFS_DIRBLKSIZ < np->n_direofoffset) && From nobody Mon Jan 15 15:37:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDGVw5HcHz57Bkt for ; Mon, 15 Jan 2024 15:38:00 +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 4TDGVw240tz4vTW for ; Mon, 15 Jan 2024 15:38:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-557e76e1bd6so8496273a12.1 for ; Mon, 15 Jan 2024 07:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705333079; x=1705937879; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oUoT/5phOtyEzw9PNUNE0z1aTnMHXa/4eDwk/xNw+b4=; b=wd7oHQniXqBlxYM3C0g1UFza2lBnOZrlQhAkaQe3FmAP/8YxL0Fs5adwvIdgJM2JQi JU+1MRkF2MQCKsh+j23iAhcu5W8dvyHCVaWal4q9UBcRmou/3feu9GmUEWSkEFZRpHUa ML6yrhYqHC2VfPfnEc/Q7ZG/dYMYHC0QYIoKRHFXQjpbeKE1soupFGRHvirkRHuw9UkU 5MdXD3TfE2pTdZiol//h4GMnl0fK967gtl3aaHqPa/JoP9MGFTlyjpUerEhzYPnWbp4C UhEmL73lMRxXHpEpMEMKi9iiLri9a1FwBCS9MZQAo1RQpV5+TlAEgBop8+YjzBXQNoJp dmkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705333079; x=1705937879; 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=oUoT/5phOtyEzw9PNUNE0z1aTnMHXa/4eDwk/xNw+b4=; b=nyiv2+DuqMrGxtAcX1z5dl7iqhKmDESVJDJJ7NptrM/uiI87wfYLBJDxhiF6ZXcR4l UftxEbrigxjQztcwX3QTPFHt4focGYqvnWJZMUI3tqSsLNEpiJn2EelNFsiA3YfnNVvG 03lGHWz0YZmzZjH6SIJa2ecuuCNSlrDC/O9FPS+kcT409iszPxV6GQJ/qmfB2zeaYKqh z17U8flwCNo3no0fkuEIgdxQZjxYINrITwh93W1RybUKAlm9zo/BH0Pl8W7xwd0VV0vT qb9FylIgSiKrJAlfOEnQqUGEcUX646Fv8OKuvPtv3NQYZoyhv4xtYnXpHNnnMSVYXATP CWiA== X-Gm-Message-State: AOJu0YzsoVsd3rDLfzkwUnp0sXQ5ko/Ow925fsFpaErjsKskykhCt52d HpIBWAou+jdsf9XMK+ldvSKHgj13LmQVi2h+Lu/vX2QnXw6a/g== X-Google-Smtp-Source: AGHT+IHZHKDRuaEQsTS3T5gYc5DKX5hnd1ctIkPtF9VxScQTqJpm0uiJo0gf4eChjp6haPxGqhw1S5jhKtmqEb+fdcY= X-Received: by 2002:a17:907:a43:b0:a28:b183:a637 with SMTP id be3-20020a1709070a4300b00a28b183a637mr3155558ejc.40.1705333078650; Mon, 15 Jan 2024 07:37:58 -0800 (PST) List-Id: Commit messages for the main 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: <202401151330.40FDU0q9009324@gitrepo.freebsd.org> In-Reply-To: <202401151330.40FDU0q9009324@gitrepo.freebsd.org> From: Warner Losh Date: Mon, 15 Jan 2024 08:37:49 -0700 Message-ID: Subject: Re: git: 6137b5f7b8c1 - main - Increase the size of riscv GENERICSD images to 6 GB To: Mike Karels Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000608587060efdcc89" X-Rspamd-Queue-Id: 4TDGVw240tz4vTW X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --000000000000608587060efdcc89 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable One question here... Do we need to include all the debugging stuff in /usr/lib/debug? i'ts over 1GB out of 5GB and seems like a poor fit for this form factor. We can easily provide it as a package instead.... I know the inevitable march of largeness must progress, but we should ask ourselves is this really a good use of that 1GB? Warner On Mon, Jan 15, 2024 at 6:30=E2=80=AFAM Mike Karels wr= ote: > The branch main has been updated by karels: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D6137b5f7b8c183ee8806d79b3f1d8e5= e3ddb3df3 > > commit 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3 > Author: Mike Karels > AuthorDate: 2024-01-14 17:01:19 +0000 > Commit: Mike Karels > CommitDate: 2024-01-15 13:28:53 +0000 > > Increase the size of riscv GENERICSD images to 6 GB > > The stable/13 snapshot this week failed to build the riscv GENERICSD > image because it ran out of space. Checking main and stable/14 > snapshots, they are also low on space, around 100% or more of > capacity. Increase them all from 5 GB to 6 GB. Note, this is the > only riscv image configuration. > > Discussed with: cperciva > --- > release/riscv/GENERICSD.conf | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/release/riscv/GENERICSD.conf b/release/riscv/GENERICSD.conf > index d0b1ee32743c..7bd58bc9f97b 100644 > --- a/release/riscv/GENERICSD.conf > +++ b/release/riscv/GENERICSD.conf > @@ -7,7 +7,7 @@ EMBEDDED_TARGET=3D"riscv" > EMBEDDEDBUILD=3D1 > FAT_SIZE=3D"54m -b 8m" > FAT_TYPE=3D"16" > -IMAGE_SIZE=3D"5120M" > +IMAGE_SIZE=3D"6144M" > KERNEL=3D"GENERIC" > MD_ARGS=3D"-x 63 -y 255" > PART_SCHEME=3D"GPT" > --000000000000608587060efdcc89 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
One question here...

Do we n= eed to include all the debugging stuff in /usr/lib/debug? i'ts over 1GB= out of 5GB and seems like a poor fit
for this form factor. We ca= n easily provide it as a package instead....

I= know the inevitable march of largeness must progress, but we should ask ou= rselves is this really a good use of that 1GB?

War= ner

On Mon, Jan 15, 2024 at 6:30=E2=80=AFAM Mike Karels <karels@freebsd.org> wrote:
The branch main has been update= d by karels:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3D6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3
commit 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3
Author:=C2=A0 =C2=A0 =C2=A0Mike Karels <karels@FreeBSD.org>
AuthorDate: 2024-01-14 17:01:19 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Mike Karels <karels@FreeBSD.org>
CommitDate: 2024-01-15 13:28:53 +0000

=C2=A0 =C2=A0 Increase the size of riscv GENERICSD images to 6 GB

=C2=A0 =C2=A0 The stable/13 snapshot this week failed to build the riscv GE= NERICSD
=C2=A0 =C2=A0 image because it ran out of space.=C2=A0 Checking main and st= able/14
=C2=A0 =C2=A0 snapshots, they are also low on space, around 100% or more of=
=C2=A0 =C2=A0 capacity.=C2=A0 Increase them all from 5 GB to 6 GB.=C2=A0 No= te, this is the
=C2=A0 =C2=A0 only riscv image configuration.

=C2=A0 =C2=A0 Discussed with: cperciva
---
=C2=A0release/riscv/GENERICSD.conf | 2 +-
=C2=A01 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/release/riscv/GENERICSD.conf b/release/riscv/GENERICSD.conf index d0b1ee32743c..7bd58bc9f97b 100644
--- a/release/riscv/GENERICSD.conf
+++ b/release/riscv/GENERICSD.conf
@@ -7,7 +7,7 @@ EMBEDDED_TARGET=3D"riscv"
=C2=A0EMBEDDEDBUILD=3D1
=C2=A0FAT_SIZE=3D"54m -b 8m"
=C2=A0FAT_TYPE=3D"16"
-IMAGE_SIZE=3D"5120M"
+IMAGE_SIZE=3D"6144M"
=C2=A0KERNEL=3D"GENERIC"
=C2=A0MD_ARGS=3D"-x 63 -y 255"
=C2=A0PART_SCHEME=3D"GPT"
--000000000000608587060efdcc89-- From nobody Mon Jan 15 16:30:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDHgC4RNFz57Hht; Mon, 15 Jan 2024 16:30:15 +0000 (UTC) (envelope-from jhb@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 4TDHgC3vXQz570D; Mon, 15 Jan 2024 16:30:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705336215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1iZkRmFTzvnJN42d9LTTIznN+rxqbbGoy5R6Va0v0VM=; b=jwzNK3lim+D8mlJhYCugxG7weniaa31xDh0+H4w0PfXCHtqkF4aap6uO4ypXOIBdWJ4cAh cz8YGFwXU5fpMiQf78PdJS/v2Mid+wYe6dA9kwfgQGmtD9LDBBXSlap1AKqyZWEW3IPxKW sa410/STiZ0Cm2feSbQ5mzGyByRceDJdb/+D45Bnyd3VaLKznula2xS+KyjgX45zWDU1xc MhxilGWjR3jS6W8MKw8qhsOtjER9NqSa74/7RIqQfrDg0WK/4InR4TZh30wC0KXRnzemCS hktYqvxTzkGfl0yos9uDOMrO4quMszej2MKHR78XozMkQRuFXKmHRucXupQMww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705336215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1iZkRmFTzvnJN42d9LTTIznN+rxqbbGoy5R6Va0v0VM=; b=IR1LfxSad4DMvzPbsMB0yp8LQ8MV+kE8tU9J5HTQtk/+9mkIVmgp9tqvbI+ePBzGiie54i 752ouZGL+WZd8+rwXih9kfs0ztC5O74Ptkd7fqWfpAp72tCRIRRXYJZ5XtJ5Ay5xxB1MY2 ezyL/jqzEx8MBFvvb/qTSw+SHZX1w9H7MXECZvbrQzIu3ndHSaUg4T3MTpfmM3UYCeILuX OELR6MTN68KF2joWeNzY1drk+Y9Hwf5aQ6UUOGq/KpB0UXjCSu2K+6oWHjyhGr/wCpYoqX N+BCkLqcSKKnvCzL8ulZBcddFmUM8Ej4laE0p153SpxXzUEEYmp28mgMePC2lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705336215; a=rsa-sha256; cv=none; b=d6iPeA/vp2SbG4sJ6Oiq52j8dgryKreajMCk9z+tqBVLbU5j16Lb40wbuBNBgoVBvfc4Y0 Ho8URZQ/uLx/N2pi6vFWWsUbupLn4QJQksWclE7YHL2dC9D38fnL/uZtOLncOa/mg2r2Rv fk9IubVTlh3dwe9n1ami/8WAzHkMSmE+IWdzziZROYS10NmTysFbcO5cMwqWKu6nnTKic2 eopgxUQylmDJfTf50Olt0jJGYYzELFZYmPg9k7nwOV0GyKH1sGUt/oLnc3l1IcJIGEp1CH UAZPRhq14vdibO5+zpWHfMqKGz78RJlQepYK8qZ7NsFHQYuuQEXAtHtvjbJ3IQ== Received: from [IPV6:2601:644:9381:f410:29e7:37c1:a879:8b7d] (unknown [IPv6:2601:644:9381:f410:29e7:37c1:a879:8b7d]) (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: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4TDHgC018zzJmG; Mon, 15 Jan 2024 16:30:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 15 Jan 2024 08:30:13 -0800 List-Id: Commit messages for the main 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 Thunderbird Subject: Re: git: df834e06bbc7 - main - git-arc: Just strip escape sequences form arc log Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202401150224.40F2OSBS093537@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202401150224.40F2OSBS093537@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/14/24 6:24 PM, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=df834e06bbc78c03cb6b35f074ae43673c9ce463 > > commit df834e06bbc78c03cb6b35f074ae43673c9ce463 > Author: Warner Losh > AuthorDate: 2024-01-15 02:22:04 +0000 > Commit: Warner Losh > CommitDate: 2024-01-15 02:23:45 +0000 > > git-arc: Just strip escape sequences form arc log > > Just strip escape sequences and Warning: lines from 'arc list' output. I > upgraded and they changed and git arc list broke. This restores its > functionality. > > Note: jhb didn't like this, so if others object, I'll fix... > > Sponsored by: Netflix > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D36553 Namely, it breaks the color output for reviews in different states, so Needs Review shows up as purple, Approved as green, etc. If you find the color output useful you'll have to revert this locally. Also, your last update in the review said that git arc was no longer broken for you back in May implying this commit wasn't needed for git arc to work for you? -- John Baldwin From nobody Mon Jan 15 16:36:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDHp32nf1z57JNW; Mon, 15 Jan 2024 16:36:11 +0000 (UTC) (envelope-from karels@freebsd.org) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDHp325Xwz57NC; Mon, 15 Jan 2024 16:36:11 +0000 (UTC) (envelope-from karels@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.17.1/8.17.1) with ESMTP id 40FGa927088877; Mon, 15 Jan 2024 10:36:09 -0600 (CST) (envelope-from karels@freebsd.org) Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id kpNWCvlepWUrWwEAs/W3XQ (envelope-from ); Mon, 15 Jan 2024 10:36:09 -0600 From: Mike Karels To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, FreeBSD Release Engineering Team Subject: Re: git: 6137b5f7b8c1 - main - Increase the size of riscv GENERICSD images to 6 GB Date: Mon, 15 Jan 2024 10:36:08 -0600 X-Mailer: MailMate (1.14r6015) Message-ID: <45CAA8CA-9B5E-41D2-8416-83156B6AC721@freebsd.org> In-Reply-To: References: <202401151330.40FDU0q9009324@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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4TDHp325Xwz57NC X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] On 15 Jan 2024, at 9:37, Warner Losh wrote: > One question here... > > Do we need to include all the debugging stuff in /usr/lib/debug? i'ts o= ver > 1GB out of 5GB and seems like a poor fit > for this form factor. We can easily provide it as a package instead....= > > I know the inevitable march of largeness must progress, but we should a= sk > ourselves is this really a good use of that 1GB? > > Warner Good question. On riscv, /usr/lib/debug is 2.5 GB. (arm64 is 2.1 GB.) I'm also not sure what it would take to leave it off, although I would gu= ess that a tweak to installworld could do it if we need debug for other targe= ts. I think the package already exists. Of course, these images usually get expanded to a much larger size on the first boot, so maybe the space does= n't matter as much. Ideally, we'd keep the kernel debug, but that would probably be more work= =2E It would probably make the most sense to the same thing for other archite= ctures, although arm64 at least has headroom. The scripts to build the image fil= es are shared, but there is a config file per image. Opinions, anyone? We could ask on freebsd-riscv and maybe other lists to= o. Mike > On Mon, Jan 15, 2024 at 6:30=E2=80=AFAM Mike Karels wrote: > >> The branch main has been updated by karels: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3D6137b5f7b8c183ee8806d79b3f1d= 8e5e3ddb3df3 >> >> commit 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3 >> Author: Mike Karels >> AuthorDate: 2024-01-14 17:01:19 +0000 >> Commit: Mike Karels >> CommitDate: 2024-01-15 13:28:53 +0000 >> >> Increase the size of riscv GENERICSD images to 6 GB >> >> The stable/13 snapshot this week failed to build the riscv GENERIC= SD >> image because it ran out of space. Checking main and stable/14 >> snapshots, they are also low on space, around 100% or more of >> capacity. Increase them all from 5 GB to 6 GB. Note, this is the= >> only riscv image configuration. >> >> Discussed with: cperciva >> --- >> release/riscv/GENERICSD.conf | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/release/riscv/GENERICSD.conf b/release/riscv/GENERICSD.co= nf >> index d0b1ee32743c..7bd58bc9f97b 100644 >> --- a/release/riscv/GENERICSD.conf >> +++ b/release/riscv/GENERICSD.conf >> @@ -7,7 +7,7 @@ EMBEDDED_TARGET=3D"riscv" >> EMBEDDEDBUILD=3D1 >> FAT_SIZE=3D"54m -b 8m" >> FAT_TYPE=3D"16" >> -IMAGE_SIZE=3D"5120M" >> +IMAGE_SIZE=3D"6144M" >> KERNEL=3D"GENERIC" >> MD_ARGS=3D"-x 63 -y 255" >> PART_SCHEME=3D"GPT" >> From nobody Mon Jan 15 16:37:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDHrG1Tm8z57JRM for ; Mon, 15 Jan 2024 16:38:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (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 4TDHrF4W6tz3wf6 for ; Mon, 15 Jan 2024 16:38:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40e80046264so5834535e9.0 for ; Mon, 15 Jan 2024 08:38:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705336683; x=1705941483; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1ceMknBT1cssMzV6VxDtTWssN92LyHmn3DoHcJbITUg=; b=fRmaMdkTMzqFp6riiullwwOorXIzPbycjrhntEMp5CemvZ0iuPbc2OZcw3TkU07Kej MXwcNu7gxi49WkyRMHG6TttZMLovgG2Sr/IwOId+TCKI0i0RiIe50SRTt151rqTBPKEM D8Kqk1ABUC7R+WRLugvjZ6RrtsmOJPQ/IbJo4fFBcFNdx7atAN/T084iU5YpRGUzIDgX aODfOAgHQrJdgsEarKZYUi+3QzHZqFSHlvsOMma6JmJgDog6aHTu9BEfmOgbDazzPjXu FkO+qxZGeox4ckLnuc/JaS2t2BiWd/0N8+sBRlZmXrtAPgJDbSQ44SKC2FX7oAm9Eomc ltHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705336683; x=1705941483; 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=1ceMknBT1cssMzV6VxDtTWssN92LyHmn3DoHcJbITUg=; b=DLuH2rX3q2EGmFnUwmC/UpojmtCgmQ7JOdFvhiEdEeegfDxenjagnaXZVtsrUpkg1E V/66EwIgtcqaE3c/G52biSw/9NS58ZpJYlPVLNanRwNgCsphTvmhpeP92UPqS45e9+KZ AL4QbbEjFDdtEetGFKQA952tCi4BjGR+9v0fbpKB4EBQcIGbZWbanVE7yQcbdcCBFBPH Ao2RuePPKK3/sNRHJSw/eKjw60Y8K4iDoTykYLxIBjL97ExcvTTuDFQr7JRx7RDYwsfk WhTLrfYOXMSZjLsMdL9XAW3PlHjU13WulTYw09osBpgVjUzykpw9MVcMDBR9rhHl1G25 H9mg== X-Gm-Message-State: AOJu0YzLHZ3JOC31q4XIxHI82XydQdO53rgVOc1QUzu8YKUFagQW37IG PAQI75ZWXQNeWEQ/5yLnEDoq+vjd0mF5y2the6qNF4ENR3EZ4w== X-Google-Smtp-Source: AGHT+IGpi804q3bQkUJ66/THg5gKLkPpJk9BE24UEA+eu4ix49AbN8yaWuE6++rhFjeDRi4rOo6fa6NYTr/5H7XBZ7o= X-Received: by 2002:a05:600c:4d1e:b0:40e:42b0:b75d with SMTP id u30-20020a05600c4d1e00b0040e42b0b75dmr3473239wmp.42.1705336683306; Mon, 15 Jan 2024 08:38:03 -0800 (PST) List-Id: Commit messages for the main 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: <202401150224.40F2OSBS093537@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 15 Jan 2024 09:37:48 -0700 Message-ID: Subject: Re: git: df834e06bbc7 - main - git-arc: Just strip escape sequences form arc log To: John Baldwin Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000003b3a8a060efea3a4" X-Rspamd-Queue-Id: 4TDHrF4W6tz3wf6 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --0000000000003b3a8a060efea3a4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 15, 2024 at 9:30=E2=80=AFAM John Baldwin wrot= e: > On 1/14/24 6:24 PM, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Ddf834e06bbc78c03cb6b35f074ae436= 73c9ce463 > > > > commit df834e06bbc78c03cb6b35f074ae43673c9ce463 > > Author: Warner Losh > > AuthorDate: 2024-01-15 02:22:04 +0000 > > Commit: Warner Losh > > CommitDate: 2024-01-15 02:23:45 +0000 > > > > git-arc: Just strip escape sequences form arc log > > > > Just strip escape sequences and Warning: lines from 'arc list' > output. I > > upgraded and they changed and git arc list broke. This restores it= s > > functionality. > > > > Note: jhb didn't like this, so if others object, I'll fix... > > > > Sponsored by: Netflix > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D36553 > > Namely, it breaks the color output for reviews in different states, so > Needs Review > shows up as purple, Approved as green, etc. If you find the color output > useful > you'll have to revert this locally. > > Also, your last update in the review said that git arc was no longer > broken for you > back in May implying this commit wasn't needed for git arc to work for yo= u? > Yes and no. I was mistaken. This change is still needed, but its scope can be reduced. The trouble is that it's at the first for the other things I committed and getting it out of the way was a pain (I tried). Since I didn't want to delay things any further, I went ahead and committed and thought I'd fix stuff if there were objections.I'll do that now. Warner --0000000000003b3a8a060efea3a4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jan 15, 2024 at 9:30=E2=80=AF= AM John Baldwin <jhb@freebsd.org&= gt; wrote:
On 1/= 14/24 6:24 PM, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3Ddf834e06bbc78c03cb6b35f074ae43673c9ce463<= /a>
>
> commit df834e06bbc78c03cb6b35f074ae43673c9ce463
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-01-15 02:22:04 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-01-15 02:23:45 +0000
>
>=C2=A0 =C2=A0 =C2=A0 git-arc: Just strip escape sequences form arc log<= br> >=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Just strip escape sequences and Warning: lines fro= m 'arc list' output. I
>=C2=A0 =C2=A0 =C2=A0 upgraded and they changed and git arc list broke. = This restores its
>=C2=A0 =C2=A0 =C2=A0 functionality.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Note: jhb didn't like this, so if others objec= t, I'll fix...
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Netflix
>=C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 markj
>=C2=A0 =C2=A0 =C2=A0 Differential Revision:=C2=A0
https://revi= ews.freebsd.org/D36553

Namely, it breaks the color output for reviews in different states, so Need= s Review
shows up as purple, Approved as green, etc.=C2=A0 If you find the color out= put useful
you'll have to revert this locally.

Also, your last update in the review said that git arc was no longer broken= for you
back in May implying this commit wasn't needed for git arc to work for = you?

Yes and no. I was mistaken. This c= hange is still needed, but its scope can be reduced.
The trouble = is that it's at the first for the other things I committed and getting = it out of the
way was a pain (I tried). Since I didn't want t= o delay things any further, I went ahead and
committed and though= t I'd fix stuff if there were objections.I'll do that now.

Warner
--0000000000003b3a8a060efea3a4-- From nobody Mon Jan 15 16:40:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDHtt0kRpz57JmY; Mon, 15 Jan 2024 16:40:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDHts4MDlz3xRS; Mon, 15 Jan 2024 16:40:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id PJAarpIoQGAIJPQ0arW7iY; Mon, 15 Jan 2024 16:40:20 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id PQ0ZrxAHBwbmvPQ0ZrbCEl; Mon, 15 Jan 2024 16:40:20 +0000 X-Authority-Analysis: v=2.4 cv=O6wqATxW c=1 sm=1 tr=0 ts=65a55ff4 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=dEuoMetlWLkA:10 a=7LAwx-u0AAAA:8 a=YxBL1-UpAAAA:8 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YRXlNdjjCfrx9UpPGPAA:9 a=CjuIK1q_8ugA:10 a=pK3_ou3pLUoA:10 a=Wbql1O7w7MJ4N54WVBAX:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 7AAFE74D; Mon, 15 Jan 2024 08:40:18 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 68990AC; Mon, 15 Jan 2024 08:40:18 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Gordon Tetlow cc: Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , FreeBSD Security Officer Subject: Re: git: cb350ba7bf7c - main - kerberos: Fix numerous segfaults when using weak crypto In-reply-to: <75357052-F1AF-4E48-B2A8-5FE23EFB2B54@tetlows.org> References: <202401111331.40BDVZfn015429@gitrepo.freebsd.org> <20240112071106.C72D8235@slippy.cwsent.com> <20240112074339.A581B23D@slippy.cwsent.com> <20240113141123.01FCD22B@slippy.cwsent.com> <20240113141953.E79B716E@slippy.cwsent.com> <75357052-F1AF-4E48-B2A8-5FE23EFB2B54@tetlows.org> Comments: In-reply-to Gordon Tetlow message dated "Mon, 15 Jan 2024 07:17:08 -0800." List-Id: Commit messages for the main 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 Date: Mon, 15 Jan 2024 08:40:18 -0800 Message-Id: <20240115164018.68990AC@slippy.cwsent.com> X-CMAE-Envelope: MS4xfLtm4PwPbFOdf/u/HVvv4yobhS6b/VRRe5z5TwLY5/amn1murDcPHGm5XDD0dylMWiJEdogbL7ZobZ31eGM2Z7sfFC/WuMTc/Me417nJETO95wDEG2Xy cnCbD/jqjRPSldFGjsKwluWzTV6sOa0Ue5Cfc+oUJi27E5iHPzskX64pFV3kXfQPmGI7ySWCrBzONuthwzrlHFw12fC/Jhg7sTLKhWxpsa43awefNQumk5Gd EZSxVyloUB0tUP9M7rfxdlfdg+mMQrRnOiokSO8jDmbL7GQHDzglFxyNyHPrErMgDCiKr9KQsbc9A4mg3Nm0WKTAJ1/0n/sSrAGnU9ZGYyUdwrDg9rzav2XW ML8Nuuc1O0SKCWQ7bRH1nIpHpem7RvCs7NiQgzt/5HUNbB+Bi3NRo9pnM6tOtLqEovkUIO1C X-Rspamd-Queue-Id: 4TDHts4MDlz3xRS X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message <75357052-F1AF-4E48-B2A8-5FE23EFB2B54@tetlows.org>, Gordon Tetlow wr ites: > > > > On Jan 13, 2024, at 6:19 AM, Cy Schubert = > wrote: > >=20 > > In message <20240113141123.01FCD22B@slippy.cwsent.com>, Cy Schubert = > writes: > >> In message <20240112074339.A581B23D@slippy.cwsent.com>, Cy Schubert = > writes: > >>>=20 > >>> I think the correct approach would be to separate the new=20 > >>> fbsd_ossl_provider_load() and unload functions into their own = > library=20 > >>> (instead of libroken). This avoids the less desirable option of = > including=20 > >>> bsd.cpu.mk in secure/lib/Makefile.common, which does build but could = > affect > >>=20 > >>> future work. > >>=20 > >> The alternative approach also requires secure/lib/libcrypto (because = > of=20 > >> libkrb5) being built during prebuild phase. Either way bsd.cpu.mk = > will need=20 > >> to be included in the secure/lib/libcrypto/Makefile.common. Both of = > these=20 > >> similar approaches, attempting to limit the change to local to = > Heimdal only=20 > >> result in the same Linux MacOS failure. This leaves us with enabling = > legacy=20 > >> (weak) crypto globally, like this: > >>=20 > >> diff --git a/crypto/openssl/apps/openssl.cnf = > b/crypto/openssl/apps/openssl.c > >> nf > >> index 7996120cc67e..659c0b21abbd 100644 > >> --- a/crypto/openssl/apps/openssl.cnf > >> +++ b/crypto/openssl/apps/openssl.cnf > >> @@ -57,6 +57,7 @@ providers =3D provider_sect > >> # List of providers to load > >> [provider_sect] > >> default =3D default_sect > >> +legacy =3D legacy_set > >> # The fips section name should match the section name inside the > >> # included fipsmodule.cnf. > >> # fips =3D fips_sect > >> @@ -70,8 +71,10 @@ default =3D default_sect > >> # OpenSSL may not work correctly which could lead to significant = > system > >> # problems including inability to remotely access the system. > >> [default_sect] > >> -# activate =3D 1 > >> +activate =3D 1 > >>=20 > >> +[legacy_sect] > >> +activate =3D 1 > >>=20 > >> #################################################################### > >> [ ca ] > >>=20 > >> Would this be acceptable or would we prefer to add bsd.cpu.mk to=20 > >> secure/libcrypto/Makefile.inc? > >=20 > > Adding so@freebsd.org. > > Globally enabling weak crypto to serve the needs of a cross-building = > issue in software that less than 1% users use is a bad idea. Let=E2=80=99s= > find a different path please. > > Best, > Gordon > Hat: security-officer.= I have another solution, being worked on. It will dlopen()/dlsym(). Unorthodox but should work around the Linux and MacOS issues. I'll create a GH PR (gotta love reusing and recycling acronyms) to test build on Linux as jrtc27 suggested, so please, nobody take the PR and commit it. As it uses dlopen()/dlsym() it does not touch Makefile.inc1 nor src.libnames.mk, so it should build everywhere. I don't use weak crypto here (with my MIT KDC). I'll ask those watching the bugzilla PR (gotta love recycling acronyms again) to test the new patch. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Mon Jan 15 17:02:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDJNS4Czpz57693 for ; Mon, 15 Jan 2024 17:02:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 4TDJNR3CHVz45M9 for ; Mon, 15 Jan 2024 17:02:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=dXryWgsd; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::631) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a28a997f3dfso677108866b.0 for ; Mon, 15 Jan 2024 09:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705338148; x=1705942948; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=t2STmHmCmF5T4bBZstb6x5G6Bw/zRP8k8tpRxYOVTA0=; b=dXryWgsdeIA5WT/SLdpaVfoxFvRxeY3tB/okwZpuMVX0OcDY/ASJzUAlo/ivWsGXD8 GcsMjjb/b+zBoPRcW5I2bBdT3l9mkZ0N91uzrjDq7iRMhNJ3nK+DUjRpPk0VUpdrGc8R f7IerPE+pFm7LT1Yj3iRoZbx3zOCNWHrJZLyd1SiAWf1JE9sTs45DlOo58nefnLIIjYY CaKLav6PcVF7aZlS0dQZWhQnEfeQ/mgs03ssDSAKaUBnGgfYuyxhfWs3nNAmbQo2Mnd7 18tBM0AmhnJaQd9Pr6/ybtwX+mnQ0DkoUg6PjcuvhKUIuS9hp52sQ/lyYY+rVb4trNKH vXxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705338148; x=1705942948; 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=t2STmHmCmF5T4bBZstb6x5G6Bw/zRP8k8tpRxYOVTA0=; b=mRU4FR4qF3OtnZgW0niLuq1zLfat/6TJnNKxx+JwQWYvMmpCR+CmjD7qvXtLxcKW7r tePwFwRjw+ANYvFfIZMEoy5WxajbbOW2A9W9Py7/vrMD0CiuN28M8a49hwqYVNm1UXnL 3XUevixAycCS6JJe/cUMFcrhgDaU2rhlb7yEdtokrQinMp1TtnDiWwNH1LeQRM+mwkYP UWAIzQ7tKZNJwcn107pi0eC5sWXxKMLpfznG7NMOLlwh6pRWh/0Wjwb4ZEF10uqWwxhE xYXlam2diOOChaQng2akEeGLkfXER7CCW+FfmyMIS5fpRr5kGiSiwaFA0LJzyiaAAhY1 mIww== X-Gm-Message-State: AOJu0YyjNQ2RpN91XKuAIiNvhfFdxTsDWcyWkDcBMQklpaHn+e0bKx+B GbFXKBHFVwUiVGG2QJ5O7I7W53sZAeIDxTBeTyM2zfPLC3Aarw== X-Google-Smtp-Source: AGHT+IFx/Sf+hg00qOiBrQQCjPEqF59zDsRI2R2FvRvjzOY9q5lH9q8F+I+bRklnTF+jWfljxJ1OLoVPLba8xd5g0wE= X-Received: by 2002:a17:907:2da1:b0:a28:5901:70dd with SMTP id gt33-20020a1709072da100b00a28590170ddmr4037591ejc.17.1705338148601; Mon, 15 Jan 2024 09:02:28 -0800 (PST) List-Id: Commit messages for the main 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: <202401150224.40F2OSBS093537@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 15 Jan 2024 10:02:17 -0700 Message-ID: Subject: Re: git: df834e06bbc7 - main - git-arc: Just strip escape sequences form arc log To: John Baldwin Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000091d0f6060efefa28" X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::631:from]; DMARC_NA(0.00)[bsdimp.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; R_SPF_NA(0.00)[no SPF record]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4TDJNR3CHVz45M9 --00000000000091d0f6060efefa28 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey John, On Mon, Jan 15, 2024 at 9:37=E2=80=AFAM Warner Losh wrote: > > > On Mon, Jan 15, 2024 at 9:30=E2=80=AFAM John Baldwin wr= ote: > >> On 1/14/24 6:24 PM, Warner Losh wrote: >> > The branch main has been updated by imp: >> > >> > URL: >> https://cgit.FreeBSD.org/src/commit/?id=3Ddf834e06bbc78c03cb6b35f074ae43= 673c9ce463 >> > >> > commit df834e06bbc78c03cb6b35f074ae43673c9ce463 >> > Author: Warner Losh >> > AuthorDate: 2024-01-15 02:22:04 +0000 >> > Commit: Warner Losh >> > CommitDate: 2024-01-15 02:23:45 +0000 >> > >> > git-arc: Just strip escape sequences form arc log >> > >> > Just strip escape sequences and Warning: lines from 'arc list' >> output. I >> > upgraded and they changed and git arc list broke. This restores i= ts >> > functionality. >> > >> > Note: jhb didn't like this, so if others object, I'll fix... >> > >> > Sponsored by: Netflix >> > Reviewed by: markj >> > Differential Revision: https://reviews.freebsd.org/D36553 >> >> Namely, it breaks the color output for reviews in different states, so >> Needs Review >> shows up as purple, Approved as green, etc. If you find the color outpu= t >> useful >> you'll have to revert this locally. >> >> Also, your last update in the review said that git arc was no longer >> broken for you >> back in May implying this commit wasn't needed for git arc to work for >> you? >> > > Yes and no. I was mistaken. This change is still needed, but its scope ca= n > be reduced. > The trouble is that it's at the first for the other things I committed an= d > getting it out of the > way was a pain (I tried). Since I didn't want to delay things any further= , > I went ahead and > committed and thought I'd fix stuff if there were objections.I'll do that > now. > So even w/o my change, I don't see the color output for the review states (so I can remove the general filter I added for color). That's easy enough. but what are you doing to get color in the current setup? Or is your arcanist install old and un-updated? That is, even w/o git-arc.sh, I see color for 'arc list' but not for 'arc list | more'. I'd kinda like to test things with and without the change, though. I'll prep a commit that just drops the ANSI-color filter, but if arc list no longer does that for pipes it won't change anything (I think that was the change that I was talking about back in May). Warner --00000000000091d0f6060efefa28 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey John,

On Mon, Jan 15, 2024 at 9:37= =E2=80=AFAM Warner Losh <imp@bsdimp.co= m> wrote:


On Mon, Jan 15, 2024 at 9:30=E2=80= =AFAM John Baldwin <jhb@freebsd.org> wrote:
On 1/14/24 6:24 PM, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3Ddf834e06bbc78c03cb6b35f074ae43673c9ce463<= /a>
>
> commit df834e06bbc78c03cb6b35f074ae43673c9ce463
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-01-15 02:22:04 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-01-15 02:23:45 +0000
>
>=C2=A0 =C2=A0 =C2=A0 git-arc: Just strip escape sequences form arc log<= br> >=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Just strip escape sequences and Warning: lines fro= m 'arc list' output. I
>=C2=A0 =C2=A0 =C2=A0 upgraded and they changed and git arc list broke. = This restores its
>=C2=A0 =C2=A0 =C2=A0 functionality.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Note: jhb didn't like this, so if others objec= t, I'll fix...
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Netflix
>=C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 markj
>=C2=A0 =C2=A0 =C2=A0 Differential Revision:=C2=A0
https://revi= ews.freebsd.org/D36553

Namely, it breaks the color output for reviews in different states, so Need= s Review
shows up as purple, Approved as green, etc.=C2=A0 If you find the color out= put useful
you'll have to revert this locally.

Also, your last update in the review said that git arc was no longer broken= for you
back in May implying this commit wasn't needed for git arc to work for = you?

Yes and no. I was mistaken. This c= hange is still needed, but its scope can be reduced.
The trouble = is that it's at the first for the other things I committed and getting = it out of the
way was a pain (I tried). Since I didn't want t= o delay things any further, I went ahead and
committed and though= t I'd fix stuff if there were objections.I'll do that now.

So even w/o my change, I don'= t see the color output for the review states (so I can remove the
general filter I added for color). That's easy enough. but what are yo= u doing to get color in the
current setup? Or is your arcanist in= stall old and un-updated?

That is, even w/o git-ar= c.sh, I see color for 'arc list' but not for 'arc list | more&#= 39;. I'd kinda like to test
things with and without the chang= e, though.

I'll prep a commit that just drops = the ANSI-color filter, but if arc list no longer does that for pipes
<= div>it won't change anything (I think that was the change that I was ta= lking about back in May).

Warner
--00000000000091d0f6060efefa28-- From nobody Mon Jan 15 17:24:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDJsK4HYJz578Fk for ; Mon, 15 Jan 2024 17:24:05 +0000 (UTC) (envelope-from 0100018d0e26dbe8-af62cd70-8450-487d-a531-55ab3ef58c10-000000@amazonses.com) Received: from a8-26.smtp-out.amazonses.com (a8-26.smtp-out.amazonses.com [54.240.8.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDJsK10RZz46qB for ; Mon, 15 Jan 2024 17:24:05 +0000 (UTC) (envelope-from 0100018d0e26dbe8-af62cd70-8450-487d-a531-55ab3ef58c10-000000@amazonses.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1705339444; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=+wkj7c+8YKTrGmYGx8S8Skzl+VR27muwkjTmE5TPQbw=; b=ds5lbWU4VJ/KjSvTcyDkea1SQZX9pwMZHt/TBJUuiv4VoOfp7bpTUA9+3U0R5KcW Kr+HshUDaVctcxCoJQL6kS54vRB8VajAHjlBD+PzaIr6BApGWOu5n3ROeHQKRXYQAB1 EgwH9UAU+dpXEpHmqoKfRXvhBbsx1rugvCB5I4QM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1705339444; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=+wkj7c+8YKTrGmYGx8S8Skzl+VR27muwkjTmE5TPQbw=; b=CU1mVfEPozrvXWVW2dMyJOqNbdZAEjOyFZJG1vaCQarXIZDKxa/fsO80c9ThQ2JM G9VkqRm/jMpDe06kBqkMtS1jFus1gPhk/9lDVPZJGhWj93aksMtF3jIqOmj/Lhpu6aw 1D8lwe4K8iQzBYQMhJ7VeDY8+KlThjISNVb9UfQ4= Message-ID: <0100018d0e26dbe8-af62cd70-8450-487d-a531-55ab3ef58c10-000000@email.amazonses.com> Date: Mon, 15 Jan 2024 17:24:04 +0000 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 6137b5f7b8c1 - main - Increase the size of riscv GENERICSD images to 6 GB Content-Language: en-US To: Mike Karels , Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, FreeBSD Release Engineering Team References: <202401151330.40FDU0q9009324@gitrepo.freebsd.org> <45CAA8CA-9B5E-41D2-8416-83156B6AC721@freebsd.org> From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; keydata= xsFNBGWMSrYBEACdWRqDn3B3SKO7IG0/fGHYtfs26f3Q5QeAcasy1fQLniwGQWn5rlILhbCD K/jdNoDm5Zxq20eqyffoDNObCjnHgg4tGANdi+RmDy+7CDpE789H8dss9y7Pt5DlGGAXQQnt hxush3EYS/Ctprd9UUL/lzOOLOU1aNtzB84tNrJBtcJmL7OYHfyTSNFxvedqJrrasejIQOLI t/DQ89BPzz+vsKHz7FJPXh3fsVkzLA00DJYcfkgxyABfJNA7U6yMwd4DVSdx/SsvfIDMVXnu UXCXswo106WPZbYGlZPpq0wW6iibtTerJix+8AeuwXvl9O1p8yESK4ErkIxCnmghTSz+pdzj z/6xBRkdDM9VdZ0r+CzsaNXMpDOzFuKyjaiYBdgCLljbDnXIHFcqXenrZ7Xwkm09g/M4uVSh pIUG2RYa6tsHSQoGCp3f2RZv1znfViKQFbbL83QjtPA20AhseZSYbHp1FPhXyy9J0wkGL16L e99g6gdGeIRE82BZjBjKGDkoyDPq+oDRSFl8NtzmIKy+cfz00nViqcTF4bREXEawFGhlpO0X O9q8mijI9iFB6zaPBiSdJGBL5ML5qLTNCl8Zlf4m1TBvmRTqF/lzMHVXHidDoUhpSh/y3AFZ 1KrYc27ztJQywDJPJPWPbtY8YhFLFs377gfP8WldsZjzp8nvoQARAQABzSVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+wsGRBBMBCAA7FiEEglY7hNBiDtwN+4ZBOJfy 4i5lrT8FAmWMSyYCGwMICwkNCAwHCwMFFQoJCAsFFgMCAQACHgUCF4AACgkQOJfy4i5lrT+i Yg/+PYyJNoFuygtV5t/skcjYmvEC93mnazEvh+x99vGYZnGKeJ8NDOF4QCUzeHquOWxDi8Zl reXyswKcrIquPxxX6+YyGe97VbvLnez3ksfzOYRj1F4qV0Rq8ZNK51+bvIrbcS3SfDaRioAk D7WWwFor8y/hSwxYkfsKbtP5PRcem20JUxuC085zqWLaKv5t5n2CBzAGMjwJaQ3tM3AXVwWJ uJaHA6ot/6fntJlmkfcyCYyyr0D6b0guRj3STbZ2hNn5o2AI+f6LJJ31s2sPFjl6rs7fORf3 hFSNOHDd2HxfVBXFdQy24ROkC4orBBz2xh9GScjxxT/hbXkfufkubFubw7n0HkvHzA3UF+Qq A8JiI3n+d7ocsP0/5BQ2sZdeqPGJgHx6RkAMuW1tJ29wSvCN1qMgFwhYkpQdfvHlociQrimU fvlRfSrBEe8o7tvIuEdpvwvCZSTJqQbVoMw8UHFE7nzyCXUSab5h6PbjakCqim13ekVO2KFF TTPcz5o5jEeUY75tzbIwcDfFbT5KqNjWy06TVdM9VEJDHSfOfxHR3kSEwZ+tT2aTvL3grsUn gFwSNcj4Cl4CRFfUw8zVZY+7O7RiMlhBqykikvUurrdGKc1Scwa0yuppdA6eVvylyTWSQGrQ +uLWtV1LUKN7ZqKJWBkLPt9nS4XZWGyBvxOHYqjOwU0EZYxKtgEQANYfgbtUMVnhjxDHhWLp g5kLHK3YW0TfJKzpXqDB7NiqxHofn4OcbZnVC3MKggcbs9o1/UtsjnlsG8550PfiYkDXvPiO RJwgbGs6MGIDK797C6cnBLQ8xwBa9SL4cl5iQFnhWmt6vwnJ+an/cm5JpYves3wL7jV09qU9 57hkHXEUcl38r4FssZzVcLKPUVTa3Un+QGRTGDGe/f4ctjMaqv0ZCM+l2ixPhf/vqESrfSLv V/+T3dmtUfXjazO3SABvsHwxgGuTTYOlKoPCaebr+BRdqm0xeIShoIlhvTI8y4clchqx/Uxg UG5X2kvU13k3DS3Q8uLE4Et9x1CcZT6WGgBZSR6R0WfD0SDnzufNnRWJ0dEPA2MtJHE7+85R Vi9j/IgZV+y5Ur+bnPkjDG1s2SVciX5v9HQ0oilcBhvx0j5lGE9hhurD9F+fCvkr4KdbCknE 6Y8ce8pCNBUoB/DqibJivOzTk9K9MGB5x0De5TerIrFiaw3/mQC9nGeO9dtE7wvDJetWeoTq 4BEaCzpufNqbkpOaTQILr4V6Gp7M6v97g83TVAwZntz/q8ptwuKQPZ2JaSFLZn7oWUpYXA5s +SIODFHLn6iMoYpBQskHQjnj4lEPJadl4qj+ZKA89iDAKsniyoFXsbJe2CPbMS1yzBxKZq6K D/jpt7BOnuHr/JrXABEBAAHCwXYEGAEIACAWIQSCVjuE0GIO3A37hkE4l/LiLmWtPwUCZYxK tgIbDAAKCRA4l/LiLmWtP3jmEACQrh9gWe8F1Tkw3m6VoHKwLc5he4tX3WpQa//soPO6iGG3 S3WPruQ46NrAaAojoOcKI9UONDO5rxG0ZTX53S+lu2EO47jbcLwOCjaEpjKpDRt9ZXBQE8Xl mtBE9Bp3W9gpjB1nE3KNM1mJYgsK0QdRpwwfh4pVgGpOj8j23I6MCK+v99zEBnpgCn2GX8W/ kctRXHqWwndHysOJtRP/zrl7dDaABF1f9efUl0LL3TD3GJ9VDz+DNOin/uK2a1hiJo8QzTRk PpfUQ2ebzDsrd1i/pOWkMSkdH+rEu4AGrXWtaBwrMyrGkL6Icb6yO+P9/z0W2wlgBf3P1YRt JPgQt/Dj3yvA/UnaV/QmuVQPjl13o24UnJGsZM8XGnNdfWBKkC1Q6VXC4QT+dyBHYH9MuE9d 6oGl8pFM1+cTfEfbM62/rRoPkF1yHMsI/903VxEvuUIKfhEZAVLFyHldooNxuchntHQP9y8J 8Ou9bWYQP7MnEn+kwSwrZkjurfPkan+xQvp6dDYnj3V0GwA5pprBMaB928VIDVOv+1PNQI3t Cvk5VPv/skq+TJRMHW7bFSt8PRa91cUf1FOLIz9APDiJOzXkwxUEHGV3zPSaUhs1JYjyBeGT wDAvtLUdjOnRhEUOwlnIrztmvyciutjJoVzKEEjj5WXnHk9L9kQ1bpAjkjTONw== In-Reply-To: <45CAA8CA-9B5E-41D2-8416-83156B6AC721@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-SES-Outgoing: 2024.01.15-54.240.8.26 X-Rspamd-Queue-Id: 4TDJsK10RZz46qB X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US] On 1/15/24 08:36, Mike Karels wrote: > On 15 Jan 2024, at 9:37, Warner Losh wrote: >> One question here... >> >> Do we need to include all the debugging stuff in /usr/lib/debug? i'ts over >> 1GB out of 5GB and seems like a poor fit >> for this form factor. We can easily provide it as a package instead.... >> >> I know the inevitable march of largeness must progress, but we should ask >> ourselves is this really a good use of that 1GB? > > Good question. On riscv, /usr/lib/debug is 2.5 GB. (arm64 is 2.1 GB.) > I'm also not sure what it would take to leave it off, although I would guess > that a tweak to installworld could do it if we need debug for other targets. > I think the package already exists. Of course, these images usually get > expanded to a much larger size on the first boot, so maybe the space doesn't > matter as much. > > Ideally, we'd keep the kernel debug, but that would probably be more work. > > It would probably make the most sense to the same thing for other architectures, > although arm64 at least has headroom. The scripts to build the image files are > shared, but there is a config file per image. > > Opinions, anyone? We could ask on freebsd-riscv and maybe other lists too. My inclination is to say that for now the "standard" FreeBSD images should include all the bits which 'make installkernel installworld' provides. (I have been considering shipping no-debug-files EC2 AMIs as an additional option, though, since people pay per GB for storage there.) When we move to pkgbase it will become dramatically easier for users to install debug files if/when needed, and at that point I think it would make sense to ship without them by default. -- Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Mon Jan 15 18:07:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDKqy2smwz57F6d; Mon, 15 Jan 2024 18:07: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 4TDKqy2J9Nz4K39; Mon, 15 Jan 2024 18:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705342078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RaMEbE7ZoJfQhPOiiBxw2febOoKutI7ifisSAoINnwI=; b=rhmjMQGyH4anmoG+qoy/HTFFoJGvC72n9Y12vvXrMNDxF7hDjwkaYaBxT/wiy8JgZmqGW7 +8B/3C/lrRc8sBAoYKh5H9ZwYTaZeHGeX9nTKZxPzQBA2JVvo/HjPphRg0pnNNpfwiNfZO /5avoTdUtVkrcVLErjplqlRBYMpKHkreAiTYloetEajfXPjiJqP1kOU9tqoFXgoUcZ1Bx5 Z3YyExGnsrUTyaEs7MDFVuFuipUzpkQJH3G1OP/+Joecg3nviWDdgDkNDI4Wglb3g5lTwO 8bQYticf0VIYCXCGWXgK0Xvx6Wl/BBEZy4ObWYtt0QBa+0LfwLp+KwvHln5jlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705342078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RaMEbE7ZoJfQhPOiiBxw2febOoKutI7ifisSAoINnwI=; b=xxFVIyCRUNve/354iC0dIwOGxyQn1QqrwTHE8YIXdDNXepsKiPSeUvPybNRMmLMx+wUetm T/nsRQNtZNw1vYHvZwoSvcZP1msUMCumAFBNoqj4CYz8eGRUBIY4ZhO/Y7g+3G61zYe/0M 5yIh0NfgPWEG+QRrn8HxVLEWe4+Dwb39Q8ew9hR5ejy5i2FuGIoCqzWbL6dKf2OZ/IQehG 6v2HFdxAxh4d0wnmWEHLc+aUjMXPDDMI9jHZOX7yrPwUDCA2GYiraV/LMI0ZsZYtzNLtDF KthakU2fLTA/3lyG/Gpcc3TeiCoFJeBao50GZQ/p5qdneVKkLCeFLpeBIYshDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705342078; a=rsa-sha256; cv=none; b=s6MNdP8EuhW8FjELVA2j8XVEwGFWks5WEWrxLTJnnAB6omsm8yEWdKzmDNViSIKV/00eCj 3bWDcyA3kCJr+HCUyeSREaKEdWABdJPusFtetRRlrS51Gn5SdPHPCnAXBSdpC+wjvbGo55 /175Twnu8mBDsd1NxixkPVwn6y1qJMCeZdpnieEjdACthMI6Z/O41j3Wp+TaCUnohKcMiH WYhRLfPCoMIhKBC1fba6F1VIhQ01PG3cGh4PUXkGOPfyu6gtEcK4l82kQr4k5lzH7HWSUY 4b7ymIlLWlKx7IGNr63v/fUuK3cYXRtRP7dzW1rhqEhcuyJjIDEkqNrgKN4n4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDKqy1L4nz16DX; Mon, 15 Jan 2024 18:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FI7w0l080278; Mon, 15 Jan 2024 18:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FI7wB1080275; Mon, 15 Jan 2024 18:07:58 GMT (envelope-from git) Date: Mon, 15 Jan 2024 18:07:58 GMT Message-Id: <202401151807.40FI7wB1080275@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: 61b0092be751 - main - condvar: Clean up condvar.h a bit List-Id: Commit messages for the main 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: 61b0092be751b8241b65cc14e4167d431f1e5ad8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=61b0092be751b8241b65cc14e4167d431f1e5ad8 commit 61b0092be751b8241b65cc14e4167d431f1e5ad8 Author: Mark Johnston AuthorDate: 2024-01-15 17:27:11 +0000 Commit: Mark Johnston CommitDate: 2024-01-15 17:27:11 +0000 condvar: Clean up condvar.h a bit - Remove a typedef that has been unused for a long time. - Remove a LOCORE guard. MI headers like condvar.h don't need such a guard in general. - Move a forward declaration into the _KERNEL block. - Add a types.h include to make the file self-contained. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43449 --- sys/sys/condvar.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/sys/condvar.h b/sys/sys/condvar.h index 23558879452c..cd16c85024d4 100644 --- a/sys/sys/condvar.h +++ b/sys/sys/condvar.h @@ -29,14 +29,6 @@ #ifndef _SYS_CONDVAR_H_ #define _SYS_CONDVAR_H_ -#ifndef LOCORE -#include - -struct lock_object; -struct thread; - -TAILQ_HEAD(cv_waitq, thread); - /* * Condition variable. The waiters count is protected by the mutex that * protects the condition; that is, the mutex that is passed to cv_wait*() @@ -49,6 +41,10 @@ struct cv { }; #ifdef _KERNEL +#include + +struct lock_object; + void cv_init(struct cv *cvp, const char *desc); void cv_destroy(struct cv *cvp); @@ -85,5 +81,4 @@ void cv_broadcastpri(struct cv *cvp, int pri); #define cv_wmesg(cvp) ((cvp)->cv_description) #endif /* _KERNEL */ -#endif /* !LOCORE */ #endif /* _SYS_CONDVAR_H_ */ From nobody Mon Jan 15 18:07:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDKqz49m7z57FKj; Mon, 15 Jan 2024 18:07: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 4TDKqz3GFzz4Jkb; Mon, 15 Jan 2024 18:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705342079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s3qsdh9Drj03qle34T5c8E8lbKszpY3AldrzIYfWcS8=; b=je+BAX3qfxLWwPzbOruV506JxquwE7LTeDSk6lMGvs7PXfqNChbSRRzN6cR0SdNNmzfwV/ E4FOIG249ZhL6k6jeEcaVyGD5z8ytimQP9V8/OpzZbeKaIxLwrmD+Dl5LByg03fnW9vk97 wGR/ORwsY9D6bEEW+ubD32inCMuBy4EX/5BlMnOouwAR9GLgDP6Bn2OHAStKU9RwJi2gTy qwacjzHKtw//PXOGq5NPVeohGGlc8sJnbqv0RrT+Ntu3uFLg919jSAG8zaOryj+N185Koi DI0t3WGTiFf9Nr6VtYn33iu0yZdMI1B5a2Lv8zBsm924OQrOwRCWnx963zIaBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705342079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s3qsdh9Drj03qle34T5c8E8lbKszpY3AldrzIYfWcS8=; b=ZIvK9+GiWYJgy9kU/jOTrsrgm1kGiwXrqqlwKHh5qp7+P6k02zfs+dyDzgjkkBHDFR+z2a 2uOroq4snMTYvcovVSxAttMOo5CEDg+OKdc1W2T5XWmpiNRppR7gKpADf64562/DgqbAnR HskhyxQNuVnQP1TbbhWjV7EB1mVlW/gu5ygokXcMduH5CC/bQ61v9JNsvXXwDcaHaOeIoX ohkafPs7v9YUop/krZ05hI8inTV+Iw92FH1v0dnp0ota9gooQUFppY/4Uzwguv9PFBbuLF AIXzknJiaGgW8wy9ahxgn00s1aWHz7r/UWJOSbT4b+/6d7BVJ2Bs0iRG7BX8Ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705342079; a=rsa-sha256; cv=none; b=QRE+9tCJMH4i1mpQXnRInKT1D081tbiy7BN9XKygRKJe5agk9FWDBOJSL8KS31JXoctfJz L12TKKje5IVRjdMs4rgtrbpEynBKIgnmBTOhBhmOCxNgFE1O4f1gBWlmowq4G7v3SMYt9b PnKdBmyhu189pIIyTAPy/nLnWXtkurQchW4kJNRoqsImfsts2py9aFMfCBIbHkyqBNBcFV CRKDbY3Ax+3SM/CSqrYQdkXuw8zHq54J+wYUyAbf7e0ufD+MmaKdDHmlYYAIF9Je0jxjIN sOk1pPLhJ5gDdNyKwZFEB1krH0/5LiJw1DqCXZzohGpKmKZUfNMNbZrb8mIqdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDKqz22qwz16DY; Mon, 15 Jan 2024 18:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FI7xtR080337; Mon, 15 Jan 2024 18:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FI7xhp080334; Mon, 15 Jan 2024 18:07:59 GMT (envelope-from git) Date: Mon, 15 Jan 2024 18:07:59 GMT Message-Id: <202401151807.40FI7xhp080334@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: a5ef95cd228e - main - condvar: Fix a user-after-free in _cv_wait() when ktrace is enabled List-Id: Commit messages for the main 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: a5ef95cd228e43bcc459a5c8a9911e57888ba5fd Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a5ef95cd228e43bcc459a5c8a9911e57888ba5fd commit a5ef95cd228e43bcc459a5c8a9911e57888ba5fd Author: Mark Johnston AuthorDate: 2024-01-15 17:29:02 +0000 Commit: Mark Johnston CommitDate: 2024-01-15 17:29:02 +0000 condvar: Fix a user-after-free in _cv_wait() when ktrace is enabled When a thread wakes up after sleeping on a CV, it must not dereference the CV structure, as it may already have been freed. At least ZFS relies on this invariant, see commit c636f94bd2ff15be5b904939872b4bce31456c18 for example. Thus, when logging context-switch events, copy the wmesg into a stack buffer while it is still safe to do so, and log that after waking up. While here, move the initial ktrcsw() call later, after assertions and the SCHEDULER_STOPPED_TD() condition are checked. Reported by: syzkaller Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43450 --- sys/kern/kern_condvar.c | 109 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 75 insertions(+), 34 deletions(-) diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c index 6b5f2933e041..2731f581a29f 100644 --- a/sys/kern/kern_condvar.c +++ b/sys/kern/kern_condvar.c @@ -43,8 +43,9 @@ #include #include #ifdef KTRACE -#include #include +#include +#include #endif /* @@ -107,24 +108,32 @@ void _cv_wait(struct cv *cvp, struct lock_object *lock) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; uintptr_t lock_state; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return; +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -145,7 +154,7 @@ _cv_wait(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -161,14 +170,13 @@ _cv_wait(struct cv *cvp, struct lock_object *lock) void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) { +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; td = curthread; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); @@ -181,6 +189,15 @@ _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) return; } +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -196,7 +213,7 @@ _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); } @@ -211,25 +228,33 @@ int _cv_wait_sig(struct cv *cvp, struct lock_object *lock) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; uintptr_t lock_state; int rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -251,7 +276,7 @@ _cv_wait_sig(struct cv *cvp, struct lock_object *lock) #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -272,24 +297,32 @@ _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, sbintime_t pr, int flags) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; int lock_state, rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -311,7 +344,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -334,24 +367,32 @@ _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, sbintime_t pr, int flags) { WITNESS_SAVE_DECL(lock_witness); +#ifdef KTRACE + char wmesg[WMESGLEN + 1]; +#endif struct lock_class *class; struct thread *td; int lock_state, rval; td = curthread; - lock_state = 0; -#ifdef KTRACE - if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0, cv_wmesg(cvp)); -#endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); - class = LOCK_CLASS(lock); if (SCHEDULER_STOPPED_TD(td)) return (0); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) { + strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg)); + ktrcsw(1, 0, wmesg); + } else { + wmesg[0] = '\0'; + } +#endif + + class = LOCK_CLASS(lock); + lock_state = 0; sleepq_lock(cvp); CV_WAITERS_INC(cvp); @@ -374,7 +415,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0, cv_wmesg(cvp)); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { From nobody Mon Jan 15 18:31:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDLLl3zXgz57JP7; Mon, 15 Jan 2024 18:31: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 4TDLLl3YWHz4R9H; Mon, 15 Jan 2024 18:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705343471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JY6HdtKQFNCq+45YRTYlgNgDE2YwuW9ng3GvoZAu/zU=; b=dRlDW5kize1mHTTh/0EW8bKDAxiOo/mDa5OdkFyfJ8fIIlMgM4QRkdIU6U4reAUR/nTFcG gzh/tyxBhPm3j1kVUKoxKKSj2avKATtYn83C1ckEoj1dlBUYxcKWg6JDVfG4zu8ECCp1Du xrA4Hqx8JBq1FabTkIYBLndUVUweDF0fW2Hyp5IplLRO5ZN6+MDzlwa5gCbhw3inf6uXuM oVXS/b/UrrUjvJz1mjwXtYVOSzPC+gSBzxh8VR9A9Od1AAJduEZi7q9nmeWoJ+wNwaR2lO JOPm79SX1wEqcgLboCCaNG8IFdv7LvILBzARuz1UgHHiwC0Iyega0tmqaKhApA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705343471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JY6HdtKQFNCq+45YRTYlgNgDE2YwuW9ng3GvoZAu/zU=; b=b8z9GCSsg/lPcpjmW7VH0G91oRUrdy3KuXbmK5o5JynLBcypToE+lOTuttWsdVxnUpkITm erKzaRfk0XgKRgC9HOBdDsm3FwMz/vQI2TEJJ3juQFG66W7O6oxPHaneT+lALs6DsrlA55 TAxzrm43EivW9bfX3Y/eERCmHz6Cu9gYTGkdvQeGnX7mtzOOYT4Be2UWHSifLwbetoClnA gpar5xBbSxL+isslJvsQU9nPcAk+eUQBtDHeKHwPyZ/CKj0glrcWzqSMFA98YEx23rYmac tm3WTp+3nEgXoUnTn3eMOFzgrKpSw1FzCeWzZU7QZ5RqGbPfLtcmSwnSYODPwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705343471; a=rsa-sha256; cv=none; b=pt/mMRiVaCMJ2kMj+6bQ0gqkSPpO5LQpnl6jD70j8P35MCC/Phc3ycnF+xcext5/oAWeFa w8ojMwplN7t9g6475uKXdexKz3vRtmy2TStstT7Vwe6+K2DGiuR2B3GBspDA4xD1bA3Ghc vYRTpy6VDdbr9JEUXwfdVth9KQvhu0UPUWgq+/P0S1+SBGSxpwFqviPNaGcEKA4uIJQQ5t NRzqjvO0fgzL/GTCVZPWqCr7clIcHVI+YQjXAAgsloiXUuHOBTIfWKuohMeSG4yDD7d/nt ZlgaXg5TXMWQCUXb+gGTPVQY3aK0Y/B8R0wllE+PG1pNX5+1y2blXO+PjKVfLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDLLl2f8Zz16n1; Mon, 15 Jan 2024 18:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FIVBZR026498; Mon, 15 Jan 2024 18:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FIVBrY026495; Mon, 15 Jan 2024 18:31:11 GMT (envelope-from git) Date: Mon, 15 Jan 2024 18:31:11 GMT Message-Id: <202401151831.40FIVBrY026495@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: ec13a838e685 - main - man: avoid unportable use of utilities List-Id: Commit messages for the main 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: ec13a838e6857585d3c3db70a0a67e337248ec28 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ec13a838e6857585d3c3db70a0a67e337248ec28 commit ec13a838e6857585d3c3db70a0a67e337248ec28 Author: Mohamed Akram AuthorDate: 2024-01-15 18:27:04 +0000 Commit: Warner Losh CommitDate: 2024-01-15 18:30:37 +0000 man: avoid unportable use of utilities echo -e is not portable. It can be replaced by printf %b (it works only with the /bin/sh built-in echo, not /bin/echo anyway). head -# is not portable, but head -n # is. Replace these two things in three places total. Signed-off-by: Mohamed Akram Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1062 --- usr.bin/man/man.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 777726f880db..efb05603f912 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -312,7 +312,7 @@ man_check_for_so() { # We need to loop to accommodate multiple .so directives. while true do - line=$($cattool "$manpage" | head -1) + line=$($cattool "$manpage" | head -n1) case "$line" in .so*) trim "${line#.so}" decho "$manpage includes $tstr" @@ -897,11 +897,11 @@ search_whatis() { bad=${bad#\\n} if [ -n "$good" ]; then - echo -e "$good" | $MANPAGER + printf '%b\n' "$good" | $MANPAGER fi if [ -n "$bad" ]; then - echo -e "$bad" >&2 + printf '%b\n' "$bad" >&2 fi exit $rval From nobody Mon Jan 15 18:50:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDLmT2Dx4z57L2X; Mon, 15 Jan 2024 18:50: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 4TDLmT1Fr0z4Wd1; Mon, 15 Jan 2024 18:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705344601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oT6zbWvo4BGKwdqD1mphsE4VvoyF+3xoTC04aK0ZiMI=; b=orRoYXvWen30ytm76bXHikGZ3065FWnJxUCJ0ppYim++NHO8aPcFZ12S24c41CzwMIj9bt HKB990yQUXn0ocEK8wGzxcGTuT6dfQ5Qn1EcoDji9gRGIgo4m54gsCQU5DqU2/d2C9ZxPe /u0L633shDneC8r5rwg/1DssDGvcezFqy+ov6Gb2ZEhQWLwURs/8o52t/YCik1L+oYXhF0 qUdX0FQh3qmU3j8m+3lXIIhoDsa2uVTi7/IpTCTDdfOsosGPsAKxI68TfkyLwFpaQqU6V/ wdl6/ymF7WHauuiG8BKm1S4J+csoCf0V9nSOctcqQDAcE1hzFfKu1OsorgmJXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705344601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oT6zbWvo4BGKwdqD1mphsE4VvoyF+3xoTC04aK0ZiMI=; b=SSyY0UgGcVK9mUaZBoNeaYu5AKJb8rJA+k6Rc74NvBUxI/OCsP0q+UBSn8GIavazhIz4tM XY21XZCCJKQuz2yD+BRIP1MrLi42EuHfiQJyhllbaDY2F+07GDXvioRHUgZEIccnSjgPLl z/mpadxbEMm1xwxmiIRwbVlhw6GfuPMZEwGzYSWkjTLm29jzXhjnJcuq37DR/uK5B2+PtT OdCqm2B7meC/nfONeJtJON72nY8RjBCWMGT8dc7lM1A/iSYzS2w/I5esW/UnU/jpVYl4jK SxXQnAlEurn7GvJRMr7AhiIHMwLQwDzP/7ViVL4GIpIR9lW848QIQN6MPfkJOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705344601; a=rsa-sha256; cv=none; b=huphza2W+eGJm1VBcFYfodDTU5q7XUJHKFBuNd47ppP3Pgaa2OpammQ0ADZzcifqp4GXvN uM+XPiO4N9PZpl//twuTUwOwpO8moO8GQq27+0HIKrbf4R7zd5a/wKa2n4oNATa7TnziWb k+jJjnGbrxJqbTknamTEC9u51P/InScN7cY0mquD/atx3/+D+ddYtHb3Px0gRdJFyehwGe nUjSmkpohu4LbE5xvkPFjxM6UsFyWlr5ppSPohtDqyw9ZvLUqxitGVIn9Vau+kYJJQMiV/ 4z4ZErp2BW7pm2+bf+hI1gbCe2xqoLMd+IUfKJAxWjUehYuA0bsBadlKMw6y6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDLmT0LpNz17SG; Mon, 15 Jan 2024 18:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FIo0Ok048858; Mon, 15 Jan 2024 18:50:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FIo0GI048838; Mon, 15 Jan 2024 18:50:00 GMT (envelope-from git) Date: Mon, 15 Jan 2024 18:50:00 GMT Message-Id: <202401151850.40FIo0GI048838@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: 2a121b97e967 - main - find: Allow '/' to be used with -perm for GNU compatibility List-Id: Commit messages for the main 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: 2a121b97e9673ff37062c9fa026eee969940d2e2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2a121b97e9673ff37062c9fa026eee969940d2e2 commit 2a121b97e9673ff37062c9fa026eee969940d2e2 Author: Ricardo Branco AuthorDate: 2024-01-15 18:35:27 +0000 Commit: Warner Losh CommitDate: 2024-01-15 18:47:24 +0000 find: Allow '/' to be used with -perm for GNU compatibility In 2005, Gnu find deprecated '+' as the leading character for the -perm argument, instead preferring '/' with the same meaning. Implement that behavior here, and document it in the man page. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1060 --- usr.bin/find/find.1 | 19 ++++++++++++++++--- usr.bin/find/function.c | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index de16b012ce4d..856961d02395 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 22, 2023 +.Dd January 15, 2024 .Dt FIND 1 .Os .Sh NAME @@ -757,7 +757,7 @@ Slashes .Pq Dq Li / are treated as normal characters and do not have to be matched explicitly. -.It Ic -perm Oo Cm - Ns | Ns Cm + Oc Ns Ar mode +.It Ic -perm Oo Cm - Ns | Ns Cm + Ns | Ns Cm / Oc Ns Ar mode The .Ar mode may be either symbolic (see @@ -786,11 +786,14 @@ are set in the file's mode bits. If the .Ar mode is preceded by a plus -.Pq Dq Li + , +.Pq Dq Li + this primary evaluates to true if any of the bits in the .Ar mode are set in the file's mode bits. +A slash +.Pq Dq Li / +is also accepted with the same meaning as plus for compatibility with GNU find. Otherwise, this primary evaluates to true if the bits in the .Ar mode @@ -1116,6 +1119,16 @@ option was inspired by the equivalent and .Xr sed 1 options. +.Pp +The +.Ic -perm +primary accepts a leading slash +.Pq Dq Li / +as an alias for a leading plus +.Pq Dq Li + +for its argument as an extension of +.St -p1003.1-2001 +to be compatible with GNU find. .Sh HISTORY A simple .Nm diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 43aa2301439c..f96a086cbda3 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1338,7 +1338,7 @@ c_perm(OPTION *option, char ***argvp) if (*perm == '-') { new->flags |= F_ATLEAST; ++perm; - } else if (*perm == '+') { + } else if (*perm == '+' || *perm == '/') { new->flags |= F_ANY; ++perm; } From nobody Mon Jan 15 21:15:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDQ0H0RHyz57ZdJ; Mon, 15 Jan 2024 21:15: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 4TDQ0G6jhMz4rN4; Mon, 15 Jan 2024 21:15:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705353326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YvTkndc3sZRPUHBEu6EMw6Q5HQGlm239o7B94zQOozU=; b=vzXAZyTxUBwfms5NC1FP3BOJQGvawwKuBujp/y3jrY/6eohBvTMfwPEke6NWJ6rFTeSvIf ysrP9O9ePoqBeP/FFGBdogJzU8omqLAUyRlJDsa6RKHT2142RLmxbexg2CZbPj79soYfbz aRMr8ia5Uwix4yeLR24YR10se2l9D9z/NDi2LI10zHUR36/QAHSBF+fJmZBBw5HAlZWHbp I6XPm8DitIu2QanGDuVTqOsD5Atks3zYmhEoiK+d/WvuXfDKuxJZNSwxsmLnm01CBJLruw 5Rj/nhfoFDPsKlmore0FyMFZa4U3Ty/xUaeae7egGlH6punX/phdVRVBRfTtOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705353326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YvTkndc3sZRPUHBEu6EMw6Q5HQGlm239o7B94zQOozU=; b=a422LUfDs859fYIXZb23xkvYOhJqUW8jnArAdmubRH7YwR9xfu+zu530M9o/aPwtSsxTfT TV90V2idtNsufoIbPFJc2l48Dzyfbjnekoien14czo2iMQ+SmEQJHd2h++h4WTIKFfn+NY yEXUE2NXyaNh1w6BQhG2oa/6EcVpJhTXfsLABxiYAUtcFrFlFZNoBd1oCjj4ahaWlTwHzc 1evFbq8sziNBSnsKtGz2rdHyvTyQXgEq2cLo85JkJRk+2zBFo/D3qSrzkGLB3xtaB/QA0g HERs+aKss0ZsdFvqcOl3/X7Q23u1Hd0C8QC8d3MgmgSkOHg2RLLn7D79+AZr9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705353326; a=rsa-sha256; cv=none; b=te2DZ6pjDxnDjZI7NPyRXzRHEvvCz7rGMsxnG0Ip2JUBik1quBaYw+bdS/Bm37xzycObmR vba1yafhHTt3oAaeLLPK+DgZyyIp1tdmXFjC8r/elijyWEh70p4iBP90d79xPmT/Ufkw4/ 9wpUwrLQeRo1k6re4wF/yizlNO77K3czZfrGXx02cyqv6Gdqz0IoJ1TwfKJcDcuM19VnrH ZM1EbeUjvS8qbEt6CD9moh9SExd9onH3fwWTdQEuN81B3tErjJoDU6NyG1kxjJdL2ccLLQ EC3zp+KO/JQuGEdzeL7Xlca9hLJyMtFTFccQ/h5/slKK1CYd4gojn58jNJyOfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDQ0G5mmsz1C2T; Mon, 15 Jan 2024 21:15:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FLFQev000120; Mon, 15 Jan 2024 21:15:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FLFQtk000117; Mon, 15 Jan 2024 21:15:26 GMT (envelope-from git) Date: Mon, 15 Jan 2024 21:15:26 GMT Message-Id: <202401152115.40FLFQtk000117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: b9e8ae1d8a42 - main - route: error on IPv4 network routes with incorrect destination List-Id: Commit messages for the main 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: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9e8ae1d8a424194b4e185359da4ded163f24f4e Auto-Submitted: auto-generated The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=b9e8ae1d8a424194b4e185359da4ded163f24f4e commit b9e8ae1d8a424194b4e185359da4ded163f24f4e Author: Mike Karels AuthorDate: 2024-01-15 21:14:54 +0000 Commit: Mike Karels CommitDate: 2024-01-15 21:14:54 +0000 route: error on IPv4 network routes with incorrect destination Route destinations like 10/8 are most likely intended as a shorthand for 10.0.0.0/8, but instead it means 0.0.0.10/8, which includes only bits in the host part of the mask, and hence adds a route to 0.0.0.0/8. In 12.x, there was code to "do what I mean", which was removed as part of a cleanup of old network class remnants. Given that we have gone this long without that code, do not restore that behavior. Instead, detect the issue and produce an error. Specifically, if there are no dots in a numeric IPv4 address, the mask is specified with CIDR notation (using a slash), and there are bits set in the host part, produce an error like this for 10/8: route: malformed address, bits set after mask; 10 means 0.0.0.10 PR: 258874 MFC after: 1 week Reviewed by: melifaro, emaste Differential Revision: https://reviews.freebsd.org/D43384 --- sbin/route/route.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sbin/route/route.c b/sbin/route/route.c index c39a13b252bb..03844308fe84 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1329,6 +1329,9 @@ getaddr(int idx, char *str, int nrflags) q = strchr(str,'/'); if (q != NULL && idx == RTAX_DST) { /* A.B.C.D/NUM */ + struct sockaddr_in *mask; + uint32_t mask_bits; + *q = '\0'; if (inet_aton(str, &sin->sin_addr) == 0) errx(EX_NOHOST, "bad address: %s", str); @@ -1338,6 +1341,20 @@ getaddr(int idx, char *str, int nrflags) errx(EX_NOHOST, "bad mask length: %s", q + 1); inet_makemask((struct sockaddr_in *)&so[RTAX_NETMASK],masklen); + + /* + * Check for bogus destination such as "10/8"; heuristic is + * that there are bits set in the host part, and no dot + * is present. + */ + mask = ((struct sockaddr_in *) &so[RTAX_NETMASK]); + mask_bits = ntohl(mask->sin_addr.s_addr); + if ((ntohl(sin->sin_addr.s_addr) & ~mask_bits) != 0 && + strchr(str, '.') == NULL) + errx(EX_NOHOST, + "malformed address, bits set after mask;" + " %s means %s", + str, inet_ntoa(sin->sin_addr)); return (0); } if (inet_aton(str, &sin->sin_addr) != 0) From nobody Mon Jan 15 21:38:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDQVs3DgYz57cx9; Mon, 15 Jan 2024 21: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 4TDQVs2Zhwz3wZy; Mon, 15 Jan 2024 21: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=1705354709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d2trC9m+zjkyhFeNCBzdqdqWt/strAq5/F9b4UNgAeo=; b=LNuuhcRqJSrMkx0rMsxE5i1BfgQlOENN5LCRKPBpWme8CwSFSL9Udw19Z9v9SIiKx72PsR kKotYbmZPKH9wcdEdp3GDRYJ7f2bTRNQUWeMbc0AOCjnFlrpjssNYBf4epBpn/AUo8+Vdc p92FYhsH2lsZWD/GXPJ8k/YsjQ5+/gS8wSPEY0ZYnhR4P2q2vNJlwm+jACD/ayR/zrXZyS ktLXFYAOnXG0BpVDgUfYAAXpAAjVGa6aL1o9vFTE7GenqdIiJceE8eemuzWw2K5U/3kU2Q /FQJI1d0aaf6snmbv2I9YjGbXdyirsc27K6PWlxsDHNWbiUoxQflwRlNt4R1AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705354709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d2trC9m+zjkyhFeNCBzdqdqWt/strAq5/F9b4UNgAeo=; b=amNyUKPp5HFy9Aw9hX5LwL/8vQzsjzEMRRzDCdqIEIpE0vXZRaE5FALf4gvymSFGNISmOR x/QP8ERGBl+9E6rCOIMak3uws40F4IunP2gFMDqvpL3k7qwwgeVy+XK3nU12eTmcHtBak3 NRkO6y7TTwjGpXTjl4w8VNIc02rQZ55OPuHEnvCZzYpZQGKSeX8mAveA/4cxJmBj8zuRAR KYtkR6vbwEmnXmc9tonYr3W2y6yjKVw0xR1VCIw8gXry3Ev349Nyll1gl3fYO+WHUW37YO qO/q5Jjl0wcX8jQC0pl2MOJdzTdgRa8DZnNzft5q8A63UGIW3bynD3dyRbgaUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705354709; a=rsa-sha256; cv=none; b=smFEhCHuzwhm5hg5xmQZjFJvukMP0ndexC3qTzjXt8Lo8kGc9RjUAlslEb3YgdyW7NIzvW noyDU8CDCWiN1d8WMRQmGMuiECRqRGFDdFhc0AvlHWB/zesg2Xbpbo/UUmobpyFKxEc5YL sWGOJrsGgkuESSP3LCZZAElIFeosoimjbrmgpUA/x/iJjhn+q4mLr64Fk3kHFM3EAfYP7q 41OsSOYnj1qvW6BKIZlannOfUgkwmN1wd8oQHxwpniqFNxBxPT3Kj/5Rcg+Icqwcjudm+z tXw4gt++yhfP6CFZ/9Qi1TrzbxjLLBAYB3aYC/jd8SePdJEldJfl02ihpDbxgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDQVs1gtdz1C9n; Mon, 15 Jan 2024 21:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FLcTCU034449; Mon, 15 Jan 2024 21:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FLcT8j034446; Mon, 15 Jan 2024 21:38:29 GMT (envelope-from git) Date: Mon, 15 Jan 2024 21:38:29 GMT Message-Id: <202401152138.40FLcT8j034446@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: 2524b7dfb0df - main - crashinfo: Print stack traces for all on-CPU threads List-Id: Commit messages for the main 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: 2524b7dfb0df7e37ea9651559ce6c027b006e2a9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2524b7dfb0df7e37ea9651559ce6c027b006e2a9 commit 2524b7dfb0df7e37ea9651559ce6c027b006e2a9 Author: Mark Johnston AuthorDate: 2024-01-15 20:39:26 +0000 Commit: Mark Johnston CommitDate: 2024-01-15 21:36:40 +0000 crashinfo: Print stack traces for all on-CPU threads Add a python script which implements the bulk of this functionality. Over time, this would ideally evolve into a library of python routines which can be used to inspect kernel data structures and automate some debugging tasks, similar to jhb's out-of-tree scripts, but written in a somewhat nicer language and with better integration into the kgdb command prompt. Note that kgdb currently won't auto-load scripts in this directory. This should perhaps change in the future. It probably also makes more sense to have a crashinfo.py which provides all the kgdb output that we want to include in core.txt, rather than having crashinfo.sh pipe in several commands. Reviewed by: avg, imp Discussed with: jhb MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33817 --- etc/mtree/BSD.usr.dist | 2 ++ libexec/Makefile | 2 +- libexec/kgdb/Makefile | 5 ++++ libexec/kgdb/acttrace.py | 63 +++++++++++++++++++++++++++++++++++++++++ usr.sbin/crashinfo/crashinfo.sh | 8 ++++-- 5 files changed, 76 insertions(+), 4 deletions(-) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 83d8de034caf..a7738aaf6f78 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -161,6 +161,8 @@ .. hyperv .. + kgdb + .. lpr ru .. diff --git a/libexec/Makefile b/libexec/Makefile index 5f7f652df6ed..ee354fa60e79 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -1,4 +1,3 @@ - .include .include @@ -11,6 +10,7 @@ SUBDIR= ${_atf} \ flua \ getty \ ${_hyperv} \ + kgdb \ ${_mail.local} \ ${_makewhatis.local} \ ${_mknetid} \ diff --git a/libexec/kgdb/Makefile b/libexec/kgdb/Makefile new file mode 100644 index 000000000000..f6b255ab4f60 --- /dev/null +++ b/libexec/kgdb/Makefile @@ -0,0 +1,5 @@ +FILESDIR?= /usr/libexec/kgdb + +FILES= acttrace.py + +.include diff --git a/libexec/kgdb/acttrace.py b/libexec/kgdb/acttrace.py new file mode 100644 index 000000000000..3229ff708de1 --- /dev/null +++ b/libexec/kgdb/acttrace.py @@ -0,0 +1,63 @@ +#- +# Copyright (c) 2022 The FreeBSD Foundation +# +# This software was developed by Mark Johnston under sponsorship from the +# FreeBSD Foundation. +# + +import gdb + + +def symval(name): + return gdb.lookup_global_symbol(name).value() + + +def tid_to_gdb_thread(tid): + for thread in gdb.inferiors()[0].threads(): + if thread.ptid[2] == tid: + return thread + else: + return None + + +def all_pcpus(): + mp_maxid = symval("mp_maxid") + cpuid_to_pcpu = symval("cpuid_to_pcpu") + + cpu = 0 + while cpu <= mp_maxid: + pcpu = cpuid_to_pcpu[cpu] + if pcpu: + yield pcpu + cpu = cpu + 1 + + +class acttrace(gdb.Command): + def __init__(self): + super(acttrace, self).__init__("acttrace", gdb.COMMAND_USER) + + def invoke(self, arg, from_tty): + # Save the current thread so that we can switch back after. + curthread = gdb.selected_thread() + + for pcpu in all_pcpus(): + td = pcpu['pc_curthread'] + tid = td['td_tid'] + + gdb_thread = tid_to_gdb_thread(tid) + if gdb_thread is None: + print("failed to find GDB thread with TID {}".format(tid)) + else: + gdb_thread.switch() + + p = td['td_proc'] + print("Tracing command {} pid {} tid {} (CPU {})".format( + p['p_comm'], p['p_pid'], td['td_tid'], pcpu['pc_cpuid'])) + gdb.execute("bt") + print() + + curthread.switch() + + +# Registers the command with gdb, doesn't do anything. +acttrace() diff --git a/usr.sbin/crashinfo/crashinfo.sh b/usr.sbin/crashinfo/crashinfo.sh index 9a3d26020654..3bb1e1456462 100755 --- a/usr.sbin/crashinfo/crashinfo.sh +++ b/usr.sbin/crashinfo/crashinfo.sh @@ -215,13 +215,15 @@ echo sed -ne '/^ Panic String: /{s//panic: /;p;}' $INFO echo -# XXX: /bin/sh on 7.0+ is broken so we can't simply pipe the commands to -# kgdb via stdin and have to use a temporary file instead. file=`mktemp /tmp/crashinfo.XXXXXX` if [ $? -eq 0 ]; then + scriptdir=/usr/libexec/kgdb + echo "bt -full" >> $file + echo "source ${scriptdir}/acttrace.py" >> $file + echo "acttrace" >> $file echo "quit" >> $file - ${GDB%gdb}kgdb $KERNEL $VMCORE < $file + ${GDB%gdb}kgdb -q $KERNEL $VMCORE < $file rm -f $file echo fi From nobody Mon Jan 15 21:58:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDQxk4Gt9z57fll; Mon, 15 Jan 2024 21: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 4TDQxk3pl7z40yr; Mon, 15 Jan 2024 21:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705355898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=coQDL10GQTYvCtA6YCefy6EUyCQb0y2Jvy8n7DMenEY=; b=g680R3Df+79YSPk+B1PJjAhL8NjawkEkOcq5QKBBbFH4r1BNlNc5wTcyDij1WwZ3yKZYb7 Fs/W3PR39NU/kBRg1EVk3pliRYyri2vGj/Vk0nBYpP7wQ1y9P8jiJVq5JrFug6KvviOBJg pDP2xJv0a1cO+shBrhzLOXbzhvtTJSe/vjd0ljX1/fX35PdCkh6B9MWzTAadrltnW0c7wW OI0VQKAAx4EotNccqgsUPMt0eFajGUfhBfiFDPvcEcOY+z1QmJ68kE5PMYCRAJGkwGmSG6 YU3h4O3KKeq/feRry2dZrc8gvmoTEM3w5OcGfn874ZCvX4sMPdt0RkL8MKQZPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705355898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=coQDL10GQTYvCtA6YCefy6EUyCQb0y2Jvy8n7DMenEY=; b=bKBPoMrMY+WSojfWtOpiuacXOMkHqUKor8+ma9pSlOKKuk6FF0Qui+tXH3cf22XO273B3o FYE42qdSgGxBFqyRvWxe5f0qdbXDnansa5NB11Pi6ZN/HzLVIIrKfIkAVqGKQWE2kf98R6 HoO3W/tdUdsbtrGaoknp2p+hsBHcuLaqXULGBoWtuPORiBKhsQPIz02tkrlNUWPbB3H3Uz gnMfT8gCHEHoyzTqmJwUDrPeLs4vMKD9BWTu7DM81MV1OmbN1ysdE7j6wiKpXrlGIXjWPA PUN5R81j02I/ddzirx/ZGzU64/SiSohudz7Aa6lkNOxyGIn5QWE2RnynwqyCyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705355898; a=rsa-sha256; cv=none; b=sBBH43gIB7fxK5qu9zfvae1mGjd8VQyXPxCb5EmpyWfyGaZkARWC1RRfYe7UxGzJSCItHZ c1AyTIe1c3RlR1KCGHp2Js0GjTvP2F+xdKmhyd1R7agfGwue7UBi6SAZlERp42r5pxcNNr qUFs9E+mvBHpz6iSKDi0ZiE5Ra8y4iX6yMQuKJfQcfZO70LeOjFnQsSlONK5cZ92r/QyES m35+VlrZlb8BnjIjrtNYQAv51JNDu349+SWGEtD8J5Bbg5e0lKY5wNhdZrPtO8N9CuXKwT vqAihARzsP5U/1Wro2ShK89+zEEbAK3J2u0JKcEkBR+HOZHQGiMxM6m6/wq8ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDQxk2mHVz1Chn; Mon, 15 Jan 2024 21:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FLwIBP067780; Mon, 15 Jan 2024 21:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FLwIjJ067777; Mon, 15 Jan 2024 21:58:18 GMT (envelope-from git) Date: Mon, 15 Jan 2024 21:58:18 GMT Message-Id: <202401152158.40FLwIjJ067777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 1c909c300b92 - main - fusefs: fix an interaction between copy_file_range and mmap List-Id: Commit messages for the main 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c909c300b92601f7690610097ac98126caff835 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1c909c300b92601f7690610097ac98126caff835 commit 1c909c300b92601f7690610097ac98126caff835 Author: Alan Somers AuthorDate: 2023-12-31 14:31:16 +0000 Commit: Alan Somers CommitDate: 2024-01-15 21:57:15 +0000 fusefs: fix an interaction between copy_file_range and mmap If a copy_file_range operation tries to read from a page that was previously written via mmap, that page must be flushed first. MFC after: 2 weeks Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D43451 --- sys/fs/fuse/fuse_vnops.c | 1 + tests/sys/fs/fusefs/copy_file_range.cc | 68 +++++++++++++++++++++++++ tests/sys/fs/fusefs/io.cc | 90 ++++++++++++++++++++++++++++++++-- 3 files changed, 154 insertions(+), 5 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 30965b45215d..3f8f3322162a 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -906,6 +906,7 @@ fuse_vnop_copy_file_range(struct vop_copy_file_range_args *ap) if (err) goto unlock; + vnode_pager_clean_sync(invp); err = fuse_inval_buf_range(outvp, outfilesize, *ap->a_outoffp, *ap->a_outoffp + io.uio_resid); if (err) diff --git a/tests/sys/fs/fusefs/copy_file_range.cc b/tests/sys/fs/fusefs/copy_file_range.cc index 8640780c0b58..17b21b888736 100644 --- a/tests/sys/fs/fusefs/copy_file_range.cc +++ b/tests/sys/fs/fusefs/copy_file_range.cc @@ -27,6 +27,7 @@ extern "C" { #include +#include #include #include @@ -320,6 +321,73 @@ TEST_F(CopyFileRange, fallback) ASSERT_EQ(len, copy_file_range(fd1, &start1, fd2, &start2, len, 0)); } +/* + * Writes via mmap should not conflict with using copy_file_range. Any dirty + * pages that overlap with copy_file_range's input should be flushed before + * FUSE_COPY_FILE_RANGE is sent. + */ +TEST_F(CopyFileRange, mmap_write) +{ + const char FULLPATH[] = "mountpoint/src.txt"; + const char RELPATH[] = "src.txt"; + uint8_t *wbuf, *fbuf; + void *p; + size_t fsize = 0x6000; + size_t wsize = 0x3000; + ssize_t r; + off_t offset2_in = 0; + off_t offset2_out = wsize; + size_t copysize = wsize; + const uint64_t ino = 42; + const uint64_t fh = 0xdeadbeef1a7ebabe; + int fd; + const mode_t mode = 0644; + + fbuf = (uint8_t*)calloc(1, fsize); + wbuf = (uint8_t*)malloc(wsize); + memset(wbuf, 1, wsize); + + expect_lookup(RELPATH, ino, S_IFREG | mode, fsize, 1); + expect_open(ino, 0, 1, fh); + /* This read is initiated by the mmap write */ + expect_read(ino, 0, fsize, fsize, fbuf, -1, fh); + /* This write flushes the buffer filled by the mmap write */ + expect_write(ino, 0, wsize, wsize, wbuf); + + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_COPY_FILE_RANGE && + (off_t)in.body.copy_file_range.off_in == offset2_in && + (off_t)in.body.copy_file_range.off_out == offset2_out && + in.body.copy_file_range.len == copysize + ); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([&](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, write); + out.body.write.size = copysize; + }))); + + fd = open(FULLPATH, O_RDWR); + + /* First, write some data via mmap */ + p = mmap(NULL, wsize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ASSERT_NE(MAP_FAILED, p) << strerror(errno); + memmove((uint8_t*)p, wbuf, wsize); + ASSERT_EQ(0, munmap(p, wsize)) << strerror(errno); + + /* + * Then copy it around the file via copy_file_range. This should + * trigger a FUSE_WRITE to flush the pages written by mmap. + */ + r = copy_file_range(fd, &offset2_in, fd, &offset2_out, copysize, 0); + ASSERT_EQ(copysize, (size_t)r) << strerror(errno); + + free(wbuf); + free(fbuf); +} + + /* * copy_file_range should send SIGXFSZ and return EFBIG when the operation * would exceed the limit imposed by RLIMIT_FSIZE. diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index fda13a72cc4c..357772c31c2c 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -73,7 +73,7 @@ static void compare(const void *tbuf, const void *controlbuf, off_t baseofs, } } -typedef tuple IoParam; +typedef tuple IoParam; class Io: public FuseTest, public WithParamInterface { public: @@ -112,6 +112,7 @@ void SetUp() default: FAIL() << "Unknown cache mode"; } + m_kernel_minor_version = get<3>(GetParam()); m_noatime = true; // To prevent SETATTR for atime on close FuseTest::SetUp(); @@ -120,9 +121,10 @@ void SetUp() if (verbosity > 0) { printf("Test Parameters: init_flags=%#x maxwrite=%#x " - "%sasync cache=%s\n", + "%sasync cache=%s kernel_minor_version=%d\n", m_init_flags, m_maxwrite, m_async? "" : "no", - cache_mode_to_s(get<2>(GetParam()))); + cache_mode_to_s(get<2>(GetParam())), + m_kernel_minor_version); } expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); @@ -195,6 +197,30 @@ void SetUp() }, Eq(true)), _) ).WillRepeatedly(Invoke(ReturnErrno(0))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_COPY_FILE_RANGE && + in.header.nodeid == ino && + in.body.copy_file_range.nodeid_out == ino && + in.body.copy_file_range.flags == 0); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnImmediate([=](auto in, auto& out) { + off_t off_in = in.body.copy_file_range.off_in; + off_t off_out = in.body.copy_file_range.off_out; + ASSERT_EQ((ssize_t)in.body.copy_file_range.len, + copy_file_range(m_backing_fd, &off_in, m_backing_fd, + &off_out, in.body.copy_file_range.len, 0)); + SET_OUT_HEADER_LEN(out, write); + out.body.write.size = in.body.copy_file_range.len; + }))); + /* Claim that we don't support FUSE_LSEEK */ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LSEEK); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnErrno(ENOSYS))); m_test_fd = open(FULLPATH, O_RDWR ); EXPECT_LE(0, m_test_fd) << strerror(errno); @@ -223,6 +249,31 @@ void do_closeopen() ASSERT_LE(0, m_control_fd) << strerror(errno); } +void do_copy_file_range(off_t off_in, off_t off_out, size_t size) +{ + ssize_t r; + off_t test_off_in = off_in; + off_t test_off_out = off_out; + off_t test_size = size; + off_t control_off_in = off_in; + off_t control_off_out = off_out; + off_t control_size = size; + + while (test_size > 0) { + r = copy_file_range(m_test_fd, &test_off_in, m_test_fd, + &test_off_out, test_size, 0); + ASSERT_GT(r, 0) << strerror(errno); + test_size -= r; + } + while (control_size > 0) { + r = copy_file_range(m_control_fd, &control_off_in, m_control_fd, + &control_off_out, control_size, 0); + ASSERT_GT(r, 0) << strerror(errno); + control_size -= r; + } + m_filesize = std::max(m_filesize, off_out + (off_t)size); +} + void do_ftruncate(off_t offs) { ASSERT_EQ(0, ftruncate(m_test_fd, offs)) << strerror(errno); @@ -345,6 +396,13 @@ virtual void SetUp() { } }; +class IoCopyFileRange: public Io { +public: +virtual void SetUp() { + Io::SetUp(); +} +}; + /* * Extend a file with dirty data in the last page of the last block. * @@ -517,16 +575,38 @@ TEST_P(IoCacheable, vnode_pager_generic_putpage_clean_block_at_eof) do_mapwrite(0x1bbc3, 0x3b4e0); } +/* + * A copy_file_range that follows an mmap write to the input area needs to + * flush the mmap buffer first. + */ +TEST_P(IoCopyFileRange, copy_file_range_from_mapped_write) +{ + do_mapwrite(0x1000, 0); + do_copy_file_range(0, 0x1000, 0x1000); + do_read(0x1000, 0x1000); +} + + INSTANTIATE_TEST_SUITE_P(Io, Io, Combine(Bool(), /* async read */ Values(0x1000, 0x10000, 0x20000), /* m_maxwrite */ - Values(Uncached, Writethrough, Writeback, WritebackAsync) + Values(Uncached, Writethrough, Writeback, WritebackAsync), + Values(28) /* kernel_minor_vers */ ) ); INSTANTIATE_TEST_SUITE_P(Io, IoCacheable, Combine(Bool(), /* async read */ Values(0x1000, 0x10000, 0x20000), /* m_maxwrite */ - Values(Writethrough, Writeback, WritebackAsync) + Values(Writethrough, Writeback, WritebackAsync), + Values(28) /* kernel_minor_vers */ + ) +); + +INSTANTIATE_TEST_SUITE_P(Io, IoCopyFileRange, + Combine(Values(true), /* async read */ + Values(0x10000), /* m_maxwrite */ + Values(Writethrough, Writeback, WritebackAsync), + Values(27, 28) /* kernel_minor_vers */ ) ); From nobody Mon Jan 15 23:17:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDShm5WNLz57nSC; Mon, 15 Jan 2024 23: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 4TDShm4mYkz4FYH; Mon, 15 Jan 2024 23: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=1705360632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W7HOIOZXL90m6JSzIhv0VfLjH/oXqAG3uLexT18I8Zg=; b=bzPR3uSwy1Jv69TG8+2Xc1XqS1dXKZPgCn0p0CNHi+HAcDdkIVjRFdWHEQILQGoC+jz3T/ ZMrprhN9Lj5waetRmew1nJ48Dv6Yl4mXTKGQaKt49Pyd/Ypwy8vt6y4zWPCBUkPjkQdnu4 J3klImuzaPL3222iLr3950CkUB8akeyu/suvzTz+Od0mYZul95ObGS8mNTXLn3ue/DyAx9 R6P2y139nRq238VhoQ8WrOO2PCjBeN1b0BUi9M+EIefP4mA8SjliFkanAAKtX2QUll29Iq 7uLqf+0V2F3EWpg/jhpJCyUB2g2E4LtLWMtJ5/OPMpKq8kuU/5ndeeiTk8D9YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705360632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W7HOIOZXL90m6JSzIhv0VfLjH/oXqAG3uLexT18I8Zg=; b=k57jRard3dzTOlW/V05rswakYApTNwdJ7y+A07wjTrPSix5Rd2YikTTiCusS/oZFBaA/UC tLYxSnZlBxnKbdNfNiGUS4AiQbl+Z0OS3bkQtfxxqtDdaCvR0yTKWpGQ1Z0WfQ5L6MECdO ytrbE9tZgTCO4s3H7vq3Mj9uZv8R3n79uH6Pod2HdAKLh0umGHeCWx8XMWDWfR/juzbViu hQ+2X5l54C8cu0Sxok4eg5c58bENlevvRdZ2Fsqb/uFTk/tRre02zH83mzAhqW4IgaRONC J1gKgJcVys8+naylM5853avqNVDgNVC/Ehql7X9iYbm8rWD8m2YrhDlYxeDlcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705360632; a=rsa-sha256; cv=none; b=jYV+lb3BdEt58n3f+9MbwYvgnv1mtKTbH4S9BCyKPQwlf9MpLqZFCZoDuP0hEP9y3Igt6r lV8L1gAQzukRq0S21DnPPjkPvPwjVLtcLahcr3wEvbUpbhvkoa0pQ51mLo/tRsbhavSCos KDsw3cByNinKU5BhSpm6yVSUoyw18fVmagDvr8Fs2x4uwmsE9DS8Or13oFmId96hHoWDGT 3JPFHiCZl9Zs8inzbkx1/xA/BNPl700reddGKS2O5vxQUOAegmCkAx/vYpenEiBu+68RCU r/lyiD30aAQl6+z5FiBmKZKMy2lTf+dSOF6ygxl/ki17ab8k6Dp2V04i+2oQLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDShm3qJPzGdR; Mon, 15 Jan 2024 23:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FNHC3G002783; Mon, 15 Jan 2024 23:17:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FNHCne002780; Mon, 15 Jan 2024 23:17:12 GMT (envelope-from git) Date: Mon, 15 Jan 2024 23:17:12 GMT Message-Id: <202401152317.40FNHCne002780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: daf26f9350cf - main - fusefs: more consistent operand ordering in io.cc List-Id: Commit messages for the main 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: daf26f9350cf8fb3ae60d4528b60ddf65a56f5cc Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=daf26f9350cf8fb3ae60d4528b60ddf65a56f5cc commit daf26f9350cf8fb3ae60d4528b60ddf65a56f5cc Author: Alan Somers AuthorDate: 2024-01-15 23:16:40 +0000 Commit: Alan Somers CommitDate: 2024-01-15 23:16:40 +0000 fusefs: more consistent operand ordering in io.cc MFC after: 2 weeks --- tests/sys/fs/fusefs/io.cc | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index 357772c31c2c..283b601c9e87 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -281,7 +281,7 @@ void do_ftruncate(off_t offs) m_filesize = offs; } -void do_mapread(ssize_t size, off_t offs) +void do_mapread(off_t offs, ssize_t size) { void *control_buf, *p; off_t pg_offset, page_mask; @@ -307,7 +307,7 @@ void do_mapread(ssize_t size, off_t offs) free(control_buf); } -void do_read(ssize_t size, off_t offs) +void do_read(off_t offs, ssize_t size) { void *test_buf, *control_buf; ssize_t r; @@ -331,7 +331,7 @@ void do_read(ssize_t size, off_t offs) free(test_buf); } -void do_mapwrite(ssize_t size, off_t offs) +void do_mapwrite(off_t offs, ssize_t size) { char *buf; void *p; @@ -368,7 +368,7 @@ void do_mapwrite(ssize_t size, off_t offs) ASSERT_EQ(0, munmap(p, map_size)) << strerror(errno); } -void do_write(ssize_t size, off_t offs) +void do_write(off_t offs, ssize_t size) { char *buf; long i; @@ -416,9 +416,9 @@ TEST_P(Io, extend_from_dirty_page) ssize_t rsize = 0x9b22; off_t truncsize = 0x28702; - do_write(wsize, wofs); + do_write(wofs, wsize); do_ftruncate(truncsize); - do_read(rsize, rofs); + do_read(rofs, rsize); } /* @@ -428,9 +428,9 @@ TEST_P(Io, extend_from_dirty_page) */ TEST_P(IoCacheable, extend_by_mapwrite) { - do_mapwrite(0x849e, 0x29a3a); /* [0x29a3a, 0x31ed7] */ - do_mapwrite(0x3994, 0x3c7d8); /* [0x3c7d8, 0x4016b] */ - do_read(0xf556, 0x30c16); /* [0x30c16, 0x4016b] */ + do_mapwrite(0x29a3a, 0x849e); /* [0x29a3a, 0x31ed7] */ + do_mapwrite(0x3c7d8, 0x3994); /* [0x3c7d8, 0x4016b] */ + do_read(0x30c16, 0xf556); /* [0x30c16, 0x4016b] */ } /* @@ -442,9 +442,9 @@ TEST_P(IoCacheable, extend_by_mapwrite) */ TEST_P(Io, last_page) { - do_write(0xcc77, 0x1134f); /* [0x1134f, 0x1dfc5] */ - do_write(0xdfa7, 0x2096a); /* [0x2096a, 0x2e910] */ - do_read(0xb5b7, 0x1a3aa); /* [0x1a3aa, 0x25960] */ + do_write(0x1134f, 0xcc77); /* [0x1134f, 0x1dfc5] */ + do_write(0x2096a, 0xdfa7); /* [0x2096a, 0x2e910] */ + do_read(0x1a3aa, 0xb5b7); /* [0x1a3aa, 0x25960] */ } /* @@ -454,8 +454,8 @@ TEST_P(Io, last_page) */ TEST_P(IoCacheable, mapread_hole) { - do_write(0x123b7, 0xf205); /* [0xf205, 0x215bb] */ - do_mapread(0xeeea, 0x2f4c); /* [0x2f4c, 0x11e35] */ + do_write(0xf205, 0x123b7); /* [0xf205, 0x215bb] */ + do_mapread(0x2f4c, 0xeeea); /* [0x2f4c, 0x11e35] */ } /* @@ -470,8 +470,8 @@ TEST_P(Io, read_hole_from_cached_block) off_t rofs = 0x472e; ssize_t rsize = 0xd8d5; - do_write(wsize, wofs); - do_read(rsize, rofs); + do_write(wofs, wsize); + do_read(rofs, rsize); } /* @@ -491,10 +491,10 @@ TEST_P(Io, truncate_into_dirty_buffer) ssize_t rsize = 0x29ff; off_t truncsize1 = 0x152b4; - do_write(wsize0, wofs0); - do_write(wsize1, wofs1); + do_write(wofs0, wsize0); + do_write(wofs1, wsize1); do_ftruncate(truncsize0); - do_read(rsize, rofs); + do_read(rofs, rsize); do_ftruncate(truncsize1); close(m_test_fd); } @@ -523,11 +523,11 @@ TEST_P(Io, truncate_into_dirty_buffer2) * Creates a dirty buffer. The part in lbn 2 doesn't flush * synchronously. */ - do_write(wsize, wofs); + do_write(wofs, wsize); /* Truncates part of the dirty buffer created in step 2 */ do_ftruncate(truncsize1); /* XXX ?I don't know why this is necessary? */ - do_read(rsize2, rofs2); + do_read(rofs2, rsize2); /* Truncates the dirty buffer */ do_ftruncate(truncsize2); close(m_test_fd); @@ -558,10 +558,10 @@ TEST_P(Io, truncate_into_dirty_buffer2) */ TEST_P(Io, resize_a_valid_buffer_while_extending) { - do_write(0x14530, 0x36ee6); /* [0x36ee6, 0x4b415] */ - do_write(0x1507c, 0x33256); /* [0x33256, 0x482d1] */ - do_write(0x175c, 0x4c03d); /* [0x4c03d, 0x4d798] */ - do_read(0xe277, 0x3599c); /* [0x3599c, 0x43c12] */ + do_write(0x36ee6, 0x14530); /* [0x36ee6, 0x4b415] */ + do_write(0x33256, 0x1507c); /* [0x33256, 0x482d1] */ + do_write(0x4c03d, 0x175c); /* [0x4c03d, 0x4d798] */ + do_read(0x3599c, 0xe277); /* [0x3599c, 0x43c12] */ close(m_test_fd); } @@ -572,7 +572,7 @@ TEST_P(Io, resize_a_valid_buffer_while_extending) */ TEST_P(IoCacheable, vnode_pager_generic_putpage_clean_block_at_eof) { - do_mapwrite(0x1bbc3, 0x3b4e0); + do_mapwrite(0x3b4e0, 0x1bbc3); } /* @@ -581,7 +581,7 @@ TEST_P(IoCacheable, vnode_pager_generic_putpage_clean_block_at_eof) */ TEST_P(IoCopyFileRange, copy_file_range_from_mapped_write) { - do_mapwrite(0x1000, 0); + do_mapwrite(0, 0x1000); do_copy_file_range(0, 0x1000, 0x1000); do_read(0x1000, 0x1000); } From nobody Mon Jan 15 23:39:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDTBQ2YF8z57qXv; Mon, 15 Jan 2024 23:39:26 +0000 (UTC) (envelope-from jhb@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 4TDTBP5q6rz4HB3; Mon, 15 Jan 2024 23:39:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705361965; 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=2I2mW4/M5VO8WEHobzR5/ciUw4X1cfaR/wL3wTgpFsg=; b=jibKdRRgD4eFR21kmKPqlhBAgQma9YxSXrQ34/I+SeKCeYkmnsgPBDdzZDQKgDZwRR0Boy 6kfqrJsPr9wDS3YGD5lue4mJHje8pNqmZ7g6JcrnA/8CuwLuvBMFlRI7tz1FI5Y2r02zFx vIRj2/OVaRyC19X1eYK9X5te0oxolvXZTMBbAtvN5E0t6Z9r3zLOLk29LPFLgZmurMGtY8 SHFsQqvz2ZWQ1dtZLTmj++r2WmJmGHZ+tyMwJQ1nIad8VcXQ84nAsL/WKRoOBIwYqy8j54 Y4g8shax6y7dsN9Iz7Dwu397wYSW/T0ZDO0DKAszdddK8ldW2yXUTaI7el7Y7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705361965; 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=2I2mW4/M5VO8WEHobzR5/ciUw4X1cfaR/wL3wTgpFsg=; b=nxLuw6ZuSk1OMZYim3rTo0NV5CDBHMGjpnUiXWEzlP4kR2f//BanFTXs3Jai1PjRoJfmSP TD7k1BFdwHM+lxgfm7R5i/WYE0sJRW0ge79YgijjePsH+GtG1G73XSpy/ox+Q/AcH48Wz9 jo/bG1RMr0mOEO32Br6CvDLE2h58kFtCX/6xsWwJD4Eql8INHKtmSb1DFBUWi7TbzIkksM GbKtaIQLRR+HNYMRivRwySfyp/hmrgTgbIxs918udJLtgueSmGRPeBxCOiQj2D8xpw2Mnt 3vXsgciT1ER0+ZKFEJQ1ZN07UBBavJo/gqjaORDf5Jw1DBqgyKqCVQQOXLruZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705361965; a=rsa-sha256; cv=none; b=fN9Jn8LkqR4eUtbs4vrwtuw5WxxHrKYfGZymqYBnAbJ6QoUS/ZZTXQddeiy50UHefIqIP9 8w2GY+EjwG5ufxxaiSdiCUdOBWxiYM4mMvRQOsEi/rPVkGsKWs38ZLbPYtKN9qf4n5c7+0 UKAUBoX3MaW9ZgDLlO37uydEnnAql50bF5yMfik4Ss700oqfPuvVgXOsysmGJBPJmJcFdI 1+qN/0Q+udBQK6Zq6rUKW2j68xcDgpdYEg9PQFSL04Hsq5IKJQzi7VrApXqRO6n454ocEK /5mNfPdjYww9pJJvLXJe52p534+Jkf2j1IcUXpbHPEu2rkv3v99jnSZCPzPoFQ== Received: from [IPV6:2601:644:9381:f410:11eb:4f99:4a77:931] (unknown [IPv6:2601:644:9381:f410:11eb:4f99:4a77:931]) (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: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4TDTBP0tsZzRcV; Mon, 15 Jan 2024 23:39:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <046cef05-668a-4ee9-a72a-09d7de303a46@FreeBSD.org> Date: Mon, 15 Jan 2024 15:39:23 -0800 List-Id: Commit messages for the main 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 Thunderbird Subject: Re: git: df834e06bbc7 - main - git-arc: Just strip escape sequences form arc log Content-Language: en-US To: Warner Losh Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202401150224.40F2OSBS093537@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/15/24 9:02 AM, Warner Losh wrote: > Hey John, > > On Mon, Jan 15, 2024 at 9:37 AM Warner Losh wrote: > >> >> >> On Mon, Jan 15, 2024 at 9:30 AM John Baldwin wrote: >> >>> On 1/14/24 6:24 PM, Warner Losh wrote: >>>> The branch main has been updated by imp: >>>> >>>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=df834e06bbc78c03cb6b35f074ae43673c9ce463 >>>> >>>> commit df834e06bbc78c03cb6b35f074ae43673c9ce463 >>>> Author: Warner Losh >>>> AuthorDate: 2024-01-15 02:22:04 +0000 >>>> Commit: Warner Losh >>>> CommitDate: 2024-01-15 02:23:45 +0000 >>>> >>>> git-arc: Just strip escape sequences form arc log >>>> >>>> Just strip escape sequences and Warning: lines from 'arc list' >>> output. I >>>> upgraded and they changed and git arc list broke. This restores its >>>> functionality. >>>> >>>> Note: jhb didn't like this, so if others object, I'll fix... >>>> >>>> Sponsored by: Netflix >>>> Reviewed by: markj >>>> Differential Revision: https://reviews.freebsd.org/D36553 >>> >>> Namely, it breaks the color output for reviews in different states, so >>> Needs Review >>> shows up as purple, Approved as green, etc. If you find the color output >>> useful >>> you'll have to revert this locally. >>> >>> Also, your last update in the review said that git arc was no longer >>> broken for you >>> back in May implying this commit wasn't needed for git arc to work for >>> you? >>> >> >> Yes and no. I was mistaken. This change is still needed, but its scope can >> be reduced. >> The trouble is that it's at the first for the other things I committed and >> getting it out of the >> way was a pain (I tried). Since I didn't want to delay things any further, >> I went ahead and >> committed and thought I'd fix stuff if there were objections.I'll do that >> now. >> > > So even w/o my change, I don't see the color output for the review states > (so I can remove the > general filter I added for color). That's easy enough. but what are you > doing to get color in the > current setup? Or is your arcanist install old and un-updated? Nope, built locally via poudriere back in October on 14-stable: > pkg info | grep arcan arcanist-lib-php81-20220518_5 Libraries for the command line interface for Phabricator arcanist-php81-20220518_5 Command line interface for Phabricator > ll /usr/local/poudriere/data/logs/bulk/14_0-20231022-ports/*/arcanist* -rw-r--r-- 3 root wheel 16185 Oct 22 22:34 /usr/local/poudriere/data/logs/bulk/14_0-20231022-ports/latest-per-pkg/arcanist-lib-php81-20220518_5.log -rw-r--r-- 3 root wheel 14152 Oct 22 22:56 /usr/local/poudriere/data/logs/bulk/14_0-20231022-ports/latest-per-pkg/arcanist-php81-20220518_5.log Can't show color arc list output via text e-mail, but it's color, and git arc list is still color for me (from commit 613aaf59afa307fc77c8eed01962a59423b1c5f3). arc list | more shows all the escape codes, but arc list | less -R shows the colors just fine. This is in konsole with TERM=xterm256-color. It also works fine for me in plain xterm under i3wm on my X1 carbon running main from September with arcanist built in September. -- John Baldwin From nobody Tue Jan 16 00:58:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDVx43MLSz57xdw; Tue, 16 Jan 2024 00:58: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 4TDVx42gg7z4Qdk; Tue, 16 Jan 2024 00:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705366680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TdhQWyhVr6VHUiYel4n78KmZlCTPlUpH1/dwTjTlayY=; b=wnfvA9EF8Tf7RkT8yF6HzeuF0rDyVvhY8pe/lK36WQAk/jl/+hhNG1y7tol88b3aSwGZGr 1T124GztHwnHNnqLkum8wJXfQeRl2bz+ogSTk8DY2SE8PBPe6OH16m94jxUyYy1NN800XD fzybGWAqjpphmd73+B2HVBSuLh4yWXFjXN0s3GnN44A/el/n+/98K2I4Hl6gWjtSEmzjVL 36YSa9TeBfLySISs3HYe2Ycu569WvmyWI4kUfQsc1kKX34JzMI4hDpjfe00aQqE/urCmvO x08Ql+S0hvfSm333BEYM6nLxdRLVQGIWinA4AGR7DKZSOFkgDcXBUjFlMMfbAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705366680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TdhQWyhVr6VHUiYel4n78KmZlCTPlUpH1/dwTjTlayY=; b=sYL80Ui1SQqyqrkjq2Q7TfegWJPVthReGmjInuMwboHXQaA8PxJdS8BM/YFoihfAI0xLQA 2O27gHmd5plqwYOt4Obwb/9ecVKOyMxpOeqRHf0KyheVq8eSZDIvqRC2au9Zu0rWMu3f01 dD1VD+DDRYkt+i5+6sb6ZEK2z/OAKYz8e0PhZPpfeoHX+0kpQgbG75tcpCFAGz7hBt+fv1 CSwQdrwz67mUrWdEMqvMFjvGLgSevho6cNsodYyGNrc0KZVU7VgjwhA9H5iMHomWv05K2x v7r6784QRPfolsE418idJS1bDndUWms2TAiSwxNAviH33hdDlyMbysGGidNqNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705366680; a=rsa-sha256; cv=none; b=MuFxkWTUMlZn3F1VPtBUHbXl3KfwtAx1fWjAryU50qDUdWwulB/PUKmC6wGniwuvqMli1N J0RhccC8tUn+M2l3OHhksbiq9irlXuf44DoF70pcnRFUWA45ceQlUjsYv2opT01EQmR48a AX3q2J6MF7Wn9Upchq7C+zhZU8YoBiQtTYwNGutX26PL2uvhbkLcU2SRIEhRyu1ziO4N8w XkSxKOc6P3zFoZbJ3MBdrZX9VQDtyoo0fYupdiypsRqKZMKIjSAMRrr7ojlklGA/iT7Uk6 ch96xdc82fKfaiJykB82o9AFfSHLvZqe6arGQa2lV/34pTUcqivl9/eKbBuhpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDVx41cFbzJ9Y; Tue, 16 Jan 2024 00:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G0w0FW070489; Tue, 16 Jan 2024 00:58:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G0w0M4070486; Tue, 16 Jan 2024 00:58:00 GMT (envelope-from git) Date: Tue, 16 Jan 2024 00:58:00 GMT Message-Id: <202401160058.40G0w0M4070486@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: 11500481c82c - main - mptable: improve error reporting for invalid commands List-Id: Commit messages for the main 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: 11500481c82c9fa6e7d3b9a707bd9ca1ed637c2d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=11500481c82c9fa6e7d3b9a707bd9ca1ed637c2d commit 11500481c82c9fa6e7d3b9a707bd9ca1ed637c2d Author: Pete Zaitcev AuthorDate: 2024-01-15 21:42:28 +0000 Commit: Warner Losh CommitDate: 2024-01-16 00:57:28 +0000 mptable: improve error reporting for invalid commands mptable ignores arguments with matching first letters, report errors when it gets garbate. PR: 38727 Reviewed by: imp --- usr.sbin/mptable/mptable.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/usr.sbin/mptable/mptable.c b/usr.sbin/mptable/mptable.c index 0d1e169ec96f..a879279a2d4e 100644 --- a/usr.sbin/mptable/mptable.c +++ b/usr.sbin/mptable/mptable.c @@ -183,19 +183,21 @@ main( int argc, char *argv[] ) if ( strcmp( optarg, "mesg") == 0 ) dmesg = 1; else - dmesg = 0; + usage(); break; case 'h': - if ( strcmp( optarg, "elp") == 0 ) - usage(); - break; + usage(); case 'g': if ( strcmp( optarg, "rope") == 0 ) grope = 1; + else + usage(); break; case 'v': if ( strcmp( optarg, "erbose") == 0 ) verbose = 1; + else + usage(); break; default: usage(); From nobody Tue Jan 16 00:58:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDVx54Qz9z57xHP; Tue, 16 Jan 2024 00:58: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 4TDVx534xnz4QnP; Tue, 16 Jan 2024 00:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705366681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vg756sqc9j9X5yZNvBql+pHF1U5/WxqGV2z3CNmmNd8=; b=upEwDltC76vzNncDxfXRK5E3SFzmN8Kgv7UbdqjfGWNRWUQ9xDnibs5zOaVtjd1Hrufsc9 LZDTuzJNrrVJBRMomXvpZOI7kiRqp4o2/xnIQnpGPS77PhaY86YQ+cRdX8709MeYFBi97J Wh8Hu12dWB3rqq73vo23Vh7NumnMadu+Z4Ym/j3fjYKiitQ+3W9bIypdM1YaoJK9ztfDAu 1hdYF2ONCqOdrnf12VkIZpAZpgTKcqDsCTrjhMtG9ugEvwVUNrqk/WwMaY9HVjlBXz+nIF a3iNH0RO4BVMMwwkWjpT4gHMWkJlp8F8BieHLRo4TS6FOA8eVhkkStoVIE2nEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705366681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vg756sqc9j9X5yZNvBql+pHF1U5/WxqGV2z3CNmmNd8=; b=MDLcMtyAu0elDIhfUH8AAS1xlyv5MGrZTPWph9xxt3ZdVALeuLdZcFAhzpZ4/zDN0lNKWz VIx97E2aC7NkpaNiYQKXA48PRG4QRA/G5uBWpv/fibFkn4ZZzJZiR+Ts9boUz+ZQ6lR1Iv tu+UiExd6W4HBLIORix+Zi5lCikAkQID6FRvWhm/5tsiRypJoIMQznz9+PwbMdvelQGl8p XgeVynoRFinUfnlDrjUvLQe24010aTAde0wgEcBY0tl1YuaQdThL57e4c3UBelYjRAwTqP Y5ziHQf1v4B9auPUP8XJG2hbCPYJ/l5cqXVX77pm7oeM/O32eLcPU7ZZw3US5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705366681; a=rsa-sha256; cv=none; b=j6zxKHXX4AkLv8oKiMZPFmZWXZwD4O8bfBm+jOE6KOyA+i2ctZl7KdbVDj293scZWM6y8+ PWOfGo6vcK+eAn5VXLxU4yZuuEIhNCM7TUkJLbpfqJKINhXsLvig/Gd/ymqinZzsUUnbp1 ZkA/S7KlORIcFsf+45k+r8W4wzhK1zrVyFSO+m4tqYbNIP554WbBjOhSf8vGGV4HXzUoMz S3UfGwEqvZT7cpxvApsXogpBC1V56nN3agwmtGKIgQMC1+qJmq3VrIKNgoujrBJWcOK+al N1+5sbGFqJbqpAuwptIIO2kcl8bw9yKzU/uMztJuSGglcVP1+b/nPnx1nbeMbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDVx529VwzJtQ; Tue, 16 Jan 2024 00:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G0w1Mj070538; Tue, 16 Jan 2024 00:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G0w1Jn070535; Tue, 16 Jan 2024 00:58:01 GMT (envelope-from git) Date: Tue, 16 Jan 2024 00:58:01 GMT Message-Id: <202401160058.40G0w1Jn070535@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: 57623b3b745a - main - checkstyle9.pl: Soften the single line braces requirement List-Id: Commit messages for the main 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: 57623b3b745a2a89ea9b998cadf8cc8c02228fea Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=57623b3b745a2a89ea9b998cadf8cc8c02228fea commit 57623b3b745a2a89ea9b998cadf8cc8c02228fea Author: Warner Losh AuthorDate: 2024-01-15 21:48:01 +0000 Commit: Warner Losh CommitDate: 2024-01-16 00:57:28 +0000 checkstyle9.pl: Soften the single line braces requirement We inherited the error for single line statements needing braces from the original script. Style(9) allow that, and could be read to encourage that, but does not require that. Sponsored by: Netflix --- tools/build/checkstyle9.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl index 3b28fef93669..8b30baa10fc9 100755 --- a/tools/build/checkstyle9.pl +++ b/tools/build/checkstyle9.pl @@ -2546,7 +2546,7 @@ sub process { $herectx .= raw_line($linenr, $n) . "\n";; } - ERROR("braces {} are necessary even for single statement blocks\n" . $herectx); + WARN("braces {} are encouraged even for single statement blocks\n" . $herectx); } } From nobody Tue Jan 16 00:59:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDVyK56Csz57xT1; Tue, 16 Jan 2024 00:59: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 4TDVyK4cFMz4Rqk; Tue, 16 Jan 2024 00:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705366745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yqBLlPhaEPH5ShLVlsebnFn20e9mRrU9G8OCEYViKTs=; b=qilECOFnnwPg6+dr0rDIEeFIYh9+Zs2KIFFDAwVTvH9dN2iqomCx05JL0j/gNVeE7p3xNI fjqFmVIzzP9KFpjlhIwJw2DM091GwK283aq0cxjdxVh63MiQpsVqr5Qcy1e8/i6r49EhyM Jnuh3b0M3tpbydJ8pqslTb4nrjMxrkG50Dpc7zuCPlrZItz6tCcjnm1J4ibQeGnlflAPyC Uigbybi6S+235YXF5IFwc3UR69y/CH4gJaWmwRTV6zEapDl5l7hBaCFbh577enBPdSs251 OSXpcES+blSSUJLSseocDs0hZY1BwUjh1mW3PJ96Vz/KSTskDGIQHpxccvMomg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705366745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yqBLlPhaEPH5ShLVlsebnFn20e9mRrU9G8OCEYViKTs=; b=FM8JEwqjHCPH+Pbt3x6paeWvccvl8JmXAzX1YGWJIYl26PxsVUirSg8tK5GOu0qxvebjsQ iO7MYVdrZedzFDna7eU/XsjmlFyWHzbTYTbvZAW8aP6HNlN0mex1MYb1KsEtpnHpAbqVSi J2z1M3n3/zquiuxMyt2CXAq6b42Rh1oJmSixpN8p5jeJsmeb2YOlRgbPUHZMDRYAs8k/Ve DVc3pxKTTfj4vEpTNgFQyioeDN+DOQN/N3pkwECQwepnbfMB0Q6LaKcptZ/5gjcr3ZUHbv cBIi6BiNt3o3Ik57ZaZ/i5E1NmV5XFZdKq6izVBrshpxhjsPwZIoYfXk6CR1ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705366745; a=rsa-sha256; cv=none; b=L0c0gaP0+CepADe0HZWPNk77FGKNhG3ZWgQF4d5Su8F09OHWNrO2s7jwX6wyTcqNa8axfK auD+7bfkCUGkXq/sxYYG2jctm/0cJht8cfOO5sF+Lj2jYkBiU9fWTQ9xilfSFqbVQ3yrze eeFu9PJOPvIV+Zsj4zuIQ4q+91ta/2jVhgtV7+ziPQ7abh/xgyqdI92uVheaiznYkqHe9a lWei3WOrs7czj88EwaIPArpCm9J7N9xiloRPeFUGCtYNuOJWzaksFrHPT2O7DKHKL0r0o7 a9xPOYjJVquNiJBODPFqYjetnf+sMmvXfI3ACU9GOndliZCdjaZBERIEzJGrUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDVyK3gMfzK6s; Tue, 16 Jan 2024 00:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G0x5lL070816; Tue, 16 Jan 2024 00:59:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G0x5Eb070813; Tue, 16 Jan 2024 00:59:05 GMT (envelope-from git) Date: Tue, 16 Jan 2024 00:59:05 GMT Message-Id: <202401160059.40G0x5Eb070813@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: 08efe9bef43b - main - GitHub: style: Add the synchronize activity type List-Id: Commit messages for the main 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: 08efe9bef43b784b3cd4f22252a8f908f448895b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=08efe9bef43b784b3cd4f22252a8f908f448895b commit 08efe9bef43b784b3cd4f22252a8f908f448895b Author: Jose Luis Duran AuthorDate: 2024-01-16 00:58:29 +0000 Commit: Warner Losh CommitDate: 2024-01-16 00:58:31 +0000 GitHub: style: Add the synchronize activity type Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1064 --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index a4d5adb90df3..8860a24fe594 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -9,7 +9,7 @@ name: Style Checker on: pull_request: # maybe pull_request_target branches: [ main ] - types: [ opened, reopened, edited ] + types: [ opened, reopened, edited, synchronize ] permissions: contents: read From nobody Tue Jan 16 02:35:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDY5x74Xyz56Pmd for ; Tue, 16 Jan 2024 02:35:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 4TDY5x59QCz4bb4 for ; Tue, 16 Jan 2024 02:35:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a27733ae1dfso1076396566b.3 for ; Mon, 15 Jan 2024 18:35:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705372548; x=1705977348; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IUoFNklR5N0e9CeZuoOgNPinrLlorBhaBHtX00ONgpc=; b=WQD5MFqDRJ0XhMrUp78l2DArAwpuvsDARDhLnUSdYMyJ99am0dTd1vnp+cAcdiHa2T ndY0ntkhyVBmqPAHGtWAuPY9xL4VtN1V7eE6rZQZPk6jZwVM6mhIEDweA2cr2Wms7/uA 0m38dSDkCHJqqAA47quak5JIcyh4QRGDTHC/YIDEHNX4L4efGHDAUGPpsOwAqyJf24O7 JAiu3iomYlILBe6mgdiPRcxlAzHeRtXsUxoL8nEqZgiSWxRCf/MT2n+SJPghfO7ZLUPs a79cz+0cGb3R4paJUmZyMS/kUmo2Km8udqZ2xlG3zQD2YdMZMtJ+oU6RKGOurtQKWkTo hqug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705372548; x=1705977348; 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=IUoFNklR5N0e9CeZuoOgNPinrLlorBhaBHtX00ONgpc=; b=jKBzpzARPOFO8LEJn3EHRGzdb/1LByQTKfaXqW+yt0qXyhymwwTNIGjVMuOL5ED1Ra QwUTExEwJNdoMcoyqvoLCEsjuWnd0BAx3xyInmncWO0X4UNSChaFSsMvYDhrOJjDusP/ 9QOyUyvK2RvNVMYZvzr9eLtATcY5VxnHlyqlXMfrjiLXY6B7XnT5oLDWAawoAB8D1VGf oNoBtBsJsISCi0FNt7CzEwYOheLIfnho/6bL7Xf9hKSlal2QF8e1ESfOEYztUdVGv93o HQHa8rzr/zU2YyxfZCxeW5NBwWEMe4gqAnDp8cyy2+Aw7dRHIEnuu4e8LfiAUWuG3xPl j0kg== X-Gm-Message-State: AOJu0Yw+4pkt2JqgehFIavZXgDUjJIgSXZigJsEPt+9NWV4sI/y8HuvQ au+rO4FBn+u/+5GKJ//Gpdesi5eve43oJ/Fk67nPRDddrfzZOQ== X-Google-Smtp-Source: AGHT+IE++9DKwo+lcFFBOo92HsjfJGXYRJKlk/UC3F4uO5kLkksMz3AUbOTYcHj601Up8rv9WMqR+/Uvi0QZcv/KKdY= X-Received: by 2002:a17:907:a705:b0:a2c:e4ab:1d61 with SMTP id vw5-20020a170907a70500b00a2ce4ab1d61mr1597816ejc.306.1705372548548; Mon, 15 Jan 2024 18:35:48 -0800 (PST) List-Id: Commit messages for the main 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: <202401150224.40F2OSBS093537@gitrepo.freebsd.org> <046cef05-668a-4ee9-a72a-09d7de303a46@FreeBSD.org> In-Reply-To: <046cef05-668a-4ee9-a72a-09d7de303a46@FreeBSD.org> From: Warner Losh Date: Mon, 15 Jan 2024 19:35:36 -0700 Message-ID: Subject: Re: git: df834e06bbc7 - main - git-arc: Just strip escape sequences form arc log To: John Baldwin Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000f759f2060f06fc9f" X-Rspamd-Queue-Id: 4TDY5x59QCz4bb4 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --000000000000f759f2060f06fc9f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 15, 2024, 4:39=E2=80=AFPM John Baldwin wrote: > On 1/15/24 9:02 AM, Warner Losh wrote: > > Hey John, > > > > On Mon, Jan 15, 2024 at 9:37=E2=80=AFAM Warner Losh wr= ote: > > > >> > >> > >> On Mon, Jan 15, 2024 at 9:30=E2=80=AFAM John Baldwin = wrote: > >> > >>> On 1/14/24 6:24 PM, Warner Losh wrote: > >>>> The branch main has been updated by imp: > >>>> > >>>> URL: > >>> > https://cgit.FreeBSD.org/src/commit/?id=3Ddf834e06bbc78c03cb6b35f074ae436= 73c9ce463 > >>>> > >>>> commit df834e06bbc78c03cb6b35f074ae43673c9ce463 > >>>> Author: Warner Losh > >>>> AuthorDate: 2024-01-15 02:22:04 +0000 > >>>> Commit: Warner Losh > >>>> CommitDate: 2024-01-15 02:23:45 +0000 > >>>> > >>>> git-arc: Just strip escape sequences form arc log > >>>> > >>>> Just strip escape sequences and Warning: lines from 'arc list' > >>> output. I > >>>> upgraded and they changed and git arc list broke. This restore= s > its > >>>> functionality. > >>>> > >>>> Note: jhb didn't like this, so if others object, I'll fix... > >>>> > >>>> Sponsored by: Netflix > >>>> Reviewed by: markj > >>>> Differential Revision: https://reviews.freebsd.org/D36553 > >>> > >>> Namely, it breaks the color output for reviews in different states, s= o > >>> Needs Review > >>> shows up as purple, Approved as green, etc. If you find the color > output > >>> useful > >>> you'll have to revert this locally. > >>> > >>> Also, your last update in the review said that git arc was no longer > >>> broken for you > >>> back in May implying this commit wasn't needed for git arc to work fo= r > >>> you? > >>> > >> > >> Yes and no. I was mistaken. This change is still needed, but its scope > can > >> be reduced. > >> The trouble is that it's at the first for the other things I committed > and > >> getting it out of the > >> way was a pain (I tried). Since I didn't want to delay things any > further, > >> I went ahead and > >> committed and thought I'd fix stuff if there were objections.I'll do > that > >> now. > >> > > > > So even w/o my change, I don't see the color output for the review stat= es > > (so I can remove the > > general filter I added for color). That's easy enough. but what are you > > doing to get color in the > > current setup? Or is your arcanist install old and un-updated? > > Nope, built locally via poudriere back in October on 14-stable: > > > pkg info | grep arcan > arcanist-lib-php81-20220518_5 Libraries for the command line interface > for Phabricator > arcanist-php81-20220518_5 Command line interface for Phabricator > > > ll /usr/local/poudriere/data/logs/bulk/14_0-20231022-ports/*/arcanist* > -rw-r--r-- 3 root wheel 16185 Oct 22 22:34 > /usr/local/poudriere/data/logs/bulk/14_0-20231022-ports/latest-per-pkg/ar= canist-lib-php81-20220518_5.log > -rw-r--r-- 3 root wheel 14152 Oct 22 22:56 > /usr/local/poudriere/data/logs/bulk/14_0-20231022-ports/latest-per-pkg/ar= canist-php81-20220518_5.log > > Can't show color arc list output via text e-mail, but it's color, and > git arc list is still color for me (from commit > 613aaf59afa307fc77c8eed01962a59423b1c5f3). > > arc list | more shows all the escape codes, but arc list | less -R > shows the colors just fine. This is in konsole with TERM=3Dxterm256-colo= r. > It also works fine for me in plain xterm under i3wm on my X1 carbon > running main from September with arcanist built in September. > I've had to add --ansi to get color in pipelines... I'm using: the same version of arc too: % arc version arcanist-lib-php80 20220518_5 (devel/arcanist-lib) and 'arc list' into a pipe never gives me color, but 'arc list --ansi' always does. Though there's also arc list --noansi that would be easier than filtering the escape sequences. In any event, I've posted a review https://reviews.freebsd.org/D43459 that should do the right thing. Warner Warner --=20 > John Baldwin > > --000000000000f759f2060f06fc9f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jan 15, 2024, 4:39=E2=80=AFPM= John Baldwin <jhb@= freebsd.org> wrote:
On 1/15/= 24 9:02 AM, Warner Losh wrote:
> Hey John,
>
> On Mon, Jan 15, 2024 at 9:37=E2=80=AFAM Warner Losh <imp@bsdimp.com= > wrote:
>
>>
>>
>> On Mon, Jan 15, 2024 at 9:30=E2=80=AFAM John Baldwin <jhb@freebs= d.org> wrote:
>>
>>> On 1/14/24 6:24 PM, Warner Losh wrote:
>>>> The branch main has been updated by imp:
>>>>
>>>> URL:
>>> https://cgit.FreeBSD.org/src/commit/?id=3Ddf834e06bbc78c03cb6b35f074a= e43673c9ce463
>>>>
>>>> commit df834e06bbc78c03cb6b35f074ae43673c9ce463
>>>> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org= >
>>>> AuthorDate: 2024-01-15 02:22:04 +0000
>>>> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org= >
>>>> CommitDate: 2024-01-15 02:23:45 +0000
>>>>
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0git-arc: Just strip escape seque= nces form arc log
>>>>
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Just strip escape sequences and = Warning: lines from 'arc list'
>>> output. I
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0upgraded and they changed and gi= t arc list broke. This restores its
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0functionality.
>>>>
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Note: jhb didn't like this, = so if others object, I'll fix...
>>>>
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0Netflix
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 markj
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 https://reviews.freebsd.org/D36553
>>>
>>> Namely, it breaks the color output for reviews in different st= ates, so
>>> Needs Review
>>> shows up as purple, Approved as green, etc.=C2=A0 If you find = the color output
>>> useful
>>> you'll have to revert this locally.
>>>
>>> Also, your last update in the review said that git arc was no = longer
>>> broken for you
>>> back in May implying this commit wasn't needed for git arc= to work for
>>> you?
>>>
>>
>> Yes and no. I was mistaken. This change is still needed, but its s= cope can
>> be reduced.
>> The trouble is that it's at the first for the other things I c= ommitted and
>> getting it out of the
>> way was a pain (I tried). Since I didn't want to delay things = any further,
>> I went ahead and
>> committed and thought I'd fix stuff if there were objections.I= 'll do that
>> now.
>>
>
> So even w/o my change, I don't see the color output for the review= states
> (so I can remove the
> general filter I added for color). That's easy enough. but what ar= e you
> doing to get color in the
> current setup? Or is your arcanist install old and un-updated?

Nope, built locally via poudriere back in October on 14-stable:

> pkg info | grep arcan
arcanist-lib-php81-20220518_5=C2=A0 Libraries for the command line interfac= e for Phabricator
arcanist-php81-20220518_5=C2=A0 =C2=A0 =C2=A0 Command line interface for Ph= abricator

> ll /usr/local/poudriere/data/logs/bulk/14_0-20231022-ports/*/arcanist*=
-rw-r--r--=C2=A0 3 root wheel 16185 Oct 22 22:34 /usr/local/poudriere/data/= logs/bulk/14_0-20231022-ports/latest-per-pkg/arcanist-lib-php81-20220518_5.= log
-rw-r--r--=C2=A0 3 root wheel 14152 Oct 22 22:56 /usr/local/poudriere/data/= logs/bulk/14_0-20231022-ports/latest-per-pkg/arcanist-php81-20220518_5.log<= br>
Can't show color arc list output via text e-mail, but it's color, a= nd
git arc list is still color for me (from commit
613aaf59afa307fc77c8eed01962a59423b1c5f3).

arc list | more shows all the escape codes, but arc list | less -R
shows the colors just fine.=C2=A0 This is in konsole with TERM=3Dxterm256-c= olor.
It also works fine for me in plain xterm under i3wm on my X1 carbon
running main from September with arcanist built in September.

I've had t= o add --ansi to get color in pipelines...

=
I'm using: the same version of arc too:
% arc version
arcanist-lib-php80 20220518_5 (devel/arcanist-lib)
and 'arc list' into a pipe never gives me color, but &= #39;arc list --ansi' always does.

Though there= 's also arc list --noansi that would be easier than filtering the escap= e sequences.

In any event, I've posted a revie= w https://reviews.freebsd.or= g/D43459 that should do the right thing.

Warne= r

Warner

=
--
John Baldwin

--000000000000f759f2060f06fc9f-- From nobody Tue Jan 16 02:56:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDYYj0gZnz56SXQ; Tue, 16 Jan 2024 02:56: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 4TDYYj0BsCz4fRq; Tue, 16 Jan 2024 02:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705373785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JvHmBBe2eIjYhBZu7Yma79FJ+ec6KlpocIcUErCrTLU=; b=N6vFlPT61CGOfzlmHAOq9VnUXpsoOjL9gj9W8AukQoFATajqMipWo/gxZBtO3CNZZS1MPb B+H4N7+7rfXoIsdVKXfhyk6Tp7raHBvfRRgonEtOyANKBu/aYjm+2rPVSR4hL9CxKr7OTf oJ4uRDQYef6rKVpD63OkTJ3n3tSXRW/+ywD0aSpicUHNflrAm6m6F5h/iJUhWFyBkMVf0N cQhFTItEbDqhbmRkbypVcunULbvXBzZ2FiGJwj6Eo6KwLm/6zXrQFxGUatfqME1dMjbmUZ prev1x9XlwMTcUtqu5hn3D96al90v2mtA4z8aiGkcQcJGDJ94gN5SgvdAtMozw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705373785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JvHmBBe2eIjYhBZu7Yma79FJ+ec6KlpocIcUErCrTLU=; b=Px1c1hGFvtn5sw3a5es5zdDu4llqGTYsYxyZhzVv0u/B/z4/mx0BFesGVgTFQ9XP29VQgb Cvgjju0LakJUk73d/F7m7hf9fKRks5kA8NCY0y83IgSJePkiuI0mEnLmTqEWkhIkDETeWA 8r3MFUbuR4JStFOoFmNyHr+bWfa16sNA3qtksqjqNtrCZUhWGRdInd6LqyKjAZAtt3qLXd ceheMdt3ZIbuxRgLToWvus/kICPgysRcT1g0Y42eeciJwKFYDt6QKpMcEscwEtoOoJuEF1 q6PB1dzXXZ0LbHJ2lG490BF+/aOtyQ+PDdgOy0FqIUzw8WlqODOn0YT+342mog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705373785; a=rsa-sha256; cv=none; b=ZJ6h2raQzbW9kzI5uz6F51Fv4kExjk2R+dQJUDXW0dxD5It8fJOg3nhfy3WL9mAX/6+h7U tZ1jYbH0mkZMd2uIO32nx05oPL56PXCatfAeBeHYbKv4dtPpUVZNE35sRICIBIWESPinU5 /xG2gOxpFc1VZvi8ZD9Lv9AMdSO/TdA4optpAkdwPu2nu44L0dB4u2tRr6zhZHo2vU4/CL RBo4h/qtLJSLCCz99uIm7xwU3myU1iXrqLwybMv+5IV8BSreqC8Nv83n6IPUAJhbdUPSB9 +4D/zINJ8HSJXOW2GYjP2OhdjzygssQb9KdddPvEx4lXWXENu+up6d288GkEoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDYYh6MCNzNLB; Tue, 16 Jan 2024 02:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G2uOLV071443; Tue, 16 Jan 2024 02:56:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G2uOIk071436; Tue, 16 Jan 2024 02:56:24 GMT (envelope-from git) Date: Tue, 16 Jan 2024 02:56:24 GMT Message-Id: <202401160256.40G2uOIk071436@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: 09a43b8790bd - main - kern: tty: fix ttyinq_read_uio assertion List-Id: Commit messages for the main 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: 09a43b8790bdeb97fbecd3ea767c2f599eb4a4d3 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=09a43b8790bdeb97fbecd3ea767c2f599eb4a4d3 commit 09a43b8790bdeb97fbecd3ea767c2f599eb4a4d3 Author: Kyle Evans AuthorDate: 2024-01-16 02:55:58 +0000 Commit: Kyle Evans CommitDate: 2024-01-16 02:55:58 +0000 kern: tty: fix ttyinq_read_uio assertion It's clear from later context that `rlen` was always expected to include `flen`, as we'll trim `flen` bytes from the end of the read. Relax our initial assertion to only require the total size less trimmed bytes to lie within the out buffer size. While we're here, I note that if we have to read more than one block and we're trimming from the end then we'll do the wrong thing and omit `flen` bytes from every block, rather than just the end. Add an assertion to make sure we're not doing that, but the only caller that specifies a non-zero `flen` today will only really be doing so if rlen is entirely within a single buffer. Reviewed by: cy, imp Differential Revision: https://reviews.freebsd.org/D43377 --- sys/kern/tty_inq.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/kern/tty_inq.c b/sys/kern/tty_inq.c index 1a31d8b7fa2b..2eed9802a7b7 100644 --- a/sys/kern/tty_inq.c +++ b/sys/kern/tty_inq.c @@ -164,7 +164,8 @@ ttyinq_read_uio(struct ttyinq *ti, struct tty *tp, struct uio *uio, size_t rlen, size_t flen) { - MPASS(rlen <= uio->uio_resid); + /* rlen includes flen, flen bytes will be trimmed from the end. */ + MPASS(rlen - flen <= uio->uio_resid); while (rlen > 0) { int error; @@ -191,6 +192,14 @@ ttyinq_read_uio(struct ttyinq *ti, struct tty *tp, struct uio *uio, MPASS(clen >= flen); rlen -= clen; + /* + * Caller shouldn't request that we trim anything if we might be + * reading across blocks. We could handle it, but today we do + * not. + */ + if (flen > 0) + MPASS(rlen == 0); + /* * We can prevent buffering in some cases: * - We need to read the block until the end. From nobody Tue Jan 16 02:56:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDYYk1lHGz56SLh; Tue, 16 Jan 2024 02:56: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 4TDYYk18x5z4fYY; Tue, 16 Jan 2024 02:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705373786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e1HeVwNy2Ndgw+xxmVYouU57WsHbcHh0S4cgXHSX0xE=; b=Nbp69x2Yl/nx4rsb+moVwRww0Dnd8YVoRfZR0LfKE/iywjOQk57YYv7L0Lz3MytsSdLfL5 PJoOwH0ZBRPYsz377is8b3Bfi667PbYoU/ZMtp9T7t8r4aWRUM7gz1ZB9f8pyal051MY3h sWb+2BMJjUVZYECwc2vSW3EOYyB8rBeUZJiZOu540tRlVmpg9BULxVzEwrYbp9onNLldH6 kuz92tLEe5uooAmE0QQyCmng0SENTkUlPQRKR7O+vbW9M99cfGzh431h5UUBmztSM1DLNA 8jdtOi9OOcoqL9Hx0MCjw8Mu4myzwmuTFfIcXbqRj2tttiBNYpQO/aVx03dMEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705373786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e1HeVwNy2Ndgw+xxmVYouU57WsHbcHh0S4cgXHSX0xE=; b=uMeHMglk6+70jl+q9X8lPG93qwM7cO3H2NkSA6eg7QwHIt1rQUA/7yhS3eD+9G0SWZ/kCh Je4D/s7Y9u1I9CyqNfdiiGKPqPHuSILq2fuOcGnE/QxHTvGWb4BVZqWfMqnWxg9NZ/syeU EoBYtQxsj5ht/XBa8gzUiQghDtOIAlM0vmrjbNGzsLfeE9WaUEEcKF8h4Hi9RYXbl43OiR sz3T6M1cf6Wmk9CgHdOwmldKXsBaSdt1o63+WsxAO5l7EBxAy6xV1K4OfCp4bRLsFMl/jR 8FuA95G49cUa62HBHnduPw2qweSx/c0ul8RJlXg/LLGyGzsyPmkZjr/lrJhWqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705373786; a=rsa-sha256; cv=none; b=UPCdrl2UuiH8Mx8Ymc8lfXFihLIYjh2gFXSV81KAUew9cQmlUz48cz+j7Nh3Doj1ZOgS7h mpFU+PY6kqHBlwwwlMiDRGrPhZRXN4+za6AgHdeI3j8xY/XdcKnbSK1yVPcFdUzK6ZQJJB hCtxKgMzjyS0hn7ehTmbxY2hFGpaphhvHvk/4NFZEG2KzjUES/aItVLEdNkWJQ1BvBJkf0 USU5CK1uSSkEFNW65d907z7CCftkqxVHp/uqxiYAIq+ujMSdqRXXKL9EO71pGow+EyhtVG GsN22YjopKrNBYe973xCI1A7Ht6TZ3GYRtJSRIXBlzmF9KYhr+uYfmiKgSj3fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDYYk0FrJzN02; Tue, 16 Jan 2024 02:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G2uPsM071494; Tue, 16 Jan 2024 02:56:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G2uPNx071491; Tue, 16 Jan 2024 02:56:25 GMT (envelope-from git) Date: Tue, 16 Jan 2024 02:56:25 GMT Message-Id: <202401160256.40G2uPNx071491@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: d51dac5f1370 - main - kern: tty: fix EOF handling for canonical reads List-Id: Commit messages for the main 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: d51dac5f1370bdca1ea20c6b48cdea463f6f5dda Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d51dac5f1370bdca1ea20c6b48cdea463f6f5dda commit d51dac5f1370bdca1ea20c6b48cdea463f6f5dda Author: Kyle Evans AuthorDate: 2024-01-16 02:55:58 +0000 Commit: Kyle Evans CommitDate: 2024-01-16 02:55:58 +0000 kern: tty: fix EOF handling for canonical reads If the read(2) buffer is one byte short of an EOF, then we'll end up reading the line into the buffer, then re-entering and seeing an EOF at the beginning of the inq, assuming it's a zero-length line. Fix this corner-case by searching one more byte than we have available for an EOF. If we found it, then we'll trim it here; otherwise, we'll limit our read to just the space we have in the out buffer and the next read(2) will (potentially) read the remainder of the line. Fix FIONREAD while we're here to match what an application can expect read(2) to return -- scan for the first break character in the part of the input that's been canonicalized, we'll never return more than that. PR: 276220 Reviewed by: cy, imp (both previous version), kib Differential Revision: https://reviews.freebsd.org/D43378 --- sys/kern/tty.c | 2 +- sys/kern/tty_ttydisc.c | 72 ++++++++++++++++++++++++++++++++++++++++++++------ sys/sys/ttydisc.h | 1 + 3 files changed, 66 insertions(+), 9 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 61a6beafa2c0..e4186a67cb31 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1673,7 +1673,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, /* This device supports non-blocking operation. */ return (0); case FIONREAD: - *(int *)data = ttyinq_bytescanonicalized(&tp->t_inq); + *(int *)data = ttydisc_bytesavail(tp); return (0); case FIONWRITE: case TIOCOUTQ: diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index 3016f5e4ccb5..f6e9e9869951 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -112,15 +112,20 @@ ttydisc_close(struct tty *tp) ttyhook_close(tp); } -static int -ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) +/* + * Populate our break array; it should likely be at least 4 bytes in size to + * allow for \n, VEOF, and VEOL. + */ +static void +ttydisc_read_break(struct tty *tp, char *breakc, size_t breaksz) { - char breakc[4] = { CNL }; /* enough to hold \n, VEOF and VEOL. */ - int error; - size_t clen, flen = 0, n = 1; - unsigned char lastc = _POSIX_VDISABLE; + size_t n = 0; + MPASS(breaksz != 0); + + breakc[n++] = CNL; #define BREAK_ADD(c) do { \ + MPASS(n < breaksz - 1); /* NUL terminated */ \ if (tp->t_termios.c_cc[c] != _POSIX_VDISABLE) \ breakc[n++] = tp->t_termios.c_cc[c]; \ } while (0) @@ -128,7 +133,48 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) BREAK_ADD(VEOF); BREAK_ADD(VEOL); #undef BREAK_ADD + breakc[n] = '\0'; +} + +size_t +ttydisc_bytesavail(struct tty *tp) +{ + size_t clen; + char breakc[4]; + unsigned char lastc = _POSIX_VDISABLE; + + clen = ttyinq_bytescanonicalized(&tp->t_inq); + if (!CMP_FLAG(l, ICANON) || clen == 0) + return (clen); + + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); + clen = ttyinq_findchar(&tp->t_inq, breakc, clen, &lastc); + + /* + * We might have a partial line canonicalized in the input queue if we, + * for instance, switched to ICANON after taking some input in raw mode. + * In this case, read(2) will block because we only have a partial line. + */ + if (lastc == _POSIX_VDISABLE) + return (0); + + /* If VEOF was our terminal, it must be discarded (not counted). */ + if (CMP_CC(VEOF, lastc)) + clen--; + + return (clen); +} + +static int +ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) +{ + char breakc[4]; /* enough to hold \n, VEOF and VEOL. */ + int error; + size_t clen, flen = 0; + unsigned char lastc = _POSIX_VDISABLE; + + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); do { error = tty_wait_background(tp, curthread, SIGTTIN); @@ -153,7 +199,7 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) * cause the TTY layer to return data in chunks using * the blocksize (except the first and last blocks). */ - clen = ttyinq_findchar(&tp->t_inq, breakc, uio->uio_resid, + clen = ttyinq_findchar(&tp->t_inq, breakc, uio->uio_resid + 1, &lastc); /* No more data. */ @@ -169,10 +215,20 @@ ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) continue; } - /* Don't send the EOF char back to userspace. */ + /* + * Don't send the EOF char back to userspace. Our above call to + * ttyinq_findchar overreads by 1 character in case we would + * otherwise be leaving an EOF for the next read(). We'll trim + * clen back down to uio_resid whether we find our EOF or not. + */ if (CMP_CC(VEOF, lastc)) flen = 1; + /* + * Trim clen back down to the buffer size, since we had + * intentionally over-read. + */ + clen = MIN(uio->uio_resid + flen, clen); MPASS(flen <= clen); /* Read and throw away the EOF character. */ diff --git a/sys/sys/ttydisc.h b/sys/sys/ttydisc.h index 0458fae6e34b..81d436139555 100644 --- a/sys/sys/ttydisc.h +++ b/sys/sys/ttydisc.h @@ -44,6 +44,7 @@ struct uio; /* Top half routines. */ void ttydisc_open(struct tty *tp); void ttydisc_close(struct tty *tp); +size_t ttydisc_bytesavail(struct tty *tp); int ttydisc_read(struct tty *tp, struct uio *uio, int ioflag); int ttydisc_write(struct tty *tp, struct uio *uio, int ioflag); void ttydisc_optimize(struct tty *tp); From nobody Tue Jan 16 02:56:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDYYl3dNyz56Sb1; Tue, 16 Jan 2024 02:56: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 4TDYYl20wVz4fCK; Tue, 16 Jan 2024 02:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705373787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nnEj9LUWNTZNm+gpJq5OnzsRmntirj+ng89sHy0YuQ0=; b=h960KVtTZsxNjxSKKBRlqeIGuMtfTgujDCLV5gosU27Gzm6kFa6y0/UxE+/LVK2K1bo+T4 n0vTMgt0a6NqFEjVm/osEv7NITRubO+/RxDBsIkbyet4BxsiuchbG0HsE7JsqVPs2fP/08 BKPt+x9DeKToUWAyloev5bQRV8KmbqRa9NJdomeIJbJL9W4AXxdtwPWb42jDaRl6v3hgnW h05q0KBTImYJ4Uol1K4+I9LNaCPzyfB6D5vI7CRz6lUuUcIxFaSSlw6/Cn+zfqORp4Dfi8 Aj2GGI48Ba0RiSCRZseUHTQWiIlC1GuwBpWqWchMUZv5dKVFYZ4YtU/9I9c7Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705373787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nnEj9LUWNTZNm+gpJq5OnzsRmntirj+ng89sHy0YuQ0=; b=Sb2lm/KlsaqjYx9JRmycna659KGf/b/G1IRX1RXl/3ZUz52RRGA+xzBOeJmNHMit2jR4BX XZ/2LY6Oo2EIh9UBXBP0b37wOnuAYyxPixZI2VpG1u3eRqM+q5fzIOx1JxbmjZ5ke/gdn3 B/DCiGqsN4S3R7tzWktNqzlNhIEJSbl79aVPOCBb9rowLyoWVAt6EKCt1hVAB3Tpx3RFVs jRS8BqC55dYsDRGSNQRDlWS8KC6KDdCDmE0KHd8fETzStz5RGK6xWN8ZIuPv/WuMpdXl7l ORr3Vm3w4J4akjuc4iYycOMNAFQRF1wgv4kzH24trvArOjT1d1Q+S7jxPMxCBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705373787; a=rsa-sha256; cv=none; b=mR6sXRh4j37AKFbqFvqM5ntU4P/FygfwbXcP7pzqtM7+EhG4PVVlk2Gd3yg3btoI6Lsuzv dYnPMoFLccU5XzbXiUJ+KP1O1CZSPvy/gv/9hW/otA1ugv2N2ui3rIstvWssoevzEHsSi9 dyPpx3el3OUzzmbnKvcD1u8qJwhlyQEnqioHXyG/us1Lq0NR/Lygp2q8Yfu161DqekOVDE ZSc0rrGRdWkvYY2ifRNGM+fNuhJNYFqMVh9jO6EMk/hKvG+ZsQAIEKA6xWnBE7AUKGmrQw 5RCrxUU56NJ5RU7Wvzq3WQNKFOs/P2ddIB7QJKMAuKeeEI4De2xo82rvBdHLUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDYYl13X5zMVp; Tue, 16 Jan 2024 02:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G2uR6T071553; Tue, 16 Jan 2024 02:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G2uRMK071550; Tue, 16 Jan 2024 02:56:27 GMT (envelope-from git) Date: Tue, 16 Jan 2024 02:56:27 GMT Message-Id: <202401160256.40G2uRMK071550@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: 522083ffbd1a - main - kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 522083ffbd1ab9b485861750e889d606dc75ed0a Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=522083ffbd1ab9b485861750e889d606dc75ed0a commit 522083ffbd1ab9b485861750e889d606dc75ed0a Author: Kyle Evans AuthorDate: 2024-01-16 02:55:59 +0000 Commit: Kyle Evans CommitDate: 2024-01-16 02:55:59 +0000 kern: tty: recanonicalize the buffer on ICANON/VEOF/VEOL changes Before this change, we would canonicalize any partial input if the new local mode is not ICANON, but that's about it. If we were switching from -ICANON -> ICANON, or if VEOF/VEOL changes, then our internal canon accounting would be wrong. The main consequence of this is that in ICANON mode, we would potentially hang a read(2) longer if the new VEOF/VEOL appears later in the buffer, and FIONREAD would be similarly wrong as a result. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D43456 --- sys/kern/tty.c | 22 +++++++++++++++++++--- sys/kern/tty_inq.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ sys/kern/tty_ttydisc.c | 22 ++++++++++++++++++++++ sys/sys/ttydisc.h | 1 + sys/sys/ttyqueue.h | 1 + 5 files changed, 92 insertions(+), 3 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index e4186a67cb31..29bb092a50b0 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1705,6 +1705,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, case TIOCSETAW: case TIOCSETAF: { struct termios *t = data; + bool canonicalize = false; /* * Who makes up these funny rules? According to POSIX, @@ -1754,6 +1755,19 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, return (error); } + /* + * We'll canonicalize any partial input if we're transitioning + * ICANON one way or the other. If we're going from -ICANON -> + * ICANON, then in the worst case scenario we're in the middle + * of a line but both ttydisc_read() and FIONREAD will search + * for one of our line terminals. + */ + if ((t->c_lflag & ICANON) != (tp->t_termios.c_lflag & ICANON)) + canonicalize = true; + else if (tp->t_termios.c_cc[VEOF] != t->c_cc[VEOF] || + tp->t_termios.c_cc[VEOL] != t->c_cc[VEOL]) + canonicalize = true; + /* Copy new non-device driver parameters. */ tp->t_termios.c_iflag = t->c_iflag; tp->t_termios.c_oflag = t->c_oflag; @@ -1762,13 +1776,15 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, ttydisc_optimize(tp); + if (canonicalize) + ttydisc_canonicalize(tp); if ((t->c_lflag & ICANON) == 0) { /* * When in non-canonical mode, wake up all - * readers. Canonicalize any partial input. VMIN - * and VTIME could also be adjusted. + * readers. Any partial input has already been + * canonicalized above if we were in canonical mode. + * VMIN and VTIME could also be adjusted. */ - ttyinq_canonicalize(&tp->t_inq); tty_wakeup(tp, FREAD); } diff --git a/sys/kern/tty_inq.c b/sys/kern/tty_inq.c index 2eed9802a7b7..533fdfd30ce9 100644 --- a/sys/kern/tty_inq.c +++ b/sys/kern/tty_inq.c @@ -354,6 +354,55 @@ ttyinq_canonicalize(struct ttyinq *ti) ti->ti_startblock = ti->ti_reprintblock = ti->ti_lastblock; } +/* + * Canonicalize at one of the break characters; we'll work backwards from the + * lastblock to firstblock to try and find the latest one. + */ +void +ttyinq_canonicalize_break(struct ttyinq *ti, const char *breakc) +{ + struct ttyinq_block *tib = ti->ti_lastblock; + unsigned int canon, off; + unsigned int boff; + + /* No block, no change needed. */ + if (tib == NULL || ti->ti_end == 0) + return; + + /* Start just past the end... */ + off = ti->ti_end; + canon = 0; + + while (off > 0) { + if ((off % TTYINQ_DATASIZE) == 0) + tib = tib->tib_prev; + + off--; + boff = off % TTYINQ_DATASIZE; + + if (strchr(breakc, tib->tib_data[boff]) && !GETBIT(tib, boff)) { + canon = off + 1; + break; + } + } + + MPASS(canon > 0 || off == 0); + + /* + * We should only be able to hit bcanon == 0 if we walked everything we + * have and didn't find any of the break characters, so if bcanon == 0 + * then tib is already the correct block and we should avoid touching + * it. + * + * For all other scenarios, if canon lies on a block boundary then tib + * has already advanced to the previous block. + */ + if (canon != 0 && (canon % TTYINQ_DATASIZE) == 0) + tib = tib->tib_next; + ti->ti_linestart = ti->ti_reprint = canon; + ti->ti_startblock = ti->ti_reprintblock = tib; +} + size_t ttyinq_findchar(struct ttyinq *ti, const char *breakc, size_t maxlen, char *lastc) diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index f6e9e9869951..2be6b560d4f4 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -166,6 +166,28 @@ ttydisc_bytesavail(struct tty *tp) return (clen); } +void +ttydisc_canonicalize(struct tty *tp) +{ + char breakc[4]; + + /* + * If we're in non-canonical mode, it's as easy as just canonicalizing + * the current partial line. + */ + if (!CMP_FLAG(l, ICANON)) { + ttyinq_canonicalize(&tp->t_inq); + return; + } + + /* + * For canonical mode, we need to rescan the buffer for the last EOL + * indicator. + */ + ttydisc_read_break(tp, &breakc[0], sizeof(breakc)); + ttyinq_canonicalize_break(&tp->t_inq, breakc); +} + static int ttydisc_read_canonical(struct tty *tp, struct uio *uio, int ioflag) { diff --git a/sys/sys/ttydisc.h b/sys/sys/ttydisc.h index 81d436139555..cdd3576afedf 100644 --- a/sys/sys/ttydisc.h +++ b/sys/sys/ttydisc.h @@ -47,6 +47,7 @@ void ttydisc_close(struct tty *tp); size_t ttydisc_bytesavail(struct tty *tp); int ttydisc_read(struct tty *tp, struct uio *uio, int ioflag); int ttydisc_write(struct tty *tp, struct uio *uio, int ioflag); +void ttydisc_canonicalize(struct tty *tp); void ttydisc_optimize(struct tty *tp); /* Bottom half routines. */ diff --git a/sys/sys/ttyqueue.h b/sys/sys/ttyqueue.h index fd5a6bf7719e..89c07b7faa10 100644 --- a/sys/sys/ttyqueue.h +++ b/sys/sys/ttyqueue.h @@ -78,6 +78,7 @@ size_t ttyinq_write(struct ttyinq *ti, const void *buf, size_t len, int ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t len, int quote); void ttyinq_canonicalize(struct ttyinq *ti); +void ttyinq_canonicalize_break(struct ttyinq *ti, const char *breakc); size_t ttyinq_findchar(struct ttyinq *ti, const char *breakc, size_t maxlen, char *lastc); void ttyinq_flush(struct ttyinq *ti); From nobody Tue Jan 16 02:56:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDYYm5Mb3z56SRC; Tue, 16 Jan 2024 02:56: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 4TDYYm3J5kz4fJS; Tue, 16 Jan 2024 02:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705373788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yd0oG4XORcZGVF0UDzNwrRSud2Rg0xRIZM6Ckj4yUNU=; b=ibyUpwAtL7qBmuTqhnkRigW+6tYhpB+icSsM8oi5noRmtqq+gCfzz6xBCtvsX5I/XZ4sJY nhEES22X0TlMW4gB4SE0t3tIcSJJdb61sKZEeLCpbEPgsVqT3HNsVuOrjY+kGmMu8tIZyF IXW+OXDFfkk6qx9ZWgaqfc2YUkJKpMREoI3bf4DqF8nqIygFt1SHj0QB3VxHziOG5X0Vw7 Xj1BNqMNKLfB28UN6LftYCYn7+8ZQ5jf6/WvxCwBzfDB9PF4VZyKLGFhJAke5u2fJd0EPV oDMEbXkI/3+RNbjofLSuV4yx/rCxUL054PzY66IKFeNchwS5BYDh2+/VWQ+CXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705373788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yd0oG4XORcZGVF0UDzNwrRSud2Rg0xRIZM6Ckj4yUNU=; b=JBEIYN4jtME7HJ4+tvSd93D2udFNJoHqERkBsLu5FkQxOZ2GDEQasdPRXidXY0cku5SgtR 3m6v26M8Nzos7ffIa98iyxre3/snEwdboOlDZZ/E7+LF+ncZSpePtavBMGnBtl4Uvs5qC2 JKlvGVSXhoY5CFGNHvoPD6AFXvCOh2Ar19IPcUE7nMG/Cv4ga2NQtl0L+vTZsb38L1yX3I 6onj1kqkLaP4qT97j2PSh7uFuiFWdP/bEBLbdA9wNDn8fMnuoqXhYkC36OHxANh/YS/Jsi taP8607wuQOEGCUCl8xtpIEzHLTO68kk1xhlWKznFTwSUYj3MplLTdM4LqGc4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705373788; a=rsa-sha256; cv=none; b=bcqjxvCGM3TejKVq6Us7tYLvL4f74b/0+mJQKM+eGGA3DDBTtH0mGMdEyMN6Firg1c3Xrq FmQrysvUnPQwbU9uA6BbaiXwgOJ2e3H6sFOTDFaMPtI3BzinTeQByiYk95nqpoo8+oeZ3a pIXpwHT4602hnSJJIVl1k+yIzoK1ogThvym3Uit00Cgc9SsLBVggu3XgIBsutyforTEEgN L4haPXUxYhXIZVaQrgmHpUvhZwg8ZqtASzrx0yD+knd2V3gFkb1eMQPnp2wA7wx9yn8FMz bJu3x87cgn6d5XlL7TpzoV58pMdzXjIb/k0DZmAtfx0gYn8hzqQamcS2RdDduQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDYYm21ZczMxk; Tue, 16 Jan 2024 02:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G2uS3q071608; Tue, 16 Jan 2024 02:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G2uSXl071605; Tue, 16 Jan 2024 02:56:28 GMT (envelope-from git) Date: Tue, 16 Jan 2024 02:56:28 GMT Message-Id: <202401160256.40G2uSXl071605@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: 30189156d325 - main - kern: pts: do not special case closed slave side List-Id: Commit messages for the main 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: 30189156d325fbcc9d1997d791daedc9fa3bed20 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=30189156d325fbcc9d1997d791daedc9fa3bed20 commit 30189156d325fbcc9d1997d791daedc9fa3bed20 Author: Kyle Evans AuthorDate: 2024-01-16 02:55:59 +0000 Commit: Kyle Evans CommitDate: 2024-01-16 02:55:59 +0000 kern: pts: do not special case closed slave side This would previously return 1 if the slave side of the pts was closed to force an application to read() from it and observe the EOF, but it's not clear why and this is inconsistent both with how we handle devices with similar mechanics (like pipes) and also with other kernels, such as OpenBSD/NetBSD and Linux. PR: 239604 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D43457 --- sys/kern/tty_pts.c | 7 +----- tests/sys/kern/Makefile | 3 +++ tests/sys/kern/tty_pts.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c index f79c9cc3e979..31122d422a28 100644 --- a/sys/kern/tty_pts.c +++ b/sys/kern/tty_pts.c @@ -271,12 +271,7 @@ ptsdev_ioctl(struct file *fp, u_long cmd, void *data, return (0); case FIONREAD: tty_lock(tp); - if (psc->pts_flags & PTS_FINISHED) { - /* Force read() to be called. */ - *(int *)data = 1; - } else { - *(int *)data = ttydisc_getc_poll(tp); - } + *(int *)data = ttydisc_getc_poll(tp); tty_unlock(tp); return (0); case FIODGNAME: diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 143c13297585..7b5d87ff30ac 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -40,6 +40,7 @@ ATF_TESTS_C+= subr_physmem_test PLAIN_TESTS_C+= subr_unit_test ATF_TESTS_C+= sysctl_kern_proc ATF_TESTS_C+= sys_getrandom +ATF_TESTS_C+= tty_pts ATF_TESTS_C+= unix_dgram ATF_TESTS_C+= unix_passfd_dgram TEST_METADATA.unix_passfd_dgram+= is_exclusive="true" @@ -89,6 +90,8 @@ NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt +LIBADD.tty_pts+= atf_c util + ATF_TESTS_C+= libkern_crc32 SRCS.libkern_crc32+= libkern_crc32.c .PATH: ${SRCTOP}/sys/libkern diff --git a/tests/sys/kern/tty_pts.c b/tests/sys/kern/tty_pts.c new file mode 100644 index 000000000000..241cb085a5a7 --- /dev/null +++ b/tests/sys/kern/tty_pts.c @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2024 Kyle Evans + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include + +#include +#include + +/* Just a little more concise. */ +#define newpty(masterp, slavep) openpty((masterp), (slavep), NULL, NULL, NULL) + +ATF_TC_WITHOUT_HEAD(fionread); +ATF_TC_BODY(fionread, tc) +{ + char rbuf[32]; + char buf[] = "Hello"; + int master, slave; + int bytes; + + ATF_REQUIRE_EQ(0, newpty(&master, &slave)); + + /* Should be empty to begin with. */ + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + + ATF_REQUIRE_EQ(sizeof(buf) - 1, write(slave, buf, sizeof(buf) - 1)); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(sizeof(buf) - 1, bytes); + + /* Drain what we have available, should result in 0 bytes again. */ + ATF_REQUIRE_EQ(sizeof(buf) - 1, read(master, rbuf, sizeof(rbuf))); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + + /* + * Write once more, then close the slave side with data still in the + * buffer. + */ + ATF_REQUIRE_EQ(sizeof(buf) - 1, write(slave, buf, sizeof(buf) - 1)); + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(sizeof(buf) - 1, bytes); + + ATF_REQUIRE_EQ(0, close(slave)); + + /* + * The tty's output queue is discarded upon close, so we shouldn't have + * anything else to read(). + */ + ATF_REQUIRE_EQ(0, ioctl(master, FIONREAD, &bytes)); + ATF_REQUIRE_EQ(0, bytes); + ATF_REQUIRE_EQ(0, read(master, rbuf, sizeof(rbuf))); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, fionread); + return (atf_no_error()); +} From nobody Tue Jan 16 04:38:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDbqp2myNz56fnl; Tue, 16 Jan 2024 04:38: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 4TDbqp2DlBz4qWd; Tue, 16 Jan 2024 04:38:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705379926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hVO9fhTq0Prq9VV5sOZSH8XnQTyEddetAgRnbXKreJw=; b=Ttclkfueh5z5SUCHfbtdLBw62t14BdtWgeaT4tMvCeYnwsdMJrIIMZkdg8xZfEhtNelcMc 4qvBnLQ7r/mbcQdc9vZrjHmsX0FW/YIIFg4GV0ZRxW91fV/LlpNiiz8A0x+AIKct+k2N01 3LSJtZPJuE/sF6GlmJbw8DhNbHK14cFkUHu0LO7rwOhsmphOdflciBLetK6Gd/9VpQVjmE t3XlIjCzgfqMkoUOm7YCg+jncJpmanULZA2xK6HKfkhqcidipdB+tQMF9bKDgDa4CgAU3X RvkXRlfk+Ch4doIYB0gNzX5wwXIBxV1LqfQ5N8794FfnWXqLhvqwRDbk1EMaww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705379926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hVO9fhTq0Prq9VV5sOZSH8XnQTyEddetAgRnbXKreJw=; b=PFQh/21qrKoGQJ9hlZNSmQ/5dcsbxDm0OTKGscVOgoOPkymF6e6Z63dHEWkUW0cmzgIWPS 48BvDa9A+bPRMJs1h8fxYBTJREJrobJD7ZhoXpkny8eJufy591t4AqSnCBJKgTUPpKeeLs GZK/ms/vzEYizje3Ceb/eUYBVcWjzuRqFHPD6c2iHGesxixAZ1k9Jy9EilJRdHRE4TmF/L klb5rxlifZV5i4zeOUyEF0/zmjQwnBxAPBoO6j/rdVxi2maCEovWsXVL/XIdiesCB+03uC kjFCK/rmknzu6/17F3QxVpH6bJYTFqHVI8n5CuCnkXtUDX/TjnssuNaKJD1HXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705379926; a=rsa-sha256; cv=none; b=RTTJ16kr4CesNZkztzD71qEumWuloL0szJ37m8DUAL/pO3LAxOZe3FGrtuzbXqNJKII05z 83GMDas4SGEwbYgSQApnb9vM6S3PljVGXFy7tV223hUIZg/ZZEToU4nxyzrb0rzSicxERp rZROcuE6xybrEVw2/hxoIBrQnHbUaTP1x7tSFPKLEccPAjTh6Z0BJEhq6URedmxbXqegUh 4z0ctqmixbgIKLdBLRPDrSqepq8Jrym+ULX4yEQZDm6Dh7SpPeCNW+rWMLfdCvvOq58ccU ubnxmmTriE6cPtDTz2MojUOidF2Ej3gKQab3LtkvlLzMoZGo9IsYPEjlzYHnDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDbqp19cpzQdQ; Tue, 16 Jan 2024 04:38:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G4ck1V042545; Tue, 16 Jan 2024 04:38:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G4ckqb042542; Tue, 16 Jan 2024 04:38:46 GMT (envelope-from git) Date: Tue, 16 Jan 2024 04:38:46 GMT Message-Id: <202401160438.40G4ckqb042542@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: 393f2dca362a - main - mount: Add a note that userquota and groupquota aren't printed with -p List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 393f2dca362a4f32f852e95f84bb3bb4a40ea3b5 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=393f2dca362a4f32f852e95f84bb3bb4a40ea3b5 commit 393f2dca362a4f32f852e95f84bb3bb4a40ea3b5 Author: Warner Losh AuthorDate: 2024-01-15 17:55:32 +0000 Commit: Warner Losh CommitDate: 2024-01-16 04:38:26 +0000 mount: Add a note that userquota and groupquota aren't printed with -p The quota options are pseudo options and not passed to the mount system call when a filesystem is mounted. They are not part of the info returned from getmntinfo(3), so can't be printed. Add a note to this effect. --- sbin/mount/mount.8 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8 index fbca8aef9999..883e0bb5caf0 100644 --- a/sbin/mount/mount.8 +++ b/sbin/mount/mount.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 4, 2023 +.Dd January 15, 2024 .Dt MOUNT 8 .Os .Sh NAME @@ -559,6 +559,7 @@ support for a particular file system might be provided either on a static .Xr setfacl 1 , .Xr nmount 2 , .Xr acl 3 , +.Xr getmntinfo 3 , .Xr libxo 3 , .Xr xo_parse_args 3 , .Xr mac 4 , @@ -579,6 +580,7 @@ support for a particular file system might be provided either on a static .Xr mount_smbfs 8 , .Xr mount_udf 8 , .Xr mount_unionfs 8 , +.Xr quotacheck 8 , .Xr umount 8 , .Xr zfs 8 , .Xr zpool 8 @@ -611,3 +613,17 @@ only when the file system is mounted via .Nm . .Sh BUGS It is possible for a corrupted file system to cause a crash. +.Pp +The +.Fl p +option will not list +.Cm userquota +or +.Cm groupquota +items from +.Xr fstab 5 +because they are not true mount options and are not information returned by +.Xr getmntinfo 3 . +At boot +.Xr quotacheck 8 , +processes these items. From nobody Tue Jan 16 08:51:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjRr6BdJz579ft; Tue, 16 Jan 2024 08: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 4TDjRr5wjbz4Ptm; Tue, 16 Jan 2024 08: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=1705395112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=on80Lqf2GWyNR1JeEstCOrllspQDKz3KB77SoQ8/NsI=; b=Kqgbbeg+B9+8HOsI72uh2Y7WCgdIXoRdDPCEmVDHAtxjC4LHGLaloSbbKgLJ1RSJ/wtcnz sp0ztj8zMum11dKkmN/vy0sHRQdZEWreELej0i47RNknch/mvzZlpt753aWKT2rMfMWzdf 8lb/l3RNHp7hsTXZqesKi13uUgGCehjqg1km6QVf4IdLRfF6lPuiVhUFuz0la/i0KQqJNP y7q3vYCWrzPWvPE5ST2BBesY0xHE2vk9cBoktG977Gq9KEwJgQZ96KwV1B88hVJSMpPFVK OOFk59o0X8dbjHqsaRsX9/Gc99VRisOCK/Rq660ziX1BPSmvEkdHR+DO51J+LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=on80Lqf2GWyNR1JeEstCOrllspQDKz3KB77SoQ8/NsI=; b=LEOBUbR97uAwnftRKROErEADwyvzfvtHe0GiPTKfAqW2uijfyJ8qbo/ivgMsvFNoj0TmiR OrblhjLFiGUkKH7moweLeTMrAnRwybjlSrbCsvze4kBVyA+qema+jX0wdBBJgX7ZtogEm6 1pQbF4yewfWNZd5YDnHX6Y3Hlgs5v2SJr7zYsg04lqS9yWyvrlc1yj2DejQ5KxDT2+b9IK 4wckSTymWbzq9cSwg3L5bgSfT1tn4rLEVVrx7+DoGtUc9jD3wLHR3NhysZIVKYKdCKzmIt g7cjuK6kkQDt0pkbeJayJtIy2lTxGyGvsZ7owZDlCrbDHcaJjcMuk5ROSO+cOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395112; a=rsa-sha256; cv=none; b=F4YmsYdQGv4tcXTuRH9MELaUmWSs2F4S/VeLYobZEkDWThJE5CGhbsd6c4k1OzayCs0ypS Jyk1cXd7zZeM+rYumOFym+U/JfuF92Jry7B8+hiuOEmAlIX0FwSBbTaOOQ2pV2aDWJgVNg usiNAy4b5j9DoPm2BAaO+bn/kdmRp2Sgrk+Rqh93LDS86fkoI5xdkTT569dAeH2t0s4wOh Jl5emtmKoIzF/46dpfxmSEdrYVN6V2+lOfSRK13Q6Dhps4tzv0NDryGCtxZRQBEjBwxKIn 2IjiuKWxIcv02oAuxdkfn56vMek4LWuu7ZXp1DRjsZsOVUtOQe78jk07CXd+DQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjRr4zYZzZLZ; Tue, 16 Jan 2024 08:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8pqIZ075681; Tue, 16 Jan 2024 08:51:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8pqXN075678; Tue, 16 Jan 2024 08:51:52 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:51:52 GMT Message-Id: <202401160851.40G8pqXN075678@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: f92d9b1aad73 - main - pflow: import from OpenBSD List-Id: Commit messages for the main 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: f92d9b1aad73fc47f8f0b960808ca2c1a938e9e7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f92d9b1aad73fc47f8f0b960808ca2c1a938e9e7 commit f92d9b1aad73fc47f8f0b960808ca2c1a938e9e7 Author: Kristof Provost AuthorDate: 2023-11-28 13:00:16 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:53 +0000 pflow: import from OpenBSD pflow is a pseudo device to export flow accounting data over UDP. It's compatible with netflow version 5 and IPFIX (10). The data is extracted from the pf state table. States are exported once they are removed. Reviewed by: melifaro Obtained from: OpenBSD Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43106 --- sbin/Makefile | 1 + sbin/pflowctl/Makefile | 10 + sbin/pflowctl/pflowctl.8 | 91 ++ sbin/pflowctl/pflowctl.c | 548 ++++++++++++ share/man/man4/Makefile | 2 + share/man/man4/pflow.4 | 123 +++ sys/conf/files | 1 + sys/modules/Makefile | 2 + sys/modules/pflow/Makefile | 16 + sys/net/pflow.h | 333 +++++++ sys/net/pfvar.h | 4 +- sys/netlink/netlink_message_parser.h | 6 +- sys/netpfil/pf/pf.c | 24 + sys/netpfil/pf/pf_ioctl.c | 14 +- sys/netpfil/pf/pflow.c | 1578 ++++++++++++++++++++++++++++++++++ 15 files changed, 2749 insertions(+), 4 deletions(-) diff --git a/sbin/Makefile b/sbin/Makefile index 0c648f29badb..342f385f090b 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -81,6 +81,7 @@ SUBDIR.${MK_NVME}+= nvmecontrol SUBDIR.${MK_OPENSSL}+= decryptcore SUBDIR.${MK_PF}+= pfctl SUBDIR.${MK_PF}+= pflogd +SUBDIR.${MK_PF}+= pflowctl SUBDIR.${MK_QUOTAS}+= quotacheck SUBDIR.${MK_ROUTED}+= routed SUBDIR.${MK_VERIEXEC}+= veriexec diff --git a/sbin/pflowctl/Makefile b/sbin/pflowctl/Makefile new file mode 100644 index 000000000000..35cf8cc020f4 --- /dev/null +++ b/sbin/pflowctl/Makefile @@ -0,0 +1,10 @@ + +.include + +PACKAGE=pf +PROG= pflowctl +MAN= pflowctl.8 + +SRCS = pflowctl.c + +.include diff --git a/sbin/pflowctl/pflowctl.8 b/sbin/pflowctl/pflowctl.8 new file mode 100644 index 000000000000..e2e19b7ddfa0 --- /dev/null +++ b/sbin/pflowctl/pflowctl.8 @@ -0,0 +1,91 @@ +.\" $OpenBSD: pflow.4,v 1.19 2014/03/29 11:26:03 florian Exp $ +.\" +.\" Copyright (c) 2008 Henning Brauer +.\" Copyright (c) 2008 Joerg Goltermann +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: January 08 2024 $ +.Dt PFLOWCTL 8 +.Os +.Sh NAME +.Nm pflowctl +.Nd control pflow data export +.Sh SYNOPSIS +.Nm pflowctl +.Bk -words +.Op Fl lc +.Op Fl d Ar id +.Op Fl s Ar id ... +.Ek +.Sh DESCRIPTION +The +.Nm +utility creates, configures and deletes netflow accounting data export using the +.Xr pflow 4 +subsystem. +.Pp +The +.Nm +utility provides several commands. +The options are as follows: +.Bl -tag -width Ds +.It Fl c +Create a new +.Xr pflow 4 +exporter. +.It Fl d Ar id +Remove an existing +.Xr pflow 4 +exporter. +The +.Ar id +may be either numeric or the full pflowX name. +.It Fl l +List all existing +.Xr pflow 4 +exporters. +.It Fl s Ar id ... +Configure an existing +.Xr pflow 4 +exporter. +This takes the following keywords: +.Pp +.Bl -tag -width xxxxxxxxxxxx -compact +.It Cm src +set the source IP address (and optionally port). +.It Cm dst +set the destination IP address (and optionally port). +.It Cm proto +set the protocol version. +Valid values are 5 and 10. +.El +.Pp +Multiple keywords may be passed in the same command invocation. +.Pp +For example, the following command sets 10.0.0.1 as the source +and 10.0.0.2:1234 as destination: +.Bd -literal -offset indent +# pflowctl -s pflow0 src 10.0.0.1 dst 10.0.0.2:1234 +.Ed +.Sh SEE ALSO +.Xr netintro 4 , +.Xr pf 4 , +.Xr pflow 4 , +.Xr udp 4 , +.Xr pf.conf 5 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 15.0 . diff --git a/sbin/pflowctl/pflowctl.c b/sbin/pflowctl/pflowctl.c new file mode 100644 index 000000000000..046919867ff2 --- /dev/null +++ b/sbin/pflowctl/pflowctl.c @@ -0,0 +1,548 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Rubicon Communications, LLC (Netgate) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - 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 COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS 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. + * + */ +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +static int get(int id); + +static void +usage(void) +{ + extern char *__progname; + + fprintf(stderr, +"usage: %s [-la] [-d id]\n", + __progname); + + exit(1); +} + +static int +pflow_to_id(const char *name) +{ + int ret, id; + + ret = sscanf(name, "pflow%d", &id); + if (ret == 1) + return (id); + + ret = sscanf(name, "%d", &id); + if (ret == 1) + return (id); + + return (-1); +} + +struct pflowctl_list { + int id; +}; +#define _IN(_field) offsetof(struct genlmsghdr, _field) +#define _OUT(_field) offsetof(struct pflowctl_list, _field) +static struct snl_attr_parser ap_list[] = { + { .type = PFLOWNL_L_ID, .off = _OUT(id), .cb = snl_attr_get_int32 }, +}; +static struct snl_field_parser fp_list[] = {}; +#undef _IN +#undef _OUT +SNL_DECLARE_PARSER(list_parser, struct genlmsghdr, fp_list, ap_list); + +static int +list(void) +{ + struct snl_state ss = {}; + struct snl_errmsg_data e = {}; + struct pflowctl_list l = {}; + struct snl_writer nw; + struct nlmsghdr *hdr; + uint32_t seq_id; + int family_id; + + snl_init(&ss, NETLINK_GENERIC); + family_id = snl_get_genl_family(&ss, PFLOWNL_FAMILY_NAME); + if (family_id == 0) + errx(1, "pflow.ko is not loaded."); + + snl_init_writer(&ss, &nw); + hdr = snl_create_genl_msg_request(&nw, family_id, PFLOWNL_CMD_LIST); + + hdr = snl_finalize_msg(&nw); + if (hdr == NULL) + return (ENOMEM); + seq_id = hdr->nlmsg_seq; + + snl_send_message(&ss, hdr); + + while ((hdr = snl_read_reply_multi(&ss, seq_id, &e)) != NULL) { + if (! snl_parse_nlmsg(&ss, hdr, &list_parser, &l)) + continue; + + get(l.id); + } + + if (e.error) + errc(1, e.error, "failed to list"); + + return (0); +} + +struct pflowctl_create { + int id; +}; +#define _IN(_field) offsetof(struct genlmsghsdr, _field) +#define _OUT(_field) offsetof(struct pflowctl_create, _field) +static struct snl_attr_parser ap_create[] = { + { .type = PFLOWNL_CREATE_ID, .off = _OUT(id), .cb = snl_attr_get_int32 }, +}; +static struct snl_field_parser pf_create[] = {}; +#undef _IN +#undef _OUT +SNL_DECLARE_PARSER(create_parser, struct genlmsghdr, pf_create, ap_create); + +static int +create(void) +{ + struct snl_state ss = {}; + struct snl_errmsg_data e = {}; + struct pflowctl_create c = {}; + struct snl_writer nw; + struct nlmsghdr *hdr; + uint32_t seq_id; + int family_id; + + snl_init(&ss, NETLINK_GENERIC); + family_id = snl_get_genl_family(&ss, PFLOWNL_FAMILY_NAME); + if (family_id == 0) + errx(1, "pflow.ko is not loaded."); + + snl_init_writer(&ss, &nw); + hdr = snl_create_genl_msg_request(&nw, family_id, PFLOWNL_CMD_CREATE); + + hdr = snl_finalize_msg(&nw); + if (hdr == NULL) + return (ENOMEM); + seq_id = hdr->nlmsg_seq; + + snl_send_message(&ss, hdr); + + while ((hdr = snl_read_reply_multi(&ss, seq_id, &e)) != NULL) { + if (! snl_parse_nlmsg(&ss, hdr, &create_parser, &c)) + continue; + + printf("pflow%d\n", c.id); + } + + if (e.error) + errc(1, e.error, "failed to create"); + + return (0); +} + +static int +del(char *idstr) +{ + struct snl_state ss = {}; + struct snl_errmsg_data e = {}; + struct snl_writer nw; + struct nlmsghdr *hdr; + int family_id; + int id; + + id = pflow_to_id(idstr); + if (id < 0) + return (EINVAL); + + snl_init(&ss, NETLINK_GENERIC); + family_id = snl_get_genl_family(&ss, PFLOWNL_FAMILY_NAME); + if (family_id == 0) + errx(1, "pflow.ko is not loaded."); + + snl_init_writer(&ss, &nw); + hdr = snl_create_genl_msg_request(&nw, family_id, PFLOWNL_CMD_DEL); + + snl_add_msg_attr_s32(&nw, PFLOWNL_DEL_ID, id); + + hdr = snl_finalize_msg(&nw); + if (hdr == NULL) + return (ENOMEM); + + snl_send_message(&ss, hdr); + snl_read_reply_code(&ss, hdr->nlmsg_seq, &e); + + if (e.error) + errc(1, e.error, "failed to delete"); + + return (0); +} + +struct pflowctl_sockaddr { + union { + struct sockaddr_in in; + struct sockaddr_in6 in6; + struct sockaddr_storage storage; + }; +}; +static bool +pflowctl_post_sockaddr(struct snl_state* ss __unused, void *target) +{ + struct pflowctl_sockaddr *s = (struct pflowctl_sockaddr *)target; + + if (s->storage.ss_family == AF_INET) + s->storage.ss_len = sizeof(struct sockaddr_in); + else if (s->storage.ss_family == AF_INET6) + s->storage.ss_len = sizeof(struct sockaddr_in6); + else + return (false); + + return (true); +} +#define _OUT(_field) offsetof(struct pflowctl_sockaddr, _field) +static struct snl_attr_parser nla_p_sockaddr[] = { + { .type = PFLOWNL_ADDR_FAMILY, .off = _OUT(in.sin_family), .cb = snl_attr_get_uint8 }, + { .type = PFLOWNL_ADDR_PORT, .off = _OUT(in.sin_port), .cb = snl_attr_get_uint16 }, + { .type = PFLOWNL_ADDR_IP, .off = _OUT(in.sin_addr), .cb = snl_attr_get_in_addr }, + { .type = PFLOWNL_ADDR_IP6, .off = _OUT(in6.sin6_addr), .cb = snl_attr_get_in6_addr }, +}; +SNL_DECLARE_ATTR_PARSER_EXT(sockaddr_parser, 0, nla_p_sockaddr, pflowctl_post_sockaddr); +#undef _OUT + +struct pflowctl_get { + int id; + int version; + struct pflowctl_sockaddr src; + struct pflowctl_sockaddr dst; +}; +#define _IN(_field) offsetof(struct genlmsghdr, _field) +#define _OUT(_field) offsetof(struct pflowctl_get, _field) +static struct snl_attr_parser ap_get[] = { + { .type = PFLOWNL_GET_ID, .off = _OUT(id), .cb = snl_attr_get_int32 }, + { .type = PFLOWNL_GET_VERSION, .off = _OUT(version), .cb = snl_attr_get_int16 }, + { .type = PFLOWNL_GET_SRC, .off = _OUT(src), .arg = &sockaddr_parser, .cb = snl_attr_get_nested }, + { .type = PFLOWNL_GET_DST, .off = _OUT(dst), .arg = &sockaddr_parser, .cb = snl_attr_get_nested }, +}; +static struct snl_field_parser fp_get[] = {}; +#undef _IN +#undef _OUT +SNL_DECLARE_PARSER(get_parser, struct genlmsghdr, fp_get, ap_get); + +static void +print_sockaddr(const char *prefix, const struct sockaddr_storage *s) +{ + char buf[INET6_ADDRSTRLEN]; + int error; + + if (s->ss_family != AF_INET && s->ss_family != AF_INET6) + return; + + if (s->ss_family == AF_INET || + s->ss_family == AF_INET6) { + error = getnameinfo((const struct sockaddr *)s, + s->ss_len, buf, sizeof(buf), NULL, 0, + NI_NUMERICHOST); + if (error) + err(1, "sender: %s", gai_strerror(error)); + } + + printf("%s", prefix); + switch (s->ss_family) { + case AF_INET: { + const struct sockaddr_in *sin = (const struct sockaddr_in *)s; + if (sin->sin_addr.s_addr != INADDR_ANY) { + printf("%s", buf); + if (sin->sin_port != 0) + printf(":%u", ntohs(sin->sin_port)); + } + break; + } + case AF_INET6: { + const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)s; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + printf("[%s]", buf); + if (sin6->sin6_port != 0) + printf(":%u", ntohs(sin6->sin6_port)); + } + break; + } + } +} + +static int +get(int id) +{ + struct snl_state ss = {}; + struct snl_errmsg_data e = {}; + struct pflowctl_get g = {}; + struct snl_writer nw; + struct nlmsghdr *hdr; + uint32_t seq_id; + int family_id; + + snl_init(&ss, NETLINK_GENERIC); + family_id = snl_get_genl_family(&ss, PFLOWNL_FAMILY_NAME); + if (family_id == 0) + errx(1, "pflow.ko is not loaded."); + + snl_init_writer(&ss, &nw); + hdr = snl_create_genl_msg_request(&nw, family_id, PFLOWNL_CMD_GET); + snl_add_msg_attr_s32(&nw, PFLOWNL_GET_ID, id); + + hdr = snl_finalize_msg(&nw); + if (hdr == NULL) + return (ENOMEM); + seq_id = hdr->nlmsg_seq; + + snl_send_message(&ss, hdr); + + while ((hdr = snl_read_reply_multi(&ss, seq_id, &e)) != NULL) { + if (! snl_parse_nlmsg(&ss, hdr, &get_parser, &g)) + continue; + + printf("pflow%d: version %d", g.id, g.version); + print_sockaddr(" src ", &g.src.storage); + print_sockaddr(" dst ", &g.dst.storage); + printf("\n"); + } + + if (e.error) + errc(1, e.error, "failed to get"); + + return (0); +} + +struct pflowctl_set { + int id; + uint16_t version; + struct sockaddr_storage src; + struct sockaddr_storage dst; +}; +static inline bool +snl_add_msg_attr_sockaddr(struct snl_writer *nw, int attrtype, struct sockaddr_storage *s) +{ + int off = snl_add_msg_attr_nested(nw, attrtype); + + snl_add_msg_attr_u8(nw, PFLOWNL_ADDR_FAMILY, s->ss_family); + + switch (s->ss_family) { + case AF_INET: { + const struct sockaddr_in *in = (const struct sockaddr_in *)s; + snl_add_msg_attr_u16(nw, PFLOWNL_ADDR_PORT, in->sin_port); + snl_add_msg_attr_ip4(nw, PFLOWNL_ADDR_IP, &in->sin_addr); + break; + } + case AF_INET6: { + const struct sockaddr_in6 *in6 = (const struct sockaddr_in6 *)s; + snl_add_msg_attr_u16(nw, PFLOWNL_ADDR_PORT, in6->sin6_port); + snl_add_msg_attr_ip6(nw, PFLOWNL_ADDR_IP6, &in6->sin6_addr); + break; + } + default: + return (false); + } + snl_end_attr_nested(nw, off); + + return (true); +} + +static int +do_set(struct pflowctl_set *s) +{ + struct snl_state ss = {}; + struct snl_errmsg_data e = {}; + struct snl_writer nw; + struct nlmsghdr *hdr; + int family_id; + + snl_init(&ss, NETLINK_GENERIC); + family_id = snl_get_genl_family(&ss, PFLOWNL_FAMILY_NAME); + if (family_id == 0) + errx(1, "pflow.ko is not loaded."); + + snl_init_writer(&ss, &nw); + snl_create_genl_msg_request(&nw, family_id, PFLOWNL_CMD_SET); + + snl_add_msg_attr_s32(&nw, PFLOWNL_SET_ID, s->id); + if (s->version != 0) + snl_add_msg_attr_u16(&nw, PFLOWNL_SET_VERSION, s->version); + if (s->src.ss_len != 0) + snl_add_msg_attr_sockaddr(&nw, PFLOWNL_SET_SRC, &s->src); + if (s->dst.ss_len != 0) + snl_add_msg_attr_sockaddr(&nw, PFLOWNL_SET_DST, &s->dst); + + hdr = snl_finalize_msg(&nw); + if (hdr == NULL) + return (1); + + snl_send_message(&ss, hdr); + snl_read_reply_code(&ss, hdr->nlmsg_seq, &e); + + if (e.error) + errc(1, e.error, "failed to set"); + + return (0); +} + +static void +pflowctl_addr(const char *val, struct sockaddr_storage *ss) +{ + struct addrinfo *res0; + int error; + bool flag; + char *ip, *port; + char buf[sysconf(_SC_HOST_NAME_MAX) + 1 + sizeof(":65535")]; + struct addrinfo hints = { + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_DGRAM, /*dummy*/ + .ai_flags = AI_NUMERICHOST, + }; + + if (strlcpy(buf, val, sizeof(buf)) >= sizeof(buf)) + errx(1, "%s bad value", val); + + port = NULL; + flag = *buf == '['; + + for (char *cp = buf; *cp; ++cp) { + if (*cp == ']' && *(cp + 1) == ':' && flag) { + *cp = '\0'; + *(cp + 1) = '\0'; + port = cp + 2; + break; + } + if (*cp == ']' && *(cp + 1) == '\0' && flag) { + *cp = '\0'; + port = NULL; + break; + } + if (*cp == ':' && !flag) { + *cp = '\0'; + port = cp + 1; + break; + } + } + + ip = buf; + if (flag) + ip++; + + if ((error = getaddrinfo(ip, port, &hints, &res0)) != 0) + errx(1, "error in parsing address string: %s", + gai_strerror(error)); + + memcpy(ss, res0->ai_addr, res0->ai_addr->sa_len); + freeaddrinfo(res0); +} + +static int +set(char *idstr, int argc, char *argv[]) +{ + struct pflowctl_set s = {}; + + s.id = pflow_to_id(idstr); + if (s.id < 0) + return (EINVAL); + + while (argc > 0) { + if (strcmp(argv[0], "src") == 0) { + if (argc < 2) + usage(); + + pflowctl_addr(argv[1], &s.src); + + argc -= 2; + argv += 2; + } else if (strcmp(argv[0], "dst") == 0) { + if (argc < 2) + usage(); + + pflowctl_addr(argv[1], &s.dst); + + argc -= 2; + argv += 2; + } else if (strcmp(argv[0], "proto") == 0) { + if (argc < 2) + usage(); + + s.version = strtol(argv[1], NULL, 10); + + argc -= 2; + argv += 2; + } else { + usage(); + } + } + + return (do_set(&s)); +} + +static const struct snl_hdr_parser *all_parsers[] = { + &list_parser, + &get_parser, +}; + +int +main(int argc, char *argv[]) +{ + int ch; + + SNL_VERIFY_PARSERS(all_parsers); + + if (argc < 2) + usage(); + + while ((ch = getopt(argc, argv, + "lcd:s:")) != -1) { + switch (ch) { + case 'l': + return (list()); + case 'c': + return (create()); + case 'd': + return (del(optarg)); + case 's': + return (set(optarg, argc - optind, argv + optind)); + } + } + + return (0); +} diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 978ec6887f85..ab951b107f27 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -433,6 +433,7 @@ MAN= aac.4 \ pcm.4 \ ${_pf.4} \ ${_pflog.4} \ + ${_pflow.4} \ ${_pfsync.4} \ pim.4 \ pms.4 \ @@ -968,6 +969,7 @@ _atf_test_case.4= atf-test-case.4 .if ${MK_PF} != "no" _pf.4= pf.4 _pflog.4= pflog.4 +_pflow.4= pflow.4 _pfsync.4= pfsync.4 .endif diff --git a/share/man/man4/pflow.4 b/share/man/man4/pflow.4 new file mode 100644 index 000000000000..320a7527dc2d --- /dev/null +++ b/share/man/man4/pflow.4 @@ -0,0 +1,123 @@ +.\" $OpenBSD: pflow.4,v 1.19 2014/03/29 11:26:03 florian Exp $ +.\" +.\" Copyright (c) 2008 Henning Brauer +.\" Copyright (c) 2008 Joerg Goltermann +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: January 08 2024 $ +.Dt PFLOW 4 +.Os +.Sh NAME +.Nm pflow +.Nd kernel interface for pflow data export +.Sh SYNOPSIS +.Cd "pseudo-device pflow" +.Sh DESCRIPTION +The +.Nm +subsystem exports +.Nm +accounting data from the kernel using +.Xr udp 4 +packets. +.Nm +is compatible with netflow version 5 and IPFIX (10). +The data is extracted from the +.Xr pf 4 +state table. +.Pp +Multiple +.Nm +interfaces can be created at runtime using the +.Ic pflowctl Ns Ar N Ic -c +command. +Each interface must be configured with a flow receiver IP address +and a flow receiver port number. +.Pp +Only states created by a rule marked with the +.Ar pflow +keyword are exported by +.Nm . +.Pp +.Nm +will attempt to export multiple +.Nm +records in one +UDP packet, but will not hold a record for longer than 30 seconds. +.Pp +Each packet seen on this interface has one header and a variable number of +flows. +The header indicates the version of the protocol, number of +flows in the packet, a unique sequence number, system time, and an engine +ID and type. +Header and flow structs are defined in +.In net/pflow.h . +.Pp +The +.Nm +source and destination addresses are controlled by +.Xr pflowctl 8 . +.Cm src +is the sender IP address of the UDP packet which can be used +to identify the source of the data on the +.Nm +collector. +.Cm dst +defines the collector IP address and the port. +The +.Cm dst +IP address and port must be defined to enable the export of flows. +.Pp +For example, the following command sets 10.0.0.1 as the source +and 10.0.0.2:1234 as destination: +.Bd -literal -offset indent +# pflowctl -s pflow0 src 10.0.0.1 dst 10.0.0.2:1234 +.Ed +.Pp +The protocol is set to IPFIX with the following command: +.Bd -literal -offset indent +# pflowctl -s pflow0 proto 10 +.Ed +.Sh SEE ALSO +.Xr netintro 4 , +.Xr pf 4 , +.Xr udp 4 , +.Xr pf.conf 5 , +.Xr pflowctl 8 , +.Xr tcpdump 8 +.Sh STANDARDS +.Rs +.%A B. Claise +.%D January 2008 +.%R RFC 5101 +.%T "Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information" +.Re +.Sh HISTORY +The +.Nm +device first appeared in +.Ox 4.5 +and was imported into +FreeBSD 15.0 . +.Sh BUGS +A state created by +.Xr pfsync 4 +can have a creation or expiration time before the machine came up. +In this case, +.Nm +pretends such flows were created or expired when the machine came up. +.Pp +The IPFIX implementation is incomplete: +The required transport protocol SCTP is not supported. +Transport over TCP and DTLS protected flow export is also not supported. diff --git a/sys/conf/files b/sys/conf/files index 484ec90beb00..9f0b3cf3831a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4511,6 +4511,7 @@ netpfil/pf/pf_osfp.c optional pf inet netpfil/pf/pf_ruleset.c optional pf inet netpfil/pf/pf_syncookies.c optional pf inet netpfil/pf/pf_table.c optional pf inet +netpfil/pf/pflow.c optional pflow pf inet netpfil/pf/pfsync_nv.c optional pfsync pf inet netpfil/pf/in4_cksum.c optional pf inet netsmb/smb_conn.c optional netsmb diff --git a/sys/modules/Makefile b/sys/modules/Makefile index c14933eebda4..606ab4cb0536 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -306,6 +306,7 @@ SUBDIR= \ ${_pcfclock} \ ${_pf} \ ${_pflog} \ + ${_pflow} \ ${_pfsync} \ plip \ ${_pms} \ @@ -611,6 +612,7 @@ _netgraph= netgraph ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES) _pf= pf _pflog= pflog +_pflow= pflow .if ${MK_INET_SUPPORT} != "no" _pfsync= pfsync .endif diff --git a/sys/modules/pflow/Makefile b/sys/modules/pflow/Makefile new file mode 100644 index 000000000000..674ca8970607 --- /dev/null +++ b/sys/modules/pflow/Makefile @@ -0,0 +1,16 @@ +.PATH: ${SRCTOP}/sys/netpfil/pf + +KMOD= pflow +SRCS= pflow.c \ + opt_pf.h opt_inet.h opt_inet6.h opt_global.h +SRCS+= bus_if.h device_if.h + +.if !defined(KERNBUILDDIR) +.if defined(VIMAGE) +opt_global.h: + echo "#define VIMAGE 1" >> ${.TARGET} +CFLAGS+= -include opt_global.h +.endif +.endif + +.include diff --git a/sys/net/pflow.h b/sys/net/pflow.h new file mode 100644 index 000000000000..fcf24e091b57 --- /dev/null +++ b/sys/net/pflow.h @@ -0,0 +1,333 @@ +/* $OpenBSD: if_pflow.h,v 1.19 2022/11/23 15:12:27 mvs Exp $ */ + +/* + * Copyright (c) 2008 Henning Brauer + * Copyright (c) 2008 Joerg Goltermann + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _NET_IF_PFLOW_H_ +#define _NET_IF_PFLOW_H_ + +#include +#include +#include + +#include + +#ifdef _KERNEL +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#endif + +#define PFLOW_ID_LEN sizeof(u_int64_t) + +#define PFLOW_MAXFLOWS 30 +#define PFLOW_ENGINE_TYPE 42 +#define PFLOW_ENGINE_ID 42 +#define PFLOW_MAXBYTES 0xffffffff +#define PFLOW_TIMEOUT 30 +#define PFLOW_TMPL_TIMEOUT 30 /* rfc 5101 10.3.6 (p.40) recommends 600 */ + +#define PFLOW_IPFIX_TMPL_SET_ID 2 + +/* RFC 5102 Information Element Identifiers */ + +#define PFIX_IE_octetDeltaCount 1 +#define PFIX_IE_packetDeltaCount 2 +#define PFIX_IE_protocolIdentifier 4 +#define PFIX_IE_ipClassOfService 5 +#define PFIX_IE_sourceTransportPort 7 *** 2076 LINES SKIPPED *** From nobody Tue Jan 16 08:51:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjRt2m6Mz57B1t; Tue, 16 Jan 2024 08:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDjRs6jpvz4Ptp; Tue, 16 Jan 2024 08:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aDSWBjFdAjVJvtrlXy+wim8xLNUzrXvCAPVkE5Je57Y=; b=rFZDr5zt9t8r4laYBFvRWP3yQNoaYowPLjAF6ZlzG75Dl8V+P7njNyXDvi+HG4pzDsFbZp IxsyYxrwxXnCv73VhnpEyKzzTr1mAjccoEuOCUbAZe5IH4goAfARPW5RDeuKhyUJHLvmwA JSNj9n+0iC3/ds8FrTMWp/B1BRMQYQ+TY1+sMCO7ZCC4/+bBZTob4zccU8so6XyBFsZdvf RsaJ8SE8Y9zJwJ3kZhp35kVj52SCFuXTh/nk9H7iJ2Ikm06QbQO26F2VYbWcsgZLcf96EI CZuVMbaL52H2KV7HFis7t9mxHPFmH07VkSkAFPE8840ndwXwQH73QXHX3bcU3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aDSWBjFdAjVJvtrlXy+wim8xLNUzrXvCAPVkE5Je57Y=; b=QuwXaJn5MKS0aryno32H3/thJuwjplfKN499QE/G9d3wiH7yVpTiERL9QDhWWqLyCYmVyP j83gddvbMuji3xQxzY+HajmbMOBNgifkBNnwUm2LeKJRKOHaeT84AfOItQK+sSYicMXVG1 7YIS3PlXStVoQAh2KTbqJyx1ywxqT2rAwJ732RxdF5HC1XrdVVBNK3mR43ikOciXqf6c7g H/DdT4ltT3lwfmZM3cNQjrrMC6iG6vRZcdISa+AolEj+FQPH1usUhC+4TQ/NxL8+d3p2Yf aACvi3Y83om9rxH3V2xEo+0O7R9PXrTXY3nwSZRWuW8bUqU1TL2Gpt7BDyU8Ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395113; a=rsa-sha256; cv=none; b=kMX2iOUqiU5olQKdrrxdbHkha71w6jSqAPCz58ZDkEi8IQRM7J0mXFoml/6gSIkQZctwLt EyxXl0fEbFPmgJYexC7HilWqpGH+I7CQT9YCJ3u3YgPO0l77DaJTaJHEaPy/lrbV4dDE9t TSq8PZXWWX6Gud/Cs0BgJTK8l5W5ekdTVjViZGeBmXBMFACHYyhZ3aOgJ4JpxRKebPIAlK e44Rr6FlaqXbn4vC3bI1YUIkNWmXMe24cYal+gMJFVSTYie6bxzeQeT+9s7TxLxdXE4WaY VUWRGCHs0i1V3VBmhNQBQm7EcjsTnpz4A62fJjVFBYJiDCM654CEiHO3HIpUVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjRs5qJhzZ9Q; Tue, 16 Jan 2024 08:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8prv8075717; Tue, 16 Jan 2024 08:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8prB7075714; Tue, 16 Jan 2024 08:51:53 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:51:53 GMT Message-Id: <202401160851.40G8prB7075714@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: 5dea523bd241 - main - pflow: netstat statistics List-Id: Commit messages for the main 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: 5dea523bd241fea07dc28c067b124d607dc96948 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5dea523bd241fea07dc28c067b124d607dc96948 commit 5dea523bd241fea07dc28c067b124d607dc96948 Author: Kristof Provost AuthorDate: 2023-12-06 13:55:33 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:53 +0000 pflow: netstat statistics Expose pflow counters via netstat. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43107 --- sys/netpfil/pf/pflow.c | 10 ++++++++-- usr.bin/netstat/if.c | 26 ++++++++++++++++++++++++++ usr.bin/netstat/main.c | 2 ++ usr.bin/netstat/netstat.h | 1 + usr.bin/netstat/nlist_symbols | 1 + 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c index 855ebe5ca98c..2dc612bd9e07 100644 --- a/sys/netpfil/pf/pflow.c +++ b/sys/netpfil/pf/pflow.c @@ -128,13 +128,19 @@ VNET_DEFINE(CK_LIST_HEAD(, pflow_softc), pflowif_list); #define V_pflowif_list VNET(pflowif_list) VNET_DEFINE(struct mtx, pflowif_list_mtx); #define V_pflowif_list_mtx VNET(pflowif_list_mtx) -VNET_DEFINE(struct pflowstats, pflowstats); -#define V_pflowstats VNET(pflowstats) +VNET_DEFINE(struct pflowstats, pflowstat); +#define V_pflowstats VNET(pflowstat) #define PFLOW_LOCK(_sc) mtx_lock(&(_sc)->sc_lock) #define PFLOW_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_lock) #define PFLOW_ASSERT(_sc) mtx_assert(&(_sc)->sc_lock, MA_OWNED) +SYSCTL_NODE(_net, OID_AUTO, pflow, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "PFLOW"); +SYSCTL_STRUCT(_net_pflow, OID_AUTO, stats, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(pflowstat), pflowstats, + "PFLOW statistics (struct pflowstats, net/if_pflow.h)"); + static void vnet_pflowattach(void) { diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 7aafdf78b296..172ea5324ccb 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -45,6 +45,7 @@ #include #ifdef PF #include +#include #include #endif @@ -181,6 +182,31 @@ pfsync_stats(u_long off, const char *name, int af1 __unused, int proto __unused) #undef p xo_close_container(name); } + +void +pflow_stats(u_long off, const char *name, int af1 __unused, int proto __unused) +{ + struct pflowstats pflowstat; + + if (fetch_stats("net.pflow.stats", off, &pflowstat, + sizeof(pflowstat), kread) != 0) + return; + + xo_emit("{T:/%s}:\n", name); + xo_open_container(name); + +#define p(f, m) if (pflowstat.f || sflag <= 1) \ + xo_emit(m, (uintmax_t)pflowstat.f, plural(pflowstat.f)) + + p(pflow_flows, "\t{:flows/%ju} {N:/flow%s sent}\n"); + p(pflow_packets, "\t{:packets/%ju} {N:/packet%s sent}\n"); + p(pflow_onomem, "\t{:nomem/%ju} " + "{N:/send failed due to mbuf memory error}\n"); + p(pflow_oerrors, "\t{:send-error/%ju} {N:/send error}\n"); +#undef p + + xo_close_container(name); +} #endif /* PF */ /* diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index b5d8754777cb..2ed6eca4626e 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -116,6 +116,8 @@ static struct protox { #ifdef PF { -1, N_PFSYNCSTATS, 1, NULL, pfsync_stats, NULL, "pfsync", 1, 0 }, + { -1, N_PFLOWSTATS, 1, NULL, + pflow_stats, NULL, "pflow", 1, 0 }, #endif { -1, N_ARPSTAT, 1, NULL, arp_stats, NULL, "arp", 1, 0 }, diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index fd8171734c97..c41862d9fbdd 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -96,6 +96,7 @@ void igmp_stats(u_long, const char *, int, int); void pim_stats(u_long, const char *, int, int); void carp_stats(u_long, const char *, int, int); void pfsync_stats(u_long, const char *, int, int); +void pflow_stats(u_long, const char *, int, int); #ifdef IPSEC void ipsec_stats(u_long, const char *, int, int); void esp_stats(u_long, const char *, int, int); diff --git a/usr.bin/netstat/nlist_symbols b/usr.bin/netstat/nlist_symbols index 7d7fcdc4c249..30cdd69bc54b 100644 --- a/usr.bin/netstat/nlist_symbols +++ b/usr.bin/netstat/nlist_symbols @@ -31,6 +31,7 @@ all _nws_array all _nws_count all _pfkeystat all _pfsyncstats +all _pflowstats all _pim6stat all _pimstat all _rip6stat From nobody Tue Jan 16 08:51:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjRv1zlNz579j9; Tue, 16 Jan 2024 08:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDjRv0nnSz4Pbn; Tue, 16 Jan 2024 08:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ra6YwMpYKt+WKrvINjCbVi6rsEjqiAiEsdUuQxQeR3M=; b=COCUWgn+iBBY0T23zmERCsRuVmJwXh4Q8bPb0ENGuNIuMJ+DoaBF22jduLKn8wxXq6rkmh YilUQO9H9wZ+9Dd450RiYMl1d2QP9XtT6MgBbJJqLfWd4qRGbnpytmqBbG8pvZK4bsHxBD xAPp6o/unZ6oPBjbaXfTh++XqPIm68owCZqw0Bk9yM0VNSJuT8oLtXK2pYyxMHBJI02eIj nhxaBGre3F3/dyFT1ODBxhx1T+g4EJRCKQHTuZjca+8nClzbbAufd3YvaC8eK8DPBt/p1B M1xw7nYwMDlsdbdzzvL9OAuCq/DM00z/LIoGL3QfyAKHmbvT0XRmvXHhRsJJKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ra6YwMpYKt+WKrvINjCbVi6rsEjqiAiEsdUuQxQeR3M=; b=ltw/bdhtbRl08K0UQnDjhbCczTHgfm8nKGhPe1yf+tnzsWpZirZU6IcYmOezvURJEowitC lT00VUqP6Pbg/uIOlG/YmLWyd0tMUfxkrSfYzGgWnXU0T37Y+2LySvfqAu92VEIBsnuCR9 VY8WKHec3J6dBRDlr+i138VTj3o9f1qNETWuyHRpKkKxqBKpgeS6eTkDF8pEY6UN43Fu/s HirHHobXjWnHh55+YYAl0CicOF8S9/ZvCu8lukqwWHfHcMFBIz+lcvEY7E+HG+dKq+rDM8 OI59p/wr9W0JaIUXc9qrEpb7RUIVRWzqMf6+XmKSkYw4G0p7ofTh1VHa4TGOIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395115; a=rsa-sha256; cv=none; b=rEti1IRG57JpEjMzhaSxXp4ug/4rgWk5U1TYsiP9s+wj6eC337CwLToXWg2hQzh4Xr0oRn DYLhxnoPWQ/vKY45rg5I1bT4uWGsNMjGOkPu4ZCgIcMSY66bQwCEk6iNVPymnWotuBYeWJ ALnk15e064pc0q7uwCeYIfq5fZAtLAWMs48arC1nyOL9nJTLB4cblSaOZdOT+/hp9TMg7t iqNAGTo4bQAEzSv5UJfvepcIdINSzPi7O3rZcFmUF3qeyFjSCb7J7vizJ0lpsC//eFhN9h mNcLNHUSwc+htHVCP4A7SHdiM1qRe0u3RYlKr+YEXi2EgVyWNGWCRmVBYvL3fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjRt6ysBzYsr; Tue, 16 Jan 2024 08:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8pseU075768; Tue, 16 Jan 2024 08:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8psfL075765; Tue, 16 Jan 2024 08:51:54 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:51:54 GMT Message-Id: <202401160851.40G8psfL075765@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: baf9b6d04205 - main - pf: allow pflow to be activated per rule List-Id: Commit messages for the main 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: baf9b6d04205e02e6248377b1e13b33059a35fc9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=baf9b6d04205e02e6248377b1e13b33059a35fc9 commit baf9b6d04205e02e6248377b1e13b33059a35fc9 Author: Kristof Provost AuthorDate: 2023-12-01 13:55:50 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:54 +0000 pf: allow pflow to be activated per rule Only generate ipfix/netflow reports (through pflow) for the rules where this is enabled. Reports can also be enabled globally through 'set state-default pflow'. Obtained from: OpenBSD Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43108 --- sbin/pfctl/parse.y | 22 ++++++++++++++++++++-- sbin/pfctl/pf_print_state.c | 2 ++ sbin/pfctl/pfctl_parser.c | 8 ++++++++ share/man/man5/pf.conf.5 | 9 +++++++-- sys/net/pflow.h | 1 - sys/net/pfvar.h | 3 +++ sys/netpfil/pf/pf.c | 5 +++++ sys/netpfil/pf/pf.h | 3 ++- sys/netpfil/pf/pf_ioctl.c | 1 + sys/netpfil/pf/pflow.c | 35 +++++++++++++++++++---------------- 10 files changed, 67 insertions(+), 22 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 17227b674814..94b7e241cd25 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -172,7 +172,8 @@ enum { PF_STATE_OPT_MAX, PF_STATE_OPT_NOSYNC, PF_STATE_OPT_SRCTRACK, PF_STATE_OPT_MAX_SRC_STATES, PF_STATE_OPT_MAX_SRC_CONN, PF_STATE_OPT_MAX_SRC_CONN_RATE, PF_STATE_OPT_MAX_SRC_NODES, PF_STATE_OPT_OVERLOAD, PF_STATE_OPT_STATELOCK, - PF_STATE_OPT_TIMEOUT, PF_STATE_OPT_SLOPPY, }; + PF_STATE_OPT_TIMEOUT, PF_STATE_OPT_SLOPPY, + PF_STATE_OPT_PFLOW }; enum { PF_SRCTRACK_NONE, PF_SRCTRACK, PF_SRCTRACK_GLOBAL, PF_SRCTRACK_RULE }; @@ -512,7 +513,7 @@ int parseport(char *, struct range *r, int); %token DNPIPE DNQUEUE RIDENTIFIER %token LOAD RULESET_OPTIMIZATION PRIO %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE -%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY +%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS %token DIVERTTO DIVERTREPLY BRIDGE_TO %token STRING @@ -2615,6 +2616,14 @@ pfrule : action dir logquick interface route af proto fromto } r.rule_flag |= PFRULE_STATESLOPPY; break; + case PF_STATE_OPT_PFLOW: + if (r.rule_flag & PFRULE_PFLOW) { + yyerror("state pflow option: " + "multiple definitions"); + YYERROR; + } + r.rule_flag |= PFRULE_PFLOW; + break; case PF_STATE_OPT_TIMEOUT: if (o->data.timeout.number == PFTM_ADAPTIVE_START || @@ -4368,6 +4377,14 @@ state_opt_item : MAXIMUM NUMBER { $$->next = NULL; $$->tail = $$; } + | PFLOW { + $$ = calloc(1, sizeof(struct node_state_opt)); + if ($$ == NULL) + err(1, "state_opt_item: calloc"); + $$->type = PF_STATE_OPT_PFLOW; + $$->next = NULL; + $$->tail = $$; + } | STRING NUMBER { int i; @@ -6318,6 +6335,7 @@ lookup(char *s) { "out", OUT}, { "overload", OVERLOAD}, { "pass", PASS}, + { "pflow", PFLOW}, { "port", PORT}, { "prio", PRIO}, { "priority", PRIORITY}, diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index 36c2103a2142..0b862273fab3 100644 --- a/sbin/pfctl/pf_print_state.c +++ b/sbin/pfctl/pf_print_state.c @@ -376,6 +376,8 @@ print_state(struct pfctl_state *s, int opts) printf(", sloppy"); if (s->state_flags & PFSTATE_NOSYNC) printf(", no-sync"); + if (s->state_flags & PFSTATE_PFLOW) + printf(", pflow"); if (s->state_flags & PFSTATE_ACK) printf(", psync-ack"); if (s->state_flags & PFSTATE_NODF) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 7dc0c3ae0cf2..e71b7b160495 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1051,6 +1051,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer opts = 1; if (r->rule_flag & PFRULE_STATESLOPPY) opts = 1; + if (r->rule_flag & PFRULE_PFLOW) + opts = 1; for (i = 0; !opts && i < PFTM_MAX; ++i) if (r->timeout[i]) opts = 1; @@ -1123,6 +1125,12 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf("sloppy"); opts = 0; } + if (r->rule_flag & PFRULE_PFLOW) { + if (!opts) + printf(", "); + printf("pflow"); + opts = 0; + } for (i = 0; i < PFTM_MAX; ++i) if (r->timeout[i]) { int j; diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 3193c18760c8..9803d96bc5d9 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 17, 2023 +.Dd December 6, 2023 .Dt PF.CONF 5 .Os .Sh NAME @@ -2429,6 +2429,10 @@ easier. This is intended to be used in situations where one does not see all packets of a connection, e.g. in asymmetric routing situations. Cannot be used with modulate or synproxy state. +.It Ar pflow +States created by this rule are exported on the +.Xr pflow 4 +interface. .El .Pp Multiple options can be specified, separated by commas: @@ -3345,7 +3349,7 @@ state-opt = ( "max" number | "no-sync" | timeout | "sloppy" | "max-src-conn" number | "max-src-conn-rate" number "/" number | "overload" "\*(Lt" string "\*(Gt" [ "flush" ] | - "if-bound" | "floating" ) + "if-bound" | "floating" | "pflow" ) fragmentation = [ "fragment reassemble" ] @@ -3406,6 +3410,7 @@ Service name database. .Xr ip 4 , .Xr ip6 4 , .Xr pf 4 , +.Xr pflow 4 , .Xr pfsync 4 , .Xr tcp 4 , .Xr sctp 4 , diff --git a/sys/net/pflow.h b/sys/net/pflow.h index fcf24e091b57..2b7dfe24b5fc 100644 --- a/sys/net/pflow.h +++ b/sys/net/pflow.h @@ -326,7 +326,6 @@ enum pflow_set_type_t { }; #ifdef _KERNEL -int export_pflow(struct pf_kstate *); int pflow_sysctl(int *, u_int, void *, size_t *, void *, size_t); #endif /* _KERNEL */ diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index d6852244ce9b..037286a756be 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1186,6 +1186,7 @@ typedef void pfsync_delete_state_t(struct pf_kstate *); typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_kstate *, struct mbuf *); typedef void pfsync_detach_ifnet_t(struct ifnet *); +typedef void pflow_export_state_t(const struct pf_kstate *); VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); #define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) @@ -1199,6 +1200,8 @@ VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_states_ptr); #define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); #define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) +VNET_DECLARE(pflow_export_state_t *, pflow_export_state_ptr); +#define V_pflow_export_state_ptr VNET(pflow_export_state_ptr) extern pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; void pfsync_state_export(union pfsync_state_union *, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index df93cc1bebc3..7eaac809e487 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1397,6 +1397,9 @@ pf_detach_state(struct pf_kstate *s) pf_sctp_multihome_detach_addr(s); + if ((s->state_flags & PFSTATE_PFLOW) && V_pflow_export_state_ptr) + V_pflow_export_state_ptr(s); + if (sks != NULL) { kh = &V_pf_keyhash[pf_hashkey(sks)]; PF_HASHROW_LOCK(kh); @@ -4872,6 +4875,8 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, s->state_flags |= PFSTATE_SLOPPY; if (pd->flags & PFDESC_TCP_NORM) /* Set by old-style scrub rules */ s->state_flags |= PFSTATE_SCRUB_TCP; + if (r->rule_flag & PFRULE_PFLOW) + s->state_flags |= PFSTATE_PFLOW; s->act.log = pd->act.log & PF_LOG_ALL; s->sync_state = PFSYNC_S_NONE; diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index dd9796b59ce9..d5ab4f03a96d 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -614,6 +614,7 @@ struct pf_rule { #define PFRULE_SET_TOS 0x00002000 #define PFRULE_IFBOUND 0x00010000 /* if-bound */ #define PFRULE_STATESLOPPY 0x00020000 /* sloppy state tracking */ +#define PFRULE_PFLOW 0x00040000 #ifdef _KERNEL #define PFRULE_REFS 0x0080 /* rule has references */ @@ -626,7 +627,7 @@ struct pf_rule { /* pf_state->state_flags, pf_rule_actions->flags, pf_krule->scrub_flags */ #define PFSTATE_ALLOWOPTS 0x0001 #define PFSTATE_SLOPPY 0x0002 -/* was PFSTATE_PFLOW 0x0004 */ +#define PFSTATE_PFLOW 0x0004 #define PFSTATE_NOSYNC 0x0008 #define PFSTATE_ACK 0x0010 #define PFSTATE_NODF 0x0020 diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index e09b7b71920e..956d954d652c 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -304,6 +304,7 @@ VNET_DEFINE(pfsync_update_state_t *, pfsync_update_state_ptr); VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); +VNET_DEFINE(pflow_export_state_t *, pflow_export_state_ptr); pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; /* pflog */ diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c index 2dc612bd9e07..a2699240fbc8 100644 --- a/sys/netpfil/pf/pflow.c +++ b/sys/netpfil/pf/pflow.c @@ -87,18 +87,19 @@ static void pflow_timeout(void *); static void pflow_timeout6(void *); static void pflow_timeout_tmpl(void *); static void copy_flow_data(struct pflow_flow *, struct pflow_flow *, - struct pf_kstate *, struct pf_state_key *, int, int); + const struct pf_kstate *, struct pf_state_key *, int, int); static void copy_flow_ipfix_4_data(struct pflow_ipfix_flow4 *, - struct pflow_ipfix_flow4 *, struct pf_kstate *, struct pf_state_key *, + struct pflow_ipfix_flow4 *, const struct pf_kstate *, struct pf_state_key *, struct pflow_softc *, int, int); static void copy_flow_ipfix_6_data(struct pflow_ipfix_flow6 *, - struct pflow_ipfix_flow6 *, struct pf_kstate *, struct pf_state_key *, + struct pflow_ipfix_flow6 *, const struct pf_kstate *, struct pf_state_key *, struct pflow_softc *, int, int); -static int pflow_pack_flow(struct pf_kstate *, struct pf_state_key *, +static int pflow_pack_flow(const struct pf_kstate *, struct pf_state_key *, struct pflow_softc *); -static int pflow_pack_flow_ipfix(struct pf_kstate *, struct pf_state_key *, +static int pflow_pack_flow_ipfix(const struct pf_kstate *, struct pf_state_key *, struct pflow_softc *); -static int export_pflow_if(struct pf_kstate*, struct pf_state_key *, +static void export_pflow(const struct pf_kstate *); +static int export_pflow_if(const struct pf_kstate*, struct pf_state_key *, struct pflow_softc *); static int copy_flow_to_m(struct pflow_flow *flow, struct pflow_softc *sc); static int copy_flow_ipfix_4_to_m(struct pflow_ipfix_flow4 *flow, @@ -323,6 +324,8 @@ pflow_create(int unit) CK_LIST_INSERT_HEAD(&V_pflowif_list, pflowif, sc_next); mtx_unlock(&V_pflowif_list_mtx); + V_pflow_export_state_ptr = export_pflow; + return (0); } @@ -352,6 +355,8 @@ pflow_destroy(int unit, bool drain) return (ENOENT); } CK_LIST_REMOVE(sc, sc_next); + if (CK_LIST_EMPTY(&V_pflowif_list)) + V_pflow_export_state_ptr = NULL; mtx_unlock(&V_pflowif_list_mtx); sc->sc_dying = 1; @@ -511,7 +516,7 @@ pflow_get_mbuf(struct pflow_softc *sc, u_int16_t set_id) static void copy_flow_data(struct pflow_flow *flow1, struct pflow_flow *flow2, - struct pf_kstate *st, struct pf_state_key *sk, int src, int dst) + const struct pf_kstate *st, struct pf_state_key *sk, int src, int dst) { flow1->src_ip = flow2->dest_ip = sk->addr[src].v4.s_addr; flow1->src_port = flow2->dest_port = sk->port[src]; @@ -548,7 +553,7 @@ copy_flow_data(struct pflow_flow *flow1, struct pflow_flow *flow2, static void copy_flow_ipfix_4_data(struct pflow_ipfix_flow4 *flow1, - struct pflow_ipfix_flow4 *flow2, struct pf_kstate *st, + struct pflow_ipfix_flow4 *flow2, const struct pf_kstate *st, struct pf_state_key *sk, struct pflow_softc *sc, int src, int dst) { flow1->src_ip = flow2->dest_ip = sk->addr[src].v4.s_addr; @@ -585,7 +590,7 @@ copy_flow_ipfix_4_data(struct pflow_ipfix_flow4 *flow1, static void copy_flow_ipfix_6_data(struct pflow_ipfix_flow6 *flow1, - struct pflow_ipfix_flow6 *flow2, struct pf_kstate *st, + struct pflow_ipfix_flow6 *flow2, const struct pf_kstate *st, struct pf_state_key *sk, struct pflow_softc *sc, int src, int dst) { bcopy(&sk->addr[src].v6, &flow1->src_ip, sizeof(flow1->src_ip)); @@ -622,8 +627,8 @@ copy_flow_ipfix_6_data(struct pflow_ipfix_flow6 *flow1, flow1->tos = flow2->tos = st->rule.ptr->tos; } -int -export_pflow(struct pf_kstate *st) +static void +export_pflow(const struct pf_kstate *st) { struct pflow_softc *sc = NULL; struct pf_state_key *sk; @@ -648,12 +653,10 @@ export_pflow(struct pf_kstate *st) } PFLOW_UNLOCK(sc); } - - return (0); } static int -export_pflow_if(struct pf_kstate *st, struct pf_state_key *sk, +export_pflow_if(const struct pf_kstate *st, struct pf_state_key *sk, struct pflow_softc *sc) { struct pf_kstate pfs_copy; @@ -787,7 +790,7 @@ copy_flow_ipfix_6_to_m(struct pflow_ipfix_flow6 *flow, struct pflow_softc *sc) } static int -pflow_pack_flow(struct pf_kstate *st, struct pf_state_key *sk, +pflow_pack_flow(const struct pf_kstate *st, struct pf_state_key *sk, struct pflow_softc *sc) { struct pflow_flow flow1; @@ -812,7 +815,7 @@ pflow_pack_flow(struct pf_kstate *st, struct pf_state_key *sk, } static int -pflow_pack_flow_ipfix(struct pf_kstate *st, struct pf_state_key *sk, +pflow_pack_flow_ipfix(const struct pf_kstate *st, struct pf_state_key *sk, struct pflow_softc *sc) { struct pflow_ipfix_flow4 flow4_1, flow4_2; From nobody Tue Jan 16 08:51:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjRw3KCJz57B4Z; Tue, 16 Jan 2024 08:51: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 4TDjRw1vPlz4Pv6; Tue, 16 Jan 2024 08:51:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ttw//nj/kE/iM5IfW0cxUVwggkB4M5Yu5ELwRiktpGE=; b=ASWOwD/s1FO7GZF5fuSJlHj/0wTEryarHwrNgi14vs0ouKW8DnAd1mSQmxvgs9OaBmwzgq mhTCEYWyb1Bi2Wp8a/pix9r6SWEXMjZnY1MKnHWWIjMGC8EYMZmuyFKDCZ6gqi8wNNLOoc ztWRJZ7XSaLlbomePXu7SXUKJXw7cRpv5tnKe3DfNdrOvTUzsEu+Zlw3Ef0DrTSMGqq1Hi HXZtHVfLL6LvmcyXnx1lP7Iahc8kv8n99+Dmz76OXopzPLUeNwmCwvFVHLRRrkS24N0qob hvo/dSheCneTSrUy9bVlxHt9zXCkIJJAswINskXKCbFBL9F8Zgyb7U7lSqSsxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ttw//nj/kE/iM5IfW0cxUVwggkB4M5Yu5ELwRiktpGE=; b=TBuj1sFTflskiipIBfAN8QtHXTGaREicbac35b2iAPLe7RmchQhoCJ4OIyy4F4Q4hBZdPI kUslwpRgw3tGQBRPyL974Paahu0VH2NhxrSO6qnPmSNenZUzy8pk6+9yB2SFQntXbAGkn0 qi/Zti3+IyDxHtONHDH1RHbUTUD/9pGcf41qH6EPJbYrDygj9W3JQak01zpHMTZAHcedcN EBwA7ErUrV9obCnYXIiyH1XDWViqfjYJW8D24bvZCDT4r3Z+c4YWN6wdta2hyyGsSVHnV+ dYaV6Dj1RDra9VJtCfV0PuhLSqUUuMU/GxDFUDRFRb5LQ4DMwKW+CAYyHPfOkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395116; a=rsa-sha256; cv=none; b=OzmLcme77PD0OquFeWbGhB2poRv6EafFLd/nf9ftLseZmJIUW5LiyCtY+DUj8v5SpZ7Aph J+E6vTg8mJfQAi81hlZma+tPW24B6END81hRKSxABoLQfgq+B/wV9ixcGrF/zpoWcIELdL 8H6zE45xIkunbBZMJ1XzTfdoYzOahzXfc2tQ8LNyahy3HjMXMUSjV9EclXQ9v38d37tlvE QyvhglM+iaGY/Gc0CVz29p2/n62ITpUW0a5vo7fTF5IJyyc5NemqNgNYp2NGvuBZXGVDFb qxw4Hdp7hTRfKwHOXuAlOOdn2xYzbEMW35NOFinv11SDFd6rzQyXkkWyh/lqAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjRw0SFyzZ6f; Tue, 16 Jan 2024 08:51:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8ptnL076254; Tue, 16 Jan 2024 08:51:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8ptsL076236; Tue, 16 Jan 2024 08:51:55 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:51:55 GMT Message-Id: <202401160851.40G8ptsL076236@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: fb0c74685f5f - main - pf tests: initial pflow test case List-Id: Commit messages for the main 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: fb0c74685f5f57f148a4628efc1fd3784a597819 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fb0c74685f5f57f148a4628efc1fd3784a597819 commit fb0c74685f5f57f148a4628efc1fd3784a597819 Author: Kristof Provost AuthorDate: 2023-12-01 17:04:00 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:54 +0000 pf tests: initial pflow test case Basic creation, validation and cleanup test for the new pflow interface. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43109 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/pflow.sh | 80 +++++++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/utils.subr | 9 +++++ 3 files changed, 90 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 5f18d7c5da35..a1a40cf4d8f4 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -25,6 +25,7 @@ ATF_TESTS_SH+= altq \ nat \ pass_block \ pflog \ + pflow \ pfsync \ prio \ proxy \ diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh new file mode 100644 index 000000000000..3ae4fedf3a93 --- /dev/null +++ b/tests/sys/netpfil/pf/pflow.sh @@ -0,0 +1,80 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic pflow test' + atf_set require.user root +} + +basic_body() +{ + pflow_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + pflow=$(jexec alcatraz pflowctl -c) + + # Reject invalid flow destinations + atf_check -s exit:1 -e ignore \ + jexec alcatraz pflowctl -s ${pflow} dst 256.0.0.1:4000 + atf_check -s exit:1 -e ignore \ + jexec alcatraz pflowctl -s ${pflow} dst 192.0.0.2:400000 + + # A valid destination is accepted + atf_check -s exit:0 \ + jexec alcatraz pflowctl -s ${pflow} dst 192.0.2.2:4000 + + # Reject invalid version numbers + atf_check -s exit:1 -e ignore \ + jexec alcatraz pflowctl -s ${pflow} proto 9 + + # Valid version passes + atf_check -s exit:0 \ + jexec alcatraz pflowctl -s ${pflow} proto 5 + atf_check -s exit:0 \ + jexec alcatraz pflowctl -s ${pflow} proto 10 +} + +basic_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index 74ed07984601..25720c1bcb66 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -88,6 +88,15 @@ pflog_init() fi } +pflow_init() +{ + pft_init + + if ! kldstat -q -m pflow; then + atf_skip "This test requires pflow" + fi +} + dummynet_init() { pft_init From nobody Tue Jan 16 08:51:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjRx3YvSz579SJ; Tue, 16 Jan 2024 08:51: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 4TDjRx2L71z4PvK; Tue, 16 Jan 2024 08:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/rr+LoXzKS+5qw8LEDDFBzjF+2mU75Xwabjggf4b3Ww=; b=HYF+nzZ0AZA6h573Ygy4nPT9GbWKcrFqlXYcX8vKqUmyRZmq/qFqch4t3iSt4FuUQ5nG1u Vqw44tMliZCoXqzp+Cqop7gem6avygx5d04ubIo0vSwChneXHZJxQvV2pWfcQ6QB5LB9Lt eju/CrgrybH6XOK7bVgHrhcOQkDHq/YdHMMzb6MI7Om4n1KeaouNLPk3E4p7E090H1Hcze RMG+kaq/re0KifcVJQ1ohaZRg/44Erhg6r8BchC+YbfRiqrmpiF5+hi0aD9lAt4lb/Jahk QufJ6CER/Fvv6TnAO5JXVB9LjyYUx13ptxaatOnF06QSKZ+/fa8zsAzKvWigrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/rr+LoXzKS+5qw8LEDDFBzjF+2mU75Xwabjggf4b3Ww=; b=FaMio4NjfZDU8SAtMSzBbi3h3uw8ooSZm0MZpdcthIxXecXS6Q0oqfuJ310ajYB8y8wHyR NrnyTjL0edqfzFNF2XQE9s6yrAJgwjG5l7Q1rDkS/jKilzyytvzc7L5sI4QtawYpP4KxW4 uCVepShK1WcSDTRF3AjIJqDSLdcmcv6ROxs54nGByC0Swva3TM1erb2UDqMWMbNJiMXEMG sus5xAHLa5pBM5i0s9W0pd+NRYwmnO2rRKvMZhxuLPZHg6gHmmxKoN9CwWT19RGVdsM7Vy CabzpnpK8fvER4JA7xln1a5qjsTZbiLl8IwnHrFJhthsdhubp4cENvWDtyb5QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395117; a=rsa-sha256; cv=none; b=FUcP8BNtoc8qXrsHYJC+7jiQJQVzSrK87WMifpraGzVz100Z4olKGzN5643X7Uv1uWmQQB NVpzOhoCDUjSdXRyy0+Esj8UZOTD+C7Av1NLB52lxybAP/HoGPVSzc0CGBkFf9y2J8FReo KVgZfiE7D6WgtHlzZzqToAw3KNuCxSDwWjxG+NlhH2IcKiXdFa8SrDaLzL1hJv6Rn4UaIg u0GlLByJmkF0zj0PNuayRqRnKITOu7kEQaxryyNnE8bUTGM8wubb680X1A8Mn2l1DGIndt RVGeLC4i828apuZFA4+kBBwITEyyOrr80oVyBgAuPc9UixeMeUUFDZfS+N9dDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjRx1RlZzYvj; Tue, 16 Jan 2024 08:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8pvgf077090; Tue, 16 Jan 2024 08:51:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8pvWZ077087; Tue, 16 Jan 2024 08:51:57 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:51:57 GMT Message-Id: <202401160851.40G8pvWZ077087@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: 7ec34ebe181d - main - pfctl tests: basic pflow parser test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 7ec34ebe181db611682eb5cf2343b98ee5c00e1d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7ec34ebe181db611682eb5cf2343b98ee5c00e1d commit 7ec34ebe181db611682eb5cf2343b98ee5c00e1d Author: Kristof Provost AuthorDate: 2023-12-01 17:22:39 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:54 +0000 pfctl tests: basic pflow parser test Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43110 --- sbin/pfctl/tests/files/pf1019.in | 1 + sbin/pfctl/tests/files/pf1019.ok | 1 + sbin/pfctl/tests/pfctl_test_list.inc | 1 + 3 files changed, 3 insertions(+) diff --git a/sbin/pfctl/tests/files/pf1019.in b/sbin/pfctl/tests/files/pf1019.in new file mode 100644 index 000000000000..04a770768714 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1019.in @@ -0,0 +1 @@ +pass in keep state (pflow) diff --git a/sbin/pfctl/tests/files/pf1019.ok b/sbin/pfctl/tests/files/pf1019.ok new file mode 100644 index 000000000000..e865d57da16c --- /dev/null +++ b/sbin/pfctl/tests/files/pf1019.ok @@ -0,0 +1 @@ +pass in all flags S/SA keep state (pflow) diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 4a63c0ba48b7..2dcee80b6e93 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -127,3 +127,4 @@ PFCTL_TEST(1015, "Ethernet rule with several labels") PFCTL_TEST(1016, "Ethernet rule with ridentifier and one label") PFCTL_TEST(1017, "Ethernet rule with ridentifier and several labels") PFCTL_TEST(1018, "Test dynamic address mask") +PFCTL_TEST(1019, "Test pflow option") From nobody Tue Jan 16 08:51:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjRy5Qzyz57B4g; Tue, 16 Jan 2024 08:51: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 4TDjRy3Kmgz4Q1X; Tue, 16 Jan 2024 08:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9NG1rSJ9aalxtDXSOKCyb18tr5EMt0LOmi9BmhY1hfg=; b=bvpqeqDewKQLrphKVcFeGimsSEnws4DQwWsnHTKK6SwL/ISGUKFZGeMNn4k12J4DFCCRJQ S+FZpxrq/ryGVHopTkqb/JYO6w+Fk+exPhYT1z9Yw5sgReeWtK8tUtAKk+AOvZOWOnKPJe 9CK3c4pYhEmreRoCRp+DgpiRTseu41p9seCB6PdHAmgI5AT9q4xKaVLT8O0zTqqzP5cMv7 sJoZCIrOyNI/+Vi6HZHHr9E5UZwlYkP92NxiuTOp0ES5ECr7DX5SSdg1+hPBe7Gbibr8iz ouQ2SdyzihqSkLMHwNAZaVckqroDUVvWu2LwC061Aw27w2fWjRU1Du7ORslUqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9NG1rSJ9aalxtDXSOKCyb18tr5EMt0LOmi9BmhY1hfg=; b=GIwmM+EIAOILqQrRSmmIqnpBxuYZAOFqVNJqUt7yx8MEtZ7Po3rvd4inktJ0Qy5Vd9NBH3 GJsigdpJpGnrCwJKlpSU/n4KPLHZzWOtHxAC3UZCGRMEICrBsk5nxSZPazmqt4YQWW/vsz RD0kwyUCUjdLYZtUgOpLXYEO+IiYzn7mciNQmmjCU6LRpARHNb/kcMpu2Xw0O2Bx3rimku IwgixDk9vKrWf/VgqtbYn7IwnY55FBsBxAVCFXnF66HCr7gXfVJ0BGr9iq+N9qoZcVOEqA I43hWj3tuv4yODUKON3Sj8pNSNRafIgLmuodREx7GipKyoVEX0n5PBf2dvPoOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395118; a=rsa-sha256; cv=none; b=q9h727G/6jaIXhGU4Jbaw5P7wG+PMrnl/joTqck7i7O5fVD3rNUSbLL3hB0dM+FJ8UkYXk 46ccCF8f9JJyp5WPZtshJggdU18FTRaPsefRtscoIcyJpurdr8omgsbe1NXLvfQA0yXpo5 SmoIxEMHvaYFEO7Gw7/n0ls67gzhcW3ws0GnRb9oxqbUDpUeFPzPF/qRaoi14ovI4hyY7B G4Awsk0xihFXFprCMaZhGaveJH+F9kVSEVEc1Efq+BLymrgcvTDhkbWJ6x67roprlMlqOq +6Kj5oHgcuSic42hA/FcdnqQ71HbulvJRmurm+GibxNwc0/QxEL/6O6nIG8Ncg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjRy29VQzYS2; Tue, 16 Jan 2024 08:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8pwic077132; Tue, 16 Jan 2024 08:51:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8pwpO077129; Tue, 16 Jan 2024 08:51:58 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:51:58 GMT Message-Id: <202401160851.40G8pwpO077129@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: 6bd36d1cf4e9 - main - pf tests: pflow functionality test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 6bd36d1cf4e98f11661642331fddb5d30dced68d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6bd36d1cf4e98f11661642331fddb5d30dced68d commit 6bd36d1cf4e98f11661642331fddb5d30dced68d Author: Kristof Provost AuthorDate: 2023-12-04 15:11:35 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:54 +0000 pf tests: pflow functionality test Test that we actually send netflow messages when configured to do so. We do not yet inspect the generated netflow messages. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43111 --- tests/sys/netpfil/pf/Makefile | 2 + tests/sys/netpfil/pf/pflow.sh | 62 +++++++++++++++++++++++++++ tests/sys/netpfil/pf/pft_read_ipfix.py | 78 ++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index a1a40cf4d8f4..f1a2fff5a45d 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -63,6 +63,7 @@ ${PACKAGE}FILES+= CVE-2019-5597.py \ frag-overreplace.py \ pfsync_defer.py \ pft_ether.py \ + pft_read_ipfix.py \ utils.subr ${PACKAGE}FILESMODE_CVE-2019-5597.py= 0555 @@ -73,5 +74,6 @@ ${PACKAGE}FILESMODE_frag-overlimit.py= 0555 ${PACKAGE}FILESMODE_frag-overreplace.py= 0555 ${PACKAGE}FILESMODE_pfsync_defer.py= 0555 ${PACKAGE}FILESMODE_pft_ether.py= 0555 +${PACKAGE}FILESMODE_pft_read_ipfix.py= 0555 .include diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh index 3ae4fedf3a93..73e041fca693 100644 --- a/tests/sys/netpfil/pf/pflow.sh +++ b/tests/sys/netpfil/pf/pflow.sh @@ -74,7 +74,69 @@ basic_cleanup() pft_cleanup } +atf_test_case "state_defaults" "cleanup" +state_defaults_head() +{ + atf_set descr 'Test set state-defaults pflow' + atf_set require.user root + atf_set require.progs scapy +} + +state_defaults_body() +{ + pflow_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "pass" + + pflow=$(jexec alcatraz pflowctl -c) + jexec alcatraz pflowctl -s ${pflow} dst 192.0.2.2:2055 + + # No flow data is generated because no states are marked for it. + ping -c 1 192.0.2.1 + # Flush states to force pflow creation + jexec alcatraz pfctl -Fstates + + atf_check -o match:"No data" \ + $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 + + # Expect pflow output with state-defaults pflow + pft_set_rules alcatraz \ + "set state-defaults pflow" \ + "pass" + + ping -c 1 192.0.2.1 + + # We default to version 5 + atf_check -o match:"^v=5.*" \ + $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 + + # Switch to version 10 + jexec alcatraz pflowctl -s ${pflow} proto 10 + + ping -c 1 192.0.2.1 + + atf_check -o match:"^v=10.*" \ + $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 +} + +state_defaults_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" + atf_add_test_case "state_defaults" } diff --git a/tests/sys/netpfil/pf/pft_read_ipfix.py b/tests/sys/netpfil/pf/pft_read_ipfix.py new file mode 100644 index 000000000000..64d4fcb3c523 --- /dev/null +++ b/tests/sys/netpfil/pf/pft_read_ipfix.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright © 2023. Rubicon Communications, LLC (Netgate). 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 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. +# + +import argparse +import logging +logging.getLogger("scapy").setLevel(logging.CRITICAL) +import scapy.all as sp + +def receive(recvif, recvport): + pkts = sp.sniff(iface=recvif, timeout=65) + + if len(pkts) == 0: + print("No data") + return + + for pkt in pkts: + udp = pkt.getlayer(sp.UDP) + if not udp: + continue + + if udp.dport != recvport: + continue + + hdr = pkt.getlayer(sp.NetflowHeader) + + if hdr.version == 5: + v5hdr = pkt.getlayer(sp.NetflowHeaderV5) + out="" + for i in range(1, v5hdr.count + 1): + r = pkt.getlayer(sp.NetflowRecordV5, nb=i) + out = "%s,proto=%d,src=%s,dst=%s,srcport=%d,dstport=%d" % (out, r.prot, r.src, r.dst, r.srcport, r.dstport) + print("v=%d,count=%d%s" % (hdr.version, v5hdr.count, out)) + elif hdr.version == 10: + print("v=10") + return + +def main(): + parser = argparse.ArgumentParser("pft_read_ipfix.py", + description="IPFix test tool") + parser.add_argument('--recvif', nargs=1, + required=True, + help='The interface on which to look for packets') + parser.add_argument('--port', nargs=1, + required=True, + help='The port number') + + args = parser.parse_args() + + receive(args.recvif[0], int(args.port[0])) + +if __name__ == '__main__': + main() + From nobody Tue Jan 16 08:51:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjRz5Hyfz57B4h; Tue, 16 Jan 2024 08:51: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 4TDjRz41HMz4Q1t; Tue, 16 Jan 2024 08:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TcTxjN2P+pY9ZqbN09eW/Lll9aUFf4rr9kwBIDDi9oU=; b=lGq8GJGXPG6C0k2oCV7SsRYO+0qC9oYwCn5pyrnA/Wkg/YO1/e9/14xJCQ3YoiacKJ2BYA v3Bh0g4SUQ93WXHw603zyFyBaL7DfajlqDtI2KpDfpdWe6G8bNUEOFxal/qZndBJmrP7TK 7Bk2naE4IQm43pDITfT3WZaRH8gKmH5yHdONRt/Dm5PAMcAUArRTMuufJOVygYD9n62ySS r4bwtVUI0F0Sxyk4wWdZuyQbZ3FQzwMsdodl0vYIXlUscNR9w70k0dGao4dguhRQJEYOGG qVfqJCTOUJEjdAZFnl6DyqExxbOPmHiREz1ttmrFExAjha2qL5SZrAQUwoFLAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TcTxjN2P+pY9ZqbN09eW/Lll9aUFf4rr9kwBIDDi9oU=; b=nKvb52gMUxhrqVPUG3938ZVgWhlRRylFahAo8ywooKDtups2eYxJ5I9TqYuki11cZ7xzKX Zp55ns4ZnS62d52Tm2WK4tWccrVSeSzeUELLKwxqP8j+uhL6KpXES3QFaXC/yP2kna7rSA Vbizhrgrm80v87wO5h/B7jxx5oPsyvtpCuMfO7yRIR4nheGNcfEybHnmVc5VEgmo668M7M Zi4QzpEznsF2mOh6o89aROvPB7OVBZ4fDOpcUPIgkLBwzSCrKnmFvcLPISDdXKXin1DNuB xhWUNPOKyy+jbIB7AK7JsKyBchXOmYvzrnGMnNvJGq9jmZnTSl07fwvCHYZDUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395119; a=rsa-sha256; cv=none; b=RSek6lscH76Vc2eyg+lsR3UGNlFEUIR8F+PgsGQnJrSq6616EG7ryRhDOIL/vU8p9kcudj MPcSs9D4v28W/4LMjS+LXTGoZli7cG3k83UT5L3tRcDC2WSmh/9+mHImxmbRQVq3zpI3lh holEPICzb+hAmpmJ0gNmlur1IlK9uV9YIMqWCbE2jZfnD82EdXxhAkTvYmsNiEd3zljmCJ 4Iae4URjzFVC5RPbY+A46rQ2Gmm4DYKXSJAnaMC3P7XXpXdpQDeaiN7tKcmDParP1tGELy QGQsh7xvb+ivFNT+pyKzpwKVyiIHY5yCJ82KR6xRP7RgJuDBlJ6BYJVhs/8uvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjRz36klzYvl; Tue, 16 Jan 2024 08:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8px7T077184; Tue, 16 Jan 2024 08:51:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8px3w077181; Tue, 16 Jan 2024 08:51:59 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:51:59 GMT Message-Id: <202401160851.40G8px3w077181@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: 0493260115db - main - pf: store state creation/expiration timestamps with milisecond precision List-Id: Commit messages for the main 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: 0493260115db10164246762d6d4923880575e529 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0493260115db10164246762d6d4923880575e529 commit 0493260115db10164246762d6d4923880575e529 Author: Kristof Provost AuthorDate: 2023-12-07 13:35:11 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:54 +0000 pf: store state creation/expiration timestamps with milisecond precision The primary beneficiary is pflow(4), which expects milisecond precision in timestamps. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43112 --- sys/net/pfvar.h | 20 ++++++++++++++++++-- sys/netpfil/pf/if_pfsync.c | 10 +++++----- sys/netpfil/pf/pf.c | 19 +++++++++---------- sys/netpfil/pf/pf_ioctl.c | 4 ++-- sys/netpfil/pf/pf_nl.c | 2 +- sys/netpfil/pf/pf_norm.c | 2 +- sys/netpfil/pf/pf_nv.c | 2 +- sys/netpfil/pf/pflow.c | 20 ++++++++++---------- 8 files changed, 47 insertions(+), 32 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 037286a756be..f0742c99a4a8 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1061,8 +1061,8 @@ struct pf_kstate { struct pf_ksrc_node *nat_src_node; u_int64_t packets[2]; u_int64_t bytes[2]; - u_int32_t creation; - u_int32_t expire; + u_int64_t creation; + u_int64_t expire; u_int32_t pfsync_time; struct pf_rule_actions act; u_int16_t tag; @@ -2238,6 +2238,22 @@ pf_release_staten(struct pf_kstate *s, u_int n) return (0); } +static __inline uint64_t +pf_get_uptime(void) +{ + struct timeval t; + microuptime(&t); + return ((t.tv_sec * 1000) + (t.tv_usec / 1000)); +} + +static __inline uint64_t +pf_get_time(void) +{ + struct timeval t; + microtime(&t); + return ((t.tv_sec * 1000) + (t.tv_usec / 1000)); +} + extern struct pf_kstate *pf_find_state_byid(uint64_t, uint32_t); extern struct pf_kstate *pf_find_state_all(struct pf_state_key_cmp *, u_int, int *); diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 75c361b394e0..c57a89ea052a 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -611,8 +611,8 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) /* copy to state */ bcopy(&sp->pfs_1301.rt_addr, &st->rt_addr, sizeof(st->rt_addr)); - st->creation = time_uptime - ntohl(sp->pfs_1301.creation); - st->expire = time_uptime; + st->creation = (time_uptime - ntohl(sp->pfs_1301.creation)) * 1000; + st->expire = pf_get_uptime(); if (sp->pfs_1301.expire) { uint32_t timeout; @@ -621,7 +621,7 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) timeout = V_pf_default_rule.timeout[sp->pfs_1301.timeout]; /* sp->expire may have been adaptively scaled by export. */ - st->expire -= timeout - ntohl(sp->pfs_1301.expire); + st->expire -= (timeout - ntohl(sp->pfs_1301.expire)) * 1000; } st->direction = sp->pfs_1301.direction; @@ -1198,7 +1198,7 @@ pfsync_in_upd(struct mbuf *m, int offset, int count, int flags, int action) if (sync < 2) { pfsync_alloc_scrub_memory(&sp->pfs_1301.dst, &st->dst); pf_state_peer_ntoh(&sp->pfs_1301.dst, &st->dst); - st->expire = time_uptime; + st->expire = pf_get_uptime(); st->timeout = sp->pfs_1301.timeout; } st->pfsync_time = time_uptime; @@ -1285,7 +1285,7 @@ pfsync_in_upd_c(struct mbuf *m, int offset, int count, int flags, int action) if (sync < 2) { pfsync_alloc_scrub_memory(&up->dst, &st->dst); pf_state_peer_ntoh(&up->dst, &st->dst); - st->expire = time_uptime; + st->expire = pf_get_uptime(); st->timeout = up->timeout; } st->pfsync_time = time_uptime; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 7eaac809e487..89f6e000f6cf 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -2037,12 +2037,12 @@ pf_state_expires(const struct pf_kstate *state) if (states < end) { timeout = (u_int64_t)timeout * (end - states) / (end - start); - return (state->expire + timeout); + return ((state->expire / 1000) + timeout); } else return (time_uptime); } - return (state->expire + timeout); + return ((state->expire / 1000) + timeout); } void @@ -4951,8 +4951,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, s->rt = r->rt; } - s->creation = time_uptime; - s->expire = time_uptime; + s->creation = s->expire = pf_get_uptime(); if (sn != NULL) s->src_node = sn; @@ -5426,7 +5425,7 @@ pf_tcp_track_full(struct pf_kstate **state, struct pfi_kkif *kif, pf_set_protostate(*state, PF_PEER_BOTH, TCPS_TIME_WAIT); /* update expire time */ - (*state)->expire = time_uptime; + (*state)->expire = pf_get_uptime(); if (src->state >= TCPS_FIN_WAIT_2 && dst->state >= TCPS_FIN_WAIT_2) (*state)->timeout = PFTM_TCP_CLOSED; @@ -5622,7 +5621,7 @@ pf_tcp_track_sloppy(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reas pf_set_protostate(*state, PF_PEER_BOTH, TCPS_TIME_WAIT); /* update expire time */ - (*state)->expire = time_uptime; + (*state)->expire = pf_get_uptime(); if (src->state >= TCPS_FIN_WAIT_2 && dst->state >= TCPS_FIN_WAIT_2) (*state)->timeout = PFTM_TCP_CLOSED; @@ -5870,7 +5869,7 @@ pf_test_state_udp(struct pf_kstate **state, struct pfi_kkif *kif, pf_set_protostate(*state, pdst, PFUDPS_MULTIPLE); /* update expire time */ - (*state)->expire = time_uptime; + (*state)->expire = pf_get_uptime(); if (src->state == PFUDPS_MULTIPLE && dst->state == PFUDPS_MULTIPLE) (*state)->timeout = PFTM_UDP_MULTIPLE; else @@ -5971,7 +5970,7 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - (*state)->expire = time_uptime; + (*state)->expire = pf_get_uptime(); /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != (*state)->key[PF_SK_STACK]) { @@ -6478,7 +6477,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, STATE_LOOKUP(kif, &key, *state, pd); - (*state)->expire = time_uptime; + (*state)->expire = pf_get_uptime(); (*state)->timeout = PFTM_ICMP_ERROR_REPLY; /* translate source/destination address, if necessary */ @@ -7063,7 +7062,7 @@ pf_test_state_other(struct pf_kstate **state, struct pfi_kkif *kif, pf_set_protostate(*state, pdst, PFOTHERS_MULTIPLE); /* update expire time */ - (*state)->expire = time_uptime; + (*state)->expire = pf_get_uptime(); if (src->state == PFOTHERS_MULTIPLE && dst->state == PFOTHERS_MULTIPLE) (*state)->timeout = PFTM_OTHER_MULTIPLE; else diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 956d954d652c..20e0b902bd60 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -5483,7 +5483,7 @@ pfsync_state_export(union pfsync_state_union *sp, struct pf_kstate *st, int msg_ /* copy from state */ strlcpy(sp->pfs_1301.ifname, st->kif->pfik_name, sizeof(sp->pfs_1301.ifname)); bcopy(&st->rt_addr, &sp->pfs_1301.rt_addr, sizeof(sp->pfs_1301.rt_addr)); - sp->pfs_1301.creation = htonl(time_uptime - st->creation); + sp->pfs_1301.creation = htonl(time_uptime - (st->creation / 1000)); sp->pfs_1301.expire = pf_state_expires(st); if (sp->pfs_1301.expire <= time_uptime) sp->pfs_1301.expire = htonl(0); @@ -5574,7 +5574,7 @@ pf_state_export(struct pf_state_export *sp, struct pf_kstate *st) strlcpy(sp->orig_ifname, st->orig_kif->pfik_name, sizeof(sp->orig_ifname)); bcopy(&st->rt_addr, &sp->rt_addr, sizeof(sp->rt_addr)); - sp->creation = htonl(time_uptime - st->creation); + sp->creation = htonl(time_uptime - (st->creation / 1000)); sp->expire = pf_state_expires(st); if (sp->expire <= time_uptime) sp->expire = htonl(0); diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 23c4249714fe..e74d4773b1e7 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -169,7 +169,7 @@ dump_state(struct nlpcb *nlp, const struct nlmsghdr *hdr, struct pf_kstate *s, nlattr_add_string(nw, PF_ST_IFNAME, s->kif->pfik_name); nlattr_add_string(nw, PF_ST_ORIG_IFNAME, s->orig_kif->pfik_name); dump_addr(nw, PF_ST_RT_ADDR, &s->rt_addr, af); - nlattr_add_u32(nw, PF_ST_CREATION, time_uptime - s->creation); + nlattr_add_u32(nw, PF_ST_CREATION, time_uptime - (s->creation / 1000)); uint32_t expire = pf_state_expires(s); if (expire > time_uptime) expire = expire - time_uptime; diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 3824e7b2f595..f5d1a66f6467 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1745,7 +1745,7 @@ pf_normalize_tcp_stateful(struct mbuf *m, int off, struct pf_pdesc *pd, getmicrouptime(&uptime); if (src->scrub && (src->scrub->pfss_flags & PFSS_PAWS) && (uptime.tv_sec - src->scrub->pfss_last.tv_sec > TS_MAX_IDLE || - time_uptime - state->creation > TS_MAX_CONN)) { + time_uptime - (state->creation / 1000) > TS_MAX_CONN)) { if (V_pf_status.debug >= PF_DEBUG_MISC) { DPFPRINTF(("src idled out of PAWS\n")); pf_print_state(state); diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index 721d35be8916..016fe52f54d8 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -974,7 +974,7 @@ pf_state_to_nvstate(const struct pf_kstate *s) s->anchor.ptr ? s->anchor.ptr->nr : -1); nvlist_add_number(nvl, "nat_rule", s->nat_rule.ptr ? s->nat_rule.ptr->nr : -1); - nvlist_add_number(nvl, "creation", s->creation); + nvlist_add_number(nvl, "creation", s->creation / 1000); expire = pf_state_expires(s); if (expire <= time_uptime) diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c index a2699240fbc8..9a192c396c2d 100644 --- a/sys/netpfil/pf/pflow.c +++ b/sys/netpfil/pf/pflow.c @@ -543,9 +543,9 @@ copy_flow_data(struct pflow_flow *flow1, struct pflow_flow *flow2, * or was created / expired before this machine came up due to pfsync. */ flow1->flow_start = flow2->flow_start = st->creation < 0 || - st->creation > st->expire ? htonl(0) : htonl(st->creation * 1000); + st->creation > st->expire ? htonl(0) : htonl(st->creation); flow1->flow_finish = flow2->flow_finish = st->expire < 0 ? htonl(0) : - htonl(st->expire * 1000); + htonl(st->expire); flow1->tcp_flags = flow2->tcp_flags = 0; flow1->protocol = flow2->protocol = sk->proto; flow1->tos = flow2->tos = st->rule.ptr->tos; @@ -579,10 +579,10 @@ copy_flow_ipfix_4_data(struct pflow_ipfix_flow4 *flow1, flow1->flow_start = flow2->flow_start = htobe64((time_second - time_uptime)*1000); else - flow1->flow_start = flow2->flow_start = htobe64((time_second - - (time_uptime - st->creation))*1000); - flow1->flow_finish = flow2->flow_finish = htobe64((time_second - - (time_uptime - st->expire))*1000); + flow1->flow_start = flow2->flow_start = htobe64((pf_get_time() - + (pf_get_uptime() - st->creation))); + flow1->flow_finish = flow2->flow_finish = htobe64((pf_get_time() - + (pf_get_uptime() - st->expire))); flow1->protocol = flow2->protocol = sk->proto; flow1->tos = flow2->tos = st->rule.ptr->tos; @@ -618,10 +618,10 @@ copy_flow_ipfix_6_data(struct pflow_ipfix_flow6 *flow1, flow1->flow_start = flow2->flow_start = htobe64((time_second - time_uptime)*1000); else - flow1->flow_start = flow2->flow_start = htobe64((time_second - - (time_uptime - st->creation))*1000); - flow1->flow_finish = flow2->flow_finish = htobe64((time_second - - (time_uptime - st->expire))*1000); + flow1->flow_start = flow2->flow_start = htobe64((pf_get_time() - + (pf_get_uptime() - st->creation))); + flow1->flow_finish = flow2->flow_finish = htobe64((pf_get_time() - + (pf_get_uptime() - st->expire))); flow1->protocol = flow2->protocol = sk->proto; flow1->tos = flow2->tos = st->rule.ptr->tos; From nobody Tue Jan 16 08:52:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjS10NV0z579p4; Tue, 16 Jan 2024 08:52: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 4TDjS063Y4z4Pwg; Tue, 16 Jan 2024 08:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6UXAmWEPdkmrlCkyczD8wqApMLAraoKJF6k//88qxsA=; b=bnlTuHQ307I7w9ohqedaDuH/UMgd1DbAZHL+njf1cSqtULhyjrPBWEloPrMpDY6NHY8j1o rScGsnsqMsM2yq+Ass/bLzQsFwl4zbp/2cAAJbHW643w+CaSELhCYdJzNBNzvMSYEjvON6 64fv4G6ZW+ftikgQ86+P5FtxlNjv+mjHKK20lua3sDrA+EaMjRboh2uxD3KOUdwLAe9JEM hIGlRIAvgcH6d7NK0I3vt1eQgZw5OeTKWJIk4O77TMeCM67vNIZK0J1JCATbadbHqLekfU zUWP+6WZwSylJ75aaTOL4PwfzzGL710qYZL6pB/KzNKDlVIcTpi7O1u/kNdlsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6UXAmWEPdkmrlCkyczD8wqApMLAraoKJF6k//88qxsA=; b=Z2ND8/t58Isi2uIdWfzVrCpL/VIDYsl9hW5RAa8/IRrwZXIB3JewpVF5InaXCcJ4AKgfhV dRANHxl9NFeC85k66VGDHmMTavRLhlFSmNNKs1jeeqSF6tXIqCHCVdyr5t0IAlPWDOXHv/ iQAyI+Es2ia53A8prKWKq1lF2IXmAgvaKKqi3hfA0f1/8RtnJFp/vkA10VmILMYmIgVl8s 6USKTpTMEaCU5PqkaY8XBpdpGXFaXesQyOLpGH3kVKkSAao8Xkh7YeKqmadTx3ucFleBds Nnjd8VlGKfebp70A/XaIHhJrg6AN5kWcdjJFAFYzDFG6ewBjV30QRFRvqJ+vNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395120; a=rsa-sha256; cv=none; b=b3sszc6LVc9+pQ1bvhNWydvkFC5LNKXzdsZoeb/13q59bTI0S6a2X8eD1QnzViSEFpcnMs 3ShM7RM13Y4MMd6RP3VqahPGwd3S8mZEDGx1H1D7ybEHV4T//TsyEBONUKY5/BJEFkpv2J SAQzIM9+WfN0wkP7LaKggtXfmf8f5yjMZA3PtHa3Cs0rGXtRu1G1cMHxzFkdXepQdRlQvt jZl5G1LOeXHTbQUW1/EPsEeuWreO7p2bcCG6jJelKl9QzWte8B5cKrf6B99ARN9KqtgknR lYlF0thkrg0QsrGgiApg7f8gyRXLfbAJ48Yi4OIcfHLt8BNoAWC3B1dEjwYs2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjS048HQzYS4; Tue, 16 Jan 2024 08:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8q0se077242; Tue, 16 Jan 2024 08:52:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8q0lo077239; Tue, 16 Jan 2024 08:52:00 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:52:00 GMT Message-Id: <202401160852.40G8q0lo077239@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: 85b71dcfc999 - main - pflow: allow observation domain to be configured List-Id: Commit messages for the main 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: 85b71dcfc99952c0b8d78be93a0104873e8f81f7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=85b71dcfc99952c0b8d78be93a0104873e8f81f7 commit 85b71dcfc99952c0b8d78be93a0104873e8f81f7 Author: Kristof Provost AuthorDate: 2023-12-08 10:00:30 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:54 +0000 pflow: allow observation domain to be configured Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43113 --- sbin/pflowctl/pflowctl.8 | 2 ++ sbin/pflowctl/pflowctl.c | 15 ++++++++++++++- sys/net/pflow.h | 3 +++ sys/netpfil/pf/pflow.c | 14 +++++++++++--- tests/sys/netpfil/pf/pflow.sh | 6 ++++++ 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/sbin/pflowctl/pflowctl.8 b/sbin/pflowctl/pflowctl.8 index e2e19b7ddfa0..5140d5febb84 100644 --- a/sbin/pflowctl/pflowctl.8 +++ b/sbin/pflowctl/pflowctl.8 @@ -68,6 +68,8 @@ set the source IP address (and optionally port). set the destination IP address (and optionally port). .It Cm proto set the protocol version. +.It Cm domain +set the observation domain. Valid values are 5 and 10. .El .Pp diff --git a/sbin/pflowctl/pflowctl.c b/sbin/pflowctl/pflowctl.c index 046919867ff2..7be85d8b6ad4 100644 --- a/sbin/pflowctl/pflowctl.c +++ b/sbin/pflowctl/pflowctl.c @@ -252,6 +252,7 @@ struct pflowctl_get { int version; struct pflowctl_sockaddr src; struct pflowctl_sockaddr dst; + uint32_t obs_dom; }; #define _IN(_field) offsetof(struct genlmsghdr, _field) #define _OUT(_field) offsetof(struct pflowctl_get, _field) @@ -260,6 +261,7 @@ static struct snl_attr_parser ap_get[] = { { .type = PFLOWNL_GET_VERSION, .off = _OUT(version), .cb = snl_attr_get_int16 }, { .type = PFLOWNL_GET_SRC, .off = _OUT(src), .arg = &sockaddr_parser, .cb = snl_attr_get_nested }, { .type = PFLOWNL_GET_DST, .off = _OUT(dst), .arg = &sockaddr_parser, .cb = snl_attr_get_nested }, + { .type = PFLOWNL_GET_OBSERVATION_DOMAIN, .off = _OUT(obs_dom), .cb = snl_attr_get_uint32 }, }; static struct snl_field_parser fp_get[] = {}; #undef _IN @@ -338,7 +340,7 @@ get(int id) if (! snl_parse_nlmsg(&ss, hdr, &get_parser, &g)) continue; - printf("pflow%d: version %d", g.id, g.version); + printf("pflow%d: version %d domain %d", g.id, g.version, g.obs_dom); print_sockaddr(" src ", &g.src.storage); print_sockaddr(" dst ", &g.dst.storage); printf("\n"); @@ -355,6 +357,7 @@ struct pflowctl_set { uint16_t version; struct sockaddr_storage src; struct sockaddr_storage dst; + uint32_t obs_dom; }; static inline bool snl_add_msg_attr_sockaddr(struct snl_writer *nw, int attrtype, struct sockaddr_storage *s) @@ -408,6 +411,8 @@ do_set(struct pflowctl_set *s) snl_add_msg_attr_sockaddr(&nw, PFLOWNL_SET_SRC, &s->src); if (s->dst.ss_len != 0) snl_add_msg_attr_sockaddr(&nw, PFLOWNL_SET_DST, &s->dst); + if (s->obs_dom != 0) + snl_add_msg_attr_u32(&nw, PFLOWNL_SET_OBSERVATION_DOMAIN, s->obs_dom); hdr = snl_finalize_msg(&nw); if (hdr == NULL) @@ -505,6 +510,14 @@ set(char *idstr, int argc, char *argv[]) s.version = strtol(argv[1], NULL, 10); + argc -= 2; + argv += 2; + } else if (strcmp(argv[0], "domain") == 0) { + if (argc < 2) + usage(); + + s.obs_dom = strtol(argv[1], NULL, 10); + argc -= 2; argv += 2; } else { diff --git a/sys/net/pflow.h b/sys/net/pflow.h index 2b7dfe24b5fc..4a63f7640629 100644 --- a/sys/net/pflow.h +++ b/sys/net/pflow.h @@ -216,6 +216,7 @@ struct pflow_softc { struct sockaddr *sc_flowdst; struct pflow_ipfix_tmpl sc_tmpl_ipfix; u_int8_t sc_version; + u_int32_t sc_observation_dom; struct mbuf *sc_mbuf; /* current cumulative mbuf */ struct mbuf *sc_mbuf6; /* current cumulative mbuf */ CK_LIST_ENTRY(pflow_softc) sc_next; @@ -315,6 +316,7 @@ enum pflow_get_type_t { PFLOWNL_GET_VERSION = 2, /* u16 */ PFLOWNL_GET_SRC = 3, /* struct sockaddr_storage */ PFLOWNL_GET_DST = 4, /* struct sockaddr_storage */ + PFLOWNL_GET_OBSERVATION_DOMAIN = 5, /* u32 */ }; enum pflow_set_type_t { @@ -323,6 +325,7 @@ enum pflow_set_type_t { PFLOWNL_SET_VERSION = 2, /* u16 */ PFLOWNL_SET_SRC = 3, /* struct sockaddr_storage */ PFLOWNL_SET_DST = 4, /* struct sockaddr_storage */ + PFLOWNL_SET_OBSERVATION_DOMAIN = 5, /* u32 */ }; #ifdef _KERNEL diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c index 9a192c396c2d..398851bf17d0 100644 --- a/sys/netpfil/pf/pflow.c +++ b/sys/netpfil/pf/pflow.c @@ -210,6 +210,7 @@ pflow_create(int unit) pflowif = malloc(sizeof(*pflowif), M_DEVBUF, M_WAITOK|M_ZERO); mtx_init(&pflowif->sc_lock, "pflowlk", NULL, MTX_DEF); pflowif->sc_version = PFLOW_PROTO_DEFAULT; + pflowif->sc_observation_dom = PFLOW_ENGINE_TYPE; /* ipfix template init */ bzero(&pflowif->sc_tmpl_ipfix,sizeof(pflowif->sc_tmpl_ipfix)); @@ -421,7 +422,7 @@ pflowvalidsockaddr(const struct sockaddr *sa, int ignore_port) } } -static int +int pflow_calc_mtu(struct pflow_softc *sc, int mtu, int hdrsz) { @@ -1010,7 +1011,7 @@ pflow_sendout_ipfix(struct pflow_softc *sc, sa_family_t af) h10->time_sec = htonl(time_second); /* XXX 2038 */ h10->flow_sequence = htonl(sc->sc_sequence); sc->sc_sequence += count; - h10->observation_dom = htonl(PFLOW_ENGINE_TYPE); + h10->observation_dom = htonl(sc->sc_observation_dom); if (mbufq_enqueue(&sc->sc_outputqueue, m) == 0) swi_sched(sc->sc_swi_cookie, 0); @@ -1045,7 +1046,7 @@ pflow_sendout_ipfix_tmpl(struct pflow_softc *sc) pflow_ipfix_tmpl)); h10->time_sec = htonl(time_second); /* XXX 2038 */ h10->flow_sequence = htonl(sc->sc_sequence); - h10->observation_dom = htonl(PFLOW_ENGINE_TYPE); + h10->observation_dom = htonl(sc->sc_observation_dom); callout_reset(&sc->sc_tmo_tmpl, PFLOW_TMPL_TIMEOUT * hz, pflow_timeout_tmpl, sc); @@ -1257,6 +1258,8 @@ pflow_nl_get(struct nlmsghdr *hdr, struct nl_pstate *npt) nlattr_add_sockaddr(nw, PFLOWNL_GET_SRC, sc->sc_flowsrc); if (sc->sc_flowdst) nlattr_add_sockaddr(nw, PFLOWNL_GET_DST, sc->sc_flowdst); + nlattr_add_u32(nw, PFLOWNL_GET_OBSERVATION_DOMAIN, + sc->sc_observation_dom); if (! nlmsg_end(nw)) { nlmsg_abort(nw); @@ -1306,6 +1309,7 @@ struct pflow_parsed_set { uint16_t version; struct sockaddr_storage src; struct sockaddr_storage dst; + uint32_t observation_dom; }; #define _IN(_field) offsetof(struct genlmsghdr, _field) #define _OUT(_field) offsetof(struct pflow_parsed_set, _field) @@ -1314,6 +1318,7 @@ static const struct nlattr_parser nla_p_set[] = { { .type = PFLOWNL_SET_VERSION, .off = _OUT(version), .cb = nlattr_get_uint16 }, { .type = PFLOWNL_SET_SRC, .off = _OUT(src), .arg = &addr_parser, .cb = nlattr_get_nested }, { .type = PFLOWNL_SET_DST, .off = _OUT(dst), .arg = &addr_parser, .cb = nlattr_get_nested }, + { .type = PFLOWNL_SET_OBSERVATION_DOMAIN, .off = _OUT(observation_dom), .cb = nlattr_get_uint32 }, }; static const struct nlfield_parser nlf_p_set[] = {}; #undef _IN @@ -1438,6 +1443,9 @@ pflow_set(struct pflow_softc *sc, const struct pflow_parsed_set *pflowr, struct sc->so = NULL; } + if (pflowr->observation_dom != 0) + sc->sc_observation_dom = pflowr->observation_dom; + /* error check is above */ if (pflowr->version != 0) sc->sc_version = pflowr->version; diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh index 73e041fca693..12d194d84c14 100644 --- a/tests/sys/netpfil/pf/pflow.sh +++ b/tests/sys/netpfil/pf/pflow.sh @@ -67,6 +67,12 @@ basic_body() jexec alcatraz pflowctl -s ${pflow} proto 5 atf_check -s exit:0 \ jexec alcatraz pflowctl -s ${pflow} proto 10 + + # We can change the observation domain + atf_check -s exit:0 \ + jexec alcatraz pflowctl -s ${pflow} domain 13 + atf_check -s exit:0 -o match:".*domain 13.*" \ + jexec alcatraz pflowctl -l } basic_cleanup() From nobody Tue Jan 16 08:52:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjS236Tcz579g7; Tue, 16 Jan 2024 08: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 4TDjS16V41z4Pky; Tue, 16 Jan 2024 08:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bIypJhqHgI+H+DQV8Dm1QaRaT8IwKP+gW/K/pvPk02Q=; b=hJ4NQxRnIAr5rHQAz6NtEIklKkUTrQSW32RFgA8GuC7utORw87kbhpqUcMiaiwzncvr4U2 VFOL0w2aM1ECVfIHCx6H8b59F+Uv0Vq4WCIets5isMNu3YRfsjqLXoG0AE/SdUyx4JVH58 0jUYz5Rnydgke1bjPUCj/ZDa0LVGH8ZAf02D9uJSZk4LcTZaDbLcBD1xm4KjhR0Z1Lhc4I EoIx4ydyYspsAMNyP8e5GW9E5lIUfCe9BUlJvYTP9hNVbJiTDjY+3uaC6M8TjvrrUTzGWg pyZnGMoBUzGqEUDrMvStV1lAJDCQLJ8NwM6HYOG8ROfTaEFNrOzyaaGItVguhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bIypJhqHgI+H+DQV8Dm1QaRaT8IwKP+gW/K/pvPk02Q=; b=NzkHdmVXNP4kq6P2OKcMHtCw7CvfX+NhmwpNyU2zyMCga7rNZVLowE9zNt14sG9YtiD6tG ltQvtM/ChtiqAc+ia4fRXALBdNwnxDGvrvuYdxiuoASQlspC7s+hsCp8PB5mDwsRkhuw5r LGdHUwywQMVVfGuN1nk3b4gLorIHqT8NHPwsTvK4PgAQenIiZLHG5FFINj77C0a5wVVpEK DlunqYQF0uFftFnWR2UGzR241X8SwZq231CyEinpdi/8o+6MeWHWO0nLTjWQK1RumMDnf9 TE0aPqJ1X1o29sHLh+pi8EnZD9pCeqhEiKpo/wMysU968EODaT8rGZKbZYh1Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395122; a=rsa-sha256; cv=none; b=MGLUVtXbCT51kzKIttWgjuJ9pxFwS/HQVFGz5W1IY3d0443DrKTEzRbeeSGnWqO4U7IreN Zqbgc3YLhAjEriG74BlKxR1KNWx3tgEZddyvyVHIzCD3us/JiPBlR6Q7UH+qYLqW+YchsO gChXnQNt3+IwbW7hrM6yOG/xN9cUacU7o58pfUQ6wXWmM02EXh5wvumWW+eprI7aP90a0S ryzqA5c6OJe79hJK6z6dkikuUrp8Z5mrzivO3L5KRcuX9h+2UvORjJwYwCpDO05loz2igU UBSZXjPCGucK19Tycrwh0ZXDk9h2vmMsdT6dANsJ/9vVP7VM/2dM0V+lMbQCJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjS14dSvzYsv; Tue, 16 Jan 2024 08:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8q1mY077286; Tue, 16 Jan 2024 08:52:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8q15o077283; Tue, 16 Jan 2024 08:52:01 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:52:01 GMT Message-Id: <202401160852.40G8q15o077283@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: fc6e50699615 - main - pflow: add RFC8158 NAT support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: fc6e50699615c93f39d008709f87c754d9b6c7d3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fc6e50699615c93f39d008709f87c754d9b6c7d3 commit fc6e50699615c93f39d008709f87c754d9b6c7d3 Author: Kristof Provost AuthorDate: 2023-12-13 15:55:28 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:55 +0000 pflow: add RFC8158 NAT support Extend pflow(4) to send NAT44 Session Create and Delete events. This applies only to IPFIX (i.e. proto version 10), and requires no user configuration. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43114 --- sbin/pfctl/parse.y | 16 ++++ sys/net/pflow.h | 44 ++++++++++ sys/netpfil/pf/pf.c | 3 +- sys/netpfil/pf/pflow.c | 213 +++++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 260 insertions(+), 16 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 94b7e241cd25..9ec86f898240 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -4680,6 +4680,7 @@ natrule : nataction interface af proto fromto tag tagged rtable redirpool pool_opts { struct pfctl_rule r; + struct node_state_opt *o; if (check_rulestate(PFCTL_STATE_NAT)) YYERROR; @@ -4855,6 +4856,21 @@ natrule : nataction interface af proto fromto tag tagged rtable r.rpool.mape = $10.mape; } + o = keep_state_defaults; + while (o) { + switch (o->type) { + case PF_STATE_OPT_PFLOW: + if (r.rule_flag & PFRULE_PFLOW) { + yyerror("state pflow option: " + "multiple definitions"); + YYERROR; + } + r.rule_flag |= PFRULE_PFLOW; + break; + } + o = o->next; + } + expand_rule(&r, $2, $9 == NULL ? NULL : $9->host, $4, $5.src_os, $5.src.host, $5.src.port, $5.dst.host, $5.dst.port, 0, 0, 0, ""); diff --git a/sys/net/pflow.h b/sys/net/pflow.h index 4a63f7640629..84fcf1327a17 100644 --- a/sys/net/pflow.h +++ b/sys/net/pflow.h @@ -68,6 +68,14 @@ #define PFIX_IE_destinationIPv6Address 28 #define PFIX_IE_flowStartMilliseconds 152 #define PFIX_IE_flowEndMilliseconds 153 +#define PFIX_IE_postNATSourceIPv4Address 225 +#define PFIX_IE_postNATDestinationIPv4Address 226 +#define PFIX_IE_postNAPTSourceTransportPort 227 +#define PFIX_IE_postNAPTDestinationTransportPort 228 +#define PFIX_IE_natEvent 230 +#define PFIX_NAT_EVENT_SESSION_CREATE 4 +#define PFIX_NAT_EVENT_SESSION_DELETE 5 +#define PFIX_IE_timeStamp 323 struct pflow_flow { u_int32_t src_ip; @@ -148,10 +156,28 @@ struct pflow_ipfix_tmpl_ipv6 { #define PFLOW_IPFIX_TMPL_IPV6_ID 257 } __packed; +struct pflow_ipfix_tmpl_nat44 { + struct pflow_tmpl_hdr h; + struct pflow_tmpl_fspec timestamp; + struct pflow_tmpl_fspec nat_event; + struct pflow_tmpl_fspec protocol; + struct pflow_tmpl_fspec src_ip; + struct pflow_tmpl_fspec src_port; + struct pflow_tmpl_fspec postnat_src_ip; + struct pflow_tmpl_fspec postnat_src_port; + struct pflow_tmpl_fspec dst_ip; + struct pflow_tmpl_fspec dst_port; + struct pflow_tmpl_fspec postnat_dst_ip; + struct pflow_tmpl_fspec postnat_dst_port; +#define PFLOW_IPFIX_TMPL_NAT44_FIELD_COUNT 11 +#define PFLOW_IPFIX_TMPL_NAT44_ID 258 +}; + struct pflow_ipfix_tmpl { struct pflow_set_header set_header; struct pflow_ipfix_tmpl_ipv4 ipv4_tmpl; struct pflow_ipfix_tmpl_ipv6 ipv6_tmpl; + struct pflow_ipfix_tmpl_nat44 nat44_tmpl; } __packed; struct pflow_ipfix_flow4 { @@ -186,6 +212,20 @@ struct pflow_ipfix_flow6 { /* XXX padding needed? */ } __packed; +struct pflow_ipfix_nat4 { + u_int64_t timestamp; /* timeStamp */ + u_int8_t nat_event; /* natEvent */ + u_int8_t protocol; /* protocolIdentifier */ + u_int32_t src_ip; /* sourceIPv4Address */ + u_int16_t src_port; /* sourceTransportPort */ + u_int32_t postnat_src_ip; /* postNATSourceIPv4Address */ + u_int16_t postnat_src_port;/* postNAPTSourceTransportPort */ + u_int32_t dest_ip; /* destinationIPv4Address */ + u_int16_t dest_port; /* destinationTransportPort */ + u_int32_t postnat_dest_ip;/* postNATDestinationIPv4Address */ + u_int16_t postnat_dest_port;/* postNAPTDestinationTransportPort */ +} __packed; + #ifdef _KERNEL struct pflow_softc { @@ -199,13 +239,16 @@ struct pflow_softc { unsigned int sc_count; unsigned int sc_count4; unsigned int sc_count6; + unsigned int sc_count_nat4; unsigned int sc_maxcount; unsigned int sc_maxcount4; unsigned int sc_maxcount6; + unsigned int sc_maxcount_nat4; u_int64_t sc_gcounter; u_int32_t sc_sequence; struct callout sc_tmo; struct callout sc_tmo6; + struct callout sc_tmo_nat4; struct callout sc_tmo_tmpl; struct intr_event *sc_swi_ie; void *sc_swi_cookie; @@ -219,6 +262,7 @@ struct pflow_softc { u_int32_t sc_observation_dom; struct mbuf *sc_mbuf; /* current cumulative mbuf */ struct mbuf *sc_mbuf6; /* current cumulative mbuf */ + struct mbuf *sc_mbuf_nat4; CK_LIST_ENTRY(pflow_softc) sc_next; struct epoch_context sc_epoch_ctx; }; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 89f6e000f6cf..9bd9828a99d9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4875,7 +4875,8 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, s->state_flags |= PFSTATE_SLOPPY; if (pd->flags & PFDESC_TCP_NORM) /* Set by old-style scrub rules */ s->state_flags |= PFSTATE_SCRUB_TCP; - if (r->rule_flag & PFRULE_PFLOW) + if ((r->rule_flag & PFRULE_PFLOW) || + (nr != NULL && nr->rule_flag & PFRULE_PFLOW)) s->state_flags |= PFSTATE_PFLOW; s->act.log = pd->act.log & PF_LOG_ALL; diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c index 398851bf17d0..ce5e8ec6547c 100644 --- a/sys/netpfil/pf/pflow.c +++ b/sys/netpfil/pf/pflow.c @@ -70,6 +70,12 @@ #define DPRINTF(x) #endif +enum pflow_family_t { + PFLOW_INET, + PFLOW_INET6, + PFLOW_NAT4, +}; + static void pflow_output_process(void *); static int pflow_create(int); static int pflow_destroy(int, bool); @@ -80,12 +86,13 @@ static int pflowvalidsockaddr(const struct sockaddr *, int); static struct mbuf *pflow_get_mbuf(struct pflow_softc *, u_int16_t); static void pflow_flush(struct pflow_softc *); static int pflow_sendout_v5(struct pflow_softc *); -static int pflow_sendout_ipfix(struct pflow_softc *, sa_family_t); +static int pflow_sendout_ipfix(struct pflow_softc *, enum pflow_family_t); static int pflow_sendout_ipfix_tmpl(struct pflow_softc *); static int pflow_sendout_mbuf(struct pflow_softc *, struct mbuf *); static void pflow_timeout(void *); static void pflow_timeout6(void *); static void pflow_timeout_tmpl(void *); +static void pflow_timeout_nat4(void *); static void copy_flow_data(struct pflow_flow *, struct pflow_flow *, const struct pf_kstate *, struct pf_state_key *, int, int); static void copy_flow_ipfix_4_data(struct pflow_ipfix_flow4 *, @@ -106,6 +113,9 @@ static int copy_flow_ipfix_4_to_m(struct pflow_ipfix_flow4 *flow, struct pflow_softc *sc); static int copy_flow_ipfix_6_to_m(struct pflow_ipfix_flow6 *flow, struct pflow_softc *sc); +static int copy_nat_ipfix_4_to_m(struct pflow_ipfix_nat4 *, + const struct pf_kstate *, struct pflow_softc *, + uint8_t, uint64_t); static const char pflowname[] = "pflow"; @@ -303,6 +313,53 @@ pflow_create(int unit) htons(PFIX_IE_protocolIdentifier); pflowif->sc_tmpl_ipfix.ipv6_tmpl.protocol.len = htons(1); + /* NAT44 create template */ + pflowif->sc_tmpl_ipfix.nat44_tmpl.h.tmpl_id = + htons(PFLOW_IPFIX_TMPL_NAT44_ID); + pflowif->sc_tmpl_ipfix.nat44_tmpl.h.field_count = + htons(PFLOW_IPFIX_TMPL_NAT44_FIELD_COUNT); + pflowif->sc_tmpl_ipfix.nat44_tmpl.timestamp.field_id = + htons(PFIX_IE_timeStamp); + pflowif->sc_tmpl_ipfix.nat44_tmpl.timestamp.len = + htons(8); + pflowif->sc_tmpl_ipfix.nat44_tmpl.nat_event.field_id = + htons(PFIX_IE_natEvent); + pflowif->sc_tmpl_ipfix.nat44_tmpl.nat_event.len = + htons(1); + pflowif->sc_tmpl_ipfix.nat44_tmpl.protocol.field_id = + htons(PFIX_IE_protocolIdentifier); + pflowif->sc_tmpl_ipfix.nat44_tmpl.protocol.len = htons(1); + pflowif->sc_tmpl_ipfix.nat44_tmpl.src_ip.field_id = + htons(PFIX_IE_sourceIPv4Address); + pflowif->sc_tmpl_ipfix.nat44_tmpl.src_ip.len = + htons(4); + pflowif->sc_tmpl_ipfix.nat44_tmpl.src_port.field_id = + htons(PFIX_IE_sourceTransportPort); + pflowif->sc_tmpl_ipfix.nat44_tmpl.src_port.len = htons(2); + pflowif->sc_tmpl_ipfix.nat44_tmpl.postnat_src_ip.field_id = + htons(PFIX_IE_postNATSourceIPv4Address); + pflowif->sc_tmpl_ipfix.nat44_tmpl.postnat_src_ip.len = + htons(4); + pflowif->sc_tmpl_ipfix.nat44_tmpl.postnat_src_port.field_id = + htons(PFIX_IE_postNAPTSourceTransportPort); + pflowif->sc_tmpl_ipfix.nat44_tmpl.postnat_src_port.len = + htons(2); + pflowif->sc_tmpl_ipfix.nat44_tmpl.dst_ip.field_id = + htons(PFIX_IE_destinationIPv4Address); + pflowif->sc_tmpl_ipfix.nat44_tmpl.dst_ip.len = + htons(4); + pflowif->sc_tmpl_ipfix.nat44_tmpl.dst_port.field_id = + htons(PFIX_IE_destinationTransportPort); + pflowif->sc_tmpl_ipfix.nat44_tmpl.dst_port.len = htons(2); + pflowif->sc_tmpl_ipfix.nat44_tmpl.postnat_dst_ip.field_id = + htons(PFIX_IE_postNATDestinationIPv4Address); + pflowif->sc_tmpl_ipfix.nat44_tmpl.postnat_dst_ip.len = + htons(4); + pflowif->sc_tmpl_ipfix.nat44_tmpl.postnat_dst_port.field_id = + htons(PFIX_IE_postNAPTDestinationTransportPort); + pflowif->sc_tmpl_ipfix.nat44_tmpl.postnat_dst_port.len = + htons(2); + pflowif->sc_id = unit; pflowif->sc_vnet = curvnet; @@ -311,6 +368,7 @@ pflow_create(int unit) callout_init_mtx(&pflowif->sc_tmo, &pflowif->sc_lock, 0); callout_init_mtx(&pflowif->sc_tmo6, &pflowif->sc_lock, 0); + callout_init_mtx(&pflowif->sc_tmo_nat4, &pflowif->sc_lock, 0); callout_init_mtx(&pflowif->sc_tmo_tmpl, &pflowif->sc_lock, 0); error = swi_add(&pflowif->sc_swi_ie, pflowname, pflow_output_process, @@ -374,10 +432,12 @@ pflow_destroy(int unit, bool drain) callout_drain(&sc->sc_tmo); callout_drain(&sc->sc_tmo6); + callout_drain(&sc->sc_tmo_nat4); callout_drain(&sc->sc_tmo_tmpl); m_freem(sc->sc_mbuf); m_freem(sc->sc_mbuf6); + m_freem(sc->sc_mbuf_nat4); PFLOW_LOCK(sc); mbufq_drain(&sc->sc_outputqueue); @@ -425,18 +485,26 @@ pflowvalidsockaddr(const struct sockaddr *sa, int ignore_port) int pflow_calc_mtu(struct pflow_softc *sc, int mtu, int hdrsz) { + size_t min; sc->sc_maxcount4 = (mtu - hdrsz - sizeof(struct udpiphdr)) / sizeof(struct pflow_ipfix_flow4); sc->sc_maxcount6 = (mtu - hdrsz - sizeof(struct udpiphdr)) / sizeof(struct pflow_ipfix_flow6); + sc->sc_maxcount_nat4 = (mtu - hdrsz - + sizeof(struct udpiphdr)) / sizeof(struct pflow_ipfix_nat4); if (sc->sc_maxcount4 > PFLOW_MAXFLOWS) sc->sc_maxcount4 = PFLOW_MAXFLOWS; if (sc->sc_maxcount6 > PFLOW_MAXFLOWS) sc->sc_maxcount6 = PFLOW_MAXFLOWS; - return (hdrsz + sizeof(struct udpiphdr) + - MIN(sc->sc_maxcount4 * sizeof(struct pflow_ipfix_flow4), - sc->sc_maxcount6 * sizeof(struct pflow_ipfix_flow6))); + if (sc->sc_maxcount_nat4 > PFLOW_MAXFLOWS) + sc->sc_maxcount_nat4 = PFLOW_MAXFLOWS; + + min = MIN(sc->sc_maxcount4 * sizeof(struct pflow_ipfix_flow4), + sc->sc_maxcount6 * sizeof(struct pflow_ipfix_flow6)); + min = MIN(min, sc->sc_maxcount_nat4 * sizeof(struct pflow_ipfix_nat4)); + + return (hdrsz + sizeof(struct udpiphdr) + min); } static void @@ -628,6 +696,28 @@ copy_flow_ipfix_6_data(struct pflow_ipfix_flow6 *flow1, flow1->tos = flow2->tos = st->rule.ptr->tos; } +static void +copy_nat_ipfix_4_data(struct pflow_ipfix_nat4 *nat1, + struct pflow_ipfix_nat4 *nat2, const struct pf_kstate *st, + struct pf_state_key *sk, struct pflow_softc *sc, int src, int dst) +{ + nat1->src_ip = nat2->dest_ip = st->key[PF_SK_STACK]->addr[src].v4.s_addr; + nat1->src_port = nat2->dest_port = st->key[PF_SK_STACK]->port[src]; + nat1->dest_ip = nat2->src_ip = st->key[PF_SK_STACK]->addr[dst].v4.s_addr; + nat1->dest_port = nat2->src_port = st->key[PF_SK_STACK]->port[dst]; + nat1->postnat_src_ip = nat2->postnat_dest_ip = st->key[PF_SK_WIRE]->addr[src].v4.s_addr; + nat1->postnat_src_port = nat2->postnat_dest_port = st->key[PF_SK_WIRE]->port[src]; + nat1->postnat_dest_ip = nat2->postnat_src_ip = st->key[PF_SK_WIRE]->addr[dst].v4.s_addr; + nat1->postnat_dest_port = nat2->postnat_src_port = st->key[PF_SK_WIRE]->port[dst]; + nat1->protocol = nat2->protocol = sk->proto; + + /* + * Because we have to generate a create and delete event we'll fill out the + * timestamp and nat_event fields when we transmit. As opposed to doing this + * work a second time. + */ +} + static void export_pflow(const struct pf_kstate *st) { @@ -755,7 +845,7 @@ copy_flow_ipfix_4_to_m(struct pflow_ipfix_flow4 *flow, struct pflow_softc *sc) sc->sc_count4++; if (sc->sc_count4 >= sc->sc_maxcount4) - ret = pflow_sendout_ipfix(sc, AF_INET); + ret = pflow_sendout_ipfix(sc, PFLOW_INET); return(ret); } @@ -785,11 +875,46 @@ copy_flow_ipfix_6_to_m(struct pflow_ipfix_flow6 *flow, struct pflow_softc *sc) sc->sc_count6++; if (sc->sc_count6 >= sc->sc_maxcount6) - ret = pflow_sendout_ipfix(sc, AF_INET6); + ret = pflow_sendout_ipfix(sc, PFLOW_INET6); return(ret); } +int +copy_nat_ipfix_4_to_m(struct pflow_ipfix_nat4 *nat, const struct pf_kstate *st, + struct pflow_softc *sc, uint8_t event, uint64_t timestamp) +{ + int ret = 0; + + PFLOW_ASSERT(sc); + + if (sc->sc_mbuf_nat4 == NULL) { + if ((sc->sc_mbuf_nat4 = + pflow_get_mbuf(sc, PFLOW_IPFIX_TMPL_NAT44_ID)) == NULL) { + return (ENOBUFS); + } + sc->sc_count_nat4 = 0; + callout_reset(&sc->sc_tmo, PFLOW_TIMEOUT * hz, + pflow_timeout_nat4, sc); + } + + nat->nat_event = event; + nat->timestamp = htobe64(pf_get_time() - (pf_get_uptime() - timestamp)); + m_copyback(sc->sc_mbuf_nat4, PFLOW_SET_HDRLEN + + (sc->sc_count_nat4 * sizeof(struct pflow_ipfix_nat4)), + sizeof(struct pflow_ipfix_nat4), (caddr_t)nat); + sc->sc_count_nat4++; + + if (V_pflowstats.pflow_flows == sc->sc_gcounter) + V_pflowstats.pflow_flows++; + + sc->sc_gcounter++; + if (sc->sc_count_nat4 >= sc->sc_maxcount_nat4) + ret = pflow_sendout_ipfix(sc, PFLOW_NAT4); + + return (ret); +} + static int pflow_pack_flow(const struct pf_kstate *st, struct pf_state_key *sk, struct pflow_softc *sc) @@ -815,17 +940,30 @@ pflow_pack_flow(const struct pf_kstate *st, struct pf_state_key *sk, return (ret); } +static bool +pflow_is_natd(const struct pf_kstate *st) +{ + /* If ports or addresses are different we've been NAT-ed. */ + return (memcmp(st->key[PF_SK_WIRE], st->key[PF_SK_STACK], + sizeof(struct pf_addr) * 2 + sizeof(uint16_t) * 2) != 0); +} + static int pflow_pack_flow_ipfix(const struct pf_kstate *st, struct pf_state_key *sk, struct pflow_softc *sc) { struct pflow_ipfix_flow4 flow4_1, flow4_2; + struct pflow_ipfix_nat4 nat4_1, nat4_2; struct pflow_ipfix_flow6 flow6_1, flow6_2; int ret = 0; + bool nat = false; + if (sk->af == AF_INET) { bzero(&flow4_1, sizeof(flow4_1)); bzero(&flow4_2, sizeof(flow4_2)); + nat = pflow_is_natd(st); + if (st->direction == PF_OUT) copy_flow_ipfix_4_data(&flow4_1, &flow4_2, st, sk, sc, 1, 0); @@ -833,11 +971,30 @@ pflow_pack_flow_ipfix(const struct pf_kstate *st, struct pf_state_key *sk, copy_flow_ipfix_4_data(&flow4_1, &flow4_2, st, sk, sc, 0, 1); - if (st->bytes[0] != 0) /* first flow from state */ + if (nat) + copy_nat_ipfix_4_data(&nat4_1, &nat4_2, st, sk, sc, 1, 0); + + if (st->bytes[0] != 0) /* first flow from state */ { ret = copy_flow_ipfix_4_to_m(&flow4_1, sc); - if (st->bytes[1] != 0) /* second flow from state */ + if (ret == 0 && nat) { + ret = copy_nat_ipfix_4_to_m(&nat4_1, st, sc, + PFIX_NAT_EVENT_SESSION_CREATE, st->creation); + ret |= copy_nat_ipfix_4_to_m(&nat4_1, st, sc, + PFIX_NAT_EVENT_SESSION_DELETE, st->expire); + } + } + + if (st->bytes[1] != 0) /* second flow from state */ { ret = copy_flow_ipfix_4_to_m(&flow4_2, sc); + + if (ret == 0 && nat) { + ret = copy_nat_ipfix_4_to_m(&nat4_2, st, sc, + PFIX_NAT_EVENT_SESSION_CREATE, st->creation); + ret |= copy_nat_ipfix_4_to_m(&nat4_2, st, sc, + PFIX_NAT_EVENT_SESSION_DELETE, st->expire); + } + } } else if (sk->af == AF_INET6) { bzero(&flow6_1, sizeof(flow6_1)); bzero(&flow6_2, sizeof(flow6_2)); @@ -871,7 +1028,7 @@ pflow_timeout(void *v) pflow_sendout_v5(sc); break; case PFLOW_PROTO_10: - pflow_sendout_ipfix(sc, AF_INET); + pflow_sendout_ipfix(sc, PFLOW_INET); break; default: /* NOTREACHED */ panic("Unsupported version %d", sc->sc_version); @@ -892,7 +1049,7 @@ pflow_timeout6(void *v) return; CURVNET_SET(sc->sc_vnet); - pflow_sendout_ipfix(sc, AF_INET6); + pflow_sendout_ipfix(sc, PFLOW_INET6); CURVNET_RESTORE(); } @@ -911,6 +1068,21 @@ pflow_timeout_tmpl(void *v) CURVNET_RESTORE(); } +static void +pflow_timeout_nat4(void *v) +{ + struct pflow_softc *sc = v; + + PFLOW_ASSERT(sc); + + if (sc->sc_version != PFLOW_PROTO_10) + return; + + CURVNET_SET(sc->sc_vnet); + pflow_sendout_ipfix(sc, PFLOW_NAT4); + CURVNET_RESTORE(); +} + static void pflow_flush(struct pflow_softc *sc) { @@ -921,8 +1093,9 @@ pflow_flush(struct pflow_softc *sc) pflow_sendout_v5(sc); break; case PFLOW_PROTO_10: - pflow_sendout_ipfix(sc, AF_INET); - pflow_sendout_ipfix(sc, AF_INET6); + pflow_sendout_ipfix(sc, PFLOW_INET); + pflow_sendout_ipfix(sc, PFLOW_INET6); + pflow_sendout_ipfix(sc, PFLOW_NAT4); break; default: /* NOTREACHED */ break; @@ -960,7 +1133,7 @@ pflow_sendout_v5(struct pflow_softc *sc) } static int -pflow_sendout_ipfix(struct pflow_softc *sc, sa_family_t af) +pflow_sendout_ipfix(struct pflow_softc *sc, enum pflow_family_t af) { struct mbuf *m; struct pflow_v10_header *h10; @@ -971,7 +1144,7 @@ pflow_sendout_ipfix(struct pflow_softc *sc, sa_family_t af) PFLOW_ASSERT(sc); switch (af) { - case AF_INET: + case PFLOW_INET: m = sc->sc_mbuf; callout_stop(&sc->sc_tmo); if (m == NULL) @@ -981,7 +1154,7 @@ pflow_sendout_ipfix(struct pflow_softc *sc, sa_family_t af) set_length = sizeof(struct pflow_set_header) + sc->sc_count4 * sizeof(struct pflow_ipfix_flow4); break; - case AF_INET6: + case PFLOW_INET6: m = sc->sc_mbuf6; callout_stop(&sc->sc_tmo6); if (m == NULL) @@ -991,6 +1164,16 @@ pflow_sendout_ipfix(struct pflow_softc *sc, sa_family_t af) set_length = sizeof(struct pflow_set_header) + sc->sc_count6 * sizeof(struct pflow_ipfix_flow6); break; + case PFLOW_NAT4: + m = sc->sc_mbuf_nat4; + callout_stop(&sc->sc_tmo_nat4); + if (m == NULL) + return (0); + sc->sc_mbuf_nat4 = NULL; + count = sc->sc_count_nat4; + set_length = sizeof(struct pflow_set_header) + + sc->sc_count_nat4 * sizeof(struct pflow_ipfix_nat4); + break; default: panic("Unsupported AF %d", af); } From nobody Tue Jan 16 08:52:02 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjS33dmnz57B7F; Tue, 16 Jan 2024 08:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDjS26XBgz4Px5; Tue, 16 Jan 2024 08: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=1705395123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AIqiwUEMLs2BTQAW5dd/E8Dmth52ULzaTOe+ttDFHLw=; b=AkO5CIJRP6KwwG55Pg8pAwxmj9kDUsO5lsutkPqrNb8/4e0M93CtiQiUQjl6846o2zoxul CfXlFxFuKu+YSfWY2UlmILZXvGaoEKcfzyphhJrF0NNCOf7uESeDoGCKYRDjwCtCcn4Nzi rYhFtNcgRVAVHvU6rwDmtd2ZUUCYv9tvxY3XiXNHUOmS9uDVoI4jB21pV2raz5QPWl/Ubl WDOTScokuYkS8RL0gxVqoDnZdwPfZ2vJ8juwpLl9VViBZ9S0S3X316RjJjdWUcqACl0C3q Pkerb+fNWcI8qbxoTnDvQU1Ask9kyAK761cdQA2+n9pF80oBZ59ZR+sCEWu+Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AIqiwUEMLs2BTQAW5dd/E8Dmth52ULzaTOe+ttDFHLw=; b=bZE5IzqXqCOWRInZDQaU0qePKw7KFeajFO6BCSy99IrjEXKW3KFhldUoAf2MES1ABmLBO8 cJH2D0O9CrgSx/pa99nVKWHC0NpAs1dpzf9eZZ4eauYvKwv4FH7aFYghu8KfQ4YIY2Q9Fc sOZpekm6bWussxWgfmEdYzEwUjNTqNOhYVyPNQoJEvp9c14m/Y9PFVJTB+gV01EyHyExgk uLjBZ3RrEZNvZf8qtKjRM9Muk1dbv0EvF5gYVp4gPLi4eI0QyH+vLAUQaMUeOu6HNC5IUJ E2XYuuysmm4kS1K58ALfCbFZyNfsjlB0Zn6atUGIA4ArIZgNxOWaBDESOs5djg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395123; a=rsa-sha256; cv=none; b=TZp1rdT0QdRq4Jo6vzQtZ48p0Ogo2TpbwvXkB/oiP4O0KekdmBOSu0YOL7AvlJHgUrrnQC kgiBXU6ra+bY3mduwkXdt4htRIbisAS9+vgjuebrRjEBDrkzHZUNFomZN6kw0lZPTMMbzV cyxBMXwa27khfHhf6QQOoz0VpsPTQXuyTy4+M8AXMEVXz+w8wxtkvHw8vlUedzbusuT8d+ 62n+ugpLJX8c/xsCyGNQAqT4uMdfiAQQy6Yvu3RB8BQKCgRjHWOL+EUsPGtgB4OXmOe9Ki 4QLl5wWVH44LFDhUkxdAJ4jUIoLEuz8xh/EO5F7xbcdC72H4z7dwAB/nghsvpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjS25dF3zZLf; Tue, 16 Jan 2024 08:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8q2GP077338; Tue, 16 Jan 2024 08:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8q2Pw077335; Tue, 16 Jan 2024 08:52:02 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:52:02 GMT Message-Id: <202401160852.40G8q2Pw077335@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: 34276498fae8 - main - pf tests: verify pflow over IPv6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 34276498fae8b41ca1d8944d466cd79aa47fadfb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=34276498fae8b41ca1d8944d466cd79aa47fadfb commit 34276498fae8b41ca1d8944d466cd79aa47fadfb Author: Kristof Provost AuthorDate: 2023-12-13 17:12:08 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:55 +0000 pf tests: verify pflow over IPv6 Test that we can send netflow information over IPv6. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43115 --- tests/sys/netpfil/pf/pflow.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh index 12d194d84c14..4bed49ef6f76 100644 --- a/tests/sys/netpfil/pf/pflow.sh +++ b/tests/sys/netpfil/pf/pflow.sh @@ -141,8 +141,51 @@ state_defaults_cleanup() pft_cleanup } +atf_test_case "v6" "cleanup" +v6_head() +{ + atf_set descr 'Test pflow over IPv6' + atf_set require.user root + atf_set require.progs scapy +} + +v6_body() +{ + pflow_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -6 -c 1 2001:db8::1 + + pflow=$(jexec alcatraz pflowctl -c ) + # Note proto 10, because there's no IPv6 information in v5 + jexec alcatraz pflowctl -s ${pflow} dst [2001:db8::2]:2055 proto 10 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set state-defaults pflow" \ + "pass" + + ping -6 -c 1 2001:db8::1 + + atf_check -o match:"^v=10.*" \ + $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 +} + +v6_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" atf_add_test_case "state_defaults" + atf_add_test_case "v6" } From nobody Tue Jan 16 08:52:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjS45Bd1z579pH; Tue, 16 Jan 2024 08:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDjS415NRz4Pj2; Tue, 16 Jan 2024 08:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xtZp2veFVgUfZ2HhXxpd5OQstCoI/7Ext/4CvQZvJ1w=; b=iEkLW6wAhrPPNh6nt4GJ6WWiqg3PIFPYmpVgDQnBMld/Rl/pTUEHScmazBsI+hWLoWvTLT 1otnbnuCRm0h1j3i74kD3BcwZ4ab0bU8eFFXsa9ROAjSmDMWPg5PixkEb/C5CRQ8YtQ7C7 teKB+z7cj8j8o7SPEfGrS7EJDNbtiqAY8JEH5drwvTRL5qQDau3qFbXy6CEzR2PgPqtY+G jsqQoJg/RAshlDurd0ZcsFtFnpVEqR7Et4u9kz1qRMaukAklde8NRSgrc9DROs1EmYE1rM HHhl9hskGI32OP6fGhn07R1gOPEt1pEeH0kBR5z9+CW+++ZLW+FBLjBXom4Q6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xtZp2veFVgUfZ2HhXxpd5OQstCoI/7Ext/4CvQZvJ1w=; b=M1kGTEZjPvV2vRR7ivlf6tdjGsh3rJfHHMrLA3wGqlrd2AN8Fne7PT5qv/HDtMd/C73yK2 ev8RZOZC4/IBgjBy8vJHcsrRsujOc/YKOoOntuYQU8H3PYs0nBuqgQPJVAMWpiWSK4WtGB vjo2w3UsiCpkdbXDoj6orNeWSloRGy9HM8HSL6JsNMSf0YWu+d2H/A+zrA78UZm2A6KbDc vkImuihPATrU3TACu7eGtvDAs0cz4HKvozxfYKwddpfHS8Ma8srcTGgdMq1xn5FqJsZy5e qKGHeFnwC/nPkuinWIq8REtGZXGEdvb1klnK1/e3UdRsc1Rw3OxFTI8j0o4uQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395124; a=rsa-sha256; cv=none; b=HKiDRAoPl4rvdbL5+ep3pLUEhOQ+elBXFbJpgnHJgndXolY1bIjrSd4DZeIq8Z5NFKv7/q MblBjJS3awXyt1GLRITchLGO5Q96KCJp8IgqsnsQEqiFclZO+qyqgkNLLXDxUL2uQIEGZ+ sLSA3V8kWUxjpZZDuOLsTS1HLYdmvK/Nd0fxUYf4rnzfTOLeJcRZYWld3Fjn1cUU2nYvgg EYdCnTPAqyvlrokqybuBMR93mCP0RgmI4PU6e5mELSA/VoydTqJXzcTVlFOCrhDY/YTiuS bCQrRmbcCoVRQS4FQHVHy9St3jNvxlv/jcbgNuKJ4Ss3TwxjHKMuEnSU7hdAAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjS36SmGzZ6l; Tue, 16 Jan 2024 08:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8q3Jx077401; Tue, 16 Jan 2024 08:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8q3RP077398; Tue, 16 Jan 2024 08:52:03 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:52:03 GMT Message-Id: <202401160852.40G8q3RP077398@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: 2be6f75707b4 - main - pflow: Turn `pflowstats' statistics counters into per-CPU counters to make them mpsafe. List-Id: Commit messages for the main 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: 2be6f75707b489d5505d45b677120d0870b6a066 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2be6f75707b489d5505d45b677120d0870b6a066 commit 2be6f75707b489d5505d45b677120d0870b6a066 Author: Kristof Provost AuthorDate: 2023-12-14 13:06:41 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:55 +0000 pflow: Turn `pflowstats' statistics counters into per-CPU counters to make them mpsafe. The weird interactions around `pflow_flows' and `sc_gcounter' replaced by simple `pflow_flows' increment. Since the flow sequence is the 32 bits integer, the `sc_gcounter' type replaced by the type of uint32_t. Obtained from: OpenBSD Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43116 --- sys/net/pflow.h | 2 +- sys/netpfil/pf/pflow.c | 76 +++++++++++++++++++++++++++++++++++++------------- 2 files changed, 58 insertions(+), 20 deletions(-) diff --git a/sys/net/pflow.h b/sys/net/pflow.h index 84fcf1327a17..456e3de52ab1 100644 --- a/sys/net/pflow.h +++ b/sys/net/pflow.h @@ -244,7 +244,7 @@ struct pflow_softc { unsigned int sc_maxcount4; unsigned int sc_maxcount6; unsigned int sc_maxcount_nat4; - u_int64_t sc_gcounter; + u_int32_t sc_gcounter; u_int32_t sc_sequence; struct callout sc_tmo; struct callout sc_tmo6; diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c index ce5e8ec6547c..0000aa05ee0d 100644 --- a/sys/netpfil/pf/pflow.c +++ b/sys/netpfil/pf/pflow.c @@ -89,6 +89,7 @@ static int pflow_sendout_v5(struct pflow_softc *); static int pflow_sendout_ipfix(struct pflow_softc *, enum pflow_family_t); static int pflow_sendout_ipfix_tmpl(struct pflow_softc *); static int pflow_sendout_mbuf(struct pflow_softc *, struct mbuf *); +static int sysctl_pflowstats(SYSCTL_HANDLER_ARGS); static void pflow_timeout(void *); static void pflow_timeout6(void *); static void pflow_timeout_tmpl(void *); @@ -119,6 +120,17 @@ static int copy_nat_ipfix_4_to_m(struct pflow_ipfix_nat4 *, static const char pflowname[] = "pflow"; +enum pflowstat_counters { + pflow_flows, + pflow_packets, + pflow_onomem, + pflow_oerrors, + pflow_ncounters, +}; +struct pflowstats_ctr { + counter_u64_t c[pflow_ncounters]; +}; + /** * Locking concept * @@ -139,7 +151,7 @@ VNET_DEFINE(CK_LIST_HEAD(, pflow_softc), pflowif_list); #define V_pflowif_list VNET(pflowif_list) VNET_DEFINE(struct mtx, pflowif_list_mtx); #define V_pflowif_list_mtx VNET(pflowif_list_mtx) -VNET_DEFINE(struct pflowstats, pflowstat); +VNET_DEFINE(struct pflowstats_ctr, pflowstat); #define V_pflowstats VNET(pflowstat) #define PFLOW_LOCK(_sc) mtx_lock(&(_sc)->sc_lock) @@ -148,10 +160,16 @@ VNET_DEFINE(struct pflowstats, pflowstat); SYSCTL_NODE(_net, OID_AUTO, pflow, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "PFLOW"); -SYSCTL_STRUCT(_net_pflow, OID_AUTO, stats, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(pflowstat), pflowstats, +SYSCTL_PROC(_net_pflow, OID_AUTO, stats, CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, sysctl_pflowstats, "S,pflowstats", "PFLOW statistics (struct pflowstats, net/if_pflow.h)"); +static inline void +pflowstat_inc(enum pflowstat_counters c) +{ + counter_u64_add(V_pflowstats.c[c], 1); +} + static void vnet_pflowattach(void) { @@ -159,6 +177,9 @@ vnet_pflowattach(void) mtx_init(&V_pflowif_list_mtx, "pflow interface list mtx", NULL, MTX_DEF); V_pflow_unr = new_unrhdr(0, INT_MAX, &V_pflowif_list_mtx); + + for (int i = 0; i < pflow_ncounters; i++) + V_pflowstats.c[i] = counter_u64_alloc(M_WAITOK); } VNET_SYSINIT(vnet_pflowattach, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, vnet_pflowattach, NULL); @@ -175,6 +196,9 @@ vnet_pflowdetach(void) MPASS(CK_LIST_EMPTY(&V_pflowif_list)); delete_unrhdr(V_pflow_unr); mtx_destroy(&V_pflowif_list_mtx); + + for (int i = 0; i < pflow_ncounters; i++) + counter_u64_free(V_pflowstats.c[i]); } VNET_SYSUNINIT(vnet_pflowdetach, SI_SUB_PROTO_FIREWALL, SI_ORDER_FOURTH, vnet_pflowdetach, NULL); @@ -538,14 +562,14 @@ pflow_get_mbuf(struct pflow_softc *sc, u_int16_t set_id) MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { - V_pflowstats.pflow_onomem++; + pflowstat_inc(pflow_onomem); return (NULL); } MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); - V_pflowstats.pflow_onomem++; + pflowstat_inc(pflow_onomem); return (NULL); } @@ -808,8 +832,7 @@ copy_flow_to_m(struct pflow_flow *flow, struct pflow_softc *sc) (sc->sc_count * sizeof(struct pflow_flow)), sizeof(struct pflow_flow), (caddr_t)flow); - if (V_pflowstats.pflow_flows == sc->sc_gcounter) - V_pflowstats.pflow_flows++; + pflowstat_inc(pflow_flows); sc->sc_gcounter++; sc->sc_count++; @@ -839,8 +862,7 @@ copy_flow_ipfix_4_to_m(struct pflow_ipfix_flow4 *flow, struct pflow_softc *sc) (sc->sc_count4 * sizeof(struct pflow_ipfix_flow4)), sizeof(struct pflow_ipfix_flow4), (caddr_t)flow); - if (V_pflowstats.pflow_flows == sc->sc_gcounter) - V_pflowstats.pflow_flows++; + pflowstat_inc(pflow_flows); sc->sc_gcounter++; sc->sc_count4++; @@ -869,8 +891,7 @@ copy_flow_ipfix_6_to_m(struct pflow_ipfix_flow6 *flow, struct pflow_softc *sc) (sc->sc_count6 * sizeof(struct pflow_ipfix_flow6)), sizeof(struct pflow_ipfix_flow6), (caddr_t)flow); - if (V_pflowstats.pflow_flows == sc->sc_gcounter) - V_pflowstats.pflow_flows++; + pflowstat_inc(pflow_flows); sc->sc_gcounter++; sc->sc_count6++; @@ -905,10 +926,9 @@ copy_nat_ipfix_4_to_m(struct pflow_ipfix_nat4 *nat, const struct pf_kstate *st, sizeof(struct pflow_ipfix_nat4), (caddr_t)nat); sc->sc_count_nat4++; - if (V_pflowstats.pflow_flows == sc->sc_gcounter) - V_pflowstats.pflow_flows++; - + pflowstat_inc(pflow_flows); sc->sc_gcounter++; + if (sc->sc_count_nat4 >= sc->sc_maxcount_nat4) ret = pflow_sendout_ipfix(sc, PFLOW_NAT4); @@ -1116,7 +1136,7 @@ pflow_sendout_v5(struct pflow_softc *sc) sc->sc_mbuf = NULL; - V_pflowstats.pflow_packets++; + pflowstat_inc(pflow_packets); h = mtod(m, struct pflow_header *); h->count = htons(sc->sc_count); @@ -1178,14 +1198,15 @@ pflow_sendout_ipfix(struct pflow_softc *sc, enum pflow_family_t af) panic("Unsupported AF %d", af); } - V_pflowstats.pflow_packets++; + pflowstat_inc(pflow_packets); + set_hdr = mtod(m, struct pflow_set_header *); set_hdr->set_length = htons(set_length); /* populate pflow_header */ M_PREPEND(m, sizeof(struct pflow_v10_header), M_NOWAIT); if (m == NULL) { - V_pflowstats.pflow_onomem++; + pflowstat_inc(pflow_onomem); return (ENOBUFS); } h10 = mtod(m, struct pflow_v10_header *); @@ -1215,12 +1236,12 @@ pflow_sendout_ipfix_tmpl(struct pflow_softc *sc) m_copyback(m, 0, sizeof(struct pflow_ipfix_tmpl), (caddr_t)&sc->sc_tmpl_ipfix); - V_pflowstats.pflow_packets++; + pflowstat_inc(pflow_packets); /* populate pflow_header */ M_PREPEND(m, sizeof(struct pflow_v10_header), M_NOWAIT); if (m == NULL) { - V_pflowstats.pflow_onomem++; + pflowstat_inc(pflow_onomem); return (ENOBUFS); } h10 = mtod(m, struct pflow_v10_header *); @@ -1249,6 +1270,23 @@ pflow_sendout_mbuf(struct pflow_softc *sc, struct mbuf *m) return (sosend(sc->so, sc->sc_flowdst, NULL, m, NULL, 0, curthread)); } +static int +sysctl_pflowstats(SYSCTL_HANDLER_ARGS) +{ + struct pflowstats pflowstats; + + pflowstats.pflow_flows = + counter_u64_fetch(V_pflowstats.c[pflow_flows]); + pflowstats.pflow_packets = + counter_u64_fetch(V_pflowstats.c[pflow_packets]); + pflowstats.pflow_onomem = + counter_u64_fetch(V_pflowstats.c[pflow_onomem]); + pflowstats.pflow_oerrors = + counter_u64_fetch(V_pflowstats.c[pflow_oerrors]); + + return (sysctl_handle_opaque(oidp, &pflowstats, sizeof(pflowstats), req)); +} + static int pflow_nl_list(struct nlmsghdr *hdr, struct nl_pstate *npt) { From nobody Tue Jan 16 08:52:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjS55079z579jK; Tue, 16 Jan 2024 08:52: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 4TDjS51TlBz4Q30; Tue, 16 Jan 2024 08:52:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4xFgaB6I2qRZHkVUUyq8z9LqFvuta+HRmqUHpLoiiw4=; b=HphzjkdOgIQJyzy3e8QN/TafOwjHZvnEeA/tj5sA6V64wBCPSS/a+x7p7eCIrP3b/kx6u3 9wR7mceJZSn4/36WNDIvgdJPvocbmiJKEu+2+bRpw0li2EuWqYLjwkXKdmUFNlJJMsMp+L QnyrsuOLkh/NTgG+ZPAQdtnuYnPThEcEPBJxWlKO6ILXWNDf8kFYdltD/H/vzdNAsgBRAy yPUnxjhehZe+j+mP/Ml7exfJy+ybblPddjOjOsFGHTz1EIK8RhLgNYdHBN2MFxjFeMfqla WiyollE/hA1N1d9SV2R5phoS3PE3p1EmIDiR/qQcQHlXEmwPawSSbTRZNw4BAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4xFgaB6I2qRZHkVUUyq8z9LqFvuta+HRmqUHpLoiiw4=; b=ec9sT9g/urc99tCyljxo2WNQWDqsPoZRN4w0NMfsfRAh8Fm7CTuYVcp48/vB5xZf5vekls ZIRitjdWgHmAp5sUb4gHxILbbk3cYi9PeUpxAAXVDeZBjve0tZnqNvvOUW7bCkzW/mlgCE JXRfkelTrVMC+MyW+dUE9tBE+lDVZ1RtCVW/rPmOivEd1z20PQK9ilEALrNVl4gAkdEJ8s goBZkkedt1grgh5V2Oi7WjbIy958cAVyY+FyHyxdFt6eOaTQk5bvMPN7r4RoJkJTCqbrAk MNYuIFdiDf2FO6rSeeuk3LTMNng14tjG8uHYpd10Mr6oKMfEfBRspuvRAJ3lzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395125; a=rsa-sha256; cv=none; b=fSU2msGsN/qcxhvOlcj0t5b+5LyMc6LXXMfmVKsi0F8OnYbOwvuMD1LMy5UvSLYt64sLOP +TRv1R/JSY1OGuLGyL5YtENSIm90fnFZM+0unEjRxQo63RFtdF8tlP68o9RDujqe98xWAS +lKoHYTHczpR7w5iVKBU5tNtxGQE7OW4rvBmCgbFOg4s2Vo5QwVwsSk48n36S2hNykiyJY gKxJvLwKsj/8EyyyvogYR+E6n/XsXHokew/4QbqE5e7W2rlr4lewiuctCxKFCoRdyFU797 96dVMHqCllqcrePIyKIUNQsBh90poQSxGVX7th45mDnAKL6m18NEH8FxZXi4SA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjS50b6PzYS7; Tue, 16 Jan 2024 08:52:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8q4qB077449; Tue, 16 Jan 2024 08:52:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8q4R6077446; Tue, 16 Jan 2024 08:52:04 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:52:04 GMT Message-Id: <202401160852.40G8q4R6077446@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: c4d97a948753 - main - pf tests: test pflow NAT state 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4d97a94875378d69e5f87d4341b95307a241a58 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c4d97a94875378d69e5f87d4341b95307a241a58 commit c4d97a94875378d69e5f87d4341b95307a241a58 Author: Kristof Provost AuthorDate: 2023-12-15 16:52:56 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:55 +0000 pf tests: test pflow NAT state information pflow(4) now also exports NAT session creation/destruction information. Test that this works as expected. While here improve the parsing of ipfix (i.e. pflowproto 10) a bit, and check more information for the existing state information exports. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43117 --- tests/sys/netpfil/pf/pflow.sh | 58 ++++++++++++++++++++++++++++++++-- tests/sys/netpfil/pf/pft_read_ipfix.py | 41 +++++++++++++++++++++--- 2 files changed, 91 insertions(+), 8 deletions(-) diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh index 4bed49ef6f76..88478cfbfe84 100644 --- a/tests/sys/netpfil/pf/pflow.sh +++ b/tests/sys/netpfil/pf/pflow.sh @@ -124,7 +124,7 @@ state_defaults_body() ping -c 1 192.0.2.1 # We default to version 5 - atf_check -o match:"^v=5.*" \ + atf_check -o match:".*v=5.*" \ $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 # Switch to version 10 @@ -132,7 +132,7 @@ state_defaults_body() ping -c 1 192.0.2.1 - atf_check -o match:"^v=10.*" \ + atf_check -o match:".*v=10.*" \ $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 } @@ -174,7 +174,7 @@ v6_body() ping -6 -c 1 2001:db8::1 - atf_check -o match:"^v=10.*" \ + atf_check -o match:".*v=10,IPv6,proto=58,src=2001:db8::2,dst=2001:db8::1.*" \ $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 } @@ -183,9 +183,61 @@ v6_cleanup() pft_cleanup } +atf_test_case "nat" "cleanup" +nat_head() +{ + atf_set descr 'Test pflow export for NAT44' + atf_set require.user root + atf_set require.progs scapy +} + +nat_body() +{ + pflow_init + + epair=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + vnet_mkjail srv ${epair_srv}a + vnet_mkjail rtr ${epair_srv}b ${epair}a + + ifconfig ${epair}b 192.0.2.2/24 up + + jexec srv ifconfig ${epair_srv}a 198.51.100.2/24 up + jexec srv route add default 198.51.100.1 + + jexec rtr ifconfig ${epair_srv}b 198.51.100.1/24 up + jexec rtr ifconfig ${epair}a 192.0.2.1/24 up + jexec rtr sysctl net.inet.ip.forwarding=1 + + route add -net 198.51.100.0/24 192.0.2.1 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "set state-defaults pflow" \ + "nat pass on ${epair_srv}b inet from 192.0.2.0/24 to any -> (${epair_srv}b)" \ + "pass" + + pflow=$(jexec rtr pflowctl -c) + jexec rtr pflowctl -s ${pflow} dst 192.0.2.2:2055 proto 10 + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 198.51.100.2 + + atf_check -o match:".*v=10,NAT=4,proto=1,src=192.0.2.2-198.51.100.1.*" \ + $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}b --port 2055 +} + +nat_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" atf_add_test_case "state_defaults" atf_add_test_case "v6" + atf_add_test_case "nat" } diff --git a/tests/sys/netpfil/pf/pft_read_ipfix.py b/tests/sys/netpfil/pf/pft_read_ipfix.py index 64d4fcb3c523..2c11bdfd130c 100644 --- a/tests/sys/netpfil/pf/pft_read_ipfix.py +++ b/tests/sys/netpfil/pf/pft_read_ipfix.py @@ -31,6 +31,34 @@ import logging logging.getLogger("scapy").setLevel(logging.CRITICAL) import scapy.all as sp +def parse_ipfix(p): + if not sp.NetflowDataflowsetV9 in p: + # A template? + return + + c = p + while sp.NetflowDataflowsetV9 in c: + datafl = c[sp.NetflowDataflowsetV9] + if datafl.templateID == 258: + # NAT + for r in datafl.records: + print("v=10,NAT=%d,proto=%s,src=%s-%s,dst=%s-%s" % + (int.from_bytes(r.natEvent, "big"), r.PROTOCOL, + r.IPV4_SRC_ADDR, r.postNATSourceIPv4Address, + r.IPV4_DST_ADDR, r.postNATDestinationIPv4Address)) + elif datafl.templateID == 257: + # IPv6 + for r in datafl.records: + print("v=10,IPv6,proto=%s,src=%s,dst=%s" % + (r.PROTOCOL, r.IPV6_SRC_ADDR, r.IPV6_DST_ADDR)) + elif datafl.templateID == 256: + # IPv4 + for r in datafl.records: + print("v=10,proto=%s,src=%s,dst=%s" % + (r.PROTOCOL, r.IPV4_SRC_ADDR, r.IPV4_DST_ADDR)) + + c = datafl.payload + def receive(recvif, recvport): pkts = sp.sniff(iface=recvif, timeout=65) @@ -38,6 +66,8 @@ def receive(recvif, recvport): print("No data") return + pkts = sp.ipfix_defragment(pkts) + for pkt in pkts: udp = pkt.getlayer(sp.UDP) if not udp: @@ -46,18 +76,19 @@ def receive(recvif, recvport): if udp.dport != recvport: continue - hdr = pkt.getlayer(sp.NetflowHeader) + if not sp.NetflowHeader in pkt: + continue + hdr = pkt.getlayer(sp.NetflowHeader) if hdr.version == 5: v5hdr = pkt.getlayer(sp.NetflowHeaderV5) out="" for i in range(1, v5hdr.count + 1): r = pkt.getlayer(sp.NetflowRecordV5, nb=i) - out = "%s,proto=%d,src=%s,dst=%s,srcport=%d,dstport=%d" % (out, r.prot, r.src, r.dst, r.srcport, r.dstport) - print("v=%d,count=%d%s" % (hdr.version, v5hdr.count, out)) + print("v=%d,proto=%d,src=%s,dst=%s,srcport=%d,dstport=%d" % + (hdr.version, r.prot, r.src, r.dst, r.srcport, r.dstport)) elif hdr.version == 10: - print("v=10") - return + parse_ipfix(pkt) def main(): parser = argparse.ArgumentParser("pft_read_ipfix.py", From nobody Tue Jan 16 08:52:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDjS6605Nz579gL; Tue, 16 Jan 2024 08:52: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 4TDjS62Srpz4Q59; Tue, 16 Jan 2024 08:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8IL3mPXlwXzgpG/fERfZZkYMllnPchdAXMtbDndkNc=; b=lqfwCkPR1Mbxi3tU7IYJoNGsJf9x64V1QEopw6SNlz6gQWCZ8O0P/JtRn/bEoMmFHUS5u/ 642Gcr9abmUz0Nri+4EPIs5HegZl+lSAT00M4+ubcfanOttSjBkABYXJiQVN1p8QgotYhn 95HBk8LfCJqNC59MBbFYm9LHOXJznl9bYq0IMnbnH24hrTo2xX/QKUS3/yR34jEGPum9Vn psPlkaoczPHE14igD6TassenYt3OFbiXyoJ9RErmv9NpycIcqkjkF8CXHCRV0x4l8OPwIC 1+EL1HjfHS3sY8iTuzva5Evyl/U//yPMPKBmkCPZERg3uoU/Ffa6Mrhfo9uUWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705395126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8IL3mPXlwXzgpG/fERfZZkYMllnPchdAXMtbDndkNc=; b=JIJ/aPnxHF2jK0BpVNzVH4J1qM2FhnuMI9yJZwYzs78cgWQqAHvfS8yqxs61fanRKUuPeK ZLXBck+pqZZn2p0/q9p66QAafk9wMSqVHUS9Qm5GIuBZzcYiZQA/EOlk861R9QX7snCik9 QibmGVi19B4/Qxxehf9BXpcdfqkCpiRlj3IbDofeGfWHAOKy8FeKW/XDghg9Dlfi+HFykY isx/jfGP4eL35UdbdrbcSsntVNp2rySYhInivMlQfDMc1puD+OWPNtSb+SF2pjfd1o6Yhn 8rpQzSztxk7dKK5nhDe72/V4+EB8esjU2P/V71CqKivNxG2vPuZOsrnuNIQuPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705395126; a=rsa-sha256; cv=none; b=by17h5xPZvnTc4+FRVeF0m4jNHY+oMKxGIQg7wgyiPAsoJBMGLh0WZq/uotqbFKvka2sYX V1LacwqA2EQCz0vEk+zZ+Ewsmgi+cUyEwcboXLSFQ5FVsL6NxFyxM9RR7E8r3Nn3Riq2ll zNhuozxRvOqI+WYB+nkOlvf6HxwOGr3zqdFXbFVkfwH4PLcc4MpN9mgAM7XSOfefyH82LO EIPKx6+sTSQF74By+ggOvzyw83E3yVA4YMgDRCGxRqOlKco9dPAyQqg3FU8rUF4Xe4un3I 8Vnf0oSnvjU2cjKIrx2hnfeb4ra2Eyo6C9NEablGMdowyAUK0N7hD4aICkN5qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDjS61ZcqzYvp; Tue, 16 Jan 2024 08:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40G8q6PK077491; Tue, 16 Jan 2024 08:52:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40G8q6rp077488; Tue, 16 Jan 2024 08:52:06 GMT (envelope-from git) Date: Tue, 16 Jan 2024 08:52:06 GMT Message-Id: <202401160852.40G8q6rp077488@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: d086b9f77c3f - main - pf tests: test per-rule pflow List-Id: Commit messages for the main 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: d086b9f77c3f72fc5e38a2a180ef53cd82b57f2f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d086b9f77c3f72fc5e38a2a180ef53cd82b57f2f commit d086b9f77c3f72fc5e38a2a180ef53cd82b57f2f Author: Kristof Provost AuthorDate: 2024-01-11 13:54:09 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 08:45:55 +0000 pf tests: test per-rule pflow Test that we can enable pflow on a per-rule basis. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/pflow.sh | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh index 88478cfbfe84..3cef5f5a2d98 100644 --- a/tests/sys/netpfil/pf/pflow.sh +++ b/tests/sys/netpfil/pf/pflow.sh @@ -234,10 +234,59 @@ nat_cleanup() pft_cleanup } +atf_test_case "rule" "cleanup" +rule_head() +{ + atf_set descr 'Test per-rule pflow option' + atf_set require.user root + atf_set require.progs scapy +} + +rule_body() +{ + pflow_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + ifconfig ${epair}a alias 192.0.2.3/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "pass in from 192.0.2.2 keep state (pflow)" \ + "pass in from 192.0.2.3 keep state" + + pflow=$(jexec alcatraz pflowctl -c) + jexec alcatraz pflowctl -s ${pflow} dst 192.0.2.2:2055 + + # No flow is generated if we ping from 192.0.2.3 + ping -c 1 -S 192.0.2.3 192.0.2.1 + + atf_check -o match:"No data" \ + $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 + + # But there is one if we ping from 192.0.2.2 + ping -c 1 -S 192.0.2.2 192.0.2.1 + + atf_check -o match:".*v=5.*" \ + $(atf_get_srcdir)/pft_read_ipfix.py --recvif ${epair}a --port 2055 +} + +rule_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" atf_add_test_case "state_defaults" atf_add_test_case "v6" atf_add_test_case "nat" + atf_add_test_case "rule" } From nobody Tue Jan 16 14:40:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDsBK0NQ7z57Lc8; Tue, 16 Jan 2024 14:40: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 4TDsBJ73XNz4HJD; Tue, 16 Jan 2024 14:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705416041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nCj2v+BlWbIjoFDwF8rzRw0BM6THMD+P9G3vXLRO+hQ=; b=dFPmAQm1uBaTlkr2PPrIWJ8i4yhBtdhrSuCFbGSsG/XmeAl3jV3BlbPFB283rE8JwQQrtx UiXfrIyC3sGxsckpO7CQFJrxv+kj57nwyflJJtsxLBMLt/ZHL5msfPzUfQVyJfTWhzdjSn X+Erf/yFqX8xQ9MF/BeY6VcysrUWhOkSkJamwMo6btxDLjTUumGk7E1KPCdtG93psn6HhQ uAh/iqBDvYxzgIs2jtwPhvYHSNjFbORweITRrciAaab7LmCwErGpCKr1XqCZs6qC2x+Wpd JRyZyDmYLUHTERG2dmQHc4IEfv+Ozqp9BasNByrk7n29XU2k4r3HabZHro1m6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705416041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nCj2v+BlWbIjoFDwF8rzRw0BM6THMD+P9G3vXLRO+hQ=; b=TPM7Xfawyvly7STfNoN8SSH+PMR6OX94x9SWRghcfGgsK1LVburtjMZMhCS8Py9KF+bnW/ qN4e4yX8j0nJk5gVOXiJxP7dTXhK5kqNqZ2eNmLOa0Jc7ikV97KezPLCv2JLhdjbgiP/1T IlPHnlmZm7lxsl+ESv5BtfoK3uhdBTwJreZ7W69NbWcgx8NTbXl2l/9OzWBHVD8xid16Hz o0LOd/9jFSyiOqQ3dc4u5fQbBvoXG2HQKUk8yh5QiW7jrR29YLpToWBzGFNqiXix8cZLkp vJQD9m+1iG/0uB+aLlJu9IfDKYSqoHsBY6b0zgx9W2rau/seNwkNayL7Q6COhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705416041; a=rsa-sha256; cv=none; b=DY/shlUpXSH+apxe9LvtGEUPf3I2lGojTRhg/7PFGMnTIdopU2vzebyF+ZIa4P5WdKz2Vy jC0KU5+Nj88WNLc94hh2GB4/+j+BGYJDQOFz6+L34zPjy4SVVUZOAlGJcCIDbQCsWbLUct DOzEqtYuAUW5mZWZUieQiyve+V0FkQlFb6u+gpOSY2HUAZww6iSWl+fFHfjX860F7nTOle QF/1ISMKy0BdQOeJFXQw78Q1Bp3d6Rcq9uuly5+jM7VO/apbIvgNPQpFBqIeY+VNPt4OeX oxvwyX4yxd1IYSAwvo4gA+Nd1TE5Ql31TC0ZVeOlJSyWE3pMJQ0i10OLk+A2ZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDsBJ67Jfzkrc; Tue, 16 Jan 2024 14:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GEeeoX063820; Tue, 16 Jan 2024 14:40:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GEeeVw063817; Tue, 16 Jan 2024 14:40:40 GMT (envelope-from git) Date: Tue, 16 Jan 2024 14:40:40 GMT Message-Id: <202401161440.40GEeeVw063817@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: 9b20849bc5f1 - main - md5: Enter capability mode earlier List-Id: Commit messages for the main 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: 9b20849bc5f1b500f2de7aeca77f0e6556069bbb Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9b20849bc5f1b500f2de7aeca77f0e6556069bbb commit 9b20849bc5f1b500f2de7aeca77f0e6556069bbb Author: Ricardo Branco AuthorDate: 2024-01-03 18:00:47 +0000 Commit: Mark Johnston CommitDate: 2024-01-16 14:38:53 +0000 md5: Enter capability mode earlier Reviewed by: markj MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/988 --- sbin/md5/Makefile | 9 ++++++--- sbin/md5/md5.c | 57 +++++++++++++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/sbin/md5/Makefile b/sbin/md5/Makefile index c9bf16796459..f91e84323b04 100644 --- a/sbin/md5/Makefile +++ b/sbin/md5/Makefile @@ -58,16 +58,19 @@ MLINKS= md5.1 md5sum.1 \ LIBADD= md -.ifndef(BOOTSTRAPPING) +.include + +.if ${MK_CASPER} != "no" && !defined(RESCUE) && !defined(BOOTSTRAPPING) # Avoid depending on capsicum during bootstrap. caph_limit_stdout() is not # available when building for Linux/MacOS or older FreeBSD hosts. # We need to bootstrap md5 when building on Linux since the md5sum command there # produces different output. CFLAGS+=-DHAVE_CAPSICUM +CFLAGS+=-DWITH_CASPER +LIBADD+= casper +LIBADD+= cap_fileargs .endif -.include - HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c index abaadb12f3ee..c8292fe2f692 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -46,6 +46,8 @@ #ifdef HAVE_CAPSICUM #include #include +#include +#include #endif /* @@ -310,6 +312,7 @@ gnu_check(const char *checksumsfile) const char *digestname; size_t digestnamelen; size_t hashstrlen; + struct stat st; if (strcmp(checksumsfile, "-") == 0) inp = stdin; @@ -357,6 +360,15 @@ gnu_check(const char *checksumsfile) rec = malloc(sizeof(*rec)); if (rec == NULL) errx(1, "malloc failed"); + + if (*filename == '*' || + *filename == ' ' || + *filename == 'U' || + *filename == '^') { + if (lstat(filename, &st) != 0) + filename++; + } + rec->chksum = strdup(hashstr); rec->filename = strdup(filename); if (rec->chksum == NULL || rec->filename == NULL) @@ -384,6 +396,7 @@ main(int argc, char *argv[]) { #ifdef HAVE_CAPSICUM cap_rights_t rights; + fileargs_t *fa = NULL; #endif const struct option *longopts; const char *shortopts; @@ -584,24 +597,25 @@ main(int argc, char *argv[]) rec = head; } +#ifdef HAVE_CAPSICUM + fa = fileargs_init(argc, argv, O_RDONLY, 0, + cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL), FA_OPEN | FA_LSTAT); + if (fa == NULL) + err(1, "Unable to initialize casper"); + if (caph_enter_casper() < 0) + err(1, "Unable to enter capability mode"); +#endif + if (*argv) { do { - struct stat st; const char *filename = *argv; const char *filemode = "rb"; - if (*filename == '*' || - *filename == ' ' || - *filename == 'U' || - *filename == '^') { - if (lstat(filename, &st) != 0) { - input_mode = (int)*filename; - filename++; - } - } - if (input_mode == input_text) - filemode = "r"; +#ifdef HAVE_CAPSICUM + if ((f = fileargs_fopen(fa, filename, filemode)) == NULL) { +#else if ((f = fopen(filename, filemode)) == NULL) { +#endif if (errno != ENOENT || !(cflag && ignoreMissing)) { warn("%s", filename); failed = true; @@ -610,20 +624,10 @@ main(int argc, char *argv[]) rec = rec->next; continue; } - /* - * XXX Enter capability mode on the last argv file. - * When a casper file service or other approach is - * available, switch to that and enter capability mode - * earlier. - */ - if (*(argv + 1) == NULL) { #ifdef HAVE_CAPSICUM - cap_rights_init(&rights, CAP_READ, CAP_FSTAT); - if (caph_rights_limit(fileno(f), &rights) < 0 || - caph_enter() < 0) - err(1, "capsicum"); + if (caph_rights_limit(fileno(f), &rights) < 0) + err(1, "capsicum"); #endif - } if (cflag && mode != mode_bsd) { checkAgainst = rec->chksum; rec = rec->next; @@ -634,7 +638,7 @@ main(int argc, char *argv[]) } while (*++argv); } else if (!cflag && string == NULL && !skip) { #ifdef HAVE_CAPSICUM - if (caph_limit_stdin() < 0 || caph_enter() < 0) + if (caph_limit_stdin() < 0) err(1, "capsicum"); #endif if (mode == mode_bsd) @@ -658,6 +662,9 @@ main(int argc, char *argv[]) if (checksFailed != 0 || (strict && malformed > 0)) return (1); } +#ifdef HAVE_CAPSICUM + fileargs_free(fa); +#endif if (failed) return (1); if (checksFailed > 0) From nobody Tue Jan 16 14:40:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDsBL39w2z57LtD; Tue, 16 Jan 2024 14:40: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 4TDsBL0lysz4HD1; Tue, 16 Jan 2024 14:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705416042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0eBxDjHD6TqOxApZB7rhTF6OFrZXCSdaRCQUpry8zKQ=; b=tUa5Q1Rf0Q9yPCjC/sa0Y2b4UtWoYFYQf6DM1zZmBVcXLHjUbdEemjRmbWTAwAG4op4f7H ObeOXXrQAtHL8X0kVUKIjQI1BN1BUO9aT0WzI37ZjMC6/p/ALn+Kj8zm2cCka/UYA+pT6K qrBanGFKts2J1TXpyjGwFBv6PRFGaUpsAsOPMV+nvaFkd1IpqU7FqnKa5bcnZzF/izwQtG pQk84lBHyInGFs2q2SduEGkmi0S6VJLZuT5OinQsaOJE/nXrDEovEom1WpUYJ/GN1bBf6F JaBGkTJHrI/159vWKSDxiELkhVt+C49aCVFcZjV9wkvPQbb0HgEWlWJD53+7Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705416042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0eBxDjHD6TqOxApZB7rhTF6OFrZXCSdaRCQUpry8zKQ=; b=IqLklbDsY9Niq0wp0oUjSjtKU1sxPF+EwJbp0dsPZktXm62T4oZMBf5G2JBIUUyvUBjDkj EjHx1NIlbuJ/j9pOgkrZM6DqggQp+cuFuRvS+AcYbRMS3lcP9DBaoKB4ZxweqYhCGumxRp kGKZtHdbQqpnYqaE3DrccVSaoRnGwEsBSVlMlES4cubgUaCKUEqrwX3dO8OHFFmdfDbmvB kmeWo1ytyIvTowjlu0nvcqwVETPcOpQCPiR4FcVZPiIC+62dPy76xaOtQWyvLXg5eeeg4P FKM5NsrGPaL6C1VfT9u4u0N1cIOHKwAu6H6q+/WDKjxhawsRVqPZQAf9psKFng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705416042; a=rsa-sha256; cv=none; b=iwqUyC/3FhXw0fZVvGYot7JYXPm7SFtNu0V9P/xOt5QXh3fn8vd4+NpFMH0N2j6RenRYf0 c3lC4MJEBPBgrT+83lksgFtFjtMa/De4YBSsAKwt0gOLj4k4czaGHIqhD9ErHMFELC7M1o S5n9uGRjiJ7AJNCPmde8CW7lhtFDCJ7cktZcx8CskSOg1nuUz3D6Tk0OuU082QE/vjqteu UmN+IrEzW6VCTemoJTzYNhV61aWA98gfT/k8V5t8mj+wovrTQTaP51OsJTnFyE7SpAnrtd av/0f+WtBrbkjBqHx+PaCkKGTBT6Dgpnrrr6UnWifOqHJMEg9+MHw9CIFSOhFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDsBK6yXLzkZP; Tue, 16 Jan 2024 14:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GEefWW063888; Tue, 16 Jan 2024 14:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GEefh4063885; Tue, 16 Jan 2024 14:40:41 GMT (envelope-from git) Date: Tue, 16 Jan 2024 14:40:41 GMT Message-Id: <202401161440.40GEefh4063885@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: e2e956828caf - main - bhyve: return ENOMEM instead of EFAULT and call free() after being used List-Id: Commit messages for the main 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: e2e956828caf2f1db308d54b264c277c0abc25df Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e2e956828caf2f1db308d54b264c277c0abc25df commit e2e956828caf2f1db308d54b264c277c0abc25df Author: rilysh AuthorDate: 2024-01-08 06:06:55 +0000 Commit: Mark Johnston CommitDate: 2024-01-16 14:39:25 +0000 bhyve: return ENOMEM instead of EFAULT and call free() after being used 1. In basl_load() function, when allocation fails, it returns an EFAULT instead of ENOMEM. An EFAULT can mislead in some scenarios, whereas an ENOMEM for an allocation function makes much more sense. 2. Call free() on addr, as it's not being used anymore after the basl_table_append_bytes() function. Signed-off-by: rilysh MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1016 --- usr.sbin/bhyve/acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/acpi.c b/usr.sbin/bhyve/acpi.c index b3d3c13fc946..85864da57af2 100644 --- a/usr.sbin/bhyve/acpi.c +++ b/usr.sbin/bhyve/acpi.c @@ -326,7 +326,7 @@ basl_load(struct vmctx *ctx, int fd) addr = calloc(1, sb.st_size); if (addr == NULL) - return (EFAULT); + return (ENOMEM); if (read(fd, addr, sb.st_size) < 0) return (errno); @@ -338,6 +338,7 @@ basl_load(struct vmctx *ctx, int fd) BASL_EXEC(basl_table_create(&table, ctx, name, BASL_TABLE_ALIGNMENT)); BASL_EXEC(basl_table_append_bytes(table, addr, sb.st_size)); + free(addr); return (0); } From nobody Tue Jan 16 16:50:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDw3c4tDMz57bd1; Tue, 16 Jan 2024 16:50: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 4TDw3c4N42z4c4q; Tue, 16 Jan 2024 16:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v9qQew4TcrsCUFp8u/o0QVmwJNdsS1HHnN/5+f03dEI=; b=DuYAI80xoQA8zNQ+Ge5tkNyKKgYADuCgnatPsA5XRjMXstu2Y7CM5g2ow1nf0GJ6/KhuD5 GXJ6faSRvf9Mqz4P3cJ1JzAJSn/lBGLC3hvRHBd5WRxkSvuCbOqyEgzHMn23rPMI6YuqSP 4rdfpzBynNAl/39kzlrPPbGgzsJxwCozXt5AbXxT3fPWdf9Wd14UZa6IQQ1TBVCHtyLeJW 3/a7ibqKgb2jidelm/TzNF1NEuac5GjUZmILmVFDhFA6+vlc8XON+JFjyNDzNFLUzj+yAw J+M4oNmP99QCWLnuO54ZJTfLbu2nRrpxVDSROfOxIlyrmmmuFfDUVVUpgO+5Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v9qQew4TcrsCUFp8u/o0QVmwJNdsS1HHnN/5+f03dEI=; b=QuIzj9pPIDCeqMqlnfcYAGmaOpHwS555ut+gTQQFFefQP7JCVHRx9D9gBrMxn2/zXeCqut f6wcj58v8jhwOuQTNjc45Yi6agalJsHtBaZ8g02wmp0vKkUyyA6qw+vhYQKeQCRmNnkWXV WfGLlL3VqpzlKAZqeIEBfUOfux+ji+6JwjuEzSilY5NFPjCJATvwlfO0b/j2FgxtM/wLCe GPhocO34AFS+5lMgUhXWOKnCGKqKFJ/0BnIMajYHLeUHlsXwJwxvhfUhSTDNgaZgDe1YeL xruWqbks9MyPjMwRqmaaAJpW6y+awtvm+4QOTgQIYcYkAAJlkyr/ai6BZ6UqgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705423804; a=rsa-sha256; cv=none; b=JivQY1G8GjcPC4juztdpANtRsICFo+TymUHWYzgEo3iWGIgtMBh+snSCgaOS1EqAODmOdb E5PRfhhVmj2UYyRzcvk/PBn98djzNG7C/uxrSmBNs82ofSbY+JPZbMY3wmoyHHK6oKQLHZ CPxRABTzHhcVIM2EJAk/Khgd1LvUlPLzG41mIpEcWrPmZD4cEFqbi6BN76s0tBtk66dKKv ckNy1lKDitwyMns1J7rzCoOV+aCM62W1ocYt7gaEO4bawHUWgvJUG2fTyDuT3Abq1jicRZ cgVivZhZpHbfN4JqahSe3tmGnX36TOL9xt7K6G11myPwB2dQ9tPp18LToHvDRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDw3c3S3CznQ7; Tue, 16 Jan 2024 16:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GGo4CM073736; Tue, 16 Jan 2024 16:50:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GGo4o5073731; Tue, 16 Jan 2024 16:50:04 GMT (envelope-from git) Date: Tue, 16 Jan 2024 16:50:04 GMT Message-Id: <202401161650.40GGo4o5073731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 18d87fe4fe3b - main - snd_uaudio: provide information about the device name and attached 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18d87fe4fe3b310796e138855016678453140423 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=18d87fe4fe3b310796e138855016678453140423 commit 18d87fe4fe3b310796e138855016678453140423 Author: Christos Margiolis AuthorDate: 2024-01-16 16:46:49 +0000 Commit: Christos Margiolis CommitDate: 2024-01-16 16:46:49 +0000 snd_uaudio: provide information about the device name and attached driver Unlike the other sound drivers, snd_uaudio(4) doesn't provide information about the device's description and the driver it's attached to. A side-effect of this is that applications such as mixer(8), that fetch these strings through the OSS API's SNDCTL_CARDINFO ioctl will show a USB audio device as: pcm0:mixer: at ? kld snd_uaudio This patch replaces the generic "USB Audio" description with the device's actual manufacturer and product strings, and the "at ?" string with the driver it's attached to: pcm0:mixer: at uaudio0 kld snd_uaudio Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D43347 --- sys/dev/sound/usb/uaudio.c | 11 +++++++++-- sys/dev/sound/usb/uaudio_pcm.c | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index a14cdf805353..3237093bcbfa 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1171,7 +1171,7 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas { struct uaudio_softc *sc = device_get_softc(device_get_parent(dev)); unsigned i = uaudio_get_child_index_by_dev(sc, dev); - char status[SND_STATUSLEN]; + char status[SND_STATUSLEN], desc[128]; uaudio_mixer_init(sc, i); @@ -1199,7 +1199,14 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas mixer_hwvol_init(dev); - snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); + snprintf(desc, sizeof(desc), "%s %s", + usb_get_manufacturer(sc->sc_udev), + usb_get_product(sc->sc_udev)); + device_set_desc_copy(dev, desc); + + snprintf(status, sizeof(status), "at %s %s", + device_get_nameunit(device_get_parent(dev)), + PCM_KLDSTRING(snd_uaudio)); if (pcm_register(dev, sc, (sc->sc_play_chan[i].num_alt > 0) ? 1 : 0, diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c index 3236e1bd2e5c..bf1f2ebb5e33 100644 --- a/sys/dev/sound/usb/uaudio_pcm.c +++ b/sys/dev/sound/usb/uaudio_pcm.c @@ -201,7 +201,6 @@ ua_probe(device_t dev) (func->func != SCF_PCM)) { return (ENXIO); } - device_set_desc(dev, "USB audio"); return (BUS_PROBE_DEFAULT); } From nobody Tue Jan 16 16:50:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDw3d5Cqzz57bTn; Tue, 16 Jan 2024 16:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDw3d4ymfz4c4r; Tue, 16 Jan 2024 16:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6r9AqgRcMtOZDYYpaNhhiiyFqEluYct4oquFMylkCzc=; b=nmGT7RXYgz7YxnWJPaO0Rdrt3HC6fcS8mNk3Y7v+OrMEZq5Vkgw2f9ySF9gY2T5TgLW7nD kAlFtptsKktKx9uJR1A4HTQlIpzRyRGB9YielnGzkWUaORIlhoobPXpDdJ7UV742dKtSUP 5TOiIcjo0N+gyo85O/QHvigdwPIKMlgxsVj7NKeL95t2QQSxwl8sYLCrzjIy4C+WB9Jq4F Uai1VnPVgKCIbZYMvoblGAssdLHQg1VUOopavD4QWiafGD+HHhE4n2UYF0HrXOv0JaJwSC KMkfzn/dqpJEbf4H/Ew/h02zT7x+F77sm2O1EGB9HzvGjWHtS4Rtz/6P+ljr8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6r9AqgRcMtOZDYYpaNhhiiyFqEluYct4oquFMylkCzc=; b=uQOuA2SJ8/ivwLe+zCAMqmHb9blqA6QoRgHlces+45KILykZAZKfqgN4zCHxEWsEAidBvl JJNT9tSotWB5n7w6a/r2mqTupm3+KPgs1mKeI7uxU5qBfvuvy/UZVBpeAgvJmUT9WsDPka 5xmBcA5m9F3tX0Aqyh0duCtxA1JtO88c/6EGG+sah0vV4UK9Q7f5geK+PktkMZ2aRQSXN4 E2tirZXYYb61rtMZv6wPL+3uUVbyTLx7aUc/cxMUnHmsesIB1bNq3XSTnBiiuIpO2meBEH KFLFX2/F/9cmeTwd2CrV53NslfS/ohSbCBQ3tKvKFl6ldCJS7KKxGs7dMRhLig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705423805; a=rsa-sha256; cv=none; b=rFgEp/A/cjpidkUQyJG4SXHB7cIi3UF8get8OJl0oLG1tWDcZCPCHFa6qbqEKsHMb9OL7F sD2zoDPiFNVeYnMLz53/RCk+UJJJwuym7PDit0tbpMV5w3vL595NMDw4Fdn/EzivVE5Cj2 NmwxyaUoCyaT4NhztSrFrqNP93k+Yp8IA7G/YJOo9l2dbzX/VD1hc3dJP5rinEx9M6Vrb6 C/pdKZTmNFyUZe1bXRj7lac8+1F8Pxbui5Z9CELQwdkiqhGl4XAk7PYPsj+bKsDdKvgRub XuPqk0YCMMqVdzIJ6Chshp+pkXTMRo+7ORDnjTuRs+CWrLZjHW1oaHF+gLjJMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDw3d42J0znq3; Tue, 16 Jan 2024 16:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GGo5DQ074027; Tue, 16 Jan 2024 16:50:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GGo5Ij074016; Tue, 16 Jan 2024 16:50:05 GMT (envelope-from git) Date: Tue, 16 Jan 2024 16:50:05 GMT Message-Id: <202401161650.40GGo5Ij074016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 837cd192ebf2 - main - sound: remove PCM_KLDSTRING() and fix status strings List-Id: Commit messages for the main 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 837cd192ebf2d0d4f5ded8883403ef11e6fa6438 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=837cd192ebf2d0d4f5ded8883403ef11e6fa6438 commit 837cd192ebf2d0d4f5ded8883403ef11e6fa6438 Author: Christos Margiolis AuthorDate: 2024-01-16 16:48:14 +0000 Commit: Christos Margiolis CommitDate: 2024-01-16 16:48:14 +0000 sound: remove PCM_KLDSTRING() and fix status strings PCM_KLDSTRING() prints the kernel module associated with a given audio device only when that module is not compiled in. Get rid of PCM_KLDSTRING() altogether and print the driver name (even for modules that are compiled in) instead, as it implies the module as well. While here, convert all status strings to the following dmesg-like format: [ ] on Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: markj, imp Differential Revision: https://reviews.freebsd.org/D43349 --- sys/dev/sound/pci/als4000.c | 5 +++-- sys/dev/sound/pci/atiixp.c | 4 ++-- sys/dev/sound/pci/cmi.c | 5 +++-- sys/dev/sound/pci/cs4281.c | 7 ++++--- sys/dev/sound/pci/csapcm.c | 5 +++-- sys/dev/sound/pci/emu10k1.c | 4 ++-- sys/dev/sound/pci/emu10kx-pcm.c | 3 ++- sys/dev/sound/pci/envy24.c | 5 +++-- sys/dev/sound/pci/envy24ht.c | 5 +++-- sys/dev/sound/pci/es137x.c | 6 +++--- sys/dev/sound/pci/fm801.c | 7 ++++--- sys/dev/sound/pci/hda/hdaa.c | 5 ++--- sys/dev/sound/pci/hdspe-pcm.c | 4 ++-- sys/dev/sound/pci/ich.c | 5 +++-- sys/dev/sound/pci/maestro3.c | 6 +++--- sys/dev/sound/pci/neomagic.c | 5 +++-- sys/dev/sound/pci/solo.c | 5 +++-- sys/dev/sound/pci/t4dwave.c | 5 +++-- sys/dev/sound/pci/via8233.c | 4 ++-- sys/dev/sound/pci/via82c686.c | 4 ++-- sys/dev/sound/pci/vibes.c | 5 +++-- sys/dev/sound/pcm/sound.h | 6 ------ sys/dev/sound/usb/uaudio.c | 5 ++--- 23 files changed, 60 insertions(+), 55 deletions(-) diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c index 5b7247517c13..b1376d2b6e5a 100644 --- a/sys/dev/sound/pci/als4000.c +++ b/sys/dev/sound/pci/als4000.c @@ -847,8 +847,9 @@ als_pci_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &alspchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &alsrchan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", - rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_als4000)); + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", + rman_get_start(sc->reg), rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/atiixp.c b/sys/dev/sound/pci/atiixp.c index 78be9475acd3..dcbf041f9605 100644 --- a/sys/dev/sound/pci/atiixp.c +++ b/sys/dev/sound/pci/atiixp.c @@ -1097,9 +1097,9 @@ atiixp_chip_post_init(void *arg) "polling", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc->dev, sizeof(sc->dev), sysctl_atiixp_polling, "I", "Enable polling mode"); - snprintf(status, SND_STATUSLEN, "at memory 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "mem 0x%jx irq %jd on %s", rman_get_start(sc->reg), rman_get_start(sc->irq), - PCM_KLDSTRING(snd_atiixp)); + device_get_nameunit(device_get_parent(sc->dev))); pcm_setstatus(sc->dev, status); diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c index 4fd6ac4c0a75..9a92066c51a4 100644 --- a/sys/dev/sound/pci/cmi.c +++ b/sys/dev/sound/pci/cmi.c @@ -990,8 +990,9 @@ cmi_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &cmichan_class, sc); pcm_addchan(dev, PCMDIR_REC, &cmichan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", - rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_cmi)); + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", + rman_get_start(sc->reg), rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); DEB(printf("cmi_attach: succeeded\n")); diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c index 25beb3f7fd0d..972b83efff8f 100644 --- a/sys/dev/sound/pci/cs4281.c +++ b/sys/dev/sound/pci/cs4281.c @@ -845,9 +845,10 @@ cs4281_pci_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &cs4281chan_class, sc); pcm_addchan(dev, PCMDIR_REC, &cs4281chan_class, sc); - snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s", - (sc->regtype == SYS_RES_IOPORT)? "io" : "memory", - rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_cs4281)); + snprintf(status, SND_STATUSLEN, "%s 0x%jx irq %jd on %s", + (sc->regtype == SYS_RES_IOPORT)? "port" : "mem", + rman_get_start(sc->reg), rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c index 8715072ec0e5..71b9a0253cdb 100644 --- a/sys/dev/sound/pci/csapcm.c +++ b/sys/dev/sound/pci/csapcm.c @@ -819,8 +819,9 @@ pcmcsa_attach(device_t dev) return (ENXIO); } - snprintf(status, SND_STATUSLEN, "at irq %jd %s", - rman_get_start(resp->irq),PCM_KLDSTRING(snd_csa)); + snprintf(status, SND_STATUSLEN, "irq %jd on %s", + rman_get_start(resp->irq), + device_get_nameunit(device_get_parent(dev))); /* Enable interrupt. */ if (snd_setup_intr(dev, resp->irq, 0, csa_intr, csa, &csa->ih)) { diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c index 92937c2d0c42..0813f89c87b8 100644 --- a/sys/dev/sound/pci/emu10k1.c +++ b/sys/dev/sound/pci/emu10k1.c @@ -2126,9 +2126,9 @@ emu_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(sc->reg), rman_get_start(sc->irq), - PCM_KLDSTRING(snd_emu10k1)); + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, sc, sc->nchans, gotmic ? 3 : 2)) goto bad; for (i = 0; i < sc->nchans; i++) diff --git a/sys/dev/sound/pci/emu10kx-pcm.c b/sys/dev/sound/pci/emu10kx-pcm.c index 661d65165190..b4633efdddc7 100644 --- a/sys/dev/sound/pci/emu10kx-pcm.c +++ b/sys/dev/sound/pci/emu10kx-pcm.c @@ -1477,7 +1477,8 @@ emu_pcm_attach(device_t dev) if (route == RT_MCHRECORD) pcm_addchan(dev, PCMDIR_REC, &emufxrchan_class, sc); - snprintf(status, SND_STATUSLEN, "on %s", device_get_nameunit(device_get_parent(dev))); + snprintf(status, SND_STATUSLEN, "on %s", + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return (0); diff --git a/sys/dev/sound/pci/envy24.c b/sys/dev/sound/pci/envy24.c index 24b5abc0eeb9..f7cc7ff5724d 100644 --- a/sys/dev/sound/pci/envy24.c +++ b/sys/dev/sound/pci/envy24.c @@ -2590,7 +2590,7 @@ envy24_pci_attach(device_t dev) /* set status iformation */ snprintf(status, SND_STATUSLEN, - "at io 0x%jx:%jd,0x%jx:%jd,0x%jx:%jd,0x%jx:%jd irq %jd", + "port 0x%jx:%jd,0x%jx:%jd,0x%jx:%jd,0x%jx:%jd irq %jd on %s", rman_get_start(sc->cs), rman_get_end(sc->cs) - rman_get_start(sc->cs) + 1, rman_get_start(sc->ddma), @@ -2599,7 +2599,8 @@ envy24_pci_attach(device_t dev) rman_get_end(sc->ds) - rman_get_start(sc->ds) + 1, rman_get_start(sc->mt), rman_get_end(sc->mt) - rman_get_start(sc->mt) + 1, - rman_get_start(sc->irq)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/envy24ht.c b/sys/dev/sound/pci/envy24ht.c index 6a3ef5afcf59..65c67b84ce53 100644 --- a/sys/dev/sound/pci/envy24ht.c +++ b/sys/dev/sound/pci/envy24ht.c @@ -2496,12 +2496,13 @@ envy24ht_pci_attach(device_t dev) /* set status iformation */ snprintf(status, SND_STATUSLEN, - "at io 0x%jx:%jd,0x%jx:%jd irq %jd", + "port 0x%jx:%jd,0x%jx:%jd irq %jd on %s", rman_get_start(sc->cs), rman_get_end(sc->cs) - rman_get_start(sc->cs) + 1, rman_get_start(sc->mt), rman_get_end(sc->mt) - rman_get_start(sc->mt) + 1, - rman_get_start(sc->irq)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 8c1c2b34e1cf..8f832d899dd3 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -1856,10 +1856,10 @@ es_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s", - (es->regtype == SYS_RES_IOPORT)? "io" : "memory", + snprintf(status, SND_STATUSLEN, "%s 0x%jx irq %jd on %s", + (es->regtype == SYS_RES_IOPORT)? "port" : "mem", rman_get_start(es->reg), rman_get_start(es->irq), - PCM_KLDSTRING(snd_es137x)); + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, es, numplay, 1)) goto bad; diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c index d7aa731175bb..fbde14f37afe 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -636,9 +636,10 @@ fm801_pci_attach(device_t dev) goto oops; } - snprintf(status, 64, "at %s 0x%jx irq %jd %s", - (fm801->regtype == SYS_RES_IOPORT)? "io" : "memory", - rman_get_start(fm801->reg), rman_get_start(fm801->irq),PCM_KLDSTRING(snd_fm801)); + snprintf(status, SND_STATUSLEN, "%s 0x%jx irq %jd on %s", + (fm801->regtype == SYS_RES_IOPORT)? "port" : "mem", + rman_get_start(fm801->reg), rman_get_start(fm801->irq), + device_get_nameunit(device_get_parent(dev))); #define FM801_MAXPLAYCH 1 if (pcm_register(dev, fm801, FM801_MAXPLAYCH, 1)) goto oops; diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index 1831ae0c1f19..e64eac6114e4 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -7114,9 +7114,8 @@ hdaa_pcm_attach(device_t dev) hdaa_unlock(devinfo); } - snprintf(status, SND_STATUSLEN, "on %s %s", - device_get_nameunit(device_get_parent(dev)), - PCM_KLDSTRING(snd_hda)); + snprintf(status, SND_STATUSLEN, "on %s", + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); return (0); diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index d9d40c9877ad..0360e84fbe91 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -1043,10 +1043,10 @@ hdspe_pcm_attach(device_t dev) scp->chnum++; } - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(scp->sc->cs), rman_get_start(scp->sc->irq), - PCM_KLDSTRING(snd_hdspe)); + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); mixer_init(dev, &hdspemixer_class, scp); diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 70a9440d9b23..fbde0accfd28 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -686,9 +686,10 @@ ich_setstatus(struct sc_info *sc) char status[SND_STATUSLEN]; snprintf(status, SND_STATUSLEN, - "at io 0x%jx, 0x%jx irq %jd bufsz %u %s", + "port 0x%jx,0x%jx irq %jd on %s", rman_get_start(sc->nambar), rman_get_start(sc->nabmbar), - rman_get_start(sc->irq), sc->bufsz,PCM_KLDSTRING(snd_ich)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(sc->dev))); if (bootverbose && (sc->flags & ICH_DMA_NOCACHE)) device_printf(sc->dev, diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c index 9ba83fe4de11..6dd54a66f683 100644 --- a/sys/dev/sound/pci/maestro3.c +++ b/sys/dev/sound/pci/maestro3.c @@ -1439,10 +1439,10 @@ m3_pci_attach(device_t dev) goto bad; } } - snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s", - (sc->regtype == SYS_RES_IOPORT)? "io" : "memory", + snprintf(status, SND_STATUSLEN, "%s 0x%jx irq %jd on %s", + (sc->regtype == SYS_RES_IOPORT)? "port" : "mem", rman_get_start(sc->reg), rman_get_start(sc->irq), - PCM_KLDSTRING(snd_maestro3)); + device_get_nameunit(device_get_parent(dev))); if (pcm_setstatus(dev, status)) { device_printf(dev, "attach: pcm_setstatus error\n"); goto bad; diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c index 1b325205da5f..25273633ff18 100644 --- a/sys/dev/sound/pci/neomagic.c +++ b/sys/dev/sound/pci/neomagic.c @@ -702,9 +702,10 @@ nm_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at memory 0x%jx, 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "mem 0x%jx,0x%jx irq %jd on %s", rman_get_start(sc->buf), rman_get_start(sc->reg), - rman_get_start(sc->irq),PCM_KLDSTRING(snd_neomagic)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, sc, 1, 1)) goto bad; pcm_addchan(dev, PCMDIR_REC, &nmchan_class, sc); diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c index d626da4fbb68..bee79e723696 100644 --- a/sys/dev/sound/pci/solo.c +++ b/sys/dev/sound/pci/solo.c @@ -1022,9 +1022,10 @@ ess_attach(device_t dev) if (mixer_init(dev, &solomixer_class, sc)) goto no; - snprintf(status, SND_STATUSLEN, "at io 0x%jx,0x%jx,0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx,0x%jx,0x%jx irq %jd on %s", rman_get_start(sc->io), rman_get_start(sc->sb), rman_get_start(sc->vc), - rman_get_start(sc->irq),PCM_KLDSTRING(snd_solo)); + rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, sc, 1, 1)) goto no; diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index 250b04426482..653e610febbe 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -917,8 +917,9 @@ tr_pci_attach(device_t dev) goto bad; } - snprintf(status, 64, "at io 0x%jx irq %jd %s", - rman_get_start(tr->reg), rman_get_start(tr->irq),PCM_KLDSTRING(snd_t4dwave)); + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", + rman_get_start(tr->reg), rman_get_start(tr->irq), + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, tr, dacn, 1)) goto bad; diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index 517e80fadb4f..9f3b312e4365 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -1347,9 +1347,9 @@ via_attach(device_t dev) ac97_setextmode(via->codec, ext); } - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(via->reg), rman_get_start(via->irq), - PCM_KLDSTRING(snd_via8233)); + device_get_nameunit(device_get_parent(dev))); /* Register */ if (pcm_register(dev, via, via_dxs_chnum + via_sgd_chnum, NWRCHANS)) diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c index 266441a938c6..44f846b684d7 100644 --- a/sys/dev/sound/pci/via82c686.c +++ b/sys/dev/sound/pci/via82c686.c @@ -580,9 +580,9 @@ via_attach(device_t dev) NSEGS * sizeof(struct via_dma_op), dma_cb, via, 0) != 0) goto bad; - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", rman_get_start(via->reg), rman_get_start(via->irq), - PCM_KLDSTRING(snd_via82c686)); + device_get_nameunit(device_get_parent(dev))); /* Register */ if (pcm_register(dev, via, 1, 1)) goto bad; diff --git a/sys/dev/sound/pci/vibes.c b/sys/dev/sound/pci/vibes.c index 538aa961d987..e587f0113b5d 100644 --- a/sys/dev/sound/pci/vibes.c +++ b/sys/dev/sound/pci/vibes.c @@ -874,8 +874,9 @@ sv_attach(device_t dev) { pcm_addchan(dev, PCMDIR_PLAY, &svpchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &svrchan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", - rman_get_start(sc->enh_reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_vibes)); + snprintf(status, SND_STATUSLEN, "port 0x%jx irq %jd on %s", + rman_get_start(sc->enh_reg), rman_get_start(sc->irq), + device_get_nameunit(device_get_parent(dev))); pcm_setstatus(dev, status); DEB(printf("sv_attach: succeeded\n")); diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 5981266116fb..5b366a62630c 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -598,12 +598,6 @@ int sound_oss_card_info(oss_card_info *); PCM_GIANT_EXIT(x); \ } while (0) -#ifdef KLD_MODULE -#define PCM_KLDSTRING(a) ("kld " # a) -#else -#define PCM_KLDSTRING(a) "" -#endif - #endif /* _KERNEL */ #endif /* _OS_H_ */ diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 3237093bcbfa..36985d4666a4 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1204,9 +1204,8 @@ uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_clas usb_get_product(sc->sc_udev)); device_set_desc_copy(dev, desc); - snprintf(status, sizeof(status), "at %s %s", - device_get_nameunit(device_get_parent(dev)), - PCM_KLDSTRING(snd_uaudio)); + snprintf(status, sizeof(status), "on %s", + device_get_nameunit(device_get_parent(dev))); if (pcm_register(dev, sc, (sc->sc_play_chan[i].num_alt > 0) ? 1 : 0, From nobody Tue Jan 16 16:50:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDw3g0ckTz57bRp; Tue, 16 Jan 2024 16:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDw3f5bYgz4c0k; Tue, 16 Jan 2024 16:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vXX/eirNJWe6K//Z19TQrM+zrNweczpT07gJoD8FAn8=; b=GrxhgqbjSOAOBUnXzGGHqR7+eZ3X5LjtseCQ5dvw41s2ykAH/N9928gXHS6Q4OMmDXxwQ2 CF8WgE8B843Ua44+i39TjeViOfZH+r8icid1SQPviDdEEzllCWjGYyJdy8VqovP9UtfhHr EHzJ2WkE/iEplwaGa17TUGnU51goI2DnNnp+9QAiueOnHz2sFJ7qGKR/xvlZaZYKXcGmQb aYXFSB1gMIRjNZDwGIMQnxKUyEFF6rAwZTVjpu0vPRfbWVR8hEW8552KjXe/4vsSqfqnA6 83AdP+nCwkR6EFAtaRW5DB5cGZmFtc4aHPPY371+YgAxC4FPpdCV+08YWeRuXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vXX/eirNJWe6K//Z19TQrM+zrNweczpT07gJoD8FAn8=; b=BhQcWcB6MvlGhWGbzWz/7PYkuRqYTdhdnyzTbWWoXIHshduhxAQLSxwtYxsS1abVt87vz9 HY+VJD2Ag8yh4j8tDZ5blGWqCJpWPUXrr5nTjLCloR9KHiDnNEUqi6Snmlcbmiwn8vPIx9 c8wmNbezRsRtCPKxSYb1HriGUF2nNikeaduRx8JTtSfmSsg/jzfFTz7vNKix5XvvudwF8T FW824imeCFae0WnyRI2cFhefsoPidyrzJF5vq4RC8atMyl1Y8AKlxCc+tMejs6lc5ZfdgV qPx2r1JE8eHbfoLp8qu9XHdYyEjP4wV74f9qeTMpvEMUrPzGEHLv/ZhQqdF51g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705423806; a=rsa-sha256; cv=none; b=v7srCvzKKyCYNiptxEv+tPObE7FiclkAIVhDSn78xocxROwX8OLw4hUGAxca52KUZwinnz 1AI+lWLm+B5aPLHlqIzMya+jtCUuZYMn8gHgwAwqiaFTPTZAvXpSKuS1wnCqpBMiP+ni0A xXS5mAIRH4WTIqKOxIjh2EjZH6UnJBfivRW53lD5n5PgNc6XZLPoy5m6hr/57KR/b33o/v K8sC3RJheNv5Qx2jCu0pIWiU6O24jU+V/W3FQquaDM4JtLzTf1TO1vgknI0GVA4JlE1/gY F80Pw8oplByLFzPR/a8AnIcZYvKmlU/3YmANjQJcS+kWgAsp8WmEszA70q6arQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDw3f4dMjznq4; Tue, 16 Jan 2024 16:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GGo6eY074307; Tue, 16 Jan 2024 16:50:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GGo6r9074302; Tue, 16 Jan 2024 16:50:06 GMT (envelope-from git) Date: Tue, 16 Jan 2024 16:50:06 GMT Message-Id: <202401161650.40GGo6r9074302@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 06a4376346e5 - main - snd_uaudio: prefix module declaration with "snd_" List-Id: Commit messages for the main 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06a4376346e55d1c7aefe7a48063dddc4d1da9b9 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=06a4376346e55d1c7aefe7a48063dddc4d1da9b9 commit 06a4376346e55d1c7aefe7a48063dddc4d1da9b9 Author: Christos Margiolis AuthorDate: 2024-01-16 16:48:49 +0000 Commit: Christos Margiolis CommitDate: 2024-01-16 16:48:49 +0000 snd_uaudio: prefix module declaration with "snd_" Although the module is compiled "snd_uaudio.ko", follow the rest of the sound modules' naming convention in the declaration as well. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D43396 --- sys/dev/sound/usb/uaudio.c | 10 +++++----- sys/dev/sound/usb/uaudio_pcm.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 36985d4666a4..ebbff0e633e4 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -6230,10 +6230,10 @@ uaudio_hid_detach(struct uaudio_softc *sc) usbd_transfer_unsetup(sc->sc_hid.xfer, UAUDIO_HID_N_TRANSFER); } -DRIVER_MODULE_ORDERED(uaudio, uhub, uaudio_driver, NULL, NULL, SI_ORDER_ANY); -MODULE_DEPEND(uaudio, usb, 1, 1, 1); -MODULE_DEPEND(uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); -MODULE_DEPEND(uaudio, hid, 1, 1, 1); -MODULE_VERSION(uaudio, 1); +DRIVER_MODULE_ORDERED(snd_uaudio, uhub, uaudio_driver, NULL, NULL, SI_ORDER_ANY); +MODULE_DEPEND(snd_uaudio, usb, 1, 1, 1); +MODULE_DEPEND(snd_uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_DEPEND(snd_uaudio, hid, 1, 1, 1); +MODULE_VERSION(snd_uaudio, 1); USB_PNP_HOST_INFO(uaudio_devs); USB_PNP_HOST_INFO(uaudio_vendor_midi); diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c index bf1f2ebb5e33..9b17cb232907 100644 --- a/sys/dev/sound/usb/uaudio_pcm.c +++ b/sys/dev/sound/usb/uaudio_pcm.c @@ -235,6 +235,6 @@ static driver_t ua_pcm_driver = { }; DRIVER_MODULE(ua_pcm, uaudio, ua_pcm_driver, 0, 0); -MODULE_DEPEND(ua_pcm, uaudio, 1, 1, 1); +MODULE_DEPEND(ua_pcm, snd_uaudio, 1, 1, 1); MODULE_DEPEND(ua_pcm, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(ua_pcm, 1); From nobody Tue Jan 16 16:50:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDw3h0nl0z57bPQ; Tue, 16 Jan 2024 16:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDw3g64HWz4c7P; Tue, 16 Jan 2024 16:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AY+ypusHWMqyztTPoCu15bzUoMpaXBOGFKWcnKHb1Zk=; b=li7+zETMYeqbijxXK5A/HzLBnkZ9lAvt01j9sX2L3y2XqEnB7g1yFNz/PhUwhj+gcAMu/G wID3/kXy6HOPWJNVPArwtx6S03MuNTgIXjbtbyzonhM6EgEygo82eJIgBb21H+lE6G6QQm BfJtcncr/9PLfJ31nQI1/+trQzS+kzDi2gJGbUEz0zjlv0Jq84iuYLrigYWUB5uUVOCBj1 0JmVKQedR/1sr8IZK5tiJybZeaK5N50UFIOCdsc/sVFxfLMM5KRzi2z85zF6tZbbkmet8h cxgxN+7C/YVX9/7XRoPolEMmewxLVYi0BErZeTgi7Rj70xqvLyY/FVGuce1Nlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AY+ypusHWMqyztTPoCu15bzUoMpaXBOGFKWcnKHb1Zk=; b=YcvUTHDWOnuFaS/hGGLqznh2QSa4hSgXAAg+0kh1Vb8W/W2SI7Oz5wJrYC4vFj9XTZ9fht TIE89mNnPTqsSssqXt7hbRaA+evZeDpDXWUOVdnPQpyUSBiC3EmGGc+1s1UQDI1nSKXXZM +RyLr303lD4vm1Z1upip/H9uAfI9k9Py80ycNHVPFZJImzPaDYsaq3npLdpVDAVIen3BGe OMP2WVk72VmveoPJSQyCsKJNdJBdG6SgpmOTlm5lxnZtB+EDu8Buz3i6DGzAJfFllmAdsI 1j1Xcyf7W1dfnHlN8qGA3wM4Ntf+hsdrHf6I8KGurDpIQ6soTWHRnANazl0+hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705423807; a=rsa-sha256; cv=none; b=YtZrtlnTGxPOwYupds5zmcsQlITOqZOBN7EhsRsk1Ge3YZVu2gSzm2zJjtqGQIQpN4QPbz 2VqExjp3BDbxkzIJ9HPLereV0ktIOAnytRJBi2PSWENx3FQYthNbeoMLEkYWWU1Axaiwr9 JcsQeO2VnUhd473srgyTiokrGJ90B22eQ5VpHzjPvQZJHI+ZY223JEtx4RTEAqHr+ube+r k0aOvcx+aAbCEVNRwLm36F4WiyjnqIXIs0ZVvB/BxHjdozWcC/3KsneatUfHDaN4N3N/7b SR0NVGYXfrDt5wZIxGcwd68C9p6pOFNtie8lD9EPoRUv737t75nCXEJgAdpAZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDw3g5BC4znY4; Tue, 16 Jan 2024 16:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GGo7Ze074589; Tue, 16 Jan 2024 16:50:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GGo7rw074585; Tue, 16 Jan 2024 16:50:07 GMT (envelope-from git) Date: Tue, 16 Jan 2024 16:50:07 GMT Message-Id: <202401161650.40GGo7rw074585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 3a79c3ac8aa3 - main - sound: add missing modules to snd_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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a79c3ac8aa3c548aab9ad38acc4f480ab9e7a5b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=3a79c3ac8aa3c548aab9ad38acc4f480ab9e7a5b commit 3a79c3ac8aa3c548aab9ad38acc4f480ab9e7a5b Author: Christos Margiolis AuthorDate: 2024-01-16 16:48:56 +0000 Commit: Christos Margiolis CommitDate: 2024-01-16 16:48:56 +0000 sound: add missing modules to snd_driver While here, remove unnecessary break. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D43394 --- sys/dev/sound/driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/driver.c b/sys/dev/sound/driver.c index b7791f5223c9..927941ab3d01 100644 --- a/sys/dev/sound/driver.c +++ b/sys/dev/sound/driver.c @@ -43,7 +43,6 @@ snd_modevent(module_t mod, int type, void *data) break; default: return (ENOTSUP); - break; } return 0; } @@ -68,6 +67,7 @@ MODULE_DEPEND(snd_driver, snd_envy24ht, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_es137x, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_fm801, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_hda, 1, 1, 1); +MODULE_DEPEND(snd_driver, snd_hdspe, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_ich, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_maestro3, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_neomagic, 1, 1, 1); @@ -77,3 +77,4 @@ MODULE_DEPEND(snd_driver, snd_t4dwave, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_via8233, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_via82c686, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_vibes, 1, 1, 1); +MODULE_DEPEND(snd_driver, snd_uaudio, 1, 1, 1); From nobody Tue Jan 16 16:50:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDw3j1XZ2z57bd3; Tue, 16 Jan 2024 16:50: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 4TDw3h6cvMz4cB8; Tue, 16 Jan 2024 16:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+C9qNsjbogCzth96jVl9rRmPWj/9g29SqoIgNUHLSeQ=; b=rl9oYm33q9L6a2mQtTtLyvSlum/dPxEBbtGSXiEzSpRD7UEDBgMGjDpiLBT1gQwiaCWQr5 FZCY7r0Yy67/LYjqpa18BmHndZptp1jZ0uNRvAcHnzubLhUCPqVM5goYMqK+ngXGQl71VZ diJwEXejk0858HHHOr8IgutAeE83CUUVExgdbGauX4C4oXRRxsnGhiINgWDdELRIYZC+JX V16nHK3KJ/w33sl/5eiDAnuewd6hKjiFqQEnxC2A+d2TUmhpU3zLgtYupr3LAO7vFPHgWX VGNrV+B0Qb4vaRb4HyxcE9eSLnQqeUXO3QpeHR5Dbdo5uRyDTTyPL0OoVmzfdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+C9qNsjbogCzth96jVl9rRmPWj/9g29SqoIgNUHLSeQ=; b=CaVeLwx8YOkjC9v3dnEKs6QkBjxVLNAsCYz9Sy/DAzHu0020gMU+avdIS5QcI7/5itYdZo 7aImzRkgFsj1p/TW7rApLDHiiBUPFQz5YCd2ELJdk1JnMnqvVhjuWSNXwVxzUhamW0DfW2 mgRWmaz48pW40FbRWtZSPFOC95VfkVWSOtWIqTE5nUX5vsupUeUvw4vQvWu6K/FuFFJMBM XWj+M6yobtaJyPFwybqBmqz8xuXAwu8mmfimknpGydDHyhxYaO6839WDB8Ace0VxkMpuCh cVl+4wLP5rGHMuOGiw6eTlHpUAJrLGNUK2fPLd+Rtr3RIQV3nrwGq/d+WBL+sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705423808; a=rsa-sha256; cv=none; b=dlxFO5Mn5i9GUVdDNPeizw62lT2clKCFKNrlzYuEMEjqQa9tLypzrSozlDT8OLv2XNFI+j j++jsgk5gPyXHwFGpXP1sniJiC1tEv5tze1apQku43qbsbUkSZeRyxJmyPDiqsrAd3paDW k05FS3Lovb/Wb38NhpVmqstRVP7gyqN+Lb9UXRckT4POfrD+r3gPOuVM5hQ8b2kZrhG3Lg 5PeAT8FQg+1paATiAUpq8P7iI9X9NOwO+eEbj7sTDcfXwe/zR/lMbw5flKNEzKOtwce1/W 1558zu4r20UWcj9CSSmnDpvHZzB6Q7MlJS8TOkSy+o2/bfrhuDWUsEfG7bhGzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDw3h5kh2znSW; Tue, 16 Jan 2024 16:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GGo8Ti074859; Tue, 16 Jan 2024 16:50:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GGo8un074854; Tue, 16 Jan 2024 16:50:08 GMT (envelope-from git) Date: Tue, 16 Jan 2024 16:50:08 GMT Message-Id: <202401161650.40GGo8un074854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ebc9b69c7785 - main - pcm.4: mention snd_uaudio auto-load List-Id: Commit messages for the main 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ebc9b69c77850d3b5a23473cd9a889b8c6d8685a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ebc9b69c77850d3b5a23473cd9a889b8c6d8685a commit ebc9b69c77850d3b5a23473cd9a889b8c6d8685a Author: Christos Margiolis AuthorDate: 2024-01-16 16:49:02 +0000 Commit: Christos Margiolis CommitDate: 2024-01-16 16:49:02 +0000 pcm.4: mention snd_uaudio auto-load Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43397 --- share/man/man4/pcm.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index 1803eaca42eb..54efd86a2b52 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 2, 2023 +.Dd January 10, 2024 .Dt SOUND 4 .Os .Sh NAME @@ -113,7 +113,7 @@ The following bridge device drivers are available: .It .Xr snd_spicds 4 .It -.Xr snd_uaudio 4 (enabled by default on amd64, i386, powerpc) +.Xr snd_uaudio 4 (auto-loaded on device plug) .It .Xr snd_via8233 4 (enabled by default on amd64, i386) .It From nobody Tue Jan 16 16:50:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDw3k2xwrz57bZX; Tue, 16 Jan 2024 16:50: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 4TDw3k0NDLz4cDr; Tue, 16 Jan 2024 16:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lmuhdru+5yZHVM2sNsDRKHfpKM0wrB0qB2FTcI0UYLw=; b=lkPFDXDm5yvOvIDYjwdaJkaZ3DtZP+aFdZHKZmNXrvmhVKkbluhMm9wJCV5Vtm+dtAY5Sl jH2xdRXpY3UpxSjaTKGhmImB1xpiX3LfIb29kijQupnjOd2O51KOC4YgJ+D8zRhQYth+Ds Ju9qwWDc9/Q4mr2rtRrAQ8QsP76GJ0b3CcPol0VizwGviP5UJz//ehFsz3thCHC/dygAmf ddgpNUqY/U8ayQj3vKHaGrRguRE9M8vt/baZL2ehz0LvuCEEbVQA4V27IXRZ2R05ejWM1u V/WXiXdEKMrauCa2y2m9Ttzq1E2bWyEWL0QBZpV1BL/GUR9FUPOoVLADErfSuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lmuhdru+5yZHVM2sNsDRKHfpKM0wrB0qB2FTcI0UYLw=; b=Qpz1rQo7o8s3iRrFwdehkNTomhSmaLG/1OzjsjrC4oiO+I1yU07iBqVdhjjQ8t/q5jrfb0 oUFLTV80DvGZ9aqFZSwc6GM+Z4dMjsijihN9Xv0gNjOT6Mm3aO4jDxDDr/As7sIzyu8agE M3M3dTtEi9QhOy8wUOLybqfigTP2z1jBPJxHr/ic+3Miqm5HNq8aGyki6r19IUlh2oB4Qm AjAcgVOMpmMZ6lc7JcsVFDknwUXShTvjF8A6S+Yl6BNdPxn+qI8JDnGla/v9YH40yChzV2 +JOB6v3wim8z9CoMpwq+ZxeCHvc+0ir/cDX8Xz+9v0TFnUh5aZuIRmowEtuN7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705423810; a=rsa-sha256; cv=none; b=YRsFBVIkm012jUlRxlWvcVMZWy64a9qeNvsmQGmAE/HlZnSmkGkEIvdREuTRib6kEgSKjL rT5Ta8dJolHJ+isGacI8mmeUt2qm4Z2vUOJEZH1Z8f8nysvlRnBrh4THrTMWexTvJNXBFW 74yksdrPwfKlwvxUWWUY2MG/idlgqpmkPn/SbCjhFWIYPiSrgiwvZk7w8DjLUJoR7uL2gQ YrOfF5LZEbRoM2lIn7q+LysIJR4/nLcijqNOhA9vc8ervJfB7wqRYPcf/EDWZohNJRrZ/7 TJQhOcZIuB34Yo8o9ARD3oMaytQ2dVJ0iuvGjx9l4IBCya0QQl38AVpZhvQ8+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDw3j6JkCznyb; Tue, 16 Jan 2024 16:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GGo9GF075405; Tue, 16 Jan 2024 16:50:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GGo98v075400; Tue, 16 Jan 2024 16:50:09 GMT (envelope-from git) Date: Tue, 16 Jan 2024 16:50:09 GMT Message-Id: <202401161650.40GGo98v075400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 45cd29412ead - main - usb: use only usb_devinfo() in device_set_usb_desc() List-Id: Commit messages for the main 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45cd29412eadbb0e8c40590a94b10663addac17a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=45cd29412eadbb0e8c40590a94b10663addac17a commit 45cd29412eadbb0e8c40590a94b10663addac17a Author: Christos Margiolis AuthorDate: 2024-01-16 16:49:08 +0000 Commit: Christos Margiolis CommitDate: 2024-01-16 16:49:08 +0000 usb: use only usb_devinfo() in device_set_usb_desc() device_set_usb_desc() first tries to fetch device information through the iInterface descriptor, otherwise it falls back to usb_devinfo(). Since usb_devinfo() is both guaranteed to work, and is more verbose, get rid of the initial iInterface attempt. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D43383 --- sys/dev/usb/usb_util.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/sys/dev/usb/usb_util.c b/sys/dev/usb/usb_util.c index f9d50bdefdea..cd2dd7d6039e 100644 --- a/sys/dev/usb/usb_util.c +++ b/sys/dev/usb/usb_util.c @@ -73,9 +73,7 @@ device_set_usb_desc(device_t dev) { struct usb_attach_arg *uaa; struct usb_device *udev; - struct usb_interface *iface; char *temp_p; - usb_error_t err; uint8_t do_unlock; if (dev == NULL) { @@ -88,33 +86,11 @@ device_set_usb_desc(device_t dev) return; } udev = uaa->device; - iface = uaa->iface; - - if ((iface == NULL) || - (iface->idesc == NULL) || - (iface->idesc->iInterface == 0)) { - err = USB_ERR_INVAL; - } else { - err = 0; - } /* Protect scratch area */ do_unlock = usbd_ctrl_lock(udev); - temp_p = (char *)udev->scratch.data; - - if (err == 0) { - /* try to get the interface string ! */ - err = usbd_req_get_string_any(udev, NULL, temp_p, - sizeof(udev->scratch.data), - iface->idesc->iInterface); - } - if (err != 0) { - /* use default description */ - usb_devinfo(udev, temp_p, - sizeof(udev->scratch.data)); - } - + usb_devinfo(udev, temp_p, sizeof(udev->scratch.data)); if (do_unlock) usbd_ctrl_unlock(udev); From nobody Tue Jan 16 16:50:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDw3l2V2mz57bXF; Tue, 16 Jan 2024 16:50: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 4TDw3l0jSBz4c84; Tue, 16 Jan 2024 16:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Myub/I6DNmrmT1gq+xX/BfqI6G/A4uXdpVsW1EN9rMc=; b=d86yY2CKRaWq9AIE8UcebdeI/iEm+IlRQ4iQNCIIrM5x1lBDH8qTBpxyTQRov8N8wObBTF JajEUmyfH45Whbki7yGz4Oov6GPF6U8HqxpRsei1nPgdbAGF241qYmy4i3QcEToep/DHDP U8OPNky9jK6h0VvyOK6J51MvHAhlI7990odFc2AihaOXlIjJzdP9B6objdhJGsUgw77doQ KqQ7JBxKHUNap9xwstUFuiq88hzYrXptO/T11aKhLw5yUKgraOscP49W4t53+58QBWUZ9W Ujsg6a6rrNZmqMOGOhbeC2SlLphO2SInY4IPWaUhdnvLwJIzngF16LffUpXa2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705423811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Myub/I6DNmrmT1gq+xX/BfqI6G/A4uXdpVsW1EN9rMc=; b=WJUF4YQhrOY9EvzQ4RZMBPbqScDC0zSqr5VngMOyq8z477tpYCwjQP/2eLxhBQR9+1TEse bdPoT8I1eLcFDTTwD9sM/3y6ljCGnRBSitGw470YV7pDsqLfWy0uhUOV17N+wYFuHCAl9K vzBfYo/QRjywY320RSedggsqEeSS4hglQVTFv81+KQJ1zsNPWpH9zoHnYyI0p/hl11EHbM 1EbF5Wcx8d33koxAySbDxRj2pJgdztEDU+rcc4Fv+fAmQ+HpiRmCkNu5tgvgsAZQsUUB53 sZiXDY3AcXPolubi+BwE6aMyQL15bOE0rm0tNI8lv1RbT7Ug2F7+kLCETpmkow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705423811; a=rsa-sha256; cv=none; b=fSr/Kz0NeEUuoViUQ3nhgiUF5LcUZ93VlnXNamw1JoVMe4oG9ZgD7bA3z+kLOckwJIOEb4 vvkmASwqFCFXpsoQqaHTlVZZKFObgcwQvUqlRZKjsohpC2FkNX+FUCkCEnJYrvprwJqBMk X0XKMas6k/SVF6MTnulTGQ93cTEX0Qp+QvgE4QeF/AZaKeHxSYVVxz4iYmx1U9sjvx4nmu nEfgrgrw3pN3hT3o5Bvh6vlEu+l/9br2GkkvmcoSBAyTuJVFlry3e/HiBS4minTMS1LT16 3lfDkOn+bUSgyTA+U1wh7cBpc0rfWqlrz+F2Q7VetPO0LQE9dbMt2ii554ZRog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDw3k6x8Gznq5; Tue, 16 Jan 2024 16:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GGoAPU076065; Tue, 16 Jan 2024 16:50:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GGoAj2076056; Tue, 16 Jan 2024 16:50:10 GMT (envelope-from git) Date: Tue, 16 Jan 2024 16:50:10 GMT Message-Id: <202401161650.40GGoAj2076056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 6b6914c1e21b - main - subr_bus: introduce device_set_descf() and modify allocation logic List-Id: Commit messages for the main 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b6914c1e21b625503a1b8d8d5cfdfbc4c6a6acd Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6b6914c1e21b625503a1b8d8d5cfdfbc4c6a6acd commit 6b6914c1e21b625503a1b8d8d5cfdfbc4c6a6acd Author: Christos Margiolis AuthorDate: 2024-01-16 16:49:15 +0000 Commit: Christos Margiolis CommitDate: 2024-01-16 16:49:15 +0000 subr_bus: introduce device_set_descf() and modify allocation logic device_set_descf() is a printf-like version of device_set_desc(). Allocation code has been transferred from device_set_desc_internal() to device_set_desc_copy() and device_set_descf() to avoid complicating device_set_desc_internal(). The "copy" argument in device_set_desc_internal() has been replaced with a flag which is set when the description string has been allocated with M_BUS. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D43370 --- share/man/man9/Makefile | 1 + share/man/man9/device_set_desc.9 | 8 +++++++- sys/kern/subr_bus.c | 43 ++++++++++++++++++++++++++-------------- sys/sys/bus.h | 1 + 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 863963d24474..3f9572796fa1 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1012,6 +1012,7 @@ MLINKS+=device_get_sysctl.9 device_get_sysctl_ctx.9 \ MLINKS+=device_quiet.9 device_is_quiet.9 \ device_quiet.9 device_verbose.9 MLINKS+=device_set_desc.9 device_get_desc.9 \ + device_set_desc.9 device_set_descf.9 \ device_set_desc.9 device_set_desc_copy.9 MLINKS+=device_set_flags.9 device_get_flags.9 MLINKS+=devstat.9 devicestat.9 \ diff --git a/share/man/man9/device_set_desc.9 b/share/man/man9/device_set_desc.9 index 69d6cfe18c6b..5037c90fedb1 100644 --- a/share/man/man9/device_set_desc.9 +++ b/share/man/man9/device_set_desc.9 @@ -26,11 +26,12 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 16, 1998 +.Dd January 9, 2024 .Dt DEVICE_SET_DESC 9 .Os .Sh NAME .Nm device_set_desc , +.Nm device_set_descf , .Nm device_set_desc_copy , .Nm device_get_desc .Nd access the description of a device @@ -40,6 +41,8 @@ .Ft void .Fn device_set_desc "device_t dev" "const char *desc" .Ft void +.Fn device_set_descf "device_t dev" "const char *fmt" "..." +.Ft void .Fn device_set_desc_copy "device_t dev" "const char *desc" .Ft const char * .Fn device_get_desc "device_t dev" @@ -54,6 +57,9 @@ is used to set the description if the string passed is a temporary buffer which will be overwritten. In this case, the system will copy the string, otherwise the pointer passed will be used directly. +.Fn device_set_descf +is a printf-like version of +.Fn device_set_desc . .Sh SEE ALSO .Xr device 9 .Sh AUTHORS diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 4f7053cc2613..21c2835f2ae6 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1997,7 +1997,7 @@ device_log(device_t dev, int pri, const char * fmt, ...) * @internal */ static void -device_set_desc_internal(device_t dev, const char* desc, int copy) +device_set_desc_internal(device_t dev, const char *desc, bool allocated) { if (dev->desc && (dev->flags & DF_DESCMALLOCED)) { free(dev->desc, M_BUS); @@ -2005,16 +2005,9 @@ device_set_desc_internal(device_t dev, const char* desc, int copy) dev->desc = NULL; } - if (copy && desc) { - dev->desc = malloc(strlen(desc) + 1, M_BUS, M_NOWAIT); - if (dev->desc) { - strcpy(dev->desc, desc); - dev->flags |= DF_DESCMALLOCED; - } - } else { - /* Avoid a -Wcast-qual warning */ - dev->desc = (char *)(uintptr_t) desc; - } + if (allocated && desc) + dev->flags |= DF_DESCMALLOCED; + dev->desc = __DECONST(char *, desc); bus_data_generation_update(); } @@ -2027,9 +2020,26 @@ device_set_desc_internal(device_t dev, const char* desc, int copy) * call to device_set_desc() or device_set_desc_copy()). */ void -device_set_desc(device_t dev, const char* desc) +device_set_desc(device_t dev, const char *desc) +{ + device_set_desc_internal(dev, desc, false); +} + +/** + * @brief Set the device's description + * + * A printf-like version of device_set_desc(). + */ +void +device_set_descf(device_t dev, const char *fmt, ...) { - device_set_desc_internal(dev, desc, FALSE); + va_list ap; + char *buf = NULL; + + va_start(ap, fmt); + vasprintf(&buf, M_BUS, fmt, ap); + va_end(ap); + device_set_desc_internal(dev, buf, true); } /** @@ -2039,9 +2049,12 @@ device_set_desc(device_t dev, const char* desc) * the device description is generated, (e.g. with sprintf()). */ void -device_set_desc_copy(device_t dev, const char* desc) +device_set_desc_copy(device_t dev, const char *desc) { - device_set_desc_internal(dev, desc, TRUE); + char *buf; + + buf = strdup_flags(desc, M_BUS, M_NOWAIT); + device_set_desc_internal(dev, buf, true); } /** diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 2ec735659452..581e81352be4 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -660,6 +660,7 @@ int device_quiesce(device_t dev); void device_quiet(device_t dev); void device_quiet_children(device_t dev); void device_set_desc(device_t dev, const char* desc); +void device_set_descf(device_t dev, const char* fmt, ...) __printflike(2, 3); void device_set_desc_copy(device_t dev, const char* desc); int device_set_devclass(device_t dev, const char *classname); int device_set_devclass_fixed(device_t dev, const char *classname); From nobody Tue Jan 16 17:21:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDwmF5HDpz57fV6; Tue, 16 Jan 2024 17:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDwmF4sWZz4l25; Tue, 16 Jan 2024 17:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705425709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TkCfy0HN2aFQ1YIPNPRBH/YH6nhz5P+HfPfTAHPEwpY=; b=QVO7t5SdTeAGTALNPZ2H5zgZX6k0pEeWA9YGYk+r5dFTqmAUzdcPbtcZQtbEJdxv607HKG rOoMltvRusP+o+sX96pR8FUh/iPU1qz1xwGO/LrdMOjTohiFwWYOocBpkIKmFBwTH/gfvC HhKUGEBv1HcFA3bub44CsyryX5sPEepp3uIWL3cdFm0I/FWbOgXxgBPqi6/0vmQFsoUav5 JWlj7qMdfSi3VM4SMvjlmTfqUP9BHUMRad6wzqOpk5YHJINciDNSZEWnWAYO6Bv84x48Ty yLaHJKxO2x1itG0RdP5USoqiLSRw0unQZN4tEYgtytJuM2wexEvoaq6Zc0MaYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705425709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TkCfy0HN2aFQ1YIPNPRBH/YH6nhz5P+HfPfTAHPEwpY=; b=uzfqFmAAZn+7ks8oRH/dgCxRNtvE/73BLhOziZv93/rZgp0LvIWSfJEN0GpaYL7PDO1gPW MNLuxGdDeaQBZN1sYJMaxtAVggnSfcYGbDtIKhvpI/cE/V62Di6/fTQyXcy9FLkIR9py90 lKNVy3vSoHsLbqMPD0nVTsf56ESq2q7kj7iuyAtqO6fTdSZYJ/6X5YdcuhvQlv7ZzDC6Hq roFxfXzZO3WiIpAfRA2MA5DVhCVuURRM/WQPtk4gmX9aGqF7WdqiUBnUFgZgqNbaoKc2Y3 SS4WvNN47xpUvfIi0WIdhbRESGpXjzHoCA5L/vU25EsZU615hLC3SewKcp1SEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705425709; a=rsa-sha256; cv=none; b=wcTxsjmNO6xM5/HhDXjwmNZA6Xwl+YP5I61hblLxsZgvt+snVxwvm+JhwcQNEMkyAmFy3w kfrICLyZveZhiFv+6Llv+KUx08e56TEVmNb3nJozg2zFAf9iNWwBxmER3VKkvEw6MTXsCd bfLeVo2rOL40EIreqFGWtMjwGTAcerJgqCWzLfkGocng2xLR/6RgP7qKwmbt5MZTji7JRS tOh+br/wA0sVw+aMG4jBAVvtmSE0E9T7gt5sCKsdHU5qr0aGirL7PdNE2uclD20I9aFRci NLYSsjTap+41xiXSLERcUUclS0cOAIQ84EUeMa4AMNk2mU0sI3HwZxnwlW0cSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDwmF3w42zq1j; Tue, 16 Jan 2024 17:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GHLn9p036661; Tue, 16 Jan 2024 17:21:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GHLnlg036658; Tue, 16 Jan 2024 17:21:49 GMT (envelope-from git) Date: Tue, 16 Jan 2024 17:21:49 GMT Message-Id: <202401161721.40GHLnlg036658@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: 284d31605cfa - main - pflowctl.8: fix copy/paste-o List-Id: Commit messages for the main 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: 284d31605cfa06a330babea48f7b88bce2c96ffa Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=284d31605cfa06a330babea48f7b88bce2c96ffa commit 284d31605cfa06a330babea48f7b88bce2c96ffa Author: Kristof Provost AuthorDate: 2024-01-16 15:27:31 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 17:18:09 +0000 pflowctl.8: fix copy/paste-o The valid values line applies to the proto field, not domain. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pflowctl/pflowctl.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pflowctl/pflowctl.8 b/sbin/pflowctl/pflowctl.8 index 5140d5febb84..446679486db6 100644 --- a/sbin/pflowctl/pflowctl.8 +++ b/sbin/pflowctl/pflowctl.8 @@ -68,9 +68,9 @@ set the source IP address (and optionally port). set the destination IP address (and optionally port). .It Cm proto set the protocol version. +Valid values are 5 and 10. .It Cm domain set the observation domain. -Valid values are 5 and 10. .El .Pp Multiple keywords may be passed in the same command invocation. From nobody Tue Jan 16 17:21:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDwmG6PpBz57flv; Tue, 16 Jan 2024 17:21: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 4TDwmG5YMvz4l8y; Tue, 16 Jan 2024 17:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705425710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FL+ZuHp4NwMVCcbnH0BFCTnU/s+PnggOZ//mTKq429g=; b=EBxlC+86QVHqfDl4WdkJMCEm6gj6pgSn0gQ0Ck4+27Mhkb8hJ1jkBwi+KZNA2ecaCOrn2O 6ktWXCP5oM1sjR0+r2HSdqzDRoHor3u7r2D12fu/jrk2Bsl8MmlXTgrb6hSrec1MuA7E6h hXCzWd6PhyvI8Rptkmm/+oM3Mg8rn2uYhAJ+xJdHT3qvZl1NqKBiyOFAONruQ0uFMSUBNM DYx671VHvOC7LYSAw+WgLeLHyTqf55JdGY/nGOeqy5tpnwyPmclHIJPyA4Z7jn+j/wASwb atjeP/zPVAYSI66fl1N3U4YsTW16kg+feTX4FxUmEb3rr4GFk7Ww4voOWF5a5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705425710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FL+ZuHp4NwMVCcbnH0BFCTnU/s+PnggOZ//mTKq429g=; b=Gnwyj8r5tsRGe3vWd0J1C4GtAsIQwCxRu7JD2jmuCYf3cZgUIWmrdupSmvkHQ9Sjfnncu0 xbRXaPRyUGE0CMGcsxxkjq0J0xcNsQgcaZG3/YZAj9TCWdTEfRjrxXIJOpx76HR9WJXRuv pmm+pMaWKCFAQyC5AzGmwllBaOehki4+TnKazb9obA2rOm+h0HKa+Zx6RBxZl0QWy28KUs rY3Mia8ZrHW68N3q8KxSTl1hLKk35651b0g7ZYUVuTzERBMNCl/yWyZvu1OFnLG6nYo5uF mXMePfHJwJuDl1H7CRl9L2ves9dxISOApmTZjTDaemKnL4KrMFfPmiQa0RLxcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705425710; a=rsa-sha256; cv=none; b=Y3pIg/UZiYdEOJN++VtlgOO1Khfozu11lM4KNDFOafFNPMkoP+JCZeJMS6xSrILplnL8Ec gi8huUTGjw9V5bgK4eOV7K0BX+IMlMqCylpOJCyNHNIxyjYrbhSzxAPK3r9p8MGSB/+sp5 c/5UqgkcgWTGTTBlKZjG/lie3jpq0HMC3jjZr/ZRBzJzuIes1NEDsb5R9Ml7s6Rr3lI2kY thEo1qr8xPTHjy966BHmXRNvCoq+GTwmX3CQyRv0yDb9q2Pz87VqU5IiV41QSQASDNugtC kLGS77NRy8qURJaXB0qoJKkMf39UoYMiOgFA7sLxQbEuGgI6SwOS/JdIj+l9kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDwmG4d3dzq1k; Tue, 16 Jan 2024 17:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GHLo2V036709; Tue, 16 Jan 2024 17:21:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GHLoH9036706; Tue, 16 Jan 2024 17:21:50 GMT (envelope-from git) Date: Tue, 16 Jan 2024 17:21:50 GMT Message-Id: <202401161721.40GHLoH9036706@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: 81ea920435b4 - main - pflowclt: fix gcc build 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81ea920435b4980683a0329cc43060fc060cf479 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=81ea920435b4980683a0329cc43060fc060cf479 commit 81ea920435b4980683a0329cc43060fc060cf479 Author: Kristof Provost AuthorDate: 2024-01-16 16:29:12 +0000 Commit: Kristof Provost CommitDate: 2024-01-16 17:18:09 +0000 pflowclt: fix gcc build error gcc is unhappy with the nested extern declaration of __progname, so move it out of the usage() function. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pflowctl/pflowctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pflowctl/pflowctl.c b/sbin/pflowctl/pflowctl.c index 7be85d8b6ad4..35daedfdf478 100644 --- a/sbin/pflowctl/pflowctl.c +++ b/sbin/pflowctl/pflowctl.c @@ -47,11 +47,11 @@ static int get(int id); +extern char *__progname; + static void usage(void) { - extern char *__progname; - fprintf(stderr, "usage: %s [-la] [-d id]\n", __progname); From nobody Tue Jan 16 17:52:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDxRQ0b1Jz57jff; Tue, 16 Jan 2024 17:52: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 4TDxRQ07Yqz4ptl; Tue, 16 Jan 2024 17:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705427538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mSQVSDG0WhJDplf2/jbt71/RFZmcec8s0NxOmET0soU=; b=ShzCYJhz3Jli68n9iPX//nb87ZAm02MmH6yiUr5/2p1FRjUn5Rcgf7qRCCd8ABuDsZ8rOc l8MEo0c9QsBbySpeq+n4ZiaSosbZiP8XV5lvESirEbhanmE8t7zHXEjnbtIvppjUdjGvZX vbmubiDzcgpWJLB5ujNYNGmBt+E05WGWDYogYSwB/Agfb0nbODn3r0aSJeIejaYaj+jDrp nrVJNBEgrUhFqP5uCC/tbMyI3K5CAnFLCEPwxF8qtveZFR/B2esL3943hLrVo+lj3ytBzB 06nFOO1LNrkiI5xfwnqTeAXXWahqXAJXMU+7M2O6UeVbljqgMiLw99/5nZDf+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705427538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mSQVSDG0WhJDplf2/jbt71/RFZmcec8s0NxOmET0soU=; b=AMNVSz3gYs7OfJOzks+gIDbPcACdVnOaM3NPZL5PPJjLbMTRrGQ/WXGqiP1WVmsxlwOIRm 3EpJND6I8AqIr42L0u1H3DzIhTkRXtG4+VMEy5/yLhapKlzEM004hV7ddRHVP9ijhUb9Dj c/T4qDnicHzfbpTf65IU0DMGTKuz9hW8mF6AnarlrkWc33Wde9D8x6Pmp8IkoXl0fe2ZVs C800MUj8iTplFlNRYuuwX/auThccHVsUXUrba2bI9IX9fT7BWJHmMajMxyGp7ZqoZ9oahR 4oUJOAD2uBOXJ+FqfKRtBVno91H9czSgA7ptGPNbuUJWuyQB4K3KjZR+cvY40A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705427538; a=rsa-sha256; cv=none; b=dryNHtgPzH5DUm8qMaLiXFxibwcuByko4WXGdf3ZHKVGHVe0qY8mmutfyUIQQO2Cmh6Rxw G++tFr3uoPSbpaAZiiptySWST571py63Z39pDmG0yn4FjggrpCPmIoZhK04ZSFKyJf+lk6 KJWFpfGX18HCkVuUux7Da2Og9qLY2kRi8hI3V1SYqQaKacqT16zKhlq7SiK2mdk1dzeafP grerUH43Lvd663eUEmlqx+pItoMIVkZ8YYMPkF7ervtRg49AWvK3Rqdv0b1go9Lr/+v0LM 1jajXjEaX/fECzeB2Z1QWfCrTbmmJZV1zGMfvDn/jFgqu+HTV8opAB/C95+xPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDxRP60VszqSb; Tue, 16 Jan 2024 17:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GHqHQB089961; Tue, 16 Jan 2024 17:52:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GHqHIA089959; Tue, 16 Jan 2024 17:52:17 GMT (envelope-from git) Date: Tue, 16 Jan 2024 17:52:17 GMT Message-Id: <202401161752.40GHqHIA089959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= Subject: git: b0165dc4539f - main - x86/xen: fix HVM guest hypercall page setup List-Id: Commit messages for the main 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: b0165dc4539fdfc84351a719b58850e4e7a6cbb6 Auto-Submitted: auto-generated The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=b0165dc4539fdfc84351a719b58850e4e7a6cbb6 commit b0165dc4539fdfc84351a719b58850e4e7a6cbb6 Author: Roger Pau Monné AuthorDate: 2024-01-16 15:32:56 +0000 Commit: Roger Pau Monné CommitDate: 2024-01-16 17:50:54 +0000 x86/xen: fix HVM guest hypercall page setup c7368ccb6801 didn't take into account that vm_guest will also get setup by generic identify CPU code, and hence by the time xen_hvm_init() gets called vm_guest will always be set if running as a Xen guest, either by the PVH entry point code, or by generic CPU identification. xen_hvm_init() and xen_hvm_init_hypercall_stubs() were relying on xen_domain() returning false when running as an HVM guest, and used that into order to figure out whether hypercall page needed to be populated. Get rid of such assumptions and simplify the code since legacy PVH is no longer supported. This fixes booting FreeBSD as a Xen HVM guest. Fixes: c7368ccb6801 ('xen: remove xen_domain_type enum/variable') Sponsored by: Cloud Software Group --- sys/x86/xen/hvm.c | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c index e096559711a3..b8125e230b6f 100644 --- a/sys/x86/xen/hvm.c +++ b/sys/x86/xen/hvm.c @@ -155,25 +155,14 @@ xen_hvm_init_hypercall_stubs(enum xen_hvm_init_type init_type) { uint32_t regs[4]; - /* Legacy PVH will get here without the cpuid leaf being set. */ - if (xen_cpuid_base == 0) - xen_cpuid_base = xen_hvm_cpuid_base(); + if (xen_cpuid_base != 0) + /* Already setup. */ + goto out; + + xen_cpuid_base = xen_hvm_cpuid_base(); if (xen_cpuid_base == 0) return (ENXIO); - if (xen_domain() && init_type == XEN_HVM_INIT_LATE) { - /* - * If the domain type is already set we can assume that the - * hypercall page has been populated too, so just print the - * version (and apply any quirks) and exit. - */ - hypervisor_version(); - return 0; - } - - if (init_type == XEN_HVM_INIT_LATE) - hypervisor_version(); - /* * Find the hypercall pages. */ @@ -185,6 +174,8 @@ xen_hvm_init_hypercall_stubs(enum xen_hvm_init_type init_type) ? (vm_paddr_t)((uintptr_t)&hypercall_page - KERNBASE) : vtophys(&hypercall_page)); +out: + hypervisor_version(); return (0); } @@ -334,7 +325,8 @@ xen_hvm_init(enum xen_hvm_init_type init_type) int error; int i; - if (init_type == XEN_HVM_INIT_CANCELLED_SUSPEND) + if (!xen_domain() || + init_type == XEN_HVM_INIT_CANCELLED_SUSPEND) return; error = xen_hvm_init_hypercall_stubs(init_type); @@ -344,15 +336,6 @@ xen_hvm_init(enum xen_hvm_init_type init_type) if (error != 0) return; - /* - * If the Xen domain type is not set at this point - * it means we are inside a (PV)HVM guest, because - * for PVH the guest type is set much earlier - * (see hammer_time_xen). - */ - if (!xen_domain()) - vm_guest = VM_GUEST_XEN; - setup_xen_features(); #ifdef SMP cpu_ops = xen_hvm_cpu_ops; From nobody Tue Jan 16 18:28:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDyFC3zB3z57mKm for ; Tue, 16 Jan 2024 18:28:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (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 4TDyFB6lLrz4tqc for ; Tue, 16 Jan 2024 18:28:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=UV0vPL6o; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::62d) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a277339dcf4so1142563966b.2 for ; Tue, 16 Jan 2024 10:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705429709; x=1706034509; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nHA/HrZr5ethJjUjiENR9VsReKk+v5qaWDQCJ5glocQ=; b=UV0vPL6ol4W9AMh68IbCVJjQqY4spJ+/kDBlihXWHxNuSDPWoqAG0V6SZPwdEUz47V 2cF0X0SWOcFQ7msmGL+6dt8FoFiI7psWuUkBCdIU/3YLR4yCcJRiej8zNNrxSQ5dg3RQ 7ARnM06JNGpP4eWfVWZs11ToeAVl8/spShEAPGAJjcZVjt1Hh8SEg7fkie+48OekxXH1 nosJKabhICqWkD+lSL1qkwpHuuA0hOvIVI3KaqZQaopj6yDv51nil934SpuiL1xWCEpM Y+ywZQiYR5J2v3Ay2beAOQ7KOapw9plC2JdJp0Tv+kgbM8D10zXqC0eZ8tXMGCbpbtaW unLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705429709; x=1706034509; 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=nHA/HrZr5ethJjUjiENR9VsReKk+v5qaWDQCJ5glocQ=; b=JSpyG/mxmEL+Azh+3p4eLGTu4H5X4RPIvs7oWv1heCajaYEW08zcG22epjmhVVNp+D 9tvVTZZTEfOf8md4oiqIQ17IvwDNsMV8+mPnhXdY3Cy3BDUd7TGBNOYkQq4j/DZFOxBA rlHQd8KwEUwq2qBGG+yYhGxZEZN+Z0INmnaZwXeEUw3g4gVhs7AjGgWN0LlBOGNjlpVd ufqN8cvkqLYhVDhwSceOvl8UFlZ+4D7kUvdLRcywY2jeYFj2Nx+OK3mCdwgg9NFxxOiR CtiMJSI+n4Imk2sFsRqg559IKUNjP0V4c1LERDMDc1cYcRMthCugGyA5gWcEKLlspnhW JRfw== X-Gm-Message-State: AOJu0YxXdCwv39FnEpTt4RSoGYRfELEaFKepfIpj0YkSQ5y4Bfzp2/Mk lDs1mFwEUgWwWd7D8+RMgqweQa+7+ttbr8IJS+tlbW1qrjbS5A== X-Google-Smtp-Source: AGHT+IFjXnlesl+m23cwjD7LsHf3JxZfi940l6B8d8qGdDenTWf+TU1VRxCNHfTMKzOHaf7bRZpcfRvSmn9z9hHM0YM= X-Received: by 2002:a17:907:788:b0:a1d:932f:9098 with SMTP id xd8-20020a170907078800b00a1d932f9098mr4334601ejb.97.1705429709573; Tue, 16 Jan 2024 10:28:29 -0800 (PST) List-Id: Commit messages for the main 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: <202401151330.40FDU0q9009324@gitrepo.freebsd.org> <45CAA8CA-9B5E-41D2-8416-83156B6AC721@freebsd.org> <0100018d0e26dbd2-438de9ce-b26b-4cef-a628-78a400025aba-000000@email.amazonses.com> In-Reply-To: <0100018d0e26dbd2-438de9ce-b26b-4cef-a628-78a400025aba-000000@email.amazonses.com> From: Warner Losh Date: Tue, 16 Jan 2024 11:28:18 -0700 Message-ID: Subject: Re: git: 6137b5f7b8c1 - main - Increase the size of riscv GENERICSD images to 6 GB To: Colin Percival Cc: Mike Karels , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, FreeBSD Release Engineering Team Content-Type: multipart/alternative; boundary="000000000000075eb3060f144cbf" X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62d:from]; DMARC_NA(0.00)[bsdimp.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; R_SPF_NA(0.00)[no SPF record]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4TDyFB6lLrz4tqc --000000000000075eb3060f144cbf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 15, 2024 at 10:24=E2=80=AFAM Colin Percival wrote: > On 1/15/24 08:36, Mike Karels wrote: > > On 15 Jan 2024, at 9:37, Warner Losh wrote: > >> One question here... > >> > >> Do we need to include all the debugging stuff in /usr/lib/debug? i'ts > over > >> 1GB out of 5GB and seems like a poor fit > >> for this form factor. We can easily provide it as a package instead...= . > >> > >> I know the inevitable march of largeness must progress, but we should > ask > >> ourselves is this really a good use of that 1GB? > > > > Good question. On riscv, /usr/lib/debug is 2.5 GB. (arm64 is 2.1 GB.) > > I'm also not sure what it would take to leave it off, although I would > guess > > that a tweak to installworld could do it if we need debug for other > targets. > > I think the package already exists. Of course, these images usually ge= t > > expanded to a much larger size on the first boot, so maybe the space > doesn't > > matter as much. > > > > Ideally, we'd keep the kernel debug, but that would probably be more > work. > > > > It would probably make the most sense to the same thing for other > architectures, > > although arm64 at least has headroom. The scripts to build the image > files are > > shared, but there is a config file per image. > > > > Opinions, anyone? We could ask on freebsd-riscv and maybe other lists > too. > > My inclination is to say that for now the "standard" FreeBSD images shoul= d > include all the bits which 'make installkernel installworld' provides. (= I > have been considering shipping no-debug-files EC2 AMIs as an additional > option, though, since people pay per GB for storage there.) > Yea, half the space is basically worthless. Few people get core dumps of userland programs, and the SD card doesn't ship with a swap area to take a kernel dump. > When we move to pkgbase it will become dramatically easier for users to > install debug files if/when needed, and at that point I think it would ma= ke > sense to ship without them by default. > Yea, if they aren't easily available, it is harder. And snapshots can be hard to get back. So if you need it, you really need it to be bundled. Warner --000000000000075eb3060f144cbf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jan 15, 2024 at 10:24=E2=80= =AFAM Colin Percival <cperciva@t= arsnap.com> wrote:
On 1/15/24 08:36, Mike Karels wrote:
> On 15 Jan 2024, at 9:37, Warner Losh wrote:
>> One question here...
>>
>> Do we need to include all the debugging stuff in /usr/lib/debug? i= 'ts over
>> 1GB out of 5GB and seems like a poor fit
>> for this form factor. We can easily provide it as a package instea= d....
>>
>> I know the inevitable march of largeness must progress, but we sho= uld ask
>> ourselves is this really a good use of that 1GB?
>
> Good question.=C2=A0 On riscv, /usr/lib/debug is 2.5 GB.=C2=A0 (arm64 = is 2.1 GB.)
> I'm also not sure what it would take to leave it off, although I w= ould guess
> that a tweak to installworld could do it if we need debug for other ta= rgets.
> I think the package already exists.=C2=A0 Of course, these images usua= lly get
> expanded to a much larger size on the first boot, so maybe the space d= oesn't
> matter as much.
>
> Ideally, we'd keep the kernel debug, but that would probably be mo= re work.
>
> It would probably make the most sense to the same thing for other arch= itectures,
> although arm64 at least has headroom.=C2=A0 The scripts to build the i= mage files are
> shared, but there is a config file per image.
>
> Opinions, anyone?=C2=A0 We could ask on freebsd-riscv and maybe other = lists too.

My inclination is to say that for now the "standard" FreeBSD imag= es should
include all the bits which 'make installkernel installworld' provid= es.=C2=A0 (I
have been considering shipping no-debug-files EC2 AMIs as an additional
option, though, since people pay per GB for storage there.)

Yea, half the space is basically worthless. Few people= get core dumps of userland
programs, and the SD card doesn't= ship with a swap area to take a kernel dump.
=C2=A0
When we move to pkgbase it will become dramatically easier for users to
install debug files if/when needed, and at that point I think it would make=
sense to ship without them by default.

= Yea, if they aren't easily available, it is harder. And snapshots can b= e hard
to get back. So if you need it, you really need it to be b= undled.

Warner
--000000000000075eb3060f144cbf-- From nobody Tue Jan 16 18:31:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDyJj2SL2z57mdw; Tue, 16 Jan 2024 18:31: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 4TDyJj1bGwz4wGB; Tue, 16 Jan 2024 18:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705429893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AlqRP5sw3uuG3i4PaNYBxd1/K/A3KoykEu2Dym/3XOo=; b=mOqhjYqRCtR5shDaDlMkYaVQRdDhc1qwmuPLRPgV9YogAfHPKjLohHtv55p+WdD4aLCJ2A 4KfysejezWF3xkoqftnYI9Wzd+7yX4VAIUvnpJKTafETa0NkMwlhg097z0sDVd72eRQx5K Tugb+5JAb2SNd6Wq/7ZuheuYPrRTHh7NkYUl38775ozNK/CQK7RUo3NgC2+jUua153LC0N 4WEVo/xiJg2Yx+tpdoM5tgsbbte2ujgeDnAWGxv4R2+IXvc5bbp8Ybp4NdOkyY9VnbJQ9a iw6ImGOOB+sV4+MPws0qXG8apiBCwnK4tY4j/ulR2xLMPGU8sN4H52Wal4Ym/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705429893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AlqRP5sw3uuG3i4PaNYBxd1/K/A3KoykEu2Dym/3XOo=; b=BaNKTHpg3fboR9FOZqCiTdc1OR9/FNlXuryyX20K52PGYsK38MV8sydWCYdXd8xmEn8Ok8 QnsblZHEyXQbgJmmNg27qDS9mnhdN/kuFA1rMGOsR4Q2x75OFB1j16yhaNEycvkeOZTCM2 LeRLJ3xvGVz85hS64akweuhsqfFjdeQ1ZdLcH8Qao7lETCzqfd2Dwyi8ku9FIu1tkEHycL 4lApwZDrKZWnLXzT9LftEV4GNTZe3GZQXAhMPlXQXOJPWHdKytUw1+hc/hoYOyS8F2H1u1 ZW/CGCq6w9FxGIBGeB5m4tC9rndaTEIKS5y5en+syTgibMs2w/Vx+9scEMGbxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705429893; a=rsa-sha256; cv=none; b=oAKJ0am1N6+1L4/C3pVekWdZQEyIWPS1/Tuw5FJhAkjBKt7agNM00F5S0jJNuupPYyskoc pX89rTVIewnUcWnjf0Q25p7shXxBsg7S5aQY0YijXePtmEPLj928U4E10uZibMJnQqq/9w rqWzn7bfWCmTq85EFBwlTP9RyB2a9eNJrSyCqHUtHTLuEjmRmss51CsJaE7pIRqfH4jNsU rPkaNBiMm7afwQYakDhZxjIptVH5Exa/Maph75VDveSeYdqGtv2m5LRV6pmGtq1USkpz9U dhKZ/ofMHIqQ24zeWzby2E5DMCRyetA4cmP92L101aRdi00wppFrJjZDCTT49Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDyJj0KtPzrCP; Tue, 16 Jan 2024 18:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GIVWbc055866; Tue, 16 Jan 2024 18:31:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GIVWbs055863; Tue, 16 Jan 2024 18:31:32 GMT (envelope-from git) Date: Tue, 16 Jan 2024 18:31:32 GMT Message-Id: <202401161831.40GIVWbs055863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: c3276e02beab - main - sockets: make shutdown(2) how argument a enum List-Id: Commit messages for the main 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3276e02beab825824e3147b31af33af66298430 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c3276e02beab825824e3147b31af33af66298430 commit c3276e02beab825824e3147b31af33af66298430 Author: Gleb Smirnoff AuthorDate: 2024-01-16 18:26:10 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-16 18:26:27 +0000 sockets: make shutdown(2) how argument a enum Reviwed by: tuexen Differential Revision: https://reviews.freebsd.org/D43412 --- sys/kern/uipc_socket.c | 5 +---- sys/kern/uipc_syscalls.c | 3 +++ sys/sys/socket.h | 8 +++++--- sys/sys/socketvar.h | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 3409a7085df6..919879e86e21 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2964,14 +2964,11 @@ soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, } int -soshutdown(struct socket *so, int how) +soshutdown(struct socket *so, enum shutdown_how how) { struct protosw *pr; int error, soerror_enotconn; - if (!(how == SHUT_RD || how == SHUT_WR || how == SHUT_RDWR)) - return (EINVAL); - soerror_enotconn = 0; SOCK_LOCK(so); if ((so->so_state & diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index e46fdef84fc9..366698054bce 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1172,6 +1172,9 @@ kern_shutdown(struct thread *td, int s, int how) struct file *fp; int error; + if (__predict_false(how < SHUT_RD || how > SHUT_RDWR)) + return (EINVAL); + AUDIT_ARG_FD(s); error = getsock(td, s, &cap_shutdown_rights, &fp); if (error == 0) { diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 23762ec3b78f..9e78281e5dd2 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -627,9 +627,11 @@ struct omsghdr { /* * howto arguments for shutdown(2), specified by Posix.1g. */ -#define SHUT_RD 0 /* shut down the reading side */ -#define SHUT_WR 1 /* shut down the writing side */ -#define SHUT_RDWR 2 /* shut down both sides */ +enum shutdown_how { + SHUT_RD = 0, /* shut down the reading side */ + SHUT_WR, /* shut down the writing side */ + SHUT_RDWR /* shut down both sides */ +}; #if __BSD_VISIBLE /* for SCTP */ diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index ae7baa87d202..19ca52177d17 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -434,6 +434,7 @@ struct mbuf; struct sockaddr; struct ucred; struct uio; +enum shutdown_how; /* Return values for socket upcalls. */ #define SU_OK 0 @@ -512,7 +513,7 @@ int sosend_dgram(struct socket *so, struct sockaddr *addr, int sosend_generic(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td); -int soshutdown(struct socket *so, int how); +int soshutdown(struct socket *so, enum shutdown_how); void soupcall_clear(struct socket *, sb_which); void soupcall_set(struct socket *, sb_which, so_upcall_t, void *); void solisten_upcall_set(struct socket *, so_upcall_t, void *); From nobody Tue Jan 16 18:31:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDyJk43zgz57mmx; Tue, 16 Jan 2024 18:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDyJk28xWz4wJt; Tue, 16 Jan 2024 18:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705429894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9e6GMqdeiXLYm9woww+kQRARMod0hSF4ePDRYVtBd3A=; b=jAr72fvql3ssXd4gsjKisgGDjc6+dh7WxPJC5VD7kt25HTI+fyflCCQa7Uax4T1Egted2H fYG4x7UEk8AWxAPA+HcPopBQhsMdfdO0fDxVlYhiTglsWCy9DHfuqN5mMGP65PYaAHr6Ch ezoejZ+/9vfGBHe23zVs0DdzlGrRH+lCinRTGbjOk6Uhq/AUNdXjEXwSMhywKsEAeC5l7D YdL0v4/ocTgmU1FyKUyX+O8qnGsHmIPNSJVLQ3gh5qUmvGEajIK6LexhnepFFPBA4sgQDV 7SryrvmwuB0n2Etc2rCMkBRSr1ghx+DUKsYBq4dOTsmpqcwwd7bKCSdyPKQqJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705429894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9e6GMqdeiXLYm9woww+kQRARMod0hSF4ePDRYVtBd3A=; b=BBqynOXPchbEZsjVLnZsnczU/Lzf2iELVLEZFMH+YA+zGZAJhI4QKuAPg/8RViKRnPy6/M 2RS0nX8BiYqOuqxqlXoDhkbdzVfmEdfCOyjIoumn7/MdpFArdhH5pDkHI6WQGhnCPX7Uny BfRNKTWQ2DFPykrRFpGRvS0k7W+sn0Iu6ZGomU/jhCZ/Yk39M0nHf2kr/CD1jPuUAjm+n3 QuyqWzsDkcHTm11xsVe8wSLt0Qlu6+aJ5n2Tui+k3bxsAXC68ZgjpOlWC49A374x+yfsBO K3BuWybYtMwHJ+lENamuNvTckG13YFAGQKtIBBkWfqzIEMBu+eVDkEV8f04tcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705429894; a=rsa-sha256; cv=none; b=d8kL9prYYd3hVjEFno+BUE0WUUBwQ2+OOi7raGQJqArLN/aicou08LN0ww0ZPSGDR3I3wY vqEQ3TROlMeIDR8kwf2bNsWohI9WgxRe9oMn4cRCriy7YZKYtIiWvORSVQeC9bXIGv8DtM sWYs6h9NfpoybYWjoaGxmjNfvwgDhvRyt6eshWXFZ71Bd81B8J6hXnDtT167UxRICdC+xv ljPIqnxkfg604PRtjNBPcLbf6v5Mvy5Pi4HbhPatVOFPh+0heH1SIdbbfupiecw2dfM4zx L40fufMTkREJ3GLnQLNbCTFwM9NVp0b0Eor6OdMG8TQQIz0ApgvGOL9gtRVJSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDyJk1DTrzrCQ; Tue, 16 Jan 2024 18:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GIVYl5055920; Tue, 16 Jan 2024 18:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GIVYT7055916; Tue, 16 Jan 2024 18:31:34 GMT (envelope-from git) Date: Tue, 16 Jan 2024 18:31:34 GMT Message-Id: <202401161831.40GIVYT7055916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 5bba2728079e - main - sockets: make pr_shutdown fully protocol specific method List-Id: Commit messages for the main 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5bba2728079ed4da33f727dbc2b6ae1de02ba897 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=5bba2728079ed4da33f727dbc2b6ae1de02ba897 commit 5bba2728079ed4da33f727dbc2b6ae1de02ba897 Author: Gleb Smirnoff AuthorDate: 2024-01-16 18:26:10 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-16 18:30:37 +0000 sockets: make pr_shutdown fully protocol specific method Disassemble a one-for-all soshutdown() into protocol specific methods. This creates a small amount of copy & paste, but makes code a lot more self documented, as protocol specific method would execute only the code that is relevant to that protocol and nothing else. This also fixes a couple recent regressions and reduces risk of future regressions. The extended KPI for the new pr_shutdown removes need for the extra pr_flush which was added for the sake of SCTP which could not perform its shutdown properly with the old one. Particularly for SCTP this change streamlines a lot of code. Some notes on why certain parts of code were copied or were not to certain protocols: * The (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING) check is needed only for those protocols that may be connected or disconnected. * The above reduces into only SS_ISCONNECTED for those protocols that always connect instantly. * The ENOTCONN and continue processing hack is left only for datagram protocols. * The SOLISTENING(so) block is copied to those protocols that listen(2). * sorflush() on SHUT_RD is copied almost to every protocol, but that will be refactored later. * wakeup(&so->so_timeo) is copied to protocols that can make a non-instant connect(2), can SO_LINGER or can accept(2). There are three protocols (netgraph(4), Bluetooth, SDP) that did not have pr_shutdown, but old soshutdown() would still perform sorflush() on SHUT_RD for them and also wakeup(9). Those protocols partially supported shutdown(2) returning EOPNOTSUP for SHUT_WR/SHUT_RDWR, now they fully lost shutdown(2) support. I'm pretty sure netgraph(4) and Bluetooth are okay about that and SDP is almost abandoned anyway. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D43413 --- sys/dev/hyperv/hvsock/hv_sock.c | 46 +++++----- sys/dev/hyperv/hvsock/hv_sock.h | 2 +- sys/kern/uipc_domain.c | 2 +- sys/kern/uipc_socket.c | 53 ++--------- sys/kern/uipc_usrreq.c | 65 ++++++++++++-- sys/net/rtsock.c | 16 +++- sys/netinet/raw_ip.c | 25 ++++-- sys/netinet/sctp_usrreq.c | 195 +++++++++++++++++++--------------------- sys/netinet/sctp_var.h | 2 +- sys/netinet/tcp_usrreq.c | 64 +++++++++---- sys/netinet/udp_usrreq.c | 42 +++++++-- sys/netinet/udp_var.h | 2 +- sys/netinet6/raw_ip6.c | 25 ++++-- sys/netinet6/sctp6_usrreq.c | 1 - sys/sys/protosw.h | 5 +- sys/sys/socket.h | 8 -- 16 files changed, 313 insertions(+), 240 deletions(-) diff --git a/sys/dev/hyperv/hvsock/hv_sock.c b/sys/dev/hyperv/hvsock/hv_sock.c index df6f58f6fcb6..8072765f2d5b 100644 --- a/sys/dev/hyperv/hvsock/hv_sock.c +++ b/sys/dev/hyperv/hvsock/hv_sock.c @@ -978,43 +978,43 @@ hvs_trans_abort(struct socket *so) } int -hvs_trans_shutdown(struct socket *so) +hvs_trans_shutdown(struct socket *so, enum shutdown_how how) { struct hvs_pcb *pcb = so2hvspcb(so); - struct sockbuf *sb; HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_shutdown called\n", __func__); + SOCK_LOCK(so); + if ((so->so_state & + (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { + SOCK_UNLOCK(so); + return (ENOTCONN); + } + SOCK_UNLOCK(so); + if (pcb == NULL) return (EINVAL); - /* - * Only get called with the shutdown method is SHUT_WR or - * SHUT_RDWR. - * When the method is SHUT_RD or SHUT_RDWR, the caller - * already set the SBS_CANTRCVMORE on receive side socket - * buffer. - */ - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) == 0) { - /* - * SHUT_WR only case. - * Receive side is still open. Just close - * the send side. - */ - socantsendmore(so); - } else { - /* SHUT_RDWR case */ + switch (how) { + case SHUT_RD: + socantrcvmore(so); + break; + case SHUT_RDWR: + socantrcvmore(so); if (so->so_state & SS_ISCONNECTED) { /* Send a FIN to peer */ - sb = &so->so_snd; - SOCKBUF_LOCK(sb); - (void) hvsock_send_data(pcb->chan, NULL, 0, sb); - SOCKBUF_UNLOCK(sb); - + SOCK_SENDBUF_LOCK(so); + (void) hvsock_send_data(pcb->chan, NULL, 0, + &so->so_snd); + SOCK_SENDBUF_UNLOCK(so); soisdisconnecting(so); } + /* FALLTHROUGH */ + case SHUT_WR: + socantsendmore(so); } + wakeup(&so->so_timeo); return (0); } diff --git a/sys/dev/hyperv/hvsock/hv_sock.h b/sys/dev/hyperv/hvsock/hv_sock.h index e11621d76dbc..32a6e71640a4 100644 --- a/sys/dev/hyperv/hvsock/hv_sock.h +++ b/sys/dev/hyperv/hvsock/hv_sock.h @@ -110,7 +110,7 @@ int hvs_trans_soreceive(struct socket *, struct sockaddr **, int hvs_trans_sosend(struct socket *, struct sockaddr *, struct uio *, struct mbuf *, struct mbuf *, int, struct thread *); int hvs_trans_disconnect(struct socket *); -int hvs_trans_shutdown(struct socket *); +int hvs_trans_shutdown(struct socket *, enum shutdown_how); int hvs_trans_lock(void); void hvs_trans_unlock(void); diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 435b13842041..ab00bf2bc71f 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -151,7 +151,7 @@ pr_ready_notsupp(struct socket *so, struct mbuf *m, int count) } static int -pr_shutdown_notsupp(struct socket *so) +pr_shutdown_notsupp(struct socket *so, enum shutdown_how how) { return (EOPNOTSUPP); } diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 919879e86e21..f61016d14e53 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2966,59 +2966,18 @@ soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, int soshutdown(struct socket *so, enum shutdown_how how) { - struct protosw *pr; - int error, soerror_enotconn; - - soerror_enotconn = 0; - SOCK_LOCK(so); - if ((so->so_state & - (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { - /* - * POSIX mandates us to return ENOTCONN when shutdown(2) is - * invoked on a datagram sockets, however historically we would - * actually tear socket down. This is known to be leveraged by - * some applications to unblock process waiting in recvXXX(2) - * by other process that it shares that socket with. Try to meet - * both backward-compatibility and POSIX requirements by forcing - * ENOTCONN but still asking protocol to perform pru_shutdown(). - */ - if (so->so_type != SOCK_DGRAM && !SOLISTENING(so)) { - SOCK_UNLOCK(so); - return (ENOTCONN); - } - soerror_enotconn = 1; - } - - if (SOLISTENING(so)) { - if (how != SHUT_WR) { - so->so_error = ECONNABORTED; - solisten_wakeup(so); /* unlocks so */ - } else { - SOCK_UNLOCK(so); - } - goto done; - } - SOCK_UNLOCK(so); + int error; CURVNET_SET(so->so_vnet); - pr = so->so_proto; - if (pr->pr_flush != NULL) - pr->pr_flush(so, how); - if (how != SHUT_WR && !(pr->pr_flags & PR_SOCKBUF)) - sorflush(so); - if (how != SHUT_RD) { - error = pr->pr_shutdown(so); - wakeup(&so->so_timeo); - CURVNET_RESTORE(); - return ((error == 0 && soerror_enotconn) ? ENOTCONN : error); - } - wakeup(&so->so_timeo); + error = so->so_proto->pr_shutdown(so, how); CURVNET_RESTORE(); -done: - return (soerror_enotconn ? ENOTCONN : 0); + return (error); } +/* + * Used by several pr_shutdown implementations that use generic socket buffers. + */ void sorflush(struct socket *so) { diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 8f5560e0f30b..0460d2761e7c 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1660,18 +1660,65 @@ uipc_sense(struct socket *so, struct stat *sb) } static int -uipc_shutdown(struct socket *so) +uipc_shutdown(struct socket *so, enum shutdown_how how) { - struct unpcb *unp; + struct unpcb *unp = sotounpcb(so); + int error; - unp = sotounpcb(so); - KASSERT(unp != NULL, ("uipc_shutdown: unp == NULL")); + SOCK_LOCK(so); + if ((so->so_state & + (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { + /* + * POSIX mandates us to just return ENOTCONN when shutdown(2) is + * invoked on a datagram sockets, however historically we would + * actually tear socket down. This is known to be leveraged by + * some applications to unblock process waiting in recv(2) by + * other process that it shares that socket with. Try to meet + * both backward-compatibility and POSIX requirements by forcing + * ENOTCONN but still flushing buffers and performing wakeup(9). + * + * XXXGL: it remains unknown what applications expect this + * behavior and is this isolated to unix/dgram or inet/dgram or + * both. See: D10351, D3039. + */ + error = ENOTCONN; + if (so->so_type != SOCK_DGRAM) { + SOCK_UNLOCK(so); + return (error); + } + } else + error = 0; + if (SOLISTENING(so)) { + if (how != SHUT_WR) { + so->so_error = ECONNABORTED; + solisten_wakeup(so); /* unlocks so */ + } else + SOCK_UNLOCK(so); + return (0); + } + SOCK_UNLOCK(so); - UNP_PCB_LOCK(unp); - socantsendmore(so); - unp_shutdown(unp); - UNP_PCB_UNLOCK(unp); - return (0); + switch (how) { + case SHUT_RD: + /* + * XXXGL: so far it is safe to call sorflush() on unix/dgram, + * because PR_RIGHTS flag saves us from destructive sbrelease() + * on our protocol specific buffers. + */ + sorflush(so); + break; + case SHUT_RDWR: + sorflush(so); + /* FALLTHROUGH */ + case SHUT_WR: + UNP_PCB_LOCK(unp); + socantsendmore(so); + unp_shutdown(unp); + UNP_PCB_UNLOCK(unp); + } + wakeup(&so->so_timeo); + + return (error); } static int diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index dea6a8f23cad..94d5e9e4bccc 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -450,10 +450,22 @@ rts_disconnect(struct socket *so) } static int -rts_shutdown(struct socket *so) +rts_shutdown(struct socket *so, enum shutdown_how how) { + /* + * Note: route socket marks itself as connected through its lifetime. + */ + switch (how) { + case SHUT_RD: + sorflush(so); + break; + case SHUT_RDWR: + sorflush(so); + /* FALLTHROUGH */ + case SHUT_WR: + socantsendmore(so); + } - socantsendmore(so); return (0); } diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 4a61e685d898..a6bef1c7e275 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -982,16 +982,27 @@ rip_connect(struct socket *so, struct sockaddr *nam, struct thread *td) } static int -rip_shutdown(struct socket *so) +rip_shutdown(struct socket *so, enum shutdown_how how) { - struct inpcb *inp; - inp = sotoinpcb(so); - KASSERT(inp != NULL, ("rip_shutdown: inp == NULL")); + SOCK_LOCK(so); + if (!(so->so_state & SS_ISCONNECTED)) { + SOCK_UNLOCK(so); + return (ENOTCONN); + } + SOCK_UNLOCK(so); + + switch (how) { + case SHUT_RD: + sorflush(so); + break; + case SHUT_RDWR: + sorflush(so); + /* FALLTHROUGH */ + case SHUT_WR: + socantsendmore(so); + } - INP_WLOCK(inp); - socantsendmore(so); - INP_WUNLOCK(inp); return (0); } #endif /* INET */ diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 7fa4559108fd..ec9f211b519b 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -775,14 +775,39 @@ sctp_disconnect(struct socket *so) } int -sctp_flush(struct socket *so, int how) +sctp_shutdown(struct socket *so, enum shutdown_how how) { + struct sctp_inpcb *inp = (struct sctp_inpcb *)so->so_pcb; struct epoch_tracker et; struct sctp_tcb *stcb; + struct sctp_association *asoc; + struct sctp_nets *netp; struct sctp_queued_to_read *control, *ncontrol; - struct sctp_inpcb *inp; struct mbuf *m, *op_err; bool need_to_abort = false; + int error = 0; + + MPASS(inp); + + if (!((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) + return (EOPNOTSUPP); + + SOCK_LOCK(so); + if ((so->so_state & + (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { + SOCK_UNLOCK(so); + return (ENOTCONN); + } + if (SOLISTENING(so)) { + if (how != SHUT_WR) { + so->so_error = ECONNABORTED; + solisten_wakeup(so); /* unlocks so */ + } else + SOCK_UNLOCK(so); + return (0); + } + SOCK_UNLOCK(so); /* * For 1-to-1 style sockets, flush the read queue and trigger an @@ -790,106 +815,70 @@ sctp_flush(struct socket *so, int how) * messages are lost. Loosing notifications does not need to be * signalled to the peer. */ - if (how == PRU_FLUSH_WR) { - /* This function is only relevant for the read directions. */ - return (0); - } - inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); - } - SCTP_INP_WLOCK(inp); - if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { - /* For 1-to-many style sockets this function does nothing. */ - SCTP_INP_WUNLOCK(inp); - return (0); - } - stcb = LIST_FIRST(&inp->sctp_asoc_list); - if (stcb != NULL) { - SCTP_TCB_LOCK(stcb); - } - SCTP_INP_READ_LOCK(inp); - inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; - SOCK_LOCK(so); - TAILQ_FOREACH_SAFE(control, &inp->read_queue, next, ncontrol) { - if ((control->spec_flags & M_NOTIFICATION) == 0) { - need_to_abort = true; - } - TAILQ_REMOVE(&inp->read_queue, control, next); - control->on_read_q = 0; - for (m = control->data; m; m = SCTP_BUF_NEXT(m)) { - sctp_sbfree(control, control->stcb, &so->so_rcv, m); - } - if (control->on_strm_q == 0) { - sctp_free_remote_addr(control->whoFrom); - if (control->data) { - sctp_m_freem(control->data); - control->data = NULL; - } - sctp_free_a_readq(stcb, control); - } else { - stcb->asoc.size_on_all_streams += control->length; + switch (how) { + case SHUT_RD: + case SHUT_RDWR: + SCTP_INP_WLOCK(inp); + stcb = LIST_FIRST(&inp->sctp_asoc_list); + if (stcb != NULL) { + SCTP_TCB_LOCK(stcb); } - } - SOCK_UNLOCK(so); - SCTP_INP_READ_UNLOCK(inp); - if (need_to_abort && (stcb != NULL)) { - inp->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6; - SCTP_INP_WUNLOCK(inp); - op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); - NET_EPOCH_ENTER(et); - sctp_abort_an_association(inp, stcb, op_err, false, SCTP_SO_LOCKED); - NET_EPOCH_EXIT(et); - return (ECONNABORTED); - } - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - SCTP_INP_WUNLOCK(inp); - return (0); -} - -int -sctp_shutdown(struct socket *so) -{ - struct sctp_inpcb *inp; + SCTP_INP_READ_LOCK(inp); + inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; + SOCK_LOCK(so); + TAILQ_FOREACH_SAFE(control, &inp->read_queue, next, ncontrol) { + if ((control->spec_flags & M_NOTIFICATION) == 0) { + need_to_abort = true; + } + TAILQ_REMOVE(&inp->read_queue, control, next); + control->on_read_q = 0; + for (m = control->data; m; m = SCTP_BUF_NEXT(m)) { + sctp_sbfree(control, control->stcb, + &so->so_rcv, m); + } + if (control->on_strm_q == 0) { + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; + } + sctp_free_a_readq(stcb, control); + } else { + stcb->asoc.size_on_all_streams += + control->length; + } + } + SOCK_UNLOCK(so); + SCTP_INP_READ_UNLOCK(inp); + if (need_to_abort && (stcb != NULL)) { + inp->last_abort_code = SCTP_FROM_SCTP_USRREQ + + SCTP_LOC_6; + SCTP_INP_WUNLOCK(inp); + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, + ""); + NET_EPOCH_ENTER(et); + sctp_abort_an_association(inp, stcb, op_err, false, + SCTP_SO_LOCKED); + NET_EPOCH_EXIT(et); - inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); - } - SCTP_INP_RLOCK(inp); - /* For UDP model this is a invalid call */ - if (!((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { - /* Restore the flags that the soshutdown took away. */ - SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_state &= ~SBS_CANTRCVMORE; - SOCKBUF_UNLOCK(&so->so_rcv); - /* This proc will wakeup for read and do nothing (I hope) */ - SCTP_INP_RUNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP); - return (EOPNOTSUPP); - } else { + error = ECONNABORTED; + goto out; + } + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + SCTP_INP_WUNLOCK(inp); /* - * Ok, if we reach here its the TCP model and it is either a - * SHUT_WR or SHUT_RDWR. This means we put the shutdown flag - * against it. + * XXXGL: does SCTP need sorflush()? This is what old + * soshutdown() used to do for all kinds of sockets. */ - struct epoch_tracker et; - struct sctp_tcb *stcb; - struct sctp_association *asoc; - struct sctp_nets *netp; + sorflush(so); + if (how == SHUT_RD) + break; + /* FALLTHROUGH */ - if ((so->so_state & - (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { - SCTP_INP_RUNLOCK(inp); - return (ENOTCONN); - } + case SHUT_WR: socantsendmore(so); - stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb == NULL) { /* @@ -898,14 +887,14 @@ sctp_shutdown(struct socket *so) * now. */ SCTP_INP_RUNLOCK(inp); - return (0); + goto out; } SCTP_TCB_LOCK(stcb); asoc = &stcb->asoc; if (asoc->state & SCTP_STATE_ABOUT_TO_BE_FREED) { SCTP_TCB_UNLOCK(stcb); SCTP_INP_RUNLOCK(inp); - return (0); + goto out; } if ((SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT) && (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_ECHOED) && @@ -916,7 +905,7 @@ sctp_shutdown(struct socket *so) */ SCTP_TCB_UNLOCK(stcb); SCTP_INP_RUNLOCK(inp); - return (0); + goto out; } NET_EPOCH_ENTER(et); if (stcb->asoc.alternate) { @@ -961,7 +950,7 @@ sctp_shutdown(struct socket *so) sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, false, SCTP_SO_LOCKED); NET_EPOCH_EXIT(et); - return (0); + goto out; } } /* @@ -972,8 +961,11 @@ sctp_shutdown(struct socket *so) SCTP_TCB_UNLOCK(stcb); SCTP_INP_RUNLOCK(inp); NET_EPOCH_EXIT(et); - return (0); } +out: + wakeup(&so->so_timeo); + + return (error); } /* @@ -7523,7 +7515,6 @@ sctp_peeraddr(struct socket *so, struct sockaddr *sa) .pr_close = sctp_close, \ .pr_detach = sctp_close, \ .pr_sopoll = sopoll_generic, \ - .pr_flush = sctp_flush, \ .pr_disconnect = sctp_disconnect, \ .pr_listen = sctp_listen, \ .pr_peeraddr = sctp_peeraddr, \ diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h index 54566e9ac0df..9ec8bdd9ab5e 100644 --- a/sys/netinet/sctp_var.h +++ b/sys/netinet/sctp_var.h @@ -331,7 +331,7 @@ void sctp_notify(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint8_t, uint8_t, uint16_t, uint32_t); int sctp_flush(struct socket *, int); -int sctp_shutdown(struct socket *); +int sctp_shutdown(struct socket *, enum shutdown_how); int sctp_bindx(struct socket *, int, struct sockaddr_storage *, int, int, struct proc *); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index dad79374c08b..ccd6a6149dae 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -799,31 +799,57 @@ tcp6_usr_accept(struct socket *so, struct sockaddr *sa) * Mark the connection as being incapable of further output. */ static int -tcp_usr_shutdown(struct socket *so) +tcp_usr_shutdown(struct socket *so, enum shutdown_how how) { - int error = 0; - struct inpcb *inp; - struct tcpcb *tp; struct epoch_tracker et; + struct inpcb *inp = sotoinpcb(so); + struct tcpcb *tp = intotcpcb(inp); + int error = 0; - inp = sotoinpcb(so); - KASSERT(inp != NULL, ("inp == NULL")); - INP_WLOCK(inp); - if (inp->inp_flags & INP_DROPPED) { - INP_WUNLOCK(inp); - return (ECONNRESET); + SOCK_LOCK(so); + if ((so->so_state & + (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { + SOCK_UNLOCK(so); + return (ENOTCONN); } - tp = intotcpcb(inp); + if (SOLISTENING(so)) { + if (how != SHUT_WR) { + so->so_error = ECONNABORTED; + solisten_wakeup(so); /* unlocks so */ + } else + SOCK_UNLOCK(so); + return (0); + } + SOCK_UNLOCK(so); - NET_EPOCH_ENTER(et); - socantsendmore(so); - tcp_usrclosed(tp); - if (!(inp->inp_flags & INP_DROPPED)) + switch (how) { + case SHUT_RD: + sorflush(so); + break; + case SHUT_RDWR: + sorflush(so); + /* FALLTHROUGH */ + case SHUT_WR: + /* + * XXXGL: mimicing old soshutdown() here. But shouldn't we + * return ECONNRESEST for SHUT_RD as well? + */ + INP_WLOCK(inp); + if (inp->inp_flags & INP_DROPPED) { + INP_WUNLOCK(inp); + return (ECONNRESET); + } + + socantsendmore(so); + NET_EPOCH_ENTER(et); + tcp_usrclosed(tp); error = tcp_output_nodrop(tp); - tcp_bblog_pru(tp, PRU_SHUTDOWN, error); - TCP_PROBE2(debug__user, tp, PRU_SHUTDOWN); - error = tcp_unlock_or_drop(tp, error); - NET_EPOCH_EXIT(et); + tcp_bblog_pru(tp, PRU_SHUTDOWN, error); + TCP_PROBE2(debug__user, tp, PRU_SHUTDOWN); + error = tcp_unlock_or_drop(tp, error); + NET_EPOCH_EXIT(et); + } + wakeup(&so->so_timeo); return (error); } diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index affdb3b1f4c7..f91a96edeb68 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1670,16 +1670,42 @@ udp_disconnect(struct socket *so) #endif /* INET */ int -udp_shutdown(struct socket *so) +udp_shutdown(struct socket *so, enum shutdown_how how) { - struct inpcb *inp; + int error; - inp = sotoinpcb(so); - KASSERT(inp != NULL, ("udp_shutdown: inp == NULL")); - INP_WLOCK(inp); - socantsendmore(so); - INP_WUNLOCK(inp); - return (0); + SOCK_LOCK(so); + if (!(so->so_state & SS_ISCONNECTED)) + /* + * POSIX mandates us to just return ENOTCONN when shutdown(2) is + * invoked on a datagram sockets, however historically we would + * actually tear socket down. This is known to be leveraged by + * some applications to unblock process waiting in recv(2) by + * other process that it shares that socket with. Try to meet + * both backward-compatibility and POSIX requirements by forcing + * ENOTCONN but still flushing buffers and performing wakeup(9). + * + * XXXGL: it remains unknown what applications expect this + * behavior and is this isolated to unix/dgram or inet/dgram or + * both. See: D10351, D3039. + */ + error = ENOTCONN; + else + error = 0; + SOCK_UNLOCK(so); + + switch (how) { + case SHUT_RD: + sorflush(so); + break; + case SHUT_RDWR: + sorflush(so); + /* FALLTHROUGH */ + case SHUT_WR: + socantsendmore(so); + } + + return (error); } #ifdef INET diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index c31db2d97b5f..a66d76845eb6 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -168,7 +168,7 @@ udp_get_inpcbinfo(int protocol) int udp_ctloutput(struct socket *, struct sockopt *); void udplite_input(struct mbuf *, int); struct inpcb *udp_notify(struct inpcb *inp, int errno); -int udp_shutdown(struct socket *so); +int udp_shutdown(struct socket *, enum shutdown_how); int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, udp_tun_icmp_t i, void *ctx); diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 174cc29e6008..3264de331817 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -827,16 +827,27 @@ rip6_connect(struct socket *so, struct sockaddr *nam, struct thread *td) } static int -rip6_shutdown(struct socket *so) +rip6_shutdown(struct socket *so, enum shutdown_how how) { - struct inpcb *inp; - inp = sotoinpcb(so); - KASSERT(inp != NULL, ("rip6_shutdown: inp == NULL")); + SOCK_LOCK(so); + if (!(so->so_state & SS_ISCONNECTED)) { + SOCK_UNLOCK(so); + return (ENOTCONN); + } + SOCK_UNLOCK(so); + + switch (how) { + case SHUT_RD: + sorflush(so); + break; + case SHUT_RDWR: + sorflush(so); + /* FALLTHROUGH */ + case SHUT_WR: + socantsendmore(so); + } - INP_WLOCK(inp); - socantsendmore(so); - INP_WUNLOCK(inp); return (0); } diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index 1268e4990e90..e3ed37b53425 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -1095,7 +1095,6 @@ sctp6_getpeeraddr(struct socket *so, struct sockaddr *sa) .pr_close = sctp6_close, \ .pr_detach = sctp6_close, \ .pr_sopoll = sopoll_generic, \ - .pr_flush = sctp_flush, \ .pr_disconnect = sctp_disconnect, \ .pr_listen = sctp_listen, \ .pr_peeraddr = sctp6_getpeeraddr, \ diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index b512c60971ee..6fd21b947687 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -39,6 +39,7 @@ struct thread; struct sockaddr; struct socket; struct sockopt; +enum shutdown_how; /*#ifdef _KERNEL*/ /* @@ -84,8 +85,7 @@ typedef int pr_send_t(struct socket *, int, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *); typedef int pr_ready_t(struct socket *, struct mbuf *, int); typedef int pr_sense_t(struct socket *, struct stat *); -typedef int pr_shutdown_t(struct socket *); -typedef int pr_flush_t(struct socket *, int); +typedef int pr_shutdown_t(struct socket *, enum shutdown_how); typedef int pr_sockaddr_t(struct socket *, struct sockaddr *); typedef int pr_sosend_t(struct socket *, struct sockaddr *, struct uio *, struct mbuf *, struct mbuf *, int, struct thread *); @@ -137,7 +137,6 @@ struct protosw { pr_peeraddr_t *pr_peeraddr; /* getpeername(2) */ pr_sockaddr_t *pr_sockaddr; /* getsockname(2) */ pr_sense_t *pr_sense; /* stat(2) */ - pr_flush_t *pr_flush; /* XXXGL: merge with pr_shutdown_t! */ pr_sosetlabel_t *pr_sosetlabel; /* MAC, XXXGL: remove */ pr_setsbopt_t *pr_setsbopt; /* Socket buffer ioctls */ }; diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 9e78281e5dd2..3e24db552618 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -633,14 +633,6 @@ enum shutdown_how { SHUT_RDWR /* shut down both sides */ }; -#if __BSD_VISIBLE -/* for SCTP */ -/* we cheat and use the SHUT_XX defines for these */ -#define PRU_FLUSH_RD SHUT_RD -#define PRU_FLUSH_WR SHUT_WR -#define PRU_FLUSH_RDWR SHUT_RDWR -#endif - #if __BSD_VISIBLE /* * sendfile(2) header/trailer struct From nobody Tue Jan 16 18:31:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDyJl72T3z57mhB; Tue, 16 Jan 2024 18:31: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 4TDyJl3YGMz4w9n; Tue, 16 Jan 2024 18:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705429895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y5D0mPv+q2B4IrZyxwhnlHM8v4p2NmHuhKMZULiDCls=; b=wmrBceL/rqL7NGfY0++1wOxIpJKrRXqHd5AFkASFFAb7OuheBvoT03OWhHjXO8dAdE/yyC 9QjgdSK+GZ2KPzQdQsy7Jm4uU2mFiILb4Zyrd1N/HVeyKwoATTQ5RonpGwi5Y0h+DrkdTP 0FuGYlogAn5FygEuhGcSPhRpcJGW5oUCzEVQiElWiBHP74ozpyLpwHFiQzCx02GDbdy8DO AVOg5PYfiEU4vWZnxNmbcjH+GUAWw+H/sDuezAqp7aQr0Oa9QWniuVohS1AyVfuyMAaqQo unabEgPdRFwH/bjk8yFaGB8rPaWyK/ljERMooxr7rb1KOEQdOB6nm3BnQEFWrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705429895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y5D0mPv+q2B4IrZyxwhnlHM8v4p2NmHuhKMZULiDCls=; b=WAxtFNHSVHjT40OSG4u0me69M+VxLzBajMgKqWEedGDmtCjCbmIdiXG3CVFkMlgvlQqfmN 7ue9nnLG6HbgN2sWMU/ij6NX9SwibGz9WtGPULM3NNCp2dngfP6JZEPfqKHgfSsODg6ntN t1yXSdM6e+UWiKehBlHeNVNWUUIEzLG9uplJUHH1wvum61XeBhecnB/IeKTwiPRpWFMj06 3AOBay5SnbSxWD37aoIDchciwPvfYybBKbWL9G4VM1uDBCQcWoS5LNlB6RxIpmJcea8GOn T3uAeetN47ZhGAKamhKTyOaCqGP0YMn8WOyWsK08S6YFcxOtXIbzMVayDQgSUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705429895; a=rsa-sha256; cv=none; b=Joy0xWnUYzq7lV5vgQIMa4LtkGmzsqGYGMeIVfXggrjo2tbW+j98sq4wZp3OIYkZ+BmMmG G09TsIznfbNYj/ra3xvsQMo3/Uh7RGcIjo/oGB8HhFYYO5ONfEA1iY4ev2gVDb8di3WPFI zQV1Fy13cjpiNrzCEE/NqmUvMOOztcAOBcCiyLHxxVsUWqCBJj2WhVnPGR0u1hwgsuuC/y yqQqnHmA4DU/PBiVOLj9gppMF4Cdh8R0NrhkjWBNyjUVuxBxUn5WiMyNviBvzMtUATJLdQ QfouEbbXqqafFxWSQP613bDVQa8pe79sVYE81qVBSD8WngSd4GrBtON+l1fQlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDyJl2Fl1zrTH; Tue, 16 Jan 2024 18:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GIVZPa055966; Tue, 16 Jan 2024 18:31:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GIVZq6055963; Tue, 16 Jan 2024 18:31:35 GMT (envelope-from git) Date: Tue, 16 Jan 2024 18:31:35 GMT Message-Id: <202401161831.40GIVZq6055963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 289bee16be9c - main - sockets: remove dom_dispose and PR_RIGHTS List-Id: Commit messages for the main 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 289bee16be9c9e32451538fd5d31916b2a348947 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=289bee16be9c9e32451538fd5d31916b2a348947 commit 289bee16be9c9e32451538fd5d31916b2a348947 Author: Gleb Smirnoff AuthorDate: 2024-01-16 18:26:10 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-16 18:30:49 +0000 sockets: remove dom_dispose and PR_RIGHTS Passing file descriptors (rights) via sockets is a feature specific to PF_UNIX only, so fully isolate the logic into uipc_usrreq.c. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D43414 --- sys/kern/uipc_debug.c | 5 ----- sys/kern/uipc_socket.c | 15 ++------------- sys/kern/uipc_usrreq.c | 46 ++++++++++++++++++++++------------------------ sys/sys/domain.h | 2 -- sys/sys/protosw.h | 2 +- 5 files changed, 25 insertions(+), 45 deletions(-) diff --git a/sys/kern/uipc_debug.c b/sys/kern/uipc_debug.c index 8ae523fa3403..1e699a10223e 100644 --- a/sys/kern/uipc_debug.c +++ b/sys/kern/uipc_debug.c @@ -242,7 +242,6 @@ db_print_domain(struct domain *d, const char *domain_name, int indent) db_print_indent(indent); db_printf("dom_externalize: %p ", d->dom_externalize); - db_printf("dom_dispose: %p\n", d->dom_dispose); db_print_indent(indent); db_printf("dom_protosw: %p ", d->dom_protosw); @@ -278,10 +277,6 @@ db_print_prflags(short pr_flags) db_printf("%sPR_WANTRCVD", comma ? ", " : ""); comma = 1; } - if (pr_flags & PR_RIGHTS) { - db_printf("%sPR_RIGHTS", comma ? ", " : ""); - comma = 1; - } if (pr_flags & PR_IMPLOPCL) { db_printf("%sPR_IMPLOPCL", comma ? ", " : ""); comma = 1; diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f61016d14e53..1626c6a7442d 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1201,10 +1201,6 @@ sofree(struct socket *so) so->so_dtor(so); VNET_SO_ASSERT(so); - if ((pr->pr_flags & PR_RIGHTS) && !SOLISTENING(so)) { - MPASS(pr->pr_domain->dom_dispose != NULL); - (*pr->pr_domain->dom_dispose)(so); - } if (pr->pr_detach != NULL) pr->pr_detach(so); @@ -2981,7 +2977,6 @@ soshutdown(struct socket *so, enum shutdown_how how) void sorflush(struct socket *so) { - struct protosw *pr; int error; VNET_SO_ASSERT(so); @@ -3001,14 +2996,8 @@ sorflush(struct socket *so) return; } - pr = so->so_proto; - if (pr->pr_flags & PR_RIGHTS) { - MPASS(pr->pr_domain->dom_dispose != NULL); - (*pr->pr_domain->dom_dispose)(so); - } else { - sbrelease(so, SO_RCV); - SOCK_IO_RECV_UNLOCK(so); - } + sbrelease(so, SO_RCV); + SOCK_IO_RECV_UNLOCK(so); } diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 0460d2761e7c..554099586bbc 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -724,6 +724,9 @@ uipc_detach(struct socket *so) vp = NULL; vplock = NULL; + if (!SOLISTENING(so)) + unp_dispose(so); + UNP_LINK_WLOCK(); LIST_REMOVE(unp, unp_link); if (unp->unp_gcflag & UNPGC_DEAD) @@ -1700,15 +1703,12 @@ uipc_shutdown(struct socket *so, enum shutdown_how how) switch (how) { case SHUT_RD: - /* - * XXXGL: so far it is safe to call sorflush() on unix/dgram, - * because PR_RIGHTS flag saves us from destructive sbrelease() - * on our protocol specific buffers. - */ - sorflush(so); + socantrcvmore(so); + unp_dispose(so); break; case SHUT_RDWR: - sorflush(so); + socantrcvmore(so); + unp_dispose(so); /* FALLTHROUGH */ case SHUT_WR: UNP_PCB_LOCK(unp); @@ -3193,7 +3193,8 @@ unp_gc(__unused void *arg, int pending) so = unref[i]->f_data; CURVNET_SET(so->so_vnet); - sorflush(so); + socantrcvmore(so); + unp_dispose(so); CURVNET_RESTORE(); } @@ -3250,15 +3251,15 @@ unp_dispose(struct socket *so) * XXXGL Mark sb with SBS_CANTRCVMORE. This is needed to * prevent uipc_sosend_dgram() or unp_disconnect() adding more * data to the socket. - * We are now in dom_dispose and it could be a call from - * soshutdown() or from the final sofree(). The sofree() case - * is simple as it guarantees that no more sends will happen, - * however we can race with unp_disconnect() from our peer. - * The shutdown(2) case is more exotic. It would call into - * dom_dispose() only if socket is SS_ISCONNECTED. This is - * possible if we did connect(2) on this socket and we also - * had it bound with bind(2) and receive connections from other - * sockets. Because soshutdown() violates POSIX (see comment + * We came here either through shutdown(2) or from the final + * sofree(). The sofree() case is simple as it guarantees + * that no more sends will happen, however we can race with + * unp_disconnect() from our peer. The shutdown(2) case is + * more exotic. It would call into unp_dispose() only if + * socket is SS_ISCONNECTED. This is possible if we did + * connect(2) on this socket and we also had it bound with + * bind(2) and receive connections from other sockets. + * Because uipc_shutdown() violates POSIX (see comment * there) we will end up here shutting down our receive side. * Of course this will have affect not only on the peer we * connect(2)ed to, but also on all of the peers who had @@ -3335,8 +3336,7 @@ unp_scan(struct mbuf *m0, void (*op)(struct filedescent **, int)) */ static struct protosw streamproto = { .pr_type = SOCK_STREAM, - .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS| - PR_CAPATTACH, + .pr_flags = PR_CONNREQUIRED | PR_WANTRCVD | PR_CAPATTACH, .pr_ctloutput = &uipc_ctloutput, .pr_abort = uipc_abort, .pr_accept = uipc_peeraddr, @@ -3362,8 +3362,7 @@ static struct protosw streamproto = { static struct protosw dgramproto = { .pr_type = SOCK_DGRAM, - .pr_flags = PR_ATOMIC | PR_ADDR |PR_RIGHTS | PR_CAPATTACH | - PR_SOCKBUF, + .pr_flags = PR_ATOMIC | PR_ADDR | PR_CAPATTACH | PR_SOCKBUF, .pr_ctloutput = &uipc_ctloutput, .pr_abort = uipc_abort, .pr_accept = uipc_peeraddr, @@ -3391,8 +3390,8 @@ static struct protosw seqpacketproto = { * due to our use of sbappendaddr. A new sbappend variants is needed * that supports both atomic record writes and control data. */ - .pr_flags = PR_ADDR|PR_ATOMIC|PR_CONNREQUIRED| - PR_WANTRCVD|PR_RIGHTS|PR_CAPATTACH, + .pr_flags = PR_ADDR | PR_ATOMIC | PR_CONNREQUIRED | + PR_WANTRCVD | PR_CAPATTACH, .pr_ctloutput = &uipc_ctloutput, .pr_abort = uipc_abort, .pr_accept = uipc_peeraddr, @@ -3419,7 +3418,6 @@ static struct domain localdomain = { .dom_family = AF_LOCAL, .dom_name = "local", .dom_externalize = unp_externalize, - .dom_dispose = unp_dispose, .dom_nprotosw = 3, .dom_protosw = { &streamproto, diff --git a/sys/sys/domain.h b/sys/sys/domain.h index 792376755750..45180aa06f80 100644 --- a/sys/sys/domain.h +++ b/sys/sys/domain.h @@ -54,8 +54,6 @@ struct domain { int (*dom_probe)(void); /* check for support (optional) */ int (*dom_externalize) /* externalize access rights */ (struct mbuf *, struct mbuf **, int); - void (*dom_dispose) /* dispose of internalized rights */ - (struct socket *); struct rib_head *(*dom_rtattach) /* initialize routing table */ (uint32_t); void (*dom_rtdetach) /* clean up routing table */ diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 6fd21b947687..60d8ffc31362 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -157,7 +157,7 @@ struct protosw { #define PR_ADDR 0x02 /* addresses given with messages */ #define PR_CONNREQUIRED 0x04 /* connection required by protocol */ #define PR_WANTRCVD 0x08 /* want PRU_RCVD calls */ -#define PR_RIGHTS 0x10 /* passes capabilities */ +/* was PR_RIGHTS 0x10 passes capabilities */ #define PR_IMPLOPCL 0x20 /* implied open/close */ /* was PR_LASTHDR 0x40 enforce ipsec policy; last header */ #define PR_CAPATTACH 0x80 /* socket can attach in cap mode */ From nobody Tue Jan 16 18:31:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDyJm6qYPz57mYp; Tue, 16 Jan 2024 18:31: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 4TDyJm4Hw2z4wB3; Tue, 16 Jan 2024 18:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705429896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OV0N1O9KYaxsRaYWjIakF8UuZSiu3IeDoCnYJV8afq4=; b=VWKPhBjr3atOH4JlBIwUtDtTaG8hh8SDCLHlLEwzFEn4ZPiTZZLmKbgI74xd+tIJ9Hrkap aLRDyispoVnKeqCZD0XggLuj43Elqko5cODZETxVvN/LqSSvZFYnCt4Qv9aTdc9+s9UuN4 arxC1dQgySq7DPVRT5HJqnaXgHd0N+FXb69Yz2JHnwzwbRhR4IB42URnLM7kMldyVq3Pbb 7GuzrUVfewVS+F3KUPpILBE173v3/WcqppnFCQqUTTQd9kJzYETbL5yQgNgWO/8aw+/GnT Lwy4RK8339lmrgOH5l7NQA2Q1EcHOGfrRjoMqHNYqSiPzMSTZ0IMYYDdFRT1Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705429896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OV0N1O9KYaxsRaYWjIakF8UuZSiu3IeDoCnYJV8afq4=; b=FT/Ox8NTTDg6hMWaKwCvKYxMwLqWtsxsm+395q85ShcRykX9rub/Ptjh4zCJI71uYnqRtr +lVSYnRG6Wa4YO0+E6/iznuRQ3J+K8D5lfZOKBeiOdyd/bHE56YRY/MEDXPfH7efMjN+O9 lxEG+G2ptQv7IjW0HmmsMwPMH3FlkPJ6hPxfPlqmpJ3ymrRrRbae2H3SCs51qAvNZVUsaC WzBCYfqZcBeD6ZauWkBcg6mG5GdD+u4cdORRAZYQWb/hDJYspjWzUweIaX7QgH8qAuPWIU crTM3kQ3CG1ln/VAUTsowATfik61NMREwH6up+4R7BeMiw0xi1p72UZSZx37EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705429896; a=rsa-sha256; cv=none; b=bDwppZohXUOY3GvereC2pdtuM7XerZlJHLpQdxXgBSQA6aK7ivhca1zhaTboKaQXk9IAd1 lwXNRxbvxhaCcNIXZS0kXdrqW4BK0HQMMbWk79IQBwOAt1L7qJI1XnlbdVCkorWRvje0/d qPPhJ17X/zFaTQr2RrG7M3Yzts0rW88E1lsTuiXJZqW6T5H6lfIXS9IKRURrqvGczTIi2n VWBHPaKinBd3JfE0tu1/3OLega39HlMiP4/Tz2u7SVT261bJzSceSVF0dCw0wQMBqT06lf 4uBe0eCIzBuDvWEXHjN+JSe9+6HQf8ny/MvystzGnD9KqfizNo1gkLRgg+1/Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDyJm3MJzzrFd; Tue, 16 Jan 2024 18:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GIVaal056002; Tue, 16 Jan 2024 18:31:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GIVaUO055999; Tue, 16 Jan 2024 18:31:36 GMT (envelope-from git) Date: Tue, 16 Jan 2024 18:31:36 GMT Message-Id: <202401161831.40GIVaUO055999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 507f87a799cf - main - sockets: retire sorflush() List-Id: Commit messages for the main 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 507f87a799cf0811ce30f0ae7f10ba19b2fd3db3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=507f87a799cf0811ce30f0ae7f10ba19b2fd3db3 commit 507f87a799cf0811ce30f0ae7f10ba19b2fd3db3 Author: Gleb Smirnoff AuthorDate: 2024-01-16 18:26:10 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-16 18:30:49 +0000 sockets: retire sorflush() With removal of dom_dispose method the function boils down to two meaningful function calls: socantrcvmore() and sbrelease(). The latter is only relevant for protocols that use generic socket buffers. The socket I/O sx(9) lock acquisition in sorflush() is not relevant for shutdown(2) operation as it doesn't do any I/O that may interleave with read(2) or write(2). The socket buffer mutex acquisition inside sbrelease() is what guarantees thread safety. This sx(9) acquisition in soshutdown() can be tracked down to 4.4BSD times, where it used to be sblock(), and it was carried over through the years evolving together with sockets with no reconsideration of why do we carry it over. I can't tell if that sblock() made sense back then, but it doesn't make any today. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D43415 --- sys/kern/uipc_socket.c | 36 +++--------------------------------- sys/net/rtsock.c | 6 ++++-- sys/netinet/raw_ip.c | 6 ++++-- sys/netinet/sctp_usrreq.c | 6 +----- sys/netinet/tcp_usrreq.c | 6 ++++-- sys/netinet/udp_usrreq.c | 6 ++++-- sys/netinet6/raw_ip6.c | 6 ++++-- sys/sys/socketvar.h | 1 - 8 files changed, 24 insertions(+), 49 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 1626c6a7442d..65230e39e4ae 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -95,9 +95,9 @@ * * NOTE: With regard to VNETs the general rule is that callers do not set * curvnet. Exceptions to this rule include soabort(), sodisconnect(), - * sofree() (and with that sorele(), sotryfree()), as well as sonewconn() - * and sorflush(), which are usually called from a pre-set VNET context. - * sopoll() currently does not need a VNET context to be set. + * sofree() (and with that sorele(), sotryfree()), as well as sonewconn(), + * which are usually called from a pre-set VNET context. sopoll() currently + * does not need a VNET context to be set. */ #include @@ -2971,36 +2971,6 @@ soshutdown(struct socket *so, enum shutdown_how how) return (error); } -/* - * Used by several pr_shutdown implementations that use generic socket buffers. - */ -void -sorflush(struct socket *so) -{ - int error; - - VNET_SO_ASSERT(so); - - /* - * Dislodge threads currently blocked in receive and wait to acquire - * a lock against other simultaneous readers before clearing the - * socket buffer. Don't let our acquire be interrupted by a signal - * despite any existing socket disposition on interruptable waiting. - */ - socantrcvmore(so); - - error = SOCK_IO_RECV_LOCK(so, SBL_WAIT | SBL_NOINTR); - if (error != 0) { - KASSERT(SOLISTENING(so), - ("%s: soiolock(%p) failed", __func__, so)); - return; - } - - sbrelease(so, SO_RCV); - SOCK_IO_RECV_UNLOCK(so); - -} - /* * Wrapper for Socket established helper hook. * Parameters: socket, context of the hook point, hook id. diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 94d5e9e4bccc..cb149f176b6d 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -457,10 +457,12 @@ rts_shutdown(struct socket *so, enum shutdown_how how) */ switch (how) { case SHUT_RD: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); break; case SHUT_RDWR: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); /* FALLTHROUGH */ case SHUT_WR: socantsendmore(so); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index a6bef1c7e275..004aaea01bfa 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -994,10 +994,12 @@ rip_shutdown(struct socket *so, enum shutdown_how how) switch (how) { case SHUT_RD: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); break; case SHUT_RDWR: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); /* FALLTHROUGH */ case SHUT_WR: socantsendmore(so); diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index ec9f211b519b..51c056e052a5 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -868,11 +868,7 @@ sctp_shutdown(struct socket *so, enum shutdown_how how) SCTP_TCB_UNLOCK(stcb); } SCTP_INP_WUNLOCK(inp); - /* - * XXXGL: does SCTP need sorflush()? This is what old - * soshutdown() used to do for all kinds of sockets. - */ - sorflush(so); + socantrcvmore(so); if (how == SHUT_RD) break; /* FALLTHROUGH */ diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index ccd6a6149dae..7c8e3d7e72db 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -824,10 +824,12 @@ tcp_usr_shutdown(struct socket *so, enum shutdown_how how) switch (how) { case SHUT_RD: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); break; case SHUT_RDWR: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); /* FALLTHROUGH */ case SHUT_WR: /* diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index f91a96edeb68..b68ec95a923a 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1696,10 +1696,12 @@ udp_shutdown(struct socket *so, enum shutdown_how how) switch (how) { case SHUT_RD: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); break; case SHUT_RDWR: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); /* FALLTHROUGH */ case SHUT_WR: socantsendmore(so); diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 3264de331817..5b31a84f31eb 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -839,10 +839,12 @@ rip6_shutdown(struct socket *so, enum shutdown_how how) switch (how) { case SHUT_RD: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); break; case SHUT_RDWR: - sorflush(so); + socantrcvmore(so); + sbrelease(so, SO_RCV); /* FALLTHROUGH */ case SHUT_WR: socantsendmore(so); diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 19ca52177d17..5d651b36b1e7 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -501,7 +501,6 @@ int soreceive_generic(struct socket *so, struct sockaddr **paddr, void sorele_locked(struct socket *so); void sodealloc(struct socket *); int soreserve(struct socket *so, u_long sndcc, u_long rcvcc); -void sorflush(struct socket *so); int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td); From nobody Tue Jan 16 19:24:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDzTk4Nd2z57sFr; Tue, 16 Jan 2024 19:24: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 4TDzTk3khvz3xvV; Tue, 16 Jan 2024 19:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705433066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dMhPUfa1ag5VyjfU/Bzd1UQ4kJ3sdUvKs5//TS/RIBM=; b=cl/WG1TCWu5zQCgFKhSgkIfSssF7X75vy1Q+bULO63zmex+DBn0qM8Fuq0ttochZ2Ln2bD sEE1NKiLQa1dvIAr7aOTiW9Juq34j3yjMPats6ju6889H/+WDuKKI7vMxbC8jjUec8YVFw xgRrZuUUFgSfUnMEbKtb0aXTI5nNnMNY3SXRWDC3wYOibgRLYJKzyvjKCfGXiOudBNJEI9 nBnTnBSqcJ9SvpEOoT2Vg5BfAHN5+7fYmd/7wTx1fDKyDZ9QJdJjxVZl5hcaMTA2EbB11J 32d44IIz9Qfz/3S5IxmIEXO+s/58Ps7R0EEC+U7jBnDMeS86Zng/NOVegrVzRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705433066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dMhPUfa1ag5VyjfU/Bzd1UQ4kJ3sdUvKs5//TS/RIBM=; b=kulOK9xab8vpcuZYRPk0pYpXmM33/0dIsgW3EZElfi8aUGGSSDYtDFQwLxJUo1FCzULx9E Vqp59LLLbUwqXcbaNhDOO3ExW0xb/4ASQGmn8fE2IEhC8eyxQVBbVb0hdwoP9PuS0vSLFs C07CWUp/0buIfAwLGnM7vg5ahgaVgJLtN9wSj/6XJPQsxVP3/tEfaTSSbE9hAOa1aPYCmg DwlS+UEjsH4fQ/kzJCGlVbE0pwMBrPISHmLO2igyEdGcmX9Za04uuZQ/96otjIyhlZZprP VyaDztJxg4OOZeWTILCT/0CzecT0rM8s0nqTipptPxn7mouip+xtJCY0HQivAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705433066; a=rsa-sha256; cv=none; b=R+paSOhqFsdNYwtylKl3LXG3dNP+B5qeCpy9KOfXa1878utk7WvfHEbfGbX55qnM6eXO2g 3+fz7N65y3Zn7wmziCDgmXgpH9kc81hVi8swT+OVPAXq1aU/cvOXwguk9c4asiVirIj0hF UzbOowTM3uHKGzo/bQ53Uej78GxO99kgAP8FvzXkBXU3RMLWI8r3ZnkQXRDdNHhXmNs9LV 3o0WXQA9e0p2k9g8tPNqq31FJdHrOQwt6jG+b0xmuODwiBPVGwBxozxSqXeXlxJ5Gtjuf8 bAWohM9q78TWVF8MBXeA47ABadgPBa+ubMc1nZ4rKB9yXsv3h4Svo5t1U/eVxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDzTk2nJszt8C; Tue, 16 Jan 2024 19:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GJOQUo043502; Tue, 16 Jan 2024 19:24:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GJOQff043499; Tue, 16 Jan 2024 19:24:26 GMT (envelope-from git) Date: Tue, 16 Jan 2024 19:24:26 GMT Message-Id: <202401161924.40GJOQff043499@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: 61a0eaca0dd7 - main - MAINTAINERS: change linuxkpi review Phabricator group. List-Id: Commit messages for the main 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: 61a0eaca0dd7de0c08b46c986aee345922c804f0 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=61a0eaca0dd7de0c08b46c986aee345922c804f0 commit 61a0eaca0dd7de0c08b46c986aee345922c804f0 Author: Bjoern A. Zeeb AuthorDate: 2024-01-15 12:26:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-01-16 19:23:39 +0000 MAINTAINERS: change linuxkpi review Phabricator group. Direct the review request to #linuxkpi instead of #x11 as it also is #wireless these days and possibly others in the future. I would suggest #x11 reviewers also add themselves to #linuxkpi instead. Reviewed by: manu, emaste Differential Revision: https://reviews.freebsd.org/D43458 --- MAINTAINERS | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 54486867eed6..8c3c798c256c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -96,9 +96,7 @@ share/mk/*.test.mk imp,bapt,bdrewery, Pre-commit review requested. stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested stand imp Pre-commit review strongly requested. -sys/compat/linuxkpi pre-commit review requested via - #x11 phabricator group. - (to avoid drm graphics drivers impact) +sys/compat/linuxkpi pre-commit review requested via #linuxkpi phabricator group. sys/contrib/dev/ice erj Pre-commit phabricator review requested. sys/netpfil/ipfilter cy Pre-commit review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. From nobody Tue Jan 16 20:03:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TF0Lw1gn2z57wjW; Tue, 16 Jan 2024 20:03: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 4TF0Lw0fLqz43gg; Tue, 16 Jan 2024 20:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705435416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IWktRBCFpMI/5RcFmMX3qPn+j2KuAOoJfpfQoRS31RI=; b=RepS5ih3n+g98MisJDyBvq0/dZLMMPnmGJ9ubzL5UhJt0yNPeck3obguj23kh8hjegXD6d 3H7mtO72tEVeGE1G1DWkw6ze4QQRvM+OYtfv6WN/08h202Zrbac+KGgbX8IG//uk3hqYPZ 2C7uA2jJLzKjIKgbYWWG18i1Ut0tDrAOMqHkt0C3/BHNwALQU1qsMospHtsbS1DwNKutQt GIpSpgNk9Dv84T0V1rZLHYaDGfHsn/TYe6TOZwkQ42mSCRjgP5jkN4jD6RyLf9IYwSAcUL MH0h1cvVzhg0wLkdPwZgBjl5BVjRgtYvHkJ+ytd/HuTd19t5PDR9ejSd3AtshQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705435416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IWktRBCFpMI/5RcFmMX3qPn+j2KuAOoJfpfQoRS31RI=; b=JZnl40SDCTed9MjHBZJv18s023Vkdk8t8OLPE3/kkkXuT+JuSZQkAEvr5mWG+BGS7PO4Xi cCtfcUej67XoAXzl+DrOZNRMKsGvprPP7aKJk6UPak27pIEw8wU2bTaEFv+5bkXOc3OzNC 2ONIf1ygCQms5DzE2M1Y7URvptjBXxm6O3sl8h//G0py8DGLkcV6+5FYhP+bzWnbR0srb9 tFNK39DfOyGvG8LgN0qvM6NHF54EDpBv2pH6eJ6NdvzS353W7IrnCzY7KDUwwrsmbbaAkk 9mpTe4eMG10DMHxpTLZJcy/H3kg74365XB5UwbsMTmZp6fxdLOZI9ws8UnnHlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705435416; a=rsa-sha256; cv=none; b=JFUCCH9//GSd5u6J9WM3OtF+TzZDUfd/OUv5BV6P3G1fBwc0wcNFE3lQg0W6FxDmiXz07D ffp2Gd1l+4RZwoHtlyOXwPIQ8OGbUMIUQ4jJPGAPW6cmMIZTNaKUitsgwyle0fdC+qUY74 pKO+9J32AuGd4o37b/ZTEbDutF8ozl4z9eTdvDHlgQ43x7M5Aguuulkgi7L3fAGY6gKHkz NZe/n0oEUlapwvVpzr0jEhVtx10Sk7i6eJfRu0zeh1NJgT4gYPXAUzAvL6lnr6Lup8pmGm feTJMYskBmR7X+CE/gHD7Z0tRjZAZolFnP40GkRf1x6287XpBs+HZsRxhgOhlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TF0Lv6qnSztlG; Tue, 16 Jan 2024 20:03:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GK3Zb9010782; Tue, 16 Jan 2024 20:03:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GK3ZRi010779; Tue, 16 Jan 2024 20:03:35 GMT (envelope-from git) Date: Tue, 16 Jan 2024 20:03:35 GMT Message-Id: <202401162003.40GK3ZRi010779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 296a4cb5c5b1 - main - sockets: provide correct pr_shutdown for keysock and SDP List-Id: Commit messages for the main 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 296a4cb5c5b18f82da7a365d9f209cb9fc09003b Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=296a4cb5c5b18f82da7a365d9f209cb9fc09003b commit 296a4cb5c5b18f82da7a365d9f209cb9fc09003b Author: Gleb Smirnoff AuthorDate: 2024-01-16 20:00:36 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-16 20:02:59 +0000 sockets: provide correct pr_shutdown for keysock and SDP My failure to run all kinds of kernel builds lead to missing the keysock and incorrectly assuming SDP as not having a shutdown method. Fixes: 5bba2728079ed4da33f727dbc2b6ae1de02ba897 --- sys/netipsec/keysock.c | 19 +++++++++- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c | 52 +++++++++++++++++++------- 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c index 18bbdae316f0..d9297d44c18a 100644 --- a/sys/netipsec/keysock.c +++ b/sys/netipsec/keysock.c @@ -310,9 +310,24 @@ key_detach(struct socket *so) } static int -key_shutdown(struct socket *so) +key_shutdown(struct socket *so, enum shutdown_how how) { - socantsendmore(so); + /* + * Note: key socket marks itself as connected through its lifetime. + */ + switch (how) { + case SHUT_RD: + socantrcvmore(so); + sbrelease(so, SO_RCV); + break; + case SHUT_RDWR: + socantrcvmore(so); + sbrelease(so, SO_RCV); + /* FALLTHROUGH */ + case SHUT_WR: + socantsendmore(so); + } + return (0); } diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index 95048a1dc186..cfc2390db02e 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -787,24 +787,50 @@ sdp_accept(struct socket *so, struct sockaddr *sa) * Mark the connection as being incapable of further output. */ static int -sdp_shutdown(struct socket *so) +sdp_shutdown(struct socket *so, enum shutdown_how how) { + struct sdp_sock *ssk = sdp_sk(so); int error = 0; - struct sdp_sock *ssk; - ssk = sdp_sk(so); - SDP_WLOCK(ssk); - if (ssk->flags & (SDP_TIMEWAIT | SDP_DROPPED)) { - error = ECONNRESET; - goto out; + SOCK_LOCK(so); + if ((so->so_state & + (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { + SOCK_UNLOCK(so); + return (ENOTCONN); } - socantsendmore(so); - sdp_usrclosed(ssk); - if (!(ssk->flags & SDP_DROPPED)) - sdp_output_disconnect(ssk); + if (SOLISTENING(so)) { + if (how != SHUT_WR) { + so->so_error = ECONNABORTED; + solisten_wakeup(so); /* unlocks so */ + } else + SOCK_UNLOCK(so); + return (0); + } + SOCK_UNLOCK(so); -out: - SDP_WUNLOCK(ssk); + switch (how) { + case SHUT_RD: + socantrcvmore(so); + sbrelease(so, SO_RCV); + break; + case SHUT_RDWR: + socantrcvmore(so); + sbrelease(so, SO_RCV); + /* FALLTHROUGH */ + case SHUT_WR: + SDP_WLOCK(ssk); + if (ssk->flags & (SDP_TIMEWAIT | SDP_DROPPED)) { + SDP_WUNLOCK(ssk); + error = ECONNRESET; + break; + } + socantsendmore(so); + sdp_usrclosed(ssk); + if (!(ssk->flags & SDP_DROPPED)) + sdp_output_disconnect(ssk); + SDP_WUNLOCK(ssk); + } + wakeup(&so->so_timeo); return (error); } From nobody Tue Jan 16 20:16:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TF0dD4kJTz57xwW; Tue, 16 Jan 2024 20:16: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 4TF0dD4G7xz44Qy; Tue, 16 Jan 2024 20:16:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705436160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dGbZGqLntCP2qz99QMCGYJC8TVlOK6ywnyNjtEJ2Lis=; b=XUPTFktAGKC5JUiBt22fqRJ+oj8R4plQSkeig1PZVxciMRi3QdUwbGDRTOQ++OvfsTaQu7 iyv21U6PuvWV3XxDRZ+Qmzpnuzk3jakNoo6BRB94Zxmi6Uvxo7aO5MtY4uAJCAFxTVumxV ol0SMHlZ5asr7cujniy8lGTUdO9fiMJATFGGJ0ih5ht02kalz3tChJ26bsVFff6mVI/n/J JkfQDf4Z2FFhxzyk/0d7nX0tQ5T5OP6iU0/uQagysZJrN9LKlearcm22r+at0ZYG7VvAtt brdP7Rt4P1Vv2VD4lAlGifqAk7sesKmADAYYjK+2WUQjiFIwjleU/5Cu8RUstA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705436160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dGbZGqLntCP2qz99QMCGYJC8TVlOK6ywnyNjtEJ2Lis=; b=LQGpMEERUdUTO1EiR24fVCmL6kn+koZb41FemUlFSdu/0aCXIFf2xAMibTzu+Qo/fgFJCA m4jNjaI5EyCb31+AfOl0HUtUwHxD4VwPixBpE2vwdbRb5oUKpbLCrUQb2e6DONjGrtWEUI I+/ahMQxhvQQz3kaOyFR/Jvbb3d0TyQjFHZSZGcB38VNzOeuOTumOzQ/6cCRkSitydgSt7 wU95v7zpHrWgnGyq2c0hAiQj1SprQPHWE/Y9qs+1PWW1NtZWNVNsI/dsQ5D5oKOWmQVtJ6 9gYRuBxFhjfZQPZ3J1SlnDpby1SmPfeljoZLutJS56lVJcIHiOe4KMCA5Bfhmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705436160; a=rsa-sha256; cv=none; b=opEslaYMvfvAATGuqD5LgtSMaEeEHDNlTHGvZM6blNlZjCrlHAPpuz+XY8U7LpS+O974oV g9GasKlFrT7SHoMjalXqzVXM7AfxEUhHmSXhXQgeKfis4BxDTmg5DdUP6rmBPfSkomJwFK 2L2Hu6+VUIRAOPJ59vKJfgLgy0xEmMEowhyNPJPDmW5d+M9/5KqYieiX4wPJZdH+nUl35p ueywvAqrsHw+ucsId+5Vbj9yuql1/bRBVlAyaqGsz0jrzGAGrvKzw3sdf/239iecVn9RLX OwQiqP2ICYEoFJrqc6yuVKdUsCCDaBXAg6IfKcGbEvvQDUZgqVDsMMLIT3X2Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TF0dD3FBbzvH0; Tue, 16 Jan 2024 20:16:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GKG0p8028204; Tue, 16 Jan 2024 20:16:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GKG019028201; Tue, 16 Jan 2024 20:16:00 GMT (envelope-from git) Date: Tue, 16 Jan 2024 20:16:00 GMT Message-Id: <202401162016.40GKG019028201@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: 38f5f2a4af5d - main - sysctl vm.objects/vm.swap_objects: do not fill vnode info if jailed List-Id: Commit messages for the main 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: 38f5f2a4af5daeec7f13d39cad1ff4dc90da52d8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=38f5f2a4af5daeec7f13d39cad1ff4dc90da52d8 commit 38f5f2a4af5daeec7f13d39cad1ff4dc90da52d8 Author: Konstantin Belousov AuthorDate: 2024-01-13 01:46:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-16 20:15:39 +0000 sysctl vm.objects/vm.swap_objects: do not fill vnode info if jailed Reported by: Shawn Webb via markj Reviewed by: jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/vm/vm_object.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 1dd6878cf4ab..905df5454355 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -2515,6 +2516,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) vm_page_t m; u_long sp; int count, error; + bool want_path; if (req->oldptr == NULL) { /* @@ -2533,6 +2535,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) count * 11 / 10)); } + want_path = !(swap_only || jailed(curthread->td_ucred)); kvo = malloc(sizeof(*kvo), M_TEMP, M_WAITOK | M_ZERO); error = 0; @@ -2584,7 +2587,8 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) freepath = NULL; fullpath = ""; vp = NULL; - kvo->kvo_type = vm_object_kvme_type(obj, swap_only ? NULL : &vp); + kvo->kvo_type = vm_object_kvme_type(obj, want_path ? &vp : + NULL); if (vp != NULL) { vref(vp); } else if ((obj->flags & OBJ_ANON) != 0) { From nobody Tue Jan 16 21:06:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TF1l85X9Fz583Qg; Tue, 16 Jan 2024 21:06: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 4TF1l855Qzz49x8; Tue, 16 Jan 2024 21:06:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705439172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=COXe+F+ulWgiOUa1LxDfU7O2I3kGKnioqcuap5uXvoE=; b=G/QfVNUJZ/O/NteDE9dUD+GpAITl7yNBQEq/bz7e513p795nOhccWjB0h/Hj9DdkrOVGLX 41Oe6DbLhyc5Dkq5qoXG6nVPSBfsuVUIfdQgZlOwzg7TkCLdFRtzhHQfHPiramXZYFAIFU u6dAatddYc2cpSVcQz/67q8RY0WbsR719O7hh5QA5GLGZqMFa8do20w2agNG9k+KvgS9XO gMx0EkvJ8IWnnUgKFO7CEnX6u0hB2wwbelZwNDIao9BImdV3zqcZ/ZQL6r5g4l5lZf67ok kcFG5xFu/cBP9OUjw4FJ+IGR143Q1DLhP0RpGUWMGevck/bE/o9dn8wQ3LrYnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705439172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=COXe+F+ulWgiOUa1LxDfU7O2I3kGKnioqcuap5uXvoE=; b=hVYFjbBPRxLu+G2ieqwLFxrDA7LdLotUqeDSbu0YznJQHuCn9F4VnkuXMi7CJHQR/5wZoj 88Ge4uCcHZgm61e9XbI/DwhgoVCqzVR0Dpo7Ed4gsz6qA9FvTNZrf8yUjCJiAzq8gX/c5p 2iItpg+gCuObjEa+aJRpeiq1ynYl4kn24nl8KpYlEFxFajpWRhrwo4KK4NYVvCj6+l1lC/ NolSHdJOu4dTT9VjAlFN9iH6e4nvmwNR8XzvqYWSzl/wzPZXVx6Y/TczLOQsUiQ/VWxZN/ rcdOZyVqohJZFirlaZ93I3hqAe4jt7I57WPH8ueSAujPQqbqgrSb6b2PRAqZgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705439172; a=rsa-sha256; cv=none; b=fqKTjzT7Sy6V2wycfSSjEc+gjKJFSgk2EZ43tM156DpCb8qLW/hlcytQjzk7rbN4Dz5iHf UgzWGhVsviHBCvEGIOwous2JvxLASv4MH5pKNIZ5r1qU63UAGtvwYvPWlW0NX8AODaPsg8 cidgrPJlaLsswEMNEdau7TVE+dvaXKo2G96zJCOGP9klBnGYbOOO15L3vGTUjScanosoCc B2VElokl0MnxZWZPrgt0YXooAu230lUs/7gnJKPErttzukUcNU4CfbQHZ839f1ce+eVDtN JwZuVXLn01tUDsNIN+886ciDJlXhsh1VZxHAO5Rh0VcUpPm1n1gN6AkRvP2EFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TF1l843BXzwK7; Tue, 16 Jan 2024 21:06:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GL6CeP012536; Tue, 16 Jan 2024 21:06:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GL6CHQ012533; Tue, 16 Jan 2024 21:06:12 GMT (envelope-from git) Date: Tue, 16 Jan 2024 21:06:12 GMT Message-Id: <202401162106.40GL6CHQ012533@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: 61c831679615 - main - sound: Fix OSS API requests for more than 8 channels List-Id: Commit messages for the main 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: 61c831679615d2a03a494bd7f3627fb945f2795c Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=61c831679615d2a03a494bd7f3627fb945f2795c commit 61c831679615d2a03a494bd7f3627fb945f2795c Author: Florian Walpen AuthorDate: 2023-11-25 00:04:34 +0000 Commit: Ed Maste CommitDate: 2024-01-16 21:05:44 +0000 sound: Fix OSS API requests for more than 8 channels Audio devices with more than 8 channels need bitperfect mode to operate, the vchan processing chain is limited to 8 channels. For these devices, let applications properly select a certain number of channels supported by the driver, instead of mapping the request to a vchan format. Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/914 --- sys/dev/sound/pcm/dsp.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 5aa7979b98c9..9040c77893d4 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -1502,24 +1502,31 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, case SOUND_PCM_WRITE_CHANNELS: /* case SNDCTL_DSP_CHANNELS: ( == SOUND_PCM_WRITE_CHANNELS) */ - if (*arg_i < 0) { + if (*arg_i < 0 || *arg_i > AFMT_CHANNEL_MAX) { *arg_i = 0; ret = EINVAL; break; } if (*arg_i != 0) { - struct pcmchan_matrix *m; - uint32_t ext; + uint32_t ext = 0; tmp = 0; - if (*arg_i > SND_CHN_MAX) - *arg_i = SND_CHN_MAX; + /* + * Map channel number to surround sound formats. + * Devices that need bitperfect mode to operate + * (e.g. more than SND_CHN_MAX channels) are not + * subject to any mapping. + */ + if (!(dsp_get_flags(i_dev) & SD_F_BITPERFECT)) { + struct pcmchan_matrix *m; - m = feeder_matrix_default_channel_map(*arg_i); - if (m != NULL) - ext = m->ext; - else - ext = 0; + if (*arg_i > SND_CHN_MAX) + *arg_i = SND_CHN_MAX; + + m = feeder_matrix_default_channel_map(*arg_i); + if (m != NULL) + ext = m->ext; + } PCM_ACQUIRE_QUICK(d); if (wrch) { From nobody Tue Jan 16 23:15:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TF4c70qqJz58Fk3; Tue, 16 Jan 2024 23:15: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 4TF4c70Hnpz4Ng9; Tue, 16 Jan 2024 23:15:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705446919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+jkasPw99iZ9rO5RheOKFwqbvCm/EZotaaZp3NDR0U=; b=kUi232w9uVufl/h20mL6BwZiyZsak170BuE1K4xG4aMOsA3l+wKLqXbZsUsEq1Pn1nJAYM dBIxkr6DtglsiwQ/mp4bq6hklUeeSBDGmkH8CUET0V9Kjv5We7T0cwvn1zJY9tlYhNSNWx 0eIrzGYMG1fN09mzoAuh4A8GP6N3WfxpB1lBViWGs9I2MQZzn5V4czMkr2+L/L/ZAuY+I5 sqZ7ZSudmGppGKT4Wa8sngGPlkbFd0q9F5ICB8MYoxePcbFJKc+LVYGjEuWqWvZeqPQjWP Rwowzv7Vc9QLg7mme5IxfRkkXP+cCARJSH8QWQGl85JYhbMO5JxFNvXM6QYbMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705446919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+jkasPw99iZ9rO5RheOKFwqbvCm/EZotaaZp3NDR0U=; b=l+YebRcqowxh2tLT3rAIotT3rU2y1gYcLnVEA8yucaN0hoRiKcW2b5x6v0yngJE3bNU7Cd TPdgDN66m5tRpo+7tV4Q7g0aRyBMIQd436cZkgLt+AIZ8PbVSDNRQI52uMw8o8XdINttmI BSnkzofmL9YtTz8Fb/Lc/nDC7W4WPbtUT2AaNWPdGAkBOq9t8oQdYopKDit+JYWH0691jy O4ROVBdUHrKnAOSyqN5rcZCyrpJliOAhebhCW6WoH5vMmyvoKvm3U9SR9TVrUdR5Kx7usr dNKT+96kmPcHBhTiqo8EpKelYyFylKoHGt5di1nji66HxLFw7mzKBjrHnpimxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705446919; a=rsa-sha256; cv=none; b=xWKFRE6m6objXpDaJJ3qd65uhr5sXO/Jh7TrY/oUdmlLiTsmXKp2hStdb6/Ov0f/6EG1kx law7STLFGql5qPixMkRqBvzK07RcTsHcjTlRypn4zo80RnKH4Ms6tOsYeh25HkK8wPaiB+ qc+qgoovId9FYHAHHhj1xiqmLqfoVY6/3rBMikT9dpwMkEhqVWxPc0GMuTW4z9xq2DZe4J 0eN2BRj9Ai8z3w9G0b7QnJklWGXSRsQ5nNmBC0d5FO/j7lZ834wNpO+cXZ5oq/kQeYCJXJ jYQmM327Vn1OzT0bLXxDyPWU6P1qXoMZiC8ST5TTuBdW5G9pevN7NAhhCuOrVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TF4c66W0Dz10fJ; Tue, 16 Jan 2024 23:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GNFI8p030444; Tue, 16 Jan 2024 23:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GNFIq4030441; Tue, 16 Jan 2024 23:15:18 GMT (envelope-from git) Date: Tue, 16 Jan 2024 23:15:18 GMT Message-Id: <202401162315.40GNFIq4030441@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: dc02374f5445 - main - Fix KASSERT in 80044c78 causing build failures List-Id: Commit messages for the main 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: dc02374f54455e354495870c24f86bb2966a7960 Auto-Submitted: auto-generated The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=dc02374f54455e354495870c24f86bb2966a7960 commit dc02374f54455e354495870c24f86bb2966a7960 Author: Allan Jude AuthorDate: 2024-01-16 23:12:30 +0000 Commit: Allan Jude CommitDate: 2024-01-16 23:15:00 +0000 Fix KASSERT in 80044c78 causing build failures Move the KASSERT to where struct ip6_hdr is populated Fixes: 80044c785cb040a2cf73779d23f9e1e81a00c6c3 Reported-by: bapt Reviewed-by: markj Sponsored-by: Klara, Inc. --- sys/netipsec/udpencap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netipsec/udpencap.c b/sys/netipsec/udpencap.c index 960e7d3d1c9f..e5b286b5ae69 100644 --- a/sys/netipsec/udpencap.c +++ b/sys/netipsec/udpencap.c @@ -259,8 +259,6 @@ udp_ipsec_output(struct mbuf *m, struct secasvar *sav) #endif #ifdef INET6 case AF_INET6: - KASSERT(ip6->ip6_nxt == IPPROTO_ESP, - ("unexpected next header type %d", ip->ip6_nxt)); hlen = sizeof(struct ip6_hdr); break; #endif @@ -297,6 +295,8 @@ udp_ipsec_output(struct mbuf *m, struct secasvar *sav) struct ip6_hdr *ip6; ip6 = mtod(m, struct ip6_hdr *); + KASSERT(ip6->ip6_nxt == IPPROTO_ESP, + ("unexpected next header type %d", ip6->ip6_nxt)); ip6->ip6_plen = htons(m->m_pkthdr.len); ip6->ip6_nxt = IPPROTO_UDP; udp->uh_sum = in6_cksum_pseudo(ip6, From nobody Wed Jan 17 07:13:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFHDQ25FNz57B3c; Wed, 17 Jan 2024 07:13: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 4TFHDQ1FrKz4CsB; Wed, 17 Jan 2024 07:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705475638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6+8gsOls/3JJCG7wZ9yL1XBgfmzvPUdXI+AfqQUrchM=; b=LozI4Cy5ZU9cZA3K9MN9GioMgp3wf5nPDXoaD/tUr8j3z/CuhO68aIAiz5qc5uvwDupNwL AM9TOyEtx6I1B1wFhjateTxxVwQdWWAhEdKxuy0BBOw/ThNB8KNQUa/FrbRVZSWJaM2vYf EPN/sHSFNuBCHMq5AYmapzMt+KWQ9k0/JxI4XuBQjMRS52UnAzbs3mufzyuyXsCD+0v6za Lr5DvDAfq18k6R3ARGCujwLrLpH06dc4U3rpI2pDsn2uGhhuT0/91eIdt5tuECHtn1Mgd2 OT/Sru5scGymnxyxyzyzAFAbLxgUADepP2UYYsUuKrsdxuZpH0sX7pRl9bBm/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705475638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6+8gsOls/3JJCG7wZ9yL1XBgfmzvPUdXI+AfqQUrchM=; b=FhvxJDsCvHY2+OotfevkPeXvb2Qob4DscThp+KA6MJe6UHfT4YY0uDEfdG8KFkauWnblI+ 86kVScJT3RJwr3J4kvKlnREuL1eivsX9kkf0hrO5E0pQU10+jaSXDNiIh560i/T+pqEtaf hA4VWbAV/WXlcJ+ynjKH5GNCAbWtPa9au1uCFqQPB15QHIb2SiHovcxRKOCfeSye1Yjz7S L6ADd1BgAfmvmV9Wsx59QU9dGHbjrhRTtqkbABPMnkt++BCpIPDF4Fe3TQTEJgogoVB4sl U0IqjJkzPh2ERNsR24BSPmd5HgjVo8Lys855t6LDDaOHqeyXr8VytPDYhSkihg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705475638; a=rsa-sha256; cv=none; b=Ef8Za9VN58mlU8QxXjdn5mZdpvK+F+sRfGx3DEVWZ/Y70U9TqMLu+IPeijLtEvQmzvvq0y lmW7y9UvqVrY0xfOW5dQAxJQefLLXaek8avby0a9vq0fr5CVfRZFhqIS0zW4cvs6Upl6Wn 4wbYHK0vglGG12eUwjklXZgLP82WyfRrFfUnsmhNJU3BBl3+A1tkiXN+P0MuF4qkNacbi3 jhCdGy871IU10q4fQL8RqOh3xyYcajNLtNN2+6Pq4wj8CE74SRf4QyxIl6mmOtBbS8U/j5 Kej5Skq9oIIdYXmm9j7OlTO69pUb1RGVZImHTqTFpsadiALdvMTLKVeM+SmStQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFHDQ0JbqzF4n; Wed, 17 Jan 2024 07:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40H7Dv3L035443; Wed, 17 Jan 2024 07:13:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40H7Dv8D035440; Wed, 17 Jan 2024 07:13:57 GMT (envelope-from git) Date: Wed, 17 Jan 2024 07:13:57 GMT Message-Id: <202401170713.40H7Dv8D035440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: a079c891c01b - main - sctp: restore missing inpcb lock List-Id: Commit messages for the main 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a079c891c01b1f8b32d79b490d9e7b7542e26d0f Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a079c891c01b1f8b32d79b490d9e7b7542e26d0f commit a079c891c01b1f8b32d79b490d9e7b7542e26d0f Author: Gleb Smirnoff AuthorDate: 2024-01-17 07:11:27 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-17 07:11:27 +0000 sctp: restore missing inpcb lock Fixes: 5bba2728079ed4da33f727dbc2b6ae1de02ba897 Reported-by: syzbot+b8636c973dc20fea4a9b@syzkaller.appspotmail.com Reported-by: syzbot+d76a18ee8bbe6f7d3056@syzkaller.appspotmail.com --- sys/netinet/sctp_usrreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 51c056e052a5..b847271a7bd3 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -874,6 +874,7 @@ sctp_shutdown(struct socket *so, enum shutdown_how how) /* FALLTHROUGH */ case SHUT_WR: + SCTP_INP_RLOCK(inp); socantsendmore(so); stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb == NULL) { From nobody Wed Jan 17 07:41:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFHqc3GB2z57DXL; Wed, 17 Jan 2024 07:41: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 4TFHqc2j8vz4FnL; Wed, 17 Jan 2024 07:41:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705477260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=66iXIp0XsnfZerICy0Mm+KPzu0J/NKi/BNCA1gXmE5M=; b=MqpHxXIbZkkC+toHXCpbK3U4E4Vr/FGSVVy7MudpybtHFMROIkWTFDxFzUqNR1SEOnfwf7 M+5cWGEgj1vCBJmszEyMOlj/uvZ469a446w2XtfafIechsFeaZ9YHfyYZGJLc9GMq3qnmG ICCUMa+/xhWS3gzMHgan1pVyRRdGNsA2pkdA4XbXYtN3zYqEIpO6lKYJRS1kkAj1PR+tQi XMLrCLFzgydS2pnpaCQuSzQkB0I0KYPF5gSdno0H6lQM/GHBc/K+e65gfPLuDUAvUPgi/A ezdlIhHclI4l8lVHEH02636TYoRxQauvwCf8q379maqh7gxzjM2FFuJk7xM2uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705477260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=66iXIp0XsnfZerICy0Mm+KPzu0J/NKi/BNCA1gXmE5M=; b=ZEZM6DHNEEgWjADwqLYqoTxWyzT2E1SkWIFYy6RtL/Zpx+dywSGRYNme/hXMqUf38NK2m+ gTnPGENiqE3vBvDScKWCTGsbo6eTe7sY0hUECgU5PRCxMcy3ppMV68BNMKnMvKXbJmOW94 9mGldWMe69xP4L7GIcr/9kwFHX1ep+lH6UKho6JcECRQmBMsCTM7mmJxVdehYddJAepLPw nKahOlZSTB9Kffn1ZkFgbSuo0WbUZ0f6u3SKAI08z6ws+MGCIWpOHoWHTTpA9ll4XiL81s TMsbgdQhhSBQHkdya8yDhMy61CXdsE/Tg1N/IOKHHKhZ2w1Tr93WPyZYHCaXdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705477260; a=rsa-sha256; cv=none; b=lvg0bUUZwBmQdIhhHGSIGG1dULiK/n2ZC9h0eDxPcjmdmjUPeYE0Fc4RdSCkn3yezgjamj gKyXWIJNm0Xb59VcEFlVsSvodKjoPcNBPJivYn19oOObzDhpeA8H+BMoM95/vbx9CGXGh8 x3EsLdYKMVVEzsfD/KlYPscihDGdAoQqu8mDOxlpL4v6mAYNZRaLSmg+ah3hwFbNEkitxJ qRxVvWpu6Hs++4ghWI2WP76+djv8UKnmiZ/fBTYG2IilQ4P5MiFSuEYoazckObr04mVEKQ T755EXAlfg3vD9ExajYdXeBM7xXNCehbGztOQjfzHoLWG2ENr8Qxddc6e4UdGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFHqc1TK0zFKp; Wed, 17 Jan 2024 07:41:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40H7f0A4079939; Wed, 17 Jan 2024 07:41:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40H7f0Oj079936; Wed, 17 Jan 2024 07:41:00 GMT (envelope-from git) Date: Wed, 17 Jan 2024 07:41:00 GMT Message-Id: <202401170741.40H7f0Oj079936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Leidinger Subject: git: e0dfe185cbca - main - jail(8): add support for ZFS datasets List-Id: Commit messages for the main 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: netchild X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0dfe185cbcae48b4c4493ed4c2626c46181eb80 Auto-Submitted: auto-generated The branch main has been updated by netchild: URL: https://cgit.FreeBSD.org/src/commit/?id=e0dfe185cbcae48b4c4493ed4c2626c46181eb80 commit e0dfe185cbcae48b4c4493ed4c2626c46181eb80 Author: Alexander Leidinger AuthorDate: 2024-01-17 07:40:40 +0000 Commit: Alexander Leidinger CommitDate: 2024-01-17 07:40:40 +0000 jail(8): add support for ZFS datasets Add zfs.dataset to jail(8) to add a list of ZFS datasets. Bump FreeBSD version for jail managers to switch to native dataset support. Datasets are attached to the jail after the jail creation and before the execution of any start command. Unlike current implementations in jail managers which attach datasets after the start command, this allows the zfs rc.d script to mount the datasets on start. Discussed with: jamie --- sys/sys/param.h | 2 +- usr.sbin/jail/command.c | 29 +++++++++++++++++++++++++++-- usr.sbin/jail/config.c | 1 + usr.sbin/jail/jail.8 | 12 +++++++++++- usr.sbin/jail/jail.c | 1 + usr.sbin/jail/jailp.h | 1 + 6 files changed, 42 insertions(+), 4 deletions(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index f912d193bc4a..b5a5398497e0 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -73,7 +73,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500010 +#define __FreeBSD_version 1500011 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index 8ffcca8039ac..60893444e9de 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -291,9 +291,9 @@ run_command(struct cfjail *j) login_cap_t *lcap; const char **argv; char *acs, *cs, *comcs, *devpath; - const char *jidstr, *conslog, *path, *ruleset, *term, *username; + const char *jidstr, *conslog, *fmt, *path, *ruleset, *term, *username; enum intparam comparam; - size_t comlen; + size_t comlen, ret; pid_t pid; cpusetid_t setid; int argc, bg, clean, consfd, down, fib, i, injail, sjuser, timeout; @@ -590,6 +590,31 @@ run_command(struct cfjail *j) } break; + case IP_ZFS_DATASET: + argv = alloca(4 * sizeof(char *)); + jidstr = string_param(j->intparams[KP_JID]) ? + string_param(j->intparams[KP_JID]) : + string_param(j->intparams[KP_NAME]); + fmt = "if [ $(/sbin/zfs get -H -o value jailed %s) = on ]; then /sbin/zfs jail %s %s || echo error, attaching %s to jail %s failed; else echo error, you need to set jailed=on for dataset %s; fi"; + comlen = strlen(fmt) + + 2 * strlen(jidstr) + + 4 * comstring->len + - 6 * 2 /* 6 * "%s" */ + + 1; + comcs = alloca(comlen); + ret = snprintf(comcs, comlen, fmt, comstring->s, + jidstr, comstring->s, comstring->s, jidstr, + comstring->s); + if (ret >= comlen) { + jail_warnx(j, "internal error in ZFS dataset handling"); + exit(1); + } + argv[0] = _PATH_BSHELL; + argv[1] = "-c"; + argv[2] = comcs; + argv[3] = NULL; + break; + case IP_COMMAND: if (j->name != NULL) goto default_command; diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c index 63adc9652145..3af0088626c9 100644 --- a/usr.sbin/jail/config.c +++ b/usr.sbin/jail/config.c @@ -93,6 +93,7 @@ static const struct ipspec intparams[] = { [IP_MOUNT_FSTAB] = {"mount.fstab", PF_INTERNAL}, [IP_STOP_TIMEOUT] = {"stop.timeout", PF_INTERNAL | PF_INT}, [IP_VNET_INTERFACE] = {"vnet.interface", PF_INTERNAL}, + [IP_ZFS_DATASET] = {"zfs.dataset", PF_INTERNAL}, #ifdef INET [IP__IP4_IFADDR] = {"ip4.addr", PF_INTERNAL | PF_CONV | PF_REV}, #endif diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index 1f745caa5e7c..e49c3fe95e7f 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 29, 2023 +.Dd January 17, 2024 .Dt JAIL 8 .Os .Sh NAME @@ -918,6 +918,15 @@ may also be specified, in the form .It Va vnet.interface A network interface to give to a vnet-enabled jail after is it created. The interface will automatically be released when the jail is removed. +.It Va zfs.dataset +A list of ZFS datasets to be attached to the jail. +This requires +.Va allow.mount.zfs +to be set. +See +.Xr zfs-jail 8 +for information on how to configure a ZFS dataset to be operated from +within a jail. .It Va ip_hostname Resolve the .Va host.hostname @@ -1431,6 +1440,7 @@ environment of the first jail. .Xr sysctl 8 , .Xr syslogd 8 , .Xr umount 8 , +.Xr zfs-jail 8 , .Xr extattr 9 .Sh HISTORY The diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index f65c51fc6de6..9f8267dc1bde 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -98,6 +98,7 @@ static const enum intparam startcommands[] = { IP_EXEC_PRESTART, IP__OP, IP_EXEC_CREATED, + IP_ZFS_DATASET, IP_VNET_INTERFACE, IP_EXEC_START, IP_COMMAND, diff --git a/usr.sbin/jail/jailp.h b/usr.sbin/jail/jailp.h index c064da09d7a5..74ef2a8acab8 100644 --- a/usr.sbin/jail/jailp.h +++ b/usr.sbin/jail/jailp.h @@ -107,6 +107,7 @@ enum intparam { IP_MOUNT_FSTAB, /* A standard fstab(5) file */ IP_STOP_TIMEOUT, /* Time to wait after sending SIGTERM */ IP_VNET_INTERFACE, /* Assign interface(s) to vnet jail */ + IP_ZFS_DATASET, /* Jail ZFS datasets */ #ifdef INET IP__IP4_IFADDR, /* Copy of ip4.addr with interface/netmask */ #endif From nobody Wed Jan 17 09:36:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFLNd3Qbmz57R8Q; Wed, 17 Jan 2024 09:36: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 4TFLNd2pwzz4Sy6; Wed, 17 Jan 2024 09:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705484177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V9ELsL5/ZmVmDP071Wc+ABGnsQmYH7TdOxzxo+oQJsc=; b=BTPbm9sBHWDIoUvhwqSXwaNSMhiLMSMZjfRTQ7cKNmblwChZSbY0HGokrTh2lwTffZjEUf TzaAB2A1d1ZJ40iO6Upf0F0j5q59eun9rFPvlLZSl74v23xDT7PBHP7Xq1qAtq6n3bWo5z r3nUtGpes8dYXO8T4vEMWt0J18cWNetIcRjL5Oivn40mzP7RR4QiBPB8ARmGC+t4nYIONp 42VV5TaH1WkdHh2NHrvG3PYVI3fmu67iJPRg4W6mYhREeZCP8JXRCxJJ3e5b3zAejpZ5Ci 95YT8+6Fp9+IR6nJjR10+bX9/UCxMZ8OqcBv7hkO+1mkqJSDie4vaeDG+K3syA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705484177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V9ELsL5/ZmVmDP071Wc+ABGnsQmYH7TdOxzxo+oQJsc=; b=vSoGAMUyOtUgCAuPBUjgSdCcCZPZ4rvuOq6qRDOc+ouH7Ni4klTAjt8rcFEOaI7TVcUM21 tCDSjdFeweF4oziEUExsJ9RJfL27qXF2LE/I/YAL4RfO/spSko1H+1jcQHblqxZNT5Tg40 R3N/l5/WLySbxLNchHWyiclkOOc1zk2/v/BNE/+EAzhuAGSbuZ6MasAerDeSl5EeCmiZKg w1koJPneMGMB5ury+TvSBI+rDd0OIuYc7oO13lPAmNU1iNZnQZFJ9sGdJl/PUHlAVKKy1+ 4CMG4vBMs6QMN9w6T8bNWnYhgdSXeXDhQiqRClmSkRs9ojHDC8WVk2vZ6gghNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705484177; a=rsa-sha256; cv=none; b=Um9zLR4rbcKHiEsvcWq1Q/ZbUtTBiUNghcZ3LN85nXmgmeR+jR4q+ShoEQThOGCeadcgWI e6Jk+MaAIirvUKffmJE/oNhdDIjwZqHQ7vffc8/D1nYWq5U5CcPQvUrJpMGDEMo4e2yGDB 3jUjbpl5YQF/ZGtEVS2F5ezE8wCzfKDnrlW4h9ViZT53kZghWY3VTFi54PqSS72ADBmNPn mbycscVagXLqpLIcibtEZr1ofcBKXgJPwSJ2AgMjh0/k4vkH56m4ds4ybQbMyXC7EquV6q D/xQw8DcbFnxe7qeejpms7M85aNiaVOsvTySbdP0m+chvESgZ+jIJowIKfjjHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFLNd1ZFWzHp8; Wed, 17 Jan 2024 09:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40H9aHZ4071451; Wed, 17 Jan 2024 09:36:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40H9aH87071448; Wed, 17 Jan 2024 09:36:17 GMT (envelope-from git) Date: Wed, 17 Jan 2024 09:36:17 GMT Message-Id: <202401170936.40H9aH87071448@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: 516b5059705b - main - mana: Fix TX CQE error handling List-Id: Commit messages for the main 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: 516b5059705b6b8bbba28821dbe05964c128f9a9 Auto-Submitted: auto-generated The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=516b5059705b6b8bbba28821dbe05964c128f9a9 commit 516b5059705b6b8bbba28821dbe05964c128f9a9 Author: Wei Hu AuthorDate: 2024-01-17 09:19:35 +0000 Commit: Wei Hu CommitDate: 2024-01-17 09:25:26 +0000 mana: Fix TX CQE error handling For an unknown TX CQE error type (probably from a newer hardware), still free the mbuf, update the queue tail, etc., otherwise the accounting will be wrong. Also, TX errors can be triggered by injecting corrupted packets, so replace the mana_err to mana_dbg logging. Reported by: NetApp MFC after: 1 week Sponsored by: Microsoft --- sys/dev/mana/mana.h | 2 ++ sys/dev/mana/mana_en.c | 14 ++++++++------ sys/dev/mana/mana_sysctl.c | 6 ++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/dev/mana/mana.h b/sys/dev/mana/mana.h index ab394f3203ad..906b28eb56b6 100644 --- a/sys/dev/mana/mana.h +++ b/sys/dev/mana/mana.h @@ -137,6 +137,8 @@ struct mana_stats { counter_u64_t mbuf_alloc_fail; /* rx */ counter_u64_t alt_chg; /* tx */ counter_u64_t alt_reset; /* tx */ + counter_u64_t cqe_err; /* tx */ + counter_u64_t cqe_unknown_type; /* tx */ }; struct mana_txq { diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c index 3948106f492e..0e5f86b5e105 100644 --- a/sys/dev/mana/mana_en.c +++ b/sys/dev/mana/mana_en.c @@ -1487,21 +1487,23 @@ mana_poll_tx_cq(struct mana_cq *cq) case CQE_TX_VPORT_DISABLED: case CQE_TX_VLAN_TAGGING_VIOLATION: sa_drop ++; - mana_err(NULL, + mana_dbg(NULL, "TX: txq %d CQE error %d, ntc = %d, " "pending sends = %d: err ignored.\n", txq_idx, cqe_oob->cqe_hdr.cqe_type, next_to_complete, txq->pending_sends); + counter_u64_add(txq->stats.cqe_err, 1); break; default: - /* If the CQE type is unexpected, log an error, - * and go through the error path. + /* If the CQE type is unknown, log a debug msg, + * and still free the mbuf, etc. */ - mana_err(NULL, - "ERROR: TX: Unexpected CQE type %d: HW BUG?\n", + mana_dbg(NULL, + "ERROR: TX: Unknown CQE type %d\n", cqe_oob->cqe_hdr.cqe_type); - return; + counter_u64_add(txq->stats.cqe_unknown_type, 1); + break; } if (txq->gdma_txq_id != completions[i].wq_num) { mana_dbg(NULL, diff --git a/sys/dev/mana/mana_sysctl.c b/sys/dev/mana/mana_sysctl.c index d03ebe44ab31..844a05040595 100644 --- a/sys/dev/mana/mana_sysctl.c +++ b/sys/dev/mana/mana_sysctl.c @@ -292,6 +292,12 @@ mana_sysctl_add_queues(struct mana_port_context *apc) SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "alt_reset", CTLFLAG_RD, &tx_stats->alt_reset, "Reset to self txq"); + SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, + "cqe_err", CTLFLAG_RD, + &tx_stats->cqe_err, "Error CQE count"); + SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, + "cqe_unknown_type", CTLFLAG_RD, + &tx_stats->cqe_unknown_type, "Unknown CQE count"); /* RX stats */ rx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO, From nobody Wed Jan 17 09:38:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFLR62NcQz57RDc; Wed, 17 Jan 2024 09:38: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 4TFLR61dwlz4TD2; Wed, 17 Jan 2024 09:38:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705484306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R7mZ6mJPr2Wo7aNiDEzizkHDn/oeFAr+/z/4BtlnMRw=; b=JnM8HviP36UK+r3por+iiJq2UMpgvHO9LgkWXSimG5IRZFAj9vTCPIvAC6WeuoE719Eh1o +mLo9zJD3LDUBfXqRZulbCFGoeYpZmyyo0+uJHW6tJNAYosLKuLussVPXkAhCPgXmKHI78 uuRc+9EQXdCyBEm5k0zr8eS0QXs3vzEVfYR6oKdBAkV0Sza/9urgvCgTkilbqYXg2ThLU3 ciMNOUpv7xroDzh23PogxvcHLOc5Na+P5U57/rQ5d5Bm78eZ72RBJo63DfCQqHvhqzboMx Ik76bhpeooBoeDLCVDnz3SfQvxwy8Q7sJYSJzHuU0fzQoA8zMo572/HggHxTng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705484306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R7mZ6mJPr2Wo7aNiDEzizkHDn/oeFAr+/z/4BtlnMRw=; b=sK2DlTupmNToqdZJZTqtGvQP7p7sxNqNuYpcI57tdLb5xXKX6uq9CZSKQK4Owt6uAnT5Hq stCdYNZijA6OCPfB4hs9WvMYjcCsV/edxc4olUBptJpVV8NEe7OWRlkl040gwWZ+r3oMFj A6by3A3U5cfeTYiBa7U9s9EzHDWGH5hUHMiy4X0RmaGMvkaXsivhhvNUcpb4UKe5fpvUOi OyJJAL3emcnEXxp0Th2TawFn6xwL5JlfBiYbt4ds5/snvfLsxL2jcr/T51nABa4ITrl4QU nkrWPzhPpRPlxht6XrjL51AMXgTX5SHFtMRxumippxJpeGEUxbvY5ZXfUH34lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705484306; a=rsa-sha256; cv=none; b=eKzbaX2h0/4lsMmaVNGSUiXcHe3T76Gi2PI+VxbMSgrHVi6tvBuSqvRWLEHw9L0JftGkQQ GdMJuTEcJaACgJ3RFGXta6kiTq75dmQC9w5Yg1P4PlTqsojd9eolpjVN5QcsKpcEPXbvMV 5DptKx5tGe0mey83IdRlZsdItUpGCZuuYMmZb6aOe30pMkaeKt6/50r+3ecDtancVHywcs 1rgb8+75nN8rU87LhklsXK05erWxUm9F/fwfZhBizPHcv2d2O4wUeiJIugeJvBK/DZsHNO eK0JWkHn8BI/rBqUVyxcmaMGbrBy6iA90xSpep9/+EWfQuvLDg3vjaq/EWEtwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFLR60jWnzJ3t; Wed, 17 Jan 2024 09:38:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40H9cQZM071908; Wed, 17 Jan 2024 09:38:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40H9cQLe071905; Wed, 17 Jan 2024 09:38:26 GMT (envelope-from git) Date: Wed, 17 Jan 2024 09:38:26 GMT Message-Id: <202401170938.40H9cQLe071905@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: f59662030254 - main - fwget: Update for Radeon RX 7900 XT (RDNA3) PCI-ID List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: f59662030254e1bc4f7f135e7617e94b46385893 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f59662030254e1bc4f7f135e7617e94b46385893 commit f59662030254e1bc4f7f135e7617e94b46385893 Author: Goran Mekić AuthorDate: 2024-01-17 09:36:37 +0000 Commit: Emmanuel Vadot CommitDate: 2024-01-17 09:38:07 +0000 fwget: Update for Radeon RX 7900 XT (RDNA3) PCI-ID Latest DRM/firmware added support for RDNA3 based GPUs, update fwget with the proper PCI ID. Differential Revision: https://reviews.freebsd.org/D43468 --- usr.sbin/fwget/pci/pci_video_amd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/usr.sbin/fwget/pci/pci_video_amd b/usr.sbin/fwget/pci/pci_video_amd index b44eac1adf7b..2a1de7ccf574 100644 --- a/usr.sbin/fwget/pci/pci_video_amd +++ b/usr.sbin/fwget/pci/pci_video_amd @@ -135,5 +135,13 @@ pci_video_amd() 0x742*|0x743*) addpkg "gpu-firmware-amd-kmod-beige-goby" ;; + 0x744c) + addpkg "gpu-firmware-amd-kmod-dcn" + addpkg "gpu-firmware-amd-kmod-gc" + addpkg "gpu-firmware-amd-kmod-psp" + addpkg "gpu-firmware-amd-kmod-smu" + addpkg "gpu-firmware-amd-kmod-sdma" + addpkg "gpu-firmware-amd-kmod-vcn" + ;; esac } From nobody Wed Jan 17 10:12:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFM9r58TZz57VY6; Wed, 17 Jan 2024 10:12: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 4TFM9r4VD3z4Z7F; Wed, 17 Jan 2024 10:12:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705486320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5mBPw46NaJhYrT4v1QGvLOIvnbMsb6mtYAArVo4duyE=; b=oo7MkHwtWmbZvxvCqdMle1+6788TAgRkW9kGNyKHMK1YUnGeMgiV9oZlTsCn+zRFSc/8F6 8GypJT54FHj5xTzMq9VpTwwFXDHjEiXCdn4Iy9CzNykRiZ6oByxaMzJm3OAgWJkaD60WmT l0fJpmW1s2Qp6hRU4KcrQO1I6CoG13X2O/298i1hbzV4k8MEHnnPOIzxxVZQE6PEpAig/u YrmzF62TL/LOGu3eZebjve7u7qcl3rYBz/BS5f/bL9fmAX1f/0/UXutYGng1qV8mIjI+Nv he/rvnY20YDQ61hQLgvJE++SzLctYNzsuqTjFVwe1yRLi8xdH4XWZuFCXcdRzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705486320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5mBPw46NaJhYrT4v1QGvLOIvnbMsb6mtYAArVo4duyE=; b=GokAAz19EjuWqFyZDZSfhF8hukwrVJ+roYVXC38yaXWSknA3mwEPuZLM3x2wAVw70eWGi3 KecdcW0ZNBa3axHzGpa3OMgddHVgozTKXO/68SK5ZSz+T895WusDn/LTuTCJqSmpeTtASy CdmUO51zFIZeKGkrGsLu1mRsYFN7s15JnKH8TVZ3+nOoc9/udgWBhMnnOp+HIb7gONI4ck +x4dolA1fLtgqEO5Hn11n9WwELTgIFSvFbA+ArRrT5LkyeZY0lDHwyrCbWz8cbAws7DTgT nyr8DhqYHMYxaGXtmOO+oDo9MrisglFHNxzhVzDizoKfhnlHKmApIKBeMgqHUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705486320; a=rsa-sha256; cv=none; b=uMatQMupCU6Ot2HrN8yT69A6YW5PU+dn83ou2LtAo8VJ73MKAVwq4FCHLCQR+afejBLA3v 6lRza9BzmP4y0wUVDa1XBDK6YPx6fm3+5fFhnU1mt7nkLjaYnA4uEAwqdWaPxOfx36crbX hKBP6LYZVY/P30j+J8vMghgHPkV2Imsv40U3qQqDfpG9xzLqjh4c/qhFYpqQh26wXGdsAQ CZbQgGW8ppPo3CQBtS0acElifGGJgfsyLydAfhWtw9yM6+riX6UGtz5bE1TUmmLfkDUAxT MFjkjKU0/fBbqqVyBI5TQRTZafXhqCcvm8e8G9jTS/tzV4rqm55RKmHEmX6WxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFM9r3XwlzKSB; Wed, 17 Jan 2024 10:12:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HAC0kF038315; Wed, 17 Jan 2024 10:12:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HAC08e038312; Wed, 17 Jan 2024 10:12:00 GMT (envelope-from git) Date: Wed, 17 Jan 2024 10:12:00 GMT Message-Id: <202401171012.40HAC08e038312@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: 6caa19a08b84 - main - fwget: Use versioned packages for RDNA3 firmware List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 6caa19a08b846f437f22920f61795e598cdf9f5e Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=6caa19a08b846f437f22920f61795e598cdf9f5e commit 6caa19a08b846f437f22920f61795e598cdf9f5e Author: Goran Mekić AuthorDate: 2024-01-17 10:10:49 +0000 Commit: Emmanuel Vadot CommitDate: 2024-01-17 10:10:49 +0000 fwget: Use versioned packages for RDNA3 firmware Fixes: f59662030254 ("fwget: Update for Radeon RX 7900 XT (RDNA3) PCI-ID") Pointy hat to: manu --- usr.sbin/fwget/pci/pci_video_amd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.sbin/fwget/pci/pci_video_amd b/usr.sbin/fwget/pci/pci_video_amd index 2a1de7ccf574..1cea101d6465 100644 --- a/usr.sbin/fwget/pci/pci_video_amd +++ b/usr.sbin/fwget/pci/pci_video_amd @@ -136,12 +136,12 @@ pci_video_amd() addpkg "gpu-firmware-amd-kmod-beige-goby" ;; 0x744c) - addpkg "gpu-firmware-amd-kmod-dcn" - addpkg "gpu-firmware-amd-kmod-gc" - addpkg "gpu-firmware-amd-kmod-psp" - addpkg "gpu-firmware-amd-kmod-smu" - addpkg "gpu-firmware-amd-kmod-sdma" - addpkg "gpu-firmware-amd-kmod-vcn" + addpkg "gpu-firmware-amd-kmod-dcn-3-2-0" + addpkg "gpu-firmware-amd-kmod-gc-11-0-0" + addpkg "gpu-firmware-amd-kmod-psp-13-0-0" + addpkg "gpu-firmware-amd-kmod-sdma-6-0-0" + addpkg "gpu-firmware-amd-kmod-smu-13-0-0" + addpkg "gpu-firmware-amd-kmod-vcn-4-0-0" ;; esac } From nobody Wed Jan 17 12:38:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFQQN17YNz57lM6; Wed, 17 Jan 2024 12:38: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 4TFQQN08JBz4n3P; Wed, 17 Jan 2024 12:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705495084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZL4HlGt11sjBEMEBTo/vTG3p8RID8ly9YiX+oxHYlnU=; b=K8J8pqkBRrAJwotCQjgJeHibUPnCkP489ucJ3KkiF+m/Z4fW8Oi8jUD3mUixBIuOqQyzse h32rYZj6yd6vmf3Gqnrf/zyfLUxdEoeXepF2e2IViUbSWqW5MnFq/NwURq/JuNiRYcBWL9 yBoonHuYs7f9B32iMhdXJErsNAgWoz3TH+cjCmNaOLCShvgMYuVkascH4WrF0V2AEAay9V Mj85Pu6ROKlwXhugzIS2mwAayY+qaBsc1R+fWGJ3dER78ythsjnyl4TFkMsWsH8VvhUPxa s1uZtz3aMcdfBuLD84C7kPsAzj9YBoOuNsrwY4Hg7/+xvmxVAN50HzVMcPBKzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705495084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZL4HlGt11sjBEMEBTo/vTG3p8RID8ly9YiX+oxHYlnU=; b=oLJpKraDe3uBbDYjh7QDqyqJfPMMQRYZdTHDd3WT9J62tfn7k4xztPFaroNabSkSvQbDe6 XibvCnfGRPWhBmXDkFAhSIRRD6slcI5KQivfdkYkkX2R0ztboQFjqFFbHM/O7uy2qFNumZ 5jqgj1pR1kFkHvy1DGiUUy4KDIO9Ghpald6WrZWRK7D/XxLAsOFgSnAiw5ODBBxrVzFCr1 h5TWkbp2SnV3JaIOjN2qWLfmv8sLbuQd8DqW8M9rSBFYQ3Zah+//GWfAi2cp1eHaG3ThZR dGFZKcgDkyTaxS+6PtlAmvcy0du51P8ysNBLsaOFFY4c+K89CUl2b53FyazqKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705495084; a=rsa-sha256; cv=none; b=LNik6NS36Bt2RZAhT27v2g9M4AVcqoA0koQXjR1Fl6hv94EBvFdCWm3frHHlZL1WkRwYAx E7rzAxkOGr9JoKmFttBWoxeKqrHqXQtsfdHDw//ud+0ax4OxMJ2xFRaJ4CzwAYaMWSpK+X Hl6GVJ17iwpm9ztIZEABZahZX0+EXkBONAaUvaMs3syC23L7jMMIacnTUDEzHOoZgOaPIS 312sWxWG1p73P2fzEJRl2hUlYz+LmmQRBYjaEcvz3rFYrUNY18dKQ0xfKC42Ni37QOCUmy MuMOikjfB3KDt8uUPDqR0rsj6pMydV6tLYbAFM6cjQiOjxV0+pCrRuHpAjvOKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFQQM6D2CzNL8; Wed, 17 Jan 2024 12:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HCc39f074186; Wed, 17 Jan 2024 12:38:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HCc3Ex074182; Wed, 17 Jan 2024 12:38:03 GMT (envelope-from git) Date: Wed, 17 Jan 2024 12:38:03 GMT Message-Id: <202401171238.40HCc3Ex074182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Leidinger Subject: git: 0b49e504a32d - main - rc.d/jail: add legacy compatibility for zfs.dataset List-Id: Commit messages for the main 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: netchild X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b49e504a32d90ccd6785841bced2ca8c93a87e6 Auto-Submitted: auto-generated The branch main has been updated by netchild: URL: https://cgit.FreeBSD.org/src/commit/?id=0b49e504a32d90ccd6785841bced2ca8c93a87e6 commit 0b49e504a32d90ccd6785841bced2ca8c93a87e6 Author: Alexander Leidinger AuthorDate: 2024-01-17 12:32:39 +0000 Commit: Alexander Leidinger CommitDate: 2024-01-17 12:38:00 +0000 rc.d/jail: add legacy compatibility for zfs.dataset Evaluate the jail_${jailname}_zfs_dataset variable for legacy jail managers. This variable can take a space separated list of datasets. The singular was used specially to allow unmaintained jail managers like ezjail to use this (simply rename jail_${jailname}_zfs_datasets in the ezjail config to jail_${jailname}_zfs_dataset). --- libexec/rc/rc.d/jail | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail index f12dae280bb0..e24d6f8e21e0 100755 --- a/libexec/rc/rc.d/jail +++ b/libexec/rc/rc.d/jail @@ -268,6 +268,13 @@ parse_options() extract_var $_jv enforce_statfs enforce_statfs - 2 extract_var $_jv osreldate osreldate extract_var $_jv osrelease osrelease + + _zfs_dataset="$(eval echo \$jail_${_jv}_zfs_dataset)" + if [ -n "$_zfs_dataset" ]; then + for ds in $_zfs_dataset; do + echo " zfs.dataset += ${ds};" + done + fi for _p in $_parameters; do echo " ${_p%\;};" done From nobody Wed Jan 17 12:59:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFQtv1JH5z57mwj; Wed, 17 Jan 2024 12:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TFQtv0khhz4pB8; Wed, 17 Jan 2024 12:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705496359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F4u8qlHIMQqXNf+aAN6pgN5XAgX3ui75uNelOFMJIoE=; b=oE+TUmtp9b8iezhTZuETGExPapkdfEZ7rR5dut9IP6HqDvRM+4tMLE+9msdQd/2H8aW7f3 GwjfNlXwXPZRQ8fj13EhuEICPa5v3B5Lkt1pXrhOoDVJgsViEwn+YgsvJrGzcu/aNelLPk OXfaae/9vPRfstBKUeAUwKB8ohC6L7+cVNy9VP1BoLgSauMIm37xAlwnsiaeD405rz78AP thHHytpJ5/PJbhm1JCSONoS9toE8SnFbIa+sgj2RFADdpF2WNt1JaG3L/LxyDr2ZLe4mB5 DicjgsTwBONJDorr7j+Emm8/EJNs7S9I4DY+APeiTitKXIM8h7/qb0kUykkuqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705496359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F4u8qlHIMQqXNf+aAN6pgN5XAgX3ui75uNelOFMJIoE=; b=GslM0OJVZYmzDLk1nAg/s/DW9KhtXcKDsKwIeuOwO+MKNev/hDHW3bJ4vpEdX3jHPVVSIj 7ZH3fO0R/q4HXPTK3G+uYx4wfH1f+WZ1f6ctWvFBDlx51FNCgqHAMlPjmEvg3EI7I6YH1X ERzz5jWnr/RhtCDJAxXaDWg0JVA+jwRq9n2/uxF1T7+jZE/nJyB9QSYmXUM0H7nZRZf7in 5CnEsbUc/swjuJ1KGOov7UdK02IpP7nbP2fErJS861ipb2nhd5m2qM4QYlcEpIF4hSpQyX CSS/Oxfac/8E/ozyxLCxcAc3x8F1/nZg2mFJ3kjeTYrpKW6QpUM8HkLIHiveeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705496359; a=rsa-sha256; cv=none; b=CvXuwazMEdSmTVcR7Fqt2bkwd+bspbSt54pbEVw2yEI9Uj8btMNaXLyYu75blYpcQ+lyi/ fJHWf1N/XwX3vHRgtlWXUD5BICBEyeyVehHHOQCwjUnmsiQoGw1TKktiA3LK0NtaQgbttk E7q3BE8EOZ3JV2+7wt6M0GfVAcOXROHyvRPwA3WQ5+E1RMcBas3X8V9AyN4Qcx2HKdK11w ox1tZK7pPOf2qtoISJuWyr3ff6iTovBpjFCcOJXqZsrLvT/libe4nsb/5jOclVFS3U4Iw7 WSsyegaMlD50MfxGLzdfw6aB6EerGxc+cM+USgG7kwckPJ1ew0G/nd0S2pzXdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFQtt6ttLzP4x; Wed, 17 Jan 2024 12:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HCxIhf007990; Wed, 17 Jan 2024 12:59:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HCxIuo007987; Wed, 17 Jan 2024 12:59:18 GMT (envelope-from git) Date: Wed, 17 Jan 2024 12:59:18 GMT Message-Id: <202401171259.40HCxIuo007987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Leidinger Subject: git: b9a60d36ba04 - main - RELNOTES: mention ZFS dataset support for jail(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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: netchild X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9a60d36ba043f313ab98b8dd058d49559254791 Auto-Submitted: auto-generated The branch main has been updated by netchild: URL: https://cgit.FreeBSD.org/src/commit/?id=b9a60d36ba043f313ab98b8dd058d49559254791 commit b9a60d36ba043f313ab98b8dd058d49559254791 Author: Alexander Leidinger AuthorDate: 2024-01-17 12:59:03 +0000 Commit: Alexander Leidinger CommitDate: 2024-01-17 12:59:03 +0000 RELNOTES: mention ZFS dataset support for jail(8) --- RELNOTES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELNOTES b/RELNOTES index adb9ca67aa0c..69a464d71873 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. +0b49e504a32d: + rc.d/jail now supports the legacy variable jail_${jailname}_zfs_dataset + to allow unmaintained jail managers like ezjail to make use of this + feature (simply rename jail_${jailname}_zfs_datasets in the ezjail + config to jail_${jailname}_zfs_dataset. + +e0dfe185cbca: + jail(8) now support zfs.dataset to add a list of ZFS datasets to a + jail. + 61174ad88e33: newsyslog(8) now supports specifying a global compression method directly at the beginning of the newsyslog.conf file, which will make newsyslog(8) From nobody Wed Jan 17 17:50:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFYLS1NcJz58HPP; Wed, 17 Jan 2024 17:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TFYLS0lSdz4W6N; Wed, 17 Jan 2024 17:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705513808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KPMMZ9NCxgXR+SW1pcrtYJ75bn9cjjo4wOyDvzRmm90=; b=FFwsvTD62qKel/R5H9MWUX1LNT5gv+Cc7NOrn4vUMps9md/3xZF+7FnHKii0IXCFWQXrqO Qh1GNvt+HGHY1pcq1llfOpOTJTrdpk6gdTrqPSCd1FnSw4zxfNmnXn7TiW3x5KQdpFCznQ BQqECkqrrqUQB+qHbu0ls8jeHTXDyMVJ6bf+jhhbNygUYry9vQ9GCBsVXWDstAfaZbsPNN n0IDEFAnqvxOrQ6Ol0vPhDFMLfwTmd780bledCOdQ/Wbt/QmXyvs9t6HHpGLAyvV2Kb2P3 7R99gv/uqR/N2GqZdnW05JN5BkFsgDFy4D45hpqlOCNJj1g8kKuhIcJeUm1lYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705513808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KPMMZ9NCxgXR+SW1pcrtYJ75bn9cjjo4wOyDvzRmm90=; b=V1prpi361D2R1KPPaYHqxnaZmK6axBT+ARp2BHm46tdGejPpt0q9VVanZG0E2qTh211P6g n7c3Wm0Hu+YjouFaYl3XJFtVlTnWQx1IgL8bkXU1LGS74/4qtFARFqlgTay20g7d8yMcMC wR0Fi1IgoshTdSo648dzUJRwoBB2vaqliMNACXBSvdH/dz0xbpGRUEFQhVjyKk44+f3TPx NFKExctCHdvULvLSA0wOy4VpycLUFbcdXIlz9ziA1WKaNyeui2kBXMCyhi/SkN4WWkHCDv 9jcvirxNyqCqdQZIPjg1ZE0QkzvLNGq9gfmir0pB5ZVfcd3yLr1DxOmvdo1SNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705513808; a=rsa-sha256; cv=none; b=EAXnNdQL6Mi+AZKJv36zekVEg6K6qgBbf01uK9pfrT1//IU3BAaKzYNjc0xPC8gOJpSwlZ whHSNUbZtPvZ+jjIwBD5hjsOFug/No4CdTo7FTgO+5HhoNeRL3S90Y+WIgDkL9e4X0dVBp VxbeDoTSZE7Y/TBgNyGF8jqb8mOFYqBrQWrqvPuydGQkxyhXNVQeAg05xzlbioYyEMfJxZ Ka2JLfshMnH+uxWRf5aytHvxhGOzqU5agUVWsAPCYxOdSA34aSmFtf9XQDbeGv+ucbRd+D JxD9k6Ood1i13oN5QN7mA0nOo2zPwTLcM8YuMPSvUs7i82QlEBt8OC60Bj+RGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFYLR6w06zYrq; Wed, 17 Jan 2024 17:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HHo7F1098801; Wed, 17 Jan 2024 17:50:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HHo7rD098796; Wed, 17 Jan 2024 17:50:07 GMT (envelope-from git) Date: Wed, 17 Jan 2024 17:50:07 GMT Message-Id: <202401171750.40HHo7rD098796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pawel Jakub Dawidek Subject: git: f1d0a0cbecf2 - main - jail: Fix information leak. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: pjd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1d0a0cbecf2c688061f35adea85bfb29c9ec893 Auto-Submitted: auto-generated The branch main has been updated by pjd: URL: https://cgit.FreeBSD.org/src/commit/?id=f1d0a0cbecf2c688061f35adea85bfb29c9ec893 commit f1d0a0cbecf2c688061f35adea85bfb29c9ec893 Author: Pawel Jakub Dawidek AuthorDate: 2024-01-17 17:43:55 +0000 Commit: Pawel Jakub Dawidek CommitDate: 2024-01-17 17:43:55 +0000 jail: Fix information leak. There is a lack of proper visibility checking in kern.ttys sysctl handler which leads to information leak about processes outside the current jail. This can be demonstrated with pstat -t: when called from within a jail, it will output all terminal devices including process groups and session leader process IDs: jail# pstat -t | grep pts/ | head LINE INQ CAN LIN LOW OUTQ USE LOW COL SESS PGID STATE pts/2 1920 0 0 192 1984 0 199 0 4132 27245 Oi pts/3 1920 0 0 192 1984 0 199 16 24890 33627 Oi pts/5 0 0 0 0 0 0 0 25 17758 0 G pts/16 0 0 0 0 0 0 0 0 52495 0 G pts/15 0 0 0 0 0 0 0 25 53446 0 G pts/17 0 0 0 0 0 0 0 6702 33230 0 G pts/19 0 0 0 0 0 0 0 14 1116 0 G pts/0 0 0 0 0 0 0 0 0 2241 0 G pts/23 0 0 0 0 0 0 0 20 15639 0 G pts/6 0 0 0 0 0 0 0 0 44062 93792 G jail# pstat -t | grep pts/ | wc -l 85 Devfs does the filtering correctly and we get only one entry: jail# ls /dev/pts/ 2 Approved by: mzaborski, secteam MFC after: 1 week Sponsored by: Fudo Security --- sys/kern/tty.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 29bb092a50b0..ce72b250c526 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1310,9 +1310,11 @@ static int sysctl_kern_ttys(SYSCTL_HANDLER_ARGS) { unsigned long lsize; + struct thread *td = curthread; struct xtty *xtlist, *xt; struct tty *tp; - int error; + struct proc *p; + int cansee, error; sx_slock(&tty_list_sx); lsize = tty_list_count * sizeof(struct xtty); @@ -1325,13 +1327,28 @@ sysctl_kern_ttys(SYSCTL_HANDLER_ARGS) TAILQ_FOREACH(tp, &tty_list, t_list) { tty_lock(tp); - tty_to_xtty(tp, xt); + if (tp->t_session != NULL) { + p = tp->t_session->s_leader; + PROC_LOCK(p); + cansee = (p_cansee(td, p) == 0); + PROC_UNLOCK(p); + } else { + cansee = !jailed(td->td_ucred); + } + if (cansee) { + tty_to_xtty(tp, xt); + xt++; + } tty_unlock(tp); - xt++; } sx_sunlock(&tty_list_sx); - error = SYSCTL_OUT(req, xtlist, lsize); + lsize = (xt - xtlist) * sizeof(struct xtty); + if (lsize > 0) { + error = SYSCTL_OUT(req, xtlist, lsize); + } else { + error = 0; + } free(xtlist, M_TTY); return (error); } From nobody Wed Jan 17 18:12:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFYrk687Rz56Mgl; Wed, 17 Jan 2024 18:12: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 4TFYrk5Smcz4Zsq; Wed, 17 Jan 2024 18:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705515174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y1Ms0IWJxPqNlCvBoseBR02aaEcywCg9cbSDkC+rBMs=; b=XKo7gpxK6gTCA6nm76S+D3UMb9YOiPwYRy4zCYycb1Weocl93CDb8eDBOm+xYG/7ErbBD9 apozRbRF6h44TpGWPi+lIt/SzXb2QClNPPB8y5AgAnX/19IoHTEtVGf+J+G/ufvPzGxeqA 1ygHtjngWPe0v/cT6W9c3VE43yVt9VfSjEHq+e2bIeCnF5tQdDpi6HOMPLV8Vk5o8/pOif k54sURIeydeLL2Cr7f2b06ft42UV0bTlNojU2bS4DU1TRTcCdysWdfSye3DbbxA2xXqJ9+ tTus8ZhnyLltiXwEQol+jiHEFmTCzIaEkVCa8SnEAWlOJgtAs+pmazTk+nXnzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705515174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y1Ms0IWJxPqNlCvBoseBR02aaEcywCg9cbSDkC+rBMs=; b=p1sWTfb9P8kKXHP7mNtD7xp0pCUSaqH0WT3npl6hZMwbE9TslXEMbqzfOKAFSJrIwVNw9X OcOTESQLQoS8NoOTgTkr8aRp6IOoQ0gosLA0tal3CVYp2vGwQ7vK/Y6G9xtqe2EaOwcOJD us5y0LiCsbUqIwSTwOJqbNb+qV9qjn+aERJN9ZDqUGTktWsl9hLDlejUKbdfrhvqGoxe8Y jBUpHFOiNKVbG1ZGS1A5r7pB+R6P3mrlJ+A7QxY9DIRvdkJHUT0y80BwpztPc2hAqwKxub p4owWRcYblBUPIe8jYg2LccNMCKHxAMzTslruYd2vzqu4kZRtRE407xQCIMBlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705515174; a=rsa-sha256; cv=none; b=P0PMqP17xxiWUahfDKzRMIRnJuWzplibcAD31d3WcXXKWDoZiMBZkaa9fgmw0c0o9auj1z NB5tidSW7ynnwJZ52H8Twva9a1qmm00K4VngP5ojymJomCAjYNTVsZ1Mrr3acut8tNoqV7 QXY/g2NYB3QLMUar+recXPscSTHQsz4SMO66QzJ1LQ985ejk3wQFYsXKfaeHOv7Bwo3fEJ 8TSdykUgcYXuik6FK8pM7AkwmmmaMI8Ixn9LIJJLHVisHpLgnAaN9Hr0AhXIMMr8YSlDzg 9W47Lf1ZsvwghzD7JptFoujMfm4UVy5lm0W3YTUtkmupMUTrEwDJEpv1b8Z0IQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFYrk4Z5szZHM; Wed, 17 Jan 2024 18:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HICsI8045500; Wed, 17 Jan 2024 18:12:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HICshL045497; Wed, 17 Jan 2024 18:12:54 GMT (envelope-from git) Date: Wed, 17 Jan 2024 18:12:54 GMT Message-Id: <202401171812.40HICshL045497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: fdd1e1a56457 - main - bhyve: correct slirp_recv_disable() List-Id: Commit messages for the main 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: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fdd1e1a5645714b68cbef56bc6e055a39a43d85b Auto-Submitted: auto-generated The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=fdd1e1a5645714b68cbef56bc6e055a39a43d85b commit fdd1e1a5645714b68cbef56bc6e055a39a43d85b Author: Robert Wing AuthorDate: 2024-01-17 18:12:44 +0000 Commit: Robert Wing CommitDate: 2024-01-17 18:12:44 +0000 bhyve: correct slirp_recv_disable() Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D43472 --- usr.sbin/bhyve/net_backend_slirp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/net_backend_slirp.c b/usr.sbin/bhyve/net_backend_slirp.c index 1d6ed45b90f2..5ae33801387c 100644 --- a/usr.sbin/bhyve/net_backend_slirp.c +++ b/usr.sbin/bhyve/net_backend_slirp.c @@ -627,11 +627,11 @@ slirp_recv_enable(struct net_backend *be) } static void -slirp_recv_disable(struct net_backend *be __unused) +slirp_recv_disable(struct net_backend *be) { struct slirp_priv *priv = NET_BE_PRIV(be); - mevent_enable(priv->mevp); + mevent_disable(priv->mevp); } static uint64_t From nobody Wed Jan 17 18:59:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFZtd3MTTz56SY8; Wed, 17 Jan 2024 18:59: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 4TFZtd2Q3Zz4jTx; Wed, 17 Jan 2024 18:59:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705517977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H+uXMRKEOXAQMUu4NOs7BN93NxwWsjuFjzxtMdCiZQk=; b=VtvP7/XwbDobjB5S4S4ZdZJ1/C3qmN5J5lZRaR4Xq+2bkbR+sWgggogL6Hg3pk0iDe7h0m vDyK81iIdQYGvEOKKYPZqMGFHJphP8oiNn7+ZWZfY/W9zx/BcMdZQNMPO/4arjBifihQKV CrFCi3XJ6HD1UNvW50ZvDBdPXFna8DMVjvtd7UwiX/v6AccHbdpW8WWGpgYxpJLpTeJBaU gSi6lcX0j23HXh3iJc44YI4+n0x0td8GW3I5H31kEVemhVZBsh9fhKgVbdQ5Q6TUYYLYBQ FN2VJEbylJDHkDB9XKonWr5YEpfpOlz2gPJxBJCYwKXDOrv7I57LEp/HUyl73A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705517977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H+uXMRKEOXAQMUu4NOs7BN93NxwWsjuFjzxtMdCiZQk=; b=WTm+ZwWzOynCw20XAF83pz+U7n4wPDRYMBQQA3E6QjSfKmtze75HGUB7bqYB6GIZk6zZfU dNPFgr7tu84/iygeYolS8DjJYmZPPjFcoBO5lK4Y+KP0TILYj4BFQul4xWZjawz3fn8x1Z 5WmgZNi5jl+LnbVBOQ4fpAyw+iXVgoTn+3SdSwaQtHLq76tnPOXqUtAhWLc/cBcZ0uk/ZU sjHCJS1c4AC5b41pgNjh2eJZjsqjqGpObndoYXHyeGAlqse4bgNpRWPyAF8TwoAAy4Tiqy W0DB/fH0EQF6Tju7Gw1+uqDHlMOGCaTOKeooxOxVPPD10q0Pt4vMRBZpIyN+og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705517977; a=rsa-sha256; cv=none; b=QdNc7dEMnsEohJLj48dVgaN3jqzOlPTxzl92zLCQx4rz/qFhoSIE6ijfeZumy9fMKs5J3k oOwAdWOOEfQLl93ndZ0wBxcFOp9/vUuCsiRO4EYX37fYsD9hO9J4GMLisNKg/zpcHnYFar QhTAL5O5ZAf19M3Hfn+l+Bj1/lPc00esldB4t2rEbUIodxxGnKMt0L6iK1t6KcymkUO8Uq tUHcaTKjF3U9AoQP6TPvM1KIkTc62SSFFoQ29FSYbb8Y4O8YQI3iWuq22V6uu6doyi7Vqq bk98lvd8sUckYkxG0kFxYnFCYX773S6IAGuD4g6p+RmZymitFRio84VNxoVnGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFZtd1LX8zbCk; Wed, 17 Jan 2024 18:59:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HIxatM013726; Wed, 17 Jan 2024 18:59:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HIxaBo013723; Wed, 17 Jan 2024 18:59:36 GMT (envelope-from git) Date: Wed, 17 Jan 2024 18:59:36 GMT Message-Id: <202401171859.40HIxaBo013723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pawel Jakub Dawidek Subject: git: 41ac0b4ce00b - main - Fix the 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: pjd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41ac0b4ce00bae061164384f23356a4df6e0e695 Auto-Submitted: auto-generated The branch main has been updated by pjd: URL: https://cgit.FreeBSD.org/src/commit/?id=41ac0b4ce00bae061164384f23356a4df6e0e695 commit 41ac0b4ce00bae061164384f23356a4df6e0e695 Author: Pawel Jakub Dawidek AuthorDate: 2024-01-17 18:54:43 +0000 Commit: Pawel Jakub Dawidek CommitDate: 2024-01-17 18:59:26 +0000 Fix the build. MFC after: 1 week MFC with: f1d0a0cbecf2c688061f35adea85bfb29c9ec893 --- sys/kern/tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index ce72b250c526..ba20f5727829 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -44,6 +44,7 @@ #ifdef COMPAT_43TTY #include #endif /* COMPAT_43TTY */ +#include #include #include #include From nobody Wed Jan 17 21:40:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFfST3hVzz56nl3; Wed, 17 Jan 2024 21:40: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 4TFfST1cnBz42H3; Wed, 17 Jan 2024 21:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705527641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7GBen1Y1NTWNs8BNnF4pIX8CmtGx9Uq7bwHt5buzFk=; b=q5uKa7W6INtbi1MELM9E0E3EJnjyQ38lvqimSQj8nDakbIUl+T/jrQ7xmp3aKYeEPlqa9y +HZkGd6G78K31vTUpgUUqA32wHszfnUHRRlPjxIbHLO4BE/k7wnv7Q9rXHMy+5xMxmOCn1 wMq/b2QiM3QuOXVXKOPoMml+gLT/vDkJyZt/syfZ3kc6NvGKlh+qEgolPsvio8KdlGssQ1 f+YX3qSgDIEJFr0Iflvo913t3CXpAAw8n+FwTVO32fsBOawIFATqz71NwAqyNRWZ9ccXQ+ 04c7MqKpNPg5NyFehShEzpWwG2U/tGBhAWGZNjwxuqULzdff7RStu57/R79WzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705527641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7GBen1Y1NTWNs8BNnF4pIX8CmtGx9Uq7bwHt5buzFk=; b=gXv2XyfxYUD0Beye3vRjhGpGM+hU52uvO2qxcbkJVbnZt+FpAn85IFTkeGvT30wMsG5d5/ SF2/8ircRoG6t5xqMHXm7gp+ASs+s3farjPEj7RQeGZnDue+yGPxl2+4o9VlFjwErKZ0H4 oDj7mD2THbG7ck7Xnx6V05NyyFXiWAvzsO9VtOjJmoUMouA/duPqYbT0ib7s9PN29iYM1r Jos8m6Fna2i3CspbtE/fgWk7tSlqOAGuSazFPZgU1cZFl2kjP8ZaJs8WZnOhLEIQdu0N49 xQ+pzDHRh+5y8GrXGkL5DNK2oCdj/l41X7uGHfS4aiwQ+Z90YGQHYRVE3T/gTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705527641; a=rsa-sha256; cv=none; b=wlGa40YgPn+aki5sEk5Ci99bXBvm+++x0hh2Ll7lhcAlsixuIywFAA0e5R6S/jFlzAxl4k ah8/HCHdlMediAdqLQVMtUthbtfaGIgWSifleCuQKC43itaSMbO5Iq/8ZlSI/v1lUfvO2I 9G1Bz49IX/vXuKPqfqchfcYSTEmZ3bwBfclOioWm0lvdHkX0kKgVbAglp7CNJQ8qneMiOl nn+oXItmbp0CBs5FT0TwCNUgVKvq09NGNRpZHMx2+k7a3qwfhSEZB8XhK1QIpE6cIILKug G6FWVsNEeYWWPT+lINtvDhh5G77VY3/NKkhF/agkuYNdwayzt2MEVLCTXM7sRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFfST0k0HzgFc; Wed, 17 Jan 2024 21:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HLefPC092139; Wed, 17 Jan 2024 21:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HLecSL092130; Wed, 17 Jan 2024 21:40:38 GMT (envelope-from git) Date: Wed, 17 Jan 2024 21:40:38 GMT Message-Id: <202401172140.40HLecSL092130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 78ae60b447eb - main - zfs: merge openzfs/zfs@a0b2a93c4 List-Id: Commit messages for the main 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: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78ae60b447ebf420dd5cebfec30480866fd5cef4 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=78ae60b447ebf420dd5cebfec30480866fd5cef4 commit 78ae60b447ebf420dd5cebfec30480866fd5cef4 Merge: 41ac0b4ce00b a0b2a93c41b0 Author: Martin Matuska AuthorDate: 2024-01-17 21:08:01 +0000 Commit: Martin Matuska CommitDate: 2024-01-17 21:39:31 +0000 zfs: merge openzfs/zfs@a0b2a93c4 Notable upstream pull request merges: #15660 66670ba9f fix(mount): do not truncate shares not zfs mount #15719 3bddc4dae spa: Fix FreeBSD sysctl handlers (already merged) #15719 5a703d136 spa: Let spa_taskq_param_get()'s addition of a newline be optional #15721 6138af86b Stop wasting time on malloc in snprintf_zstd_header #15723 1f5bf9600 Make zdb -R a little more sane. #15726 20dd16d9f Make zdb -R scale less poorly #15737 d9885b377 fix: Uber block label not always found for aux vdevs #15737 2df2a58dc Extend aux label to add path information #15737 b64be1624 Add path handling for aux vdevs in `label_path` #15747 a1771d243 Fix "out of memory" error #15752 1a11ad9d2 Fix a potential use-after-free in zfs_setsecattr() #15772 f45dd90f3 Fix cloning into mmaped and cached file #15781 1494e8fba Autotrim High Load Average Fix Obtained from: OpenZFS OpenZFS commit: a0b2a93c41b0b0d7723d1b20eb1eca7a1a63e45b sys/contrib/openzfs/cmd/zdb/zdb.c | 104 ++++++++++----- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 3 +- sys/contrib/openzfs/config/rpm.am | 10 ++ sys/contrib/openzfs/include/sys/spa_impl.h | 1 + sys/contrib/openzfs/lib/libzfs/libzfs_import.c | 4 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 32 ++++- .../openzfs/module/os/linux/spl/spl-condvar.c | 2 +- .../openzfs/module/os/linux/spl/spl-kmem-cache.c | 5 +- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 6 +- sys/contrib/openzfs/module/zfs/spa.c | 13 +- sys/contrib/openzfs/module/zfs/vdev_label.c | 85 ++++++++---- sys/contrib/openzfs/module/zfs/vdev_trim.c | 3 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 8 +- sys/contrib/openzfs/rpm/generic/zfs-kmod.spec.in | 24 ++++ sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 24 ++++ sys/contrib/openzfs/tests/runfiles/common.run | 16 ++- sys/contrib/openzfs/tests/runfiles/linux.run | 14 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 3 + sys/contrib/openzfs/tests/zfs-tests/cmd/.gitignore | 2 + .../openzfs/tests/zfs-tests/cmd/Makefile.am | 2 + .../tests/zfs-tests/cmd/clone_mmap_cached.c | 146 +++++++++++++++++++++ .../openzfs/tests/zfs-tests/cmd/clone_mmap_write.c | 123 +++++++++++++++++ .../openzfs/tests/zfs-tests/cmd/clonefile.c | 2 +- sys/contrib/openzfs/tests/zfs-tests/cmd/ctime.c | 14 +- .../openzfs/tests/zfs-tests/include/commands.cfg | 2 + .../openzfs/tests/zfs-tests/tests/Makefile.am | 3 + .../block_cloning_clone_mmap_cached.ksh | 86 ++++++++++++ .../block_cloning_clone_mmap_write.ksh | 79 +++++++++++ .../block_cloning/block_cloning_copyfilerange.ksh | 2 +- .../block_cloning_copyfilerange_cross_dataset.ksh | 2 +- .../block_cloning_copyfilerange_fallback.ksh | 2 +- ...ock_cloning_copyfilerange_fallback_same_txg.ksh | 2 +- .../block_cloning_copyfilerange_partial.ksh | 2 +- .../block_cloning_cross_enc_dataset.ksh | 2 +- .../block_cloning_disabled_copyfilerange.ksh | 2 +- .../block_cloning_lwb_buffer_overflow.ksh | 7 +- .../block_cloning/block_cloning_replay.ksh | 9 +- .../block_cloning_replay_encrypted.ksh | 9 +- .../tests/functional/block_cloning/setup.ksh | 3 + .../cli_root/zfs_share/zfs_share_after_mount.ksh | 62 +++++++++ sys/modules/zfs/zfs_config.h | 4 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 42 files changed, 807 insertions(+), 119 deletions(-) diff --cc sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_cached.c index 000000000000,c1cdf796cfb4..c1cdf796cfb4 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_cached.c +++ b/sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_cached.c diff --cc sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_write.c index 000000000000,6a5cd8721c57..6a5cd8721c57 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_write.c +++ b/sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_write.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh index 000000000000,b0ef8ec99533..b0ef8ec99533 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh index 000000000000,6215b3178e7e..6215b3178e7e mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh index 000000000000,0d4b66ea854c..0d4b66ea854c mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh diff --cc sys/modules/zfs/zfs_config.h index bd060bc882c9,000000000000..70eea47ba127 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,1176 -1,0 +1,1176 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue is available */ +/* #undef HAVE_BLK_MQ */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* dentry aliases are in d_u member */ +/* #undef HAVE_DENTRY_D_U_ALIASES */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* Define to 1 if you have the `execvpe' function. */ +/* #undef HAVE_EXECVPE */ + +/* FALLOC_FL_ZERO_RANGE is defined */ +/* #undef HAVE_FALLOC_FL_ZERO_RANGE */ + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* filemap_range_has_page() is available */ +/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* fops->fadvise() exists */ +/* #undef HAVE_FILE_FADVISE */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->setattr() exists */ +/* #undef HAVE_IOPS_SETATTR */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* linux/blk-cgroup.h exists */ +/* #undef HAVE_LINUX_BLK_CGROUP_HEADER */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* struct reclaim_state has reclaimed */ +/* #undef HAVE_RECLAIM_STATE_RECLAIMED */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* register_sysctl_table exists */ +/* #undef HAVE_REGISTER_SYSCTL_TABLE */ + +/* iops->rename2() exists */ +/* #undef HAVE_RENAME2 */ + +/* struct inode_operations_wrapper takes .rename2() */ +/* #undef HAVE_RENAME2_OPERATIONS_WRAPPER */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* shrinker_register exists */ +/* #undef HAVE_SHRINKER_REGISTER */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* cs->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* have super_block s_shrink */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK */ + +/* have super_block s_shrink pointer */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK_PTR */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* sync_blockdev() is declared in include/blkdev.h */ +/* #undef HAVE_SYNC_BLOCKDEV */ + +/* struct kobj_type has default_groups */ +/* #undef HAVE_SYSFS_DEFAULT_GROUPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 *** 306 LINES SKIPPED *** From nobody Wed Jan 17 22:50:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFh0X5fRDz56xBr; Wed, 17 Jan 2024 22:50: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 4TFh0X5Pbzz49kd; Wed, 17 Jan 2024 22:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705531804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bVc7YYrSMyJlMxri1JtvLXQlD9Y0CVWIjmoySdSpEZI=; b=ozaJTS5U2AoZO36LA5541N6l5HssQY9muKoL4oqypYb4za7QtYtp3UH4MLv/nOgTxK/mXU pqU3duu0U3cGrsqxZBycoe2FuwxqyzBAkBCi16I81e1XI/2lT7B4heyycyzyksKB438Dvq 3XmozomOmO0vMqgRDGKqt7ADbmhkyEyXzviQNsCfO0chvUy1vYa6XVGenigUnYPKI2MZt+ ohL/T0LZsqfpoOyNecqhBj7A6iat9bhtG4ALYkg/Xr1AtPhNdSDgYJvOd2dFqY8Bf0YD7u U/xtADCCtdG/IVjkPTLXHuX+D9gFlL7pSdCi+07Si5/dneBqh7AkbWhHzKYGFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705531804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bVc7YYrSMyJlMxri1JtvLXQlD9Y0CVWIjmoySdSpEZI=; b=hIhLhv2fN9oI+948XAaC+kak+F7kfyZx3KCLNjxs6PCOJXOfXk3jr2iWYD48AY+P3zPu9g XJFStrYVDNlJgPnh/XeVT5ghn61kDi7vO7oT3o6UV7RyBJ8YZMLIUJYk948VhfU2x0ktBt dfACL0CPQCXbC2SL0kozU4hHLjM/85XPpKhk6rl6/rzPL5sSHg/yXDUVRDcHOx892EV3sL 7jvE/2kDgWsmC8ZLXYfRq/zLhVVt1kZyMJt9y0Kcbs/4WFVtBkR4sLJC8tRZGnd1iHoSBI P1Z/vpY+1aWdnNja6gpvd1jmLww4mEYiooUO1PcHRSqVonn5oDfqDMxoj1+5HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705531804; a=rsa-sha256; cv=none; b=ScAtQUQsmXo191o5wA5190agWuznWMe1VtuVvN0+SVnAieP8kVOJqOdrP4azj5whiAggEH 7McX7By2dPnyBoAcLw5kE9iBGa1RMkRR6Mbule1djioFKjgbMItPjVUcRmfJ3PKR3crwKZ 40F+Rd2FQrIvtEIorlw4I8sw+vZNRKIpZ3qZRG4UNLtzTEG1fNQeB3r2WI0905/6qXvaT+ 5RDp0Pu4L06lv4CmtsEw29QXufFWRUUcGysHqwmHsE9+xOGqFTQ9RHdGSYGSA66bCrueVw X6QIB+oxA8wVz5M8LjSDdU/eCsS6uoeKA0W3Efi8bEvdMzFZjeu9T7FXbgcBOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFh0X4Sfnzj6Z; Wed, 17 Jan 2024 22:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HMo41w003466; Wed, 17 Jan 2024 22:50:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HMo4O9003460; Wed, 17 Jan 2024 22:50:04 GMT (envelope-from git) Date: Wed, 17 Jan 2024 22:50:04 GMT Message-Id: <202401172250.40HMo4O9003460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free List-Id: Commit messages for the main 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 Author: Alan Somers AuthorDate: 2024-01-15 23:49:47 +0000 Commit: Alan Somers CommitDate: 2024-01-17 22:49:41 +0000 fusefs: prefer new/delete over malloc/free MFC after: 2 weeks Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D43464 --- tests/sys/fs/fusefs/bmap.cc | 5 +- tests/sys/fs/fusefs/copy_file_range.cc | 22 ++++---- tests/sys/fs/fusefs/fallocate.cc | 6 +-- tests/sys/fs/fusefs/io.cc | 30 +++++------ tests/sys/fs/fusefs/read.cc | 14 +++-- tests/sys/fs/fusefs/setattr.cc | 23 ++++----- tests/sys/fs/fusefs/write.cc | 94 +++++++++++++++------------------- 7 files changed, 85 insertions(+), 109 deletions(-) diff --git a/tests/sys/fs/fusefs/bmap.cc b/tests/sys/fs/fusefs/bmap.cc index 1ef3dfa00045..4c9edac9360a 100644 --- a/tests/sys/fs/fusefs/bmap.cc +++ b/tests/sys/fs/fusefs/bmap.cc @@ -188,7 +188,7 @@ TEST_P(BmapEof, eof) const off_t filesize = 2 * m_maxbcachebuf; const ino_t ino = 42; mode_t mode = S_IFREG | 0644; - void *buf; + char *buf; int fd; int ngetattrs; @@ -243,11 +243,12 @@ TEST_P(BmapEof, eof) out.body.attr.attr.size = filesize / 2; }))); - buf = calloc(1, filesize); + buf = new char[filesize](); fd = open(FULLPATH, O_RDWR); ASSERT_LE(0, fd) << strerror(errno); read(fd, buf, filesize); + delete[] buf; leak(fd); } diff --git a/tests/sys/fs/fusefs/copy_file_range.cc b/tests/sys/fs/fusefs/copy_file_range.cc index 17b21b888736..806ecf3c3653 100644 --- a/tests/sys/fs/fusefs/copy_file_range.cc +++ b/tests/sys/fs/fusefs/copy_file_range.cc @@ -197,7 +197,7 @@ TEST_F(CopyFileRange, evicts_cache) const char RELPATH1[] = "src.txt"; const char FULLPATH2[] = "mountpoint/dst.txt"; const char RELPATH2[] = "dst.txt"; - void *buf0, *buf1, *buf; + char *buf0, *buf1, *buf; const uint64_t ino1 = 42; const uint64_t ino2 = 43; const uint64_t fh1 = 0xdeadbeef1a7ebabe; @@ -209,7 +209,7 @@ TEST_F(CopyFileRange, evicts_cache) ssize_t len = m_maxbcachebuf; int fd1, fd2; - buf0 = malloc(m_maxbcachebuf); + buf0 = new char[m_maxbcachebuf]; memset(buf0, 42, m_maxbcachebuf); expect_lookup(RELPATH1, ino1, S_IFREG | 0644, fsize1, 1); @@ -240,7 +240,7 @@ TEST_F(CopyFileRange, evicts_cache) fd2 = open(FULLPATH2, O_RDWR); // Prime cache - buf = malloc(m_maxbcachebuf); + buf = new char[m_maxbcachebuf]; ASSERT_EQ(m_maxbcachebuf, pread(fd2, buf, m_maxbcachebuf, start2)) << strerror(errno); EXPECT_EQ(0, memcmp(buf0, buf, m_maxbcachebuf)); @@ -249,7 +249,7 @@ TEST_F(CopyFileRange, evicts_cache) ASSERT_EQ(len, copy_file_range(fd1, &start1, fd2, &start2, len, 0)); // Read again. This should bypass the cache and read direct from server - buf1 = malloc(m_maxbcachebuf); + buf1 = new char[m_maxbcachebuf]; memset(buf1, 69, m_maxbcachebuf); start2 -= len; expect_read(ino2, start2, m_maxbcachebuf, m_maxbcachebuf, buf1, -1, @@ -258,9 +258,9 @@ TEST_F(CopyFileRange, evicts_cache) << strerror(errno); EXPECT_EQ(0, memcmp(buf1, buf, m_maxbcachebuf)); - free(buf1); - free(buf0); - free(buf); + delete[] buf1; + delete[] buf0; + delete[] buf; leak(fd1); leak(fd2); } @@ -343,8 +343,8 @@ TEST_F(CopyFileRange, mmap_write) int fd; const mode_t mode = 0644; - fbuf = (uint8_t*)calloc(1, fsize); - wbuf = (uint8_t*)malloc(wsize); + fbuf = new uint8_t[fsize](); + wbuf = new uint8_t[wsize]; memset(wbuf, 1, wsize); expect_lookup(RELPATH, ino, S_IFREG | mode, fsize, 1); @@ -383,8 +383,8 @@ TEST_F(CopyFileRange, mmap_write) r = copy_file_range(fd, &offset2_in, fd, &offset2_out, copysize, 0); ASSERT_EQ(copysize, (size_t)r) << strerror(errno); - free(wbuf); - free(fbuf); + delete[] wbuf; + delete[] fbuf; } diff --git a/tests/sys/fs/fusefs/fallocate.cc b/tests/sys/fs/fusefs/fallocate.cc index 251552ddc8d0..92e327be5ade 100644 --- a/tests/sys/fs/fusefs/fallocate.cc +++ b/tests/sys/fs/fusefs/fallocate.cc @@ -415,14 +415,14 @@ TEST_F(Fspacectl_7_18, ok) const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; struct spacectl_range rqsr, rmsr; - void *buf; + char *buf; uint64_t ino = 42; uint64_t fsize = 2000; uint64_t offset = 500; uint64_t length = 1000; int fd; - buf = malloc(length); + buf = new char[length]; expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1); expect_open(ino, 0, 1); @@ -437,7 +437,7 @@ TEST_F(Fspacectl_7_18, ok) EXPECT_EQ((off_t)(offset + length), rmsr.r_offset); leak(fd); - free(buf); + delete[] buf; } /* diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index 283b601c9e87..99b5eae34e09 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -283,7 +283,8 @@ void do_ftruncate(off_t offs) void do_mapread(off_t offs, ssize_t size) { - void *control_buf, *p; + char *control_buf; + void *p; off_t pg_offset, page_mask; size_t map_size; @@ -295,8 +296,7 @@ void do_mapread(off_t offs, ssize_t size) offs - pg_offset); ASSERT_NE(p, MAP_FAILED) << strerror(errno); - control_buf = malloc(size); - ASSERT_NE(nullptr, control_buf) << strerror(errno); + control_buf = new char[size]; ASSERT_EQ(size, pread(m_control_fd, control_buf, size, offs)) << strerror(errno); @@ -304,18 +304,16 @@ void do_mapread(off_t offs, ssize_t size) compare((void*)((char*)p + pg_offset), control_buf, offs, size); ASSERT_EQ(0, munmap(p, map_size)) << strerror(errno); - free(control_buf); + delete[] control_buf; } void do_read(off_t offs, ssize_t size) { - void *test_buf, *control_buf; + char *test_buf, *control_buf; ssize_t r; - test_buf = malloc(size); - ASSERT_NE(nullptr, test_buf) << strerror(errno); - control_buf = malloc(size); - ASSERT_NE(nullptr, control_buf) << strerror(errno); + test_buf = new char[size]; + control_buf = new char[size]; errno = 0; r = pread(m_test_fd, test_buf, size, offs); @@ -327,8 +325,8 @@ void do_read(off_t offs, ssize_t size) compare(test_buf, control_buf, offs, size); - free(control_buf); - free(test_buf); + delete[] control_buf; + delete[] test_buf; } void do_mapwrite(off_t offs, ssize_t size) @@ -343,8 +341,7 @@ void do_mapwrite(off_t offs, ssize_t size) pg_offset = offs & page_mask; map_size = pg_offset + size; - buf = (char*)malloc(size); - ASSERT_NE(nullptr, buf) << strerror(errno); + buf = new char[size]; for (i=0; i < size; i++) buf[i] = random(); @@ -364,7 +361,7 @@ void do_mapwrite(off_t offs, ssize_t size) ASSERT_EQ(size, pwrite(m_control_fd, buf, size, offs)) << strerror(errno); - free(buf); + delete[] buf; ASSERT_EQ(0, munmap(p, map_size)) << strerror(errno); } @@ -373,8 +370,7 @@ void do_write(off_t offs, ssize_t size) char *buf; long i; - buf = (char*)malloc(size); - ASSERT_NE(nullptr, buf) << strerror(errno); + buf = new char[size]; for (i=0; i < size; i++) buf[i] = random(); @@ -384,7 +380,7 @@ void do_write(off_t offs, ssize_t size) << strerror(errno); m_filesize = std::max(m_filesize, offs + size); - free(buf); + delete[] buf; } }; diff --git a/tests/sys/fs/fusefs/read.cc b/tests/sys/fs/fusefs/read.cc index 3df0420facb9..373f742d4fd3 100644 --- a/tests/sys/fs/fusefs/read.cc +++ b/tests/sys/fs/fusefs/read.cc @@ -1216,8 +1216,7 @@ TEST_F(Read, cache_block) char buf[bufsize]; const char *contents1 = CONTENTS0 + bufsize; - contents = (char*)calloc(1, filesize); - ASSERT_NE(nullptr, contents); + contents = new char[filesize](); memmove(contents, CONTENTS0, strlen(CONTENTS0)); expect_lookup(RELPATH, ino, filesize); @@ -1235,7 +1234,7 @@ TEST_F(Read, cache_block) ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno); ASSERT_EQ(0, memcmp(buf, contents1, bufsize)); leak(fd); - free(contents); + delete[] contents; } /* Reading with sendfile should work (though it obviously won't be 0-copy) */ @@ -1332,10 +1331,9 @@ TEST_P(ReadAhead, readahead) { char *rbuf, *contents; off_t offs; - contents = (char*)malloc(filesize); - ASSERT_NE(nullptr, contents); + contents = new char[filesize]; memset(contents, 'X', filesize); - rbuf = (char*)calloc(1, bufsize); + rbuf = new char[bufsize](); expect_lookup(RELPATH, ino, filesize); expect_open(ino, 0, 1); @@ -1357,8 +1355,8 @@ TEST_P(ReadAhead, readahead) { ASSERT_EQ(0, memcmp(rbuf, contents, bufsize)); leak(fd); - free(rbuf); - free(contents); + delete[] rbuf; + delete[] contents; } INSTANTIATE_TEST_SUITE_P(RA, ReadAhead, diff --git a/tests/sys/fs/fusefs/setattr.cc b/tests/sys/fs/fusefs/setattr.cc index 2502286c3f03..79559db33b12 100644 --- a/tests/sys/fs/fusefs/setattr.cc +++ b/tests/sys/fs/fusefs/setattr.cc @@ -448,7 +448,7 @@ TEST_F(Setattr, truncate) { TEST_F(Setattr, truncate_discards_cached_data) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; - void *w0buf, *r0buf, *r1buf, *expected; + char *w0buf, *r0buf, *r1buf, *expected; off_t w0_offset = 0; size_t w0_size = 0x30000; off_t r0_offset = 0; @@ -463,18 +463,13 @@ TEST_F(Setattr, truncate_discards_cached_data) { int fd, r; bool should_have_data = false; - w0buf = malloc(w0_size); - ASSERT_NE(nullptr, w0buf) << strerror(errno); + w0buf = new char[w0_size]; memset(w0buf, 'X', w0_size); - r0buf = malloc(r0_size); - ASSERT_NE(nullptr, r0buf) << strerror(errno); - r1buf = malloc(r1_size); - ASSERT_NE(nullptr, r1buf) << strerror(errno); + r0buf = new char[r0_size]; + r1buf = new char[r1_size]; - expected = malloc(r1_size); - ASSERT_NE(nullptr, expected) << strerror(errno); - memset(expected, 0, r1_size); + expected = new char[r1_size](); expect_lookup(RELPATH, ino, mode, 0, 1); expect_open(ino, O_RDWR, 1); @@ -558,10 +553,10 @@ TEST_F(Setattr, truncate_discards_cached_data) { r = memcmp(expected, r1buf, r1_size); ASSERT_EQ(0, r); - free(expected); - free(r1buf); - free(r0buf); - free(w0buf); + delete[] expected; + delete[] r1buf; + delete[] r0buf; + delete[] w0buf; leak(fd); } diff --git a/tests/sys/fs/fusefs/write.cc b/tests/sys/fs/fusefs/write.cc index 1fb9de70ec6c..f931f350a7c3 100644 --- a/tests/sys/fs/fusefs/write.cc +++ b/tests/sys/fs/fusefs/write.cc @@ -311,10 +311,8 @@ TEST_F(Write, append_to_cached) uint64_t oldsize = m_maxbcachebuf / 2; int fd; - oldcontents = (char*)calloc(1, oldsize); - ASSERT_NE(nullptr, oldcontents) << strerror(errno); - oldbuf = (char*)malloc(oldsize); - ASSERT_NE(nullptr, oldbuf) << strerror(errno); + oldcontents = new char[oldsize](); + oldbuf = new char[oldsize]; expect_lookup(RELPATH, ino, oldsize); expect_open(ino, 0, 1); @@ -332,8 +330,8 @@ TEST_F(Write, append_to_cached) /* Write the new data. There should be no more read operations */ ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno); leak(fd); - free(oldbuf); - free(oldcontents); + delete[] oldbuf; + delete[] oldcontents; } TEST_F(Write, append_direct_io) @@ -659,7 +657,7 @@ TEST_P(WriteEofDuringVnopStrategy, eof_during_vop_strategy) const char RELPATH[] = "some_file.txt"; Sequence seq; const off_t filesize = 2 * m_maxbcachebuf; - void *contents; + char *contents; uint64_t ino = 42; uint64_t attr_valid = 0; uint64_t attr_valid_nsec = 0; @@ -668,7 +666,7 @@ TEST_P(WriteEofDuringVnopStrategy, eof_during_vop_strategy) int ngetattrs; ngetattrs = GetParam(); - contents = calloc(1, filesize); + contents = new char[filesize](); EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) .WillRepeatedly(Invoke( @@ -742,14 +740,12 @@ TEST_F(Write, mmap) void *p; uint64_t offset = 10; size_t len; - void *zeros, *expected; + char *zeros, *expected; len = getpagesize(); - zeros = calloc(1, len); - ASSERT_NE(nullptr, zeros); - expected = calloc(1, len); - ASSERT_NE(nullptr, expected); + zeros = new char[len](); + expected = new char[len](); memmove((uint8_t*)expected + offset, CONTENTS, bufsize); expect_lookup(RELPATH, ino, len); @@ -774,8 +770,8 @@ TEST_F(Write, mmap) ASSERT_EQ(0, munmap(p, len)) << strerror(errno); close(fd); // Write mmap'd data on close - free(expected); - free(zeros); + delete[] expected; + delete[] zeros; leak(fd); } @@ -867,8 +863,7 @@ TEST_F(WriteMaxWrite, write) if (halfbufsize >= m_maxbcachebuf || halfbufsize >= m_maxphys) GTEST_SKIP() << "Must lower m_maxwrite for this test"; bufsize = halfbufsize * 2; - contents = (int*)malloc(bufsize); - ASSERT_NE(nullptr, contents); + contents = new int[bufsize / sizeof(int)]; for (int i = 0; i < (int)bufsize / (int)sizeof(i); i++) { contents[i] = i; } @@ -885,7 +880,7 @@ TEST_F(WriteMaxWrite, write) ASSERT_EQ(bufsize, write(fd, contents, bufsize)) << strerror(errno); leak(fd); - free(contents); + delete[] contents; } TEST_F(Write, write_nothing) @@ -966,15 +961,13 @@ TEST_F(WriteCluster, clustering) const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; int i, fd; - void *wbuf, *wbuf2x; + char *wbuf, *wbuf2x; ssize_t bufsize = m_maxbcachebuf; off_t filesize = 5 * bufsize; - wbuf = malloc(bufsize); - ASSERT_NE(nullptr, wbuf) << strerror(errno); + wbuf = new char[bufsize]; memset(wbuf, 'X', bufsize); - wbuf2x = malloc(2 * bufsize); - ASSERT_NE(nullptr, wbuf2x) << strerror(errno); + wbuf2x = new char[2 * bufsize]; memset(wbuf2x, 'X', 2 * bufsize); expect_lookup(RELPATH, ino, filesize); @@ -997,8 +990,8 @@ TEST_F(WriteCluster, clustering) << strerror(errno); } close(fd); - free(wbuf2x); - free(wbuf); + delete[] wbuf2x; + delete[] wbuf; } /* @@ -1015,12 +1008,11 @@ TEST_F(WriteCluster, cluster_write_err) const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; int i, fd; - void *wbuf; + char *wbuf; ssize_t bufsize = m_maxbcachebuf; off_t filesize = 4 * bufsize; - wbuf = malloc(bufsize); - ASSERT_NE(nullptr, wbuf) << strerror(errno); + wbuf = new char[bufsize]; memset(wbuf, 'X', bufsize); expect_lookup(RELPATH, ino, filesize); @@ -1042,7 +1034,7 @@ TEST_F(WriteCluster, cluster_write_err) << strerror(errno); } close(fd); - free(wbuf); + delete[] wbuf; } /* @@ -1179,11 +1171,11 @@ TEST_F(WriteBack, mmap_direct_io) int fd; size_t len; ssize_t bufsize = strlen(CONTENTS); - void *p, *zeros; + char *zeros; + void *p; len = getpagesize(); - zeros = calloc(1, len); - ASSERT_NE(nullptr, zeros); + zeros = new char[len](); expect_lookup(RELPATH, ino, len); expect_open(ino, FOPEN_DIRECT_IO, 1); @@ -1203,7 +1195,7 @@ TEST_F(WriteBack, mmap_direct_io) ASSERT_EQ(0, munmap(p, len)) << strerror(errno); close(fd); // Write mmap'd data on close - free(zeros); + delete[] zeros; } /* @@ -1252,10 +1244,9 @@ TEST_F(WriteBackAsync, direct_io_ignores_unrelated_cached) ssize_t bufsize = strlen(CONTENTS0) + 1; ssize_t fsize = 2 * m_maxbcachebuf; char readbuf[bufsize]; - void *zeros; + char *zeros; - zeros = calloc(1, m_maxbcachebuf); - ASSERT_NE(nullptr, zeros); + zeros = new char[m_maxbcachebuf](); expect_lookup(RELPATH, ino, fsize); expect_open(ino, 0, 1); @@ -1282,7 +1273,7 @@ TEST_F(WriteBackAsync, direct_io_ignores_unrelated_cached) ASSERT_STREQ(readbuf, CONTENTS0); leak(fd); - free(zeros); + delete[] zeros; } /* @@ -1298,20 +1289,15 @@ TEST_F(WriteBackAsync, direct_io_partially_overlaps_cached_block) int fd; off_t bs = m_maxbcachebuf; ssize_t fsize = 3 * bs; - void *readbuf, *zeros, *ones, *zeroones, *onezeros; - - readbuf = malloc(bs); - ASSERT_NE(nullptr, readbuf) << strerror(errno); - zeros = calloc(1, 3 * bs); - ASSERT_NE(nullptr, zeros); - ones = calloc(1, 2 * bs); - ASSERT_NE(nullptr, ones); + char *readbuf, *zeros, *ones, *zeroones, *onezeros; + + readbuf = new char[bs]; + zeros = new char[3 * bs](); + ones = new char[2 * bs]; memset(ones, 1, 2 * bs); - zeroones = calloc(1, bs); - ASSERT_NE(nullptr, zeroones); + zeroones = new char[bs](); memset((uint8_t*)zeroones + bs / 2, 1, bs / 2); - onezeros = calloc(1, bs); - ASSERT_NE(nullptr, onezeros); + onezeros = new char[bs](); memset(onezeros, 1, bs / 2); expect_lookup(RELPATH, ino, fsize); @@ -1356,11 +1342,11 @@ TEST_F(WriteBackAsync, direct_io_partially_overlaps_cached_block) EXPECT_EQ(0, memcmp(ones, readbuf, bs / 2)); leak(fd); - free(zeroones); - free(onezeros); - free(ones); - free(zeros); - free(readbuf); + delete[] zeroones; + delete[] onezeros; + delete[] ones; + delete[] zeros; + delete[] readbuf; } /* From nobody Wed Jan 17 23:30:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFhvP1ybGz572Q8; Wed, 17 Jan 2024 23:30: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 4TFhvP151qz4KNC; Wed, 17 Jan 2024 23:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705534241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VGK5xJoL1H/lZaCbW4vsomWjK3MyQVNuw01IhMWUamM=; b=RFwwTr67TqaeEAiAhMibY7duokbpSkwvyQ0djnlyx6lgnbQf13SUY5blRpAlVsHSLYnapx QnyzdlHFeFDv2u8T40OVAcIzp5NJedOem/9VGG+twvn58HUpzuN7BMZ8ZbfyFkpcTrvZvV brY14eJM0CAdWDhEun4AwfHvwqpVUCJDMM8F0NfN4CWBc+2MC2hCPBsxWz99TiZvvd1K5G 6y0xu35+JonvVuHy28rpmsG0N91VVu8nW40E6MEE4OKyLW/hseANF5a5cqlgUrOJVXTtG4 MEhaAka0CboxH/tdYzZpgcrqX62xcAW76az3O0jQ4qH2sgvOL9SohHilHHwP3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705534241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VGK5xJoL1H/lZaCbW4vsomWjK3MyQVNuw01IhMWUamM=; b=cD5DFNTVtwOiGxZ6K0xCuvvI2bVwfbNEX7r8W8DjoQ7RpImC9vn4wJ/46wISYH+4B8zPKV 6UPGtUX9YY4pULiOQsCudX/7EsrrC2kFjnLlu3qPjtpZhJeovKteDdeC1jZYd7i6J06+RB zr8U4fs9F0q7BqxM7zB9vWJ3RYZ3Udp6VMelDkbCEnpGSh1KRdyz7huJCqYO1gYOML/akQ M3eA4vQr7Vy4CjfopOezmMmEDT1NnfvOCYqpC/YI85D8ko049oLFa351OeGR4q4x9LhpQo /z3bs3UFEZuT7LT0726Vlj/ROc/6hctCIcPeviQgPCDUAbQ6suPD5csUYnMaMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705534241; a=rsa-sha256; cv=none; b=Iba1QDYCoS2JyZPw0wAzRaSkanTm/e12YQ2VSMrFUEp7e3nZTeqG5qVuJ+jrSxx0NGytJE wFxlkW/1dOaRoFAWRtH6V+21S74hGhuzB9MemyYaCaHfhPBt5aur9lyfsMPu+pXxrSWsv+ g3Qxg04K4dUaSjW1dNwBESZvDA2bKNOVuaV4LdiWPX6YTX4yWWBbTz878VlFR0yMnrueKq 0SSEhl8xS8xnnpN92iU3BZwYSPEpurv9qyghNAscvrVdhgyIZDeuX6FRTU1D4Et6hyWJga QFiYSCHyUvzo+kyE0FQe8OOsgy1dklfjnwGWgXD3AJBOakJgLTyT3gMHumEeMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFhvP08V9zk9g; Wed, 17 Jan 2024 23:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HNUeOD078540; Wed, 17 Jan 2024 23:30:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HNUep0078537; Wed, 17 Jan 2024 23:30:40 GMT (envelope-from git) Date: Wed, 17 Jan 2024 23:30:40 GMT Message-Id: <202401172330.40HNUep0078537@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: b891f61ef538 - main - if_wg: fix erroneous calculation in calculate_padding() for p_mtu == 0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: b891f61ef538a4e9b4658b4b756635c8036a5788 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b891f61ef538a4e9b4658b4b756635c8036a5788 commit b891f61ef538a4e9b4658b4b756635c8036a5788 Author: Aaron LI AuthorDate: 2024-01-17 23:29:23 +0000 Commit: Kyle Evans CommitDate: 2024-01-17 23:29:52 +0000 if_wg: fix erroneous calculation in calculate_padding() for p_mtu == 0 In practice this is harmless; only keepalive packets may realistically have p_mtu == 0, and they'll also have no payload so the math works out the same either way. Still, let's prefer technical accuracy and calculate the amount of padding needed rather than the padded length... PR: 276363 --- sys/dev/wg/if_wg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 71c80c8b5f77..58c0e2db1ee8 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -1463,8 +1463,12 @@ calculate_padding(struct wg_packet *pkt) { unsigned int padded_size, last_unit = pkt->p_mbuf->m_pkthdr.len; - if (__predict_false(!pkt->p_mtu)) - return (last_unit + (WG_PKT_PADDING - 1)) & ~(WG_PKT_PADDING - 1); + /* Keepalive packets don't set p_mtu, but also have a length of zero. */ + if (__predict_false(pkt->p_mtu == 0)) { + padded_size = (last_unit + (WG_PKT_PADDING - 1)) & + ~(WG_PKT_PADDING - 1); + return (padded_size - last_unit); + } if (__predict_false(last_unit > pkt->p_mtu)) last_unit %= pkt->p_mtu; @@ -1472,7 +1476,7 @@ calculate_padding(struct wg_packet *pkt) padded_size = (last_unit + (WG_PKT_PADDING - 1)) & ~(WG_PKT_PADDING - 1); if (pkt->p_mtu < padded_size) padded_size = pkt->p_mtu; - return padded_size - last_unit; + return (padded_size - last_unit); } static void From nobody Wed Jan 17 23:30:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFhvQ2Vglz572dq; Wed, 17 Jan 2024 23:30: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 4TFhvQ22ylz4K5N; Wed, 17 Jan 2024 23:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705534242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rubHbPevEt7rxFZHB/2X4LjEh3AXiQBSZtXTo+JuOr0=; b=XlQNX1y0dO9XZn/5JOE/WyrHOYDlWe8kbhui9u2HJchGooALMW4doMNw/BVcFE/WhA6xW8 zGimi9R6ijtK3if3kqPAFaiPdVz7Z/VgQHvTisD4UXX9HpQNN2Doi0iX5McmEiK3hGyUGM 91hL8z36tY7tnQtWPiFFZuFFsq6WZ6al6s5fRf38kMMOyCBgQEpmjlQZXKXqK9bI2F96px 9YOt298PtsxEFmUS16HGPF5JywK6GU8g3dm6j6KC33BXMDzivoCsleuRJlAddUVi/veykV yB30dVrB2KddlAGNV8czIP7WxsjsQV8swCRsauMnwNiVe0spBI7q8t2gi/S0mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705534242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rubHbPevEt7rxFZHB/2X4LjEh3AXiQBSZtXTo+JuOr0=; b=YIi40j1UPSVqwzifQfumKPf6ho0d83cqd9t8ClbMIFAnOp10zI7uacEbUFo6mvatfW3F7n oeCZpiaJert93/DKU6dWXFzutZwCJXWGrv1S/LwJbIF+FcHZWEZzByg+3NP1NV1bKPbYJO gTF8H/UTBBGfD8NfExUaiCXdVGK98OPCAQmqhslgVSLjRaqruq05vU2rcW05kwFuMPzt6l IROdr6P5zHahPACbrvY0mCRdNaf9fd9mCekGB3PVGB/jlVXYJvIILroreYVNXAFgfUU9hb qZvzNOpaWmE7yQ+yahpkT2tW+Ok2BiNymdDEpoT0cz4mvlFSdhPavLOppVwcUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705534242; a=rsa-sha256; cv=none; b=uya8oQdISZ15QK4mCnWFWrqiIMC9lT+hYTJw4YlVR6MNPViqNf8OGtXfo/ZwaWAL6BhnLj xuPYK40Sv3EqUccCKzLKhQnK+LfmPdUg9pjdPbJp1PEAs4MYiSaH7aarYKu58vpi4rptRd 6FLurZzyKplpvZceIQn8yCJQ0ZCMHGhfCE5DMLQvKhHfKM88SjkQ58idjVL78YJHYYG2mr e6KCSvXfgTvEcGkMBwEPwAjrk0C4BUj65qUhcaLaoRWvVKU2LYiSQ0ikeyU+wp1bDOI4Vt /0/Wi3otrREqTxeq/TaKIiv0ZmpHo2Ej8u+nmzpVEJUVCN8Id0+NPWgG3rmrzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFhvQ188tzjwj; Wed, 17 Jan 2024 23:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HNUg5H078588; Wed, 17 Jan 2024 23:30:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HNUg1q078585; Wed, 17 Jan 2024 23:30:42 GMT (envelope-from git) Date: Wed, 17 Jan 2024 23:30:42 GMT Message-Id: <202401172330.40HNUg1q078585@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: 7a4d1d1df0b2 - main - if_wg: fix access to noise_local->l_has_identity and l_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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a4d1d1df0b2e369adcb32aea9ef8c180f885751 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7a4d1d1df0b2e369adcb32aea9ef8c180f885751 commit 7a4d1d1df0b2e369adcb32aea9ef8c180f885751 Author: Aaron LI AuthorDate: 2024-01-17 23:29:23 +0000 Commit: Kyle Evans CommitDate: 2024-01-17 23:29:54 +0000 if_wg: fix access to noise_local->l_has_identity and l_private These members are protected by the identity lock, so rlock it in noise_remote_alloc() and then assert that we have it held to some extent in noise_precompute_ss(). PR: 276392 --- sys/dev/wg/wg_noise.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/wg/wg_noise.c b/sys/dev/wg/wg_noise.c index 3db74ac9580f..a727a2f99d15 100644 --- a/sys/dev/wg/wg_noise.c +++ b/sys/dev/wg/wg_noise.c @@ -281,6 +281,7 @@ noise_local_keys(struct noise_local *l, uint8_t public[NOISE_PUBLIC_KEY_LEN], static void noise_precompute_ss(struct noise_local *l, struct noise_remote *r) { + rw_assert(&l->l_identity_lock, RA_LOCKED); rw_wlock(&r->r_handshake_lock); if (!l->l_has_identity || !curve25519(r->r_ss, l->l_private, r->r_public)) @@ -302,7 +303,10 @@ noise_remote_alloc(struct noise_local *l, void *arg, r->r_handshake_state = HANDSHAKE_DEAD; r->r_last_sent = TIMER_RESET; r->r_last_init_recv = TIMER_RESET; + + rw_rlock(&l->l_identity_lock); noise_precompute_ss(l, r); + rw_runlock(&l->l_identity_lock); refcount_init(&r->r_refcnt, 1); r->r_local = noise_local_ref(l); From nobody Thu Jan 18 07:48:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFvyJ19M2z57l2b; Thu, 18 Jan 2024 07:48: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 4TFvyJ0fQzz40RZ; Thu, 18 Jan 2024 07:48:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705564136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6imuKq6bLtrekeF0s+rQ53fVntQ8X6fbhqobrv2a4tM=; b=yjP6wwpPdeAH5RcggILCZcVsV5ZjHN5dd2/2UBBzNlOfzMtbX0F+Njf5a60V5L/4JJGFC8 nRVp/UDsrBH0Tg7a6dcQ/IMz4lPHiDOQPIvh3GjBby3HZdXXFGqwt7tyIdHGa3+TN5ny7b VyK2uF02n31gdYtpHJWLfZyyahlapUCHY4flkMw9eP/AksMUkicPxdBGG/0gC0Anz2ayLA fc09yokXiePEaUwrW6QmAUXVflO4p4jI3Paikfe/I0V/UPJPYBHyOGZl/9vGHCRhRWoDif b7mCdMg/l2Nb8tNhHhz6o/4aZRNiOERKiyX0+0A1102Lqaf4cDgB8+tLHPk9oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705564136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6imuKq6bLtrekeF0s+rQ53fVntQ8X6fbhqobrv2a4tM=; b=A2uj6Bk50wd7UeqiPFxfn6MlscR4YE8OCcrJOgag0DLzKpFyg3EahTwZxKhSpXO3QK+g+B Imnk9bPQCd5F4qfr6CcB/gj5nmU5IP69YhP2YIYH86Vg15lHRgtu/X5RGqWeL3bLZbTUnE 3hLkzSShMIUQ4OCP3N/DmiGWpiV8E5eDUk3SV3l7NjfRi3+uztDkQMkL3Q2pi1TpfVSPTH 4tO9i5qeMhK/f7es6DlpDXv+rHe2cpus/xLghuzYsAL/OX6oH0RrOtHwZIWS0I3kBErcd9 Pp0i/r/gw1pcVQWAy9M4EjQykFNXxK0IhiJZy12tlhooMI20EM1HRVQIm94L2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705564136; a=rsa-sha256; cv=none; b=ZcUH7Ew+Kbq7TOHNCWyN2s95ZwrZYE72W7lPs6WUocl0EkH2o4ANy5655kciV8Fzd6+yPw 6PuuWREvkw5AhB+UOZic5ByHFu+nFftmbB9B98LAVCxCk842Tb0gzcUTLyzDmHD8Asm9wO K895QuEPH8MLrE41FR3JdXzP65rEJiKDvK+0g7xLaTPxkVM/TVkoTKioq6vU1rD/JBB28y GQCL61Xd8WBbLvKrGkkrlS5Hs6lew15U7WjEDlcjwm4fsbTFMv4hAAdvxCVnR2W3lXAsil EOekI3Mdh870Hb77yRoDqHIurSohR3pWKrBgMp4W1tZOL1WUFggqOeD9i8HJOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TFvyH6phbzyg6; Thu, 18 Jan 2024 07:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40I7mtU4008176; Thu, 18 Jan 2024 07:48:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40I7mt58008173; Thu, 18 Jan 2024 07:48:55 GMT (envelope-from git) Date: Thu, 18 Jan 2024 07:48:55 GMT Message-Id: <202401180748.40I7mt58008173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 476d63e091c2 - main - kerberos: Fix numerous segfaults when using weak crypto List-Id: Commit messages for the main 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: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 476d63e091c2e663b51d18acf6acb282e1f22bbc Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=476d63e091c2e663b51d18acf6acb282e1f22bbc commit 476d63e091c2e663b51d18acf6acb282e1f22bbc Author: Cy Schubert AuthorDate: 2023-12-06 15:30:05 +0000 Commit: Cy Schubert CommitDate: 2024-01-18 07:46:57 +0000 kerberos: Fix numerous segfaults when using weak crypto Weak crypto is provided by the openssl legacy provider which is not load by default. Load the legacy providers as needed. When the legacy provider is loaded into the default context the default provider will no longer be automatically loaded. Without the default provider the various kerberos applicaions and functions will abort(). This is the second attempt at this patch. Instead of linking secure/lib/libcrypto at build time we now link it at runtime, avoiding buildworld failures under Linux and MacOS. This is because TARGET_ENDIANNESS is undefined at pre-build time. PR: 272835 MFC after: 3 days X-MFC: only to stable/14 Tested by: netchild Joerg Pulz (previous version) --- crypto/heimdal/lib/kadm5/create_s.c | 4 ++ crypto/heimdal/lib/kadm5/kadm5_locl.h | 1 + crypto/heimdal/lib/krb5/context.c | 4 ++ crypto/heimdal/lib/krb5/crypto.c | 3 + crypto/heimdal/lib/krb5/salt.c | 5 ++ crypto/heimdal/lib/roken/version-script.map | 1 + kerberos5/include/crypto-headers.h | 4 ++ kerberos5/include/fbsd_ossl_provider.h | 4 ++ kerberos5/lib/libroken/Makefile | 8 ++- kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 77 ++++++++++++++++++++++++ 10 files changed, 109 insertions(+), 2 deletions(-) diff --git a/crypto/heimdal/lib/kadm5/create_s.c b/crypto/heimdal/lib/kadm5/create_s.c index 1033ca103239..267e9bbda2a0 100644 --- a/crypto/heimdal/lib/kadm5/create_s.c +++ b/crypto/heimdal/lib/kadm5/create_s.c @@ -169,6 +169,10 @@ kadm5_s_create_principal(void *server_handle, ent.entry.keys.len = 0; ent.entry.keys.val = NULL; + ret = fbsd_ossl_provider_load(); + if (ret) + goto out; + ret = _kadm5_set_keys(context, &ent.entry, password); if (ret) goto out; diff --git a/crypto/heimdal/lib/kadm5/kadm5_locl.h b/crypto/heimdal/lib/kadm5/kadm5_locl.h index 68b6a5ebf024..63b367ab7e21 100644 --- a/crypto/heimdal/lib/kadm5/kadm5_locl.h +++ b/crypto/heimdal/lib/kadm5/kadm5_locl.h @@ -79,5 +79,6 @@ #include #include #include "private.h" +#include "fbsd_ossl_provider.h" #endif /* __KADM5_LOCL_H__ */ diff --git a/crypto/heimdal/lib/krb5/context.c b/crypto/heimdal/lib/krb5/context.c index 86bfe539b974..681bc9a0982f 100644 --- a/crypto/heimdal/lib/krb5/context.c +++ b/crypto/heimdal/lib/krb5/context.c @@ -392,6 +392,10 @@ krb5_init_context(krb5_context *context) } HEIMDAL_MUTEX_init(p->mutex); + ret = fbsd_ossl_provider_load(); + if(ret) + goto out; + p->flags |= KRB5_CTX_F_HOMEDIR_ACCESS; ret = krb5_get_default_config_files(&files); diff --git a/crypto/heimdal/lib/krb5/crypto.c b/crypto/heimdal/lib/krb5/crypto.c index 67ecef62e875..6ee22609a4d5 100644 --- a/crypto/heimdal/lib/krb5/crypto.c +++ b/crypto/heimdal/lib/krb5/crypto.c @@ -2054,6 +2054,9 @@ krb5_crypto_init(krb5_context context, *crypto = NULL; return ret; } + ret = fbsd_ossl_provider_load(); + if (ret) + return ret; (*crypto)->key.schedule = NULL; (*crypto)->num_key_usage = 0; (*crypto)->key_usage = NULL; diff --git a/crypto/heimdal/lib/krb5/salt.c b/crypto/heimdal/lib/krb5/salt.c index 5e4c8a1c8572..2b1fbee80ab6 100644 --- a/crypto/heimdal/lib/krb5/salt.c +++ b/crypto/heimdal/lib/krb5/salt.c @@ -43,6 +43,8 @@ krb5_salttype_to_string (krb5_context context, struct _krb5_encryption_type *e; struct salt_type *st; + (void) fbsd_ossl_provider_load(); + e = _krb5_find_enctype (etype); if (e == NULL) { krb5_set_error_message(context, KRB5_PROG_ETYPE_NOSUPP, @@ -75,6 +77,8 @@ krb5_string_to_salttype (krb5_context context, struct _krb5_encryption_type *e; struct salt_type *st; + (void) fbsd_ossl_provider_load(); + e = _krb5_find_enctype (etype); if (e == NULL) { krb5_set_error_message(context, KRB5_PROG_ETYPE_NOSUPP, @@ -196,6 +200,7 @@ krb5_string_to_key_data_salt_opaque (krb5_context context, enctype); return KRB5_PROG_ETYPE_NOSUPP; } + (void) fbsd_ossl_provider_load(); for(st = et->keytype->string_to_key; st && st->type; st++) if(st->type == salt.salttype) return (*st->string_to_key)(context, enctype, password, diff --git a/crypto/heimdal/lib/roken/version-script.map b/crypto/heimdal/lib/roken/version-script.map index 72d2ea7e4f7c..bb2139ed74cc 100644 --- a/crypto/heimdal/lib/roken/version-script.map +++ b/crypto/heimdal/lib/roken/version-script.map @@ -13,6 +13,7 @@ HEIMDAL_ROKEN_1.0 { ct_memcmp; err; errx; + fbsd_ossl_provider_load; free_getarg_strings; get_default_username; get_window_size; diff --git a/kerberos5/include/crypto-headers.h b/kerberos5/include/crypto-headers.h index 3ae0d9624ffd..2cc870642964 100644 --- a/kerberos5/include/crypto-headers.h +++ b/kerberos5/include/crypto-headers.h @@ -17,5 +17,9 @@ #include #include #include +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) +#include +#include "fbsd_ossl_provider.h" +#endif #endif /* __crypto_headers_h__ */ diff --git a/kerberos5/include/fbsd_ossl_provider.h b/kerberos5/include/fbsd_ossl_provider.h new file mode 100644 index 000000000000..013983ca9f83 --- /dev/null +++ b/kerberos5/include/fbsd_ossl_provider.h @@ -0,0 +1,4 @@ +#ifndef __fbsd_ossl_provider_h +#define __fbsd_ossl_provider_h +int fbsd_ossl_provider_load(void); +#endif diff --git a/kerberos5/lib/libroken/Makefile b/kerberos5/lib/libroken/Makefile index 0c46ba6c4cb5..ca6d090e64f0 100644 --- a/kerberos5/lib/libroken/Makefile +++ b/kerberos5/lib/libroken/Makefile @@ -74,9 +74,13 @@ SRCS= base64.c \ vis.c \ warnerr.c \ write_pid.c \ - xfree.c + xfree.c \ + fbsd_ossl_provider_load.c -CFLAGS+=-I${KRB5DIR}/lib/roken -I. +CFLAGS+=-I${KRB5DIR}/lib/roken \ + -I${SRCTOP}/kerberos5/include \ + -I${KRB5DIR}/lib/krb5 \ + -I${SRCTOP}/crypto/openssl/include -I. CLEANFILES= roken.h diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c new file mode 100644 index 000000000000..497b32124f96 --- /dev/null +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include + +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) +static void fbsd_ossl_provider_unload(void); +static void print_dlerror(char *); +static OSSL_PROVIDER *legacy; +static OSSL_PROVIDER *deflt; +static int providers_loaded = 0; +static OSSL_PROVIDER * (*ossl_provider_load)(OSSL_LIB_CTX *, const char*) = NULL; +static int (*ossl_provider_unload)(OSSL_PROVIDER *) = NULL; +static void *crypto_lib_handle = NULL; + +static void +fbsd_ossl_provider_unload(void) +{ + if (ossl_provider_unload == NULL) { + if (!(ossl_provider_unload = (int (*)(OSSL_PROVIDER*)) dlsym(crypto_lib_handle, "OSSL_PROVIDER_unload"))) { + print_dlerror("Unable to link OSSL_PROVIDER_unload"); + return; + } + } + if (providers_loaded == 1) { + (*ossl_provider_unload)(legacy); + (*ossl_provider_unload)(deflt); + providers_loaded = 0; + } +} + +static void +print_dlerror(char *message) +{ + char *errstr; + + if ((errstr = dlerror()) != NULL) + fprintf(stderr, "%s: %s\n", + message, errstr); +} +#endif + +int +fbsd_ossl_provider_load(void) +{ +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) + if (crypto_lib_handle == NULL) { + if (!(crypto_lib_handle = dlopen("/usr/lib/libcrypto.so", + RTLD_LAZY|RTLD_GLOBAL))) { + print_dlerror("Unable to load libcrypto.so"); + return (EINVAL); + } + } + if (ossl_provider_load == NULL) { + if (!(ossl_provider_load = (OSSL_PROVIDER * (*)(OSSL_LIB_CTX*, const char *)) dlsym(crypto_lib_handle, "OSSL_PROVIDER_load"))) { + print_dlerror("Unable to link OSSL_PROVIDER_load"); + return(ENOENT); + } + } + + if (providers_loaded == 0) { + if ((legacy = (*ossl_provider_load)(NULL, "legacy")) == NULL) + return (EINVAL); + if ((deflt = (*ossl_provider_load)(NULL, "default")) == NULL) { + (*ossl_provider_unload)(legacy); + return (EINVAL); + } + if (atexit(fbsd_ossl_provider_unload)) { + fbsd_ossl_provider_unload(); + return (errno); + } + providers_loaded = 1; + } +#endif + return (0); +} From nobody Thu Jan 18 08:03:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFwH52jB8z57mMG for ; Thu, 18 Jan 2024 08:03:29 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.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 4TFwH470WDz41rj for ; Thu, 18 Jan 2024 08:03:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40e86a9fbd9so22650215e9.1 for ; Thu, 18 Jan 2024 00:03:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705565002; x=1706169802; 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=aqRe+TolKcjGqYGOim8ehbHUp7FOUnM+4p7X8FD4gDc=; b=sxUVnAlkGgz4eGHprh/8U5OSmG3mxOrnsVMUYCfn981pe4ZVijeTxCQKqEXHfs2WXb 7EZKXgpxfm7PMjATa36nFdQqoqXUa36Bz3RTMdlGT5KpROSB76U8EZUgi+yfHd+Vf8bL /8QPkVVVaJcMn6pk7gwJ8a7Q4ODADsnop9+kWnkcpLRYejsgNf9e+IfOrvPFCYNZzHTW dQpkKglsm/XTMiJ7n6TS2v0+N4bnB6DOrtD08DRSRENGVtmgiToi48uf4/xxWYlet2U0 ZKLRA9t4F5LHUwtvAXUFzpjZKwoUhKQkZtjaKsboWg4dEYdjb6mGHo51XpyGT24KYsa9 EqcQ== X-Gm-Message-State: AOJu0YxYoN+ASIwvLQQI7+iDiIlDM6kMY1NR7qakMEWu7jkt3YDFNGpn aMZoTkWtR79cb0dY8TPz45sov5C48XtJmXJRTs/lN4tXeg8T/NJqf2TmOrkFnE4= X-Google-Smtp-Source: AGHT+IGT1OtKbOl6mIkpwTRCwrnAT2t3yABAjEgB4y4M95uIHJh9jlCRWs9gogoBiFJ/gFB7OFyE1Q== X-Received: by 2002:a1c:7919:0:b0:40d:4e28:43e8 with SMTP id l25-20020a1c7919000000b0040d4e2843e8mr243931wme.167.1705565001772; Thu, 18 Jan 2024 00:03:21 -0800 (PST) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id q8-20020a7bce88000000b0040c11fbe581sm24431581wmj.27.2024.01.18.00.03.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 00:03:21 -0800 (PST) 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 \(3774.200.91.1.1\)) Subject: Re: git: 476d63e091c2 - main - kerberos: Fix numerous segfaults when using weak crypto From: Jessica Clarke In-Reply-To: <202401180748.40I7mt58008173@gitrepo.freebsd.org> Date: Thu, 18 Jan 2024 08:03:10 +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: <202401180748.40I7mt58008173@gitrepo.freebsd.org> To: Cy Schubert X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Rspamd-Queue-Id: 4TFwH470WDz41rj X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 18 Jan 2024, at 07:48, Cy Schubert wrote: >=20 > The branch main has been updated by cy: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D476d63e091c2e663b51d18acf6acb282= e1f22bbc >=20 > commit 476d63e091c2e663b51d18acf6acb282e1f22bbc > Author: Cy Schubert > AuthorDate: 2023-12-06 15:30:05 +0000 > Commit: Cy Schubert > CommitDate: 2024-01-18 07:46:57 +0000 >=20 > kerberos: Fix numerous segfaults when using weak crypto >=20 > Weak crypto is provided by the openssl legacy provider which is > not load by default. Load the legacy providers as needed. >=20 > When the legacy provider is loaded into the default context the = default > provider will no longer be automatically loaded. Without the = default > provider the various kerberos applicaions and functions will = abort(). >=20 > This is the second attempt at this patch. Instead of linking > secure/lib/libcrypto at build time we now link it at runtime, = avoiding > buildworld failures under Linux and MacOS. This is because > TARGET_ENDIANNESS is undefined at pre-build time. >=20 > PR: 272835 > MFC after: 3 days > X-MFC: only to stable/14 > Tested by: netchild > Joerg Pulz (previous = version) > --- > crypto/heimdal/lib/kadm5/create_s.c | 4 ++ > crypto/heimdal/lib/kadm5/kadm5_locl.h | 1 + > crypto/heimdal/lib/krb5/context.c | 4 ++ > crypto/heimdal/lib/krb5/crypto.c | 3 + > crypto/heimdal/lib/krb5/salt.c | 5 ++ > crypto/heimdal/lib/roken/version-script.map | 1 + > kerberos5/include/crypto-headers.h | 4 ++ > kerberos5/include/fbsd_ossl_provider.h | 4 ++ > kerberos5/lib/libroken/Makefile | 8 ++- > kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 77 = ++++++++++++++++++++++++ > 10 files changed, 109 insertions(+), 2 deletions(-) >=20 > diff --git a/crypto/heimdal/lib/kadm5/create_s.c = b/crypto/heimdal/lib/kadm5/create_s.c > index 1033ca103239..267e9bbda2a0 100644 > --- a/crypto/heimdal/lib/kadm5/create_s.c > +++ b/crypto/heimdal/lib/kadm5/create_s.c > @@ -169,6 +169,10 @@ kadm5_s_create_principal(void *server_handle, > ent.entry.keys.len =3D 0; > ent.entry.keys.val =3D NULL; >=20 > + ret =3D fbsd_ossl_provider_load(); > + if (ret) > + goto out; > + > ret =3D _kadm5_set_keys(context, &ent.entry, password); > if (ret) > goto out; > diff --git a/crypto/heimdal/lib/kadm5/kadm5_locl.h = b/crypto/heimdal/lib/kadm5/kadm5_locl.h > index 68b6a5ebf024..63b367ab7e21 100644 > --- a/crypto/heimdal/lib/kadm5/kadm5_locl.h > +++ b/crypto/heimdal/lib/kadm5/kadm5_locl.h > @@ -79,5 +79,6 @@ > #include > #include > #include "private.h" > +#include "fbsd_ossl_provider.h" >=20 > #endif /* __KADM5_LOCL_H__ */ > diff --git a/crypto/heimdal/lib/krb5/context.c = b/crypto/heimdal/lib/krb5/context.c > index 86bfe539b974..681bc9a0982f 100644 > --- a/crypto/heimdal/lib/krb5/context.c > +++ b/crypto/heimdal/lib/krb5/context.c > @@ -392,6 +392,10 @@ krb5_init_context(krb5_context *context) > } > HEIMDAL_MUTEX_init(p->mutex); >=20 > + ret =3D fbsd_ossl_provider_load(); > + if(ret) > + goto out; > + > p->flags |=3D KRB5_CTX_F_HOMEDIR_ACCESS; >=20 > ret =3D krb5_get_default_config_files(&files); > diff --git a/crypto/heimdal/lib/krb5/crypto.c = b/crypto/heimdal/lib/krb5/crypto.c > index 67ecef62e875..6ee22609a4d5 100644 > --- a/crypto/heimdal/lib/krb5/crypto.c > +++ b/crypto/heimdal/lib/krb5/crypto.c > @@ -2054,6 +2054,9 @@ krb5_crypto_init(krb5_context context, > *crypto =3D NULL; > return ret; > } > + ret =3D fbsd_ossl_provider_load(); > + if (ret) > + return ret; > (*crypto)->key.schedule =3D NULL; > (*crypto)->num_key_usage =3D 0; > (*crypto)->key_usage =3D NULL; > diff --git a/crypto/heimdal/lib/krb5/salt.c = b/crypto/heimdal/lib/krb5/salt.c > index 5e4c8a1c8572..2b1fbee80ab6 100644 > --- a/crypto/heimdal/lib/krb5/salt.c > +++ b/crypto/heimdal/lib/krb5/salt.c > @@ -43,6 +43,8 @@ krb5_salttype_to_string (krb5_context context, > struct _krb5_encryption_type *e; > struct salt_type *st; >=20 > + (void) fbsd_ossl_provider_load(); > + > e =3D _krb5_find_enctype (etype); > if (e =3D=3D NULL) { > krb5_set_error_message(context, KRB5_PROG_ETYPE_NOSUPP, > @@ -75,6 +77,8 @@ krb5_string_to_salttype (krb5_context context, > struct _krb5_encryption_type *e; > struct salt_type *st; >=20 > + (void) fbsd_ossl_provider_load(); > + > e =3D _krb5_find_enctype (etype); > if (e =3D=3D NULL) { > krb5_set_error_message(context, KRB5_PROG_ETYPE_NOSUPP, > @@ -196,6 +200,7 @@ krb5_string_to_key_data_salt_opaque (krb5_context = context, > enctype); > return KRB5_PROG_ETYPE_NOSUPP; > } > + (void) fbsd_ossl_provider_load(); > for(st =3D et->keytype->string_to_key; st && st->type; st++) > if(st->type =3D=3D salt.salttype) > return (*st->string_to_key)(context, enctype, password, > diff --git a/crypto/heimdal/lib/roken/version-script.map = b/crypto/heimdal/lib/roken/version-script.map > index 72d2ea7e4f7c..bb2139ed74cc 100644 > --- a/crypto/heimdal/lib/roken/version-script.map > +++ b/crypto/heimdal/lib/roken/version-script.map > @@ -13,6 +13,7 @@ HEIMDAL_ROKEN_1.0 { > ct_memcmp; > err; > errx; > + fbsd_ossl_provider_load; > free_getarg_strings; > get_default_username; > get_window_size; > diff --git a/kerberos5/include/crypto-headers.h = b/kerberos5/include/crypto-headers.h > index 3ae0d9624ffd..2cc870642964 100644 > --- a/kerberos5/include/crypto-headers.h > +++ b/kerberos5/include/crypto-headers.h > @@ -17,5 +17,9 @@ > #include > #include > #include > +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > +#include > +#include "fbsd_ossl_provider.h" > +#endif >=20 > #endif /* __crypto_headers_h__ */ > diff --git a/kerberos5/include/fbsd_ossl_provider.h = b/kerberos5/include/fbsd_ossl_provider.h > new file mode 100644 > index 000000000000..013983ca9f83 > --- /dev/null > +++ b/kerberos5/include/fbsd_ossl_provider.h > @@ -0,0 +1,4 @@ > +#ifndef __fbsd_ossl_provider_h > +#define __fbsd_ossl_provider_h > +int fbsd_ossl_provider_load(void); > +#endif > diff --git a/kerberos5/lib/libroken/Makefile = b/kerberos5/lib/libroken/Makefile > index 0c46ba6c4cb5..ca6d090e64f0 100644 > --- a/kerberos5/lib/libroken/Makefile > +++ b/kerberos5/lib/libroken/Makefile > @@ -74,9 +74,13 @@ SRCS=3D base64.c \ > vis.c \ > warnerr.c \ > write_pid.c \ > - xfree.c > + xfree.c \ > + fbsd_ossl_provider_load.c >=20 > -CFLAGS+=3D-I${KRB5DIR}/lib/roken -I. > +CFLAGS+=3D-I${KRB5DIR}/lib/roken \ > + -I${SRCTOP}/kerberos5/include \ > + -I${KRB5DIR}/lib/krb5 \ > + -I${SRCTOP}/crypto/openssl/include -I. >=20 > CLEANFILES=3D roken.h >=20 > diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c = b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > new file mode 100644 > index 000000000000..497b32124f96 > --- /dev/null > +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > @@ -0,0 +1,77 @@ > +#include > +#include > +#include > +#include > +#include > + > +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > +static void fbsd_ossl_provider_unload(void); > +static void print_dlerror(char *); > +static OSSL_PROVIDER *legacy; > +static OSSL_PROVIDER *deflt; > +static int providers_loaded =3D 0; > +static OSSL_PROVIDER * (*ossl_provider_load)(OSSL_LIB_CTX *, const = char*) =3D NULL; > +static int (*ossl_provider_unload)(OSSL_PROVIDER *) =3D NULL; > +static void *crypto_lib_handle =3D NULL; > + > +static void > +fbsd_ossl_provider_unload(void) > +{ > + if (ossl_provider_unload =3D=3D NULL) { > + if (!(ossl_provider_unload =3D (int (*)(OSSL_PROVIDER*)) = dlsym(crypto_lib_handle, "OSSL_PROVIDER_unload"))) { > + print_dlerror("Unable to link OSSL_PROVIDER_unload"); > + return; > + } > + } > + if (providers_loaded =3D=3D 1) { > + (*ossl_provider_unload)(legacy); > + (*ossl_provider_unload)(deflt); > + providers_loaded =3D 0; > + } > +} > + > +static void > +print_dlerror(char *message) > +{ > + char *errstr; > + > + if ((errstr =3D dlerror()) !=3D NULL) > + fprintf(stderr, "%s: %s\n", > + message, errstr); > +} > +#endif > + > +int > +fbsd_ossl_provider_load(void) > +{ > +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > + if (crypto_lib_handle =3D=3D NULL) { > + if (!(crypto_lib_handle =3D dlopen("/usr/lib/libcrypto.so", Doesn=E2=80=99t this need to account for libcompat? And probably best to = use the full soname here so old binaries don=E2=80=99t use newer = incompatible libraries (or new use old)? At which point can you not just drop the path and use the file name on its own? That is, I would expect this to be just "libcrypto.so.30". Also you can direct link just fine so long as bootstrapping turns it off, so you can simplify this unless there are other motivating reasons for using dlopen. Jess > + RTLD_LAZY|RTLD_GLOBAL))) { > + print_dlerror("Unable to load libcrypto.so"); > + return (EINVAL); > + } > + } > + if (ossl_provider_load =3D=3D NULL) { > + if (!(ossl_provider_load =3D (OSSL_PROVIDER * (*)(OSSL_LIB_CTX*, = const char *)) dlsym(crypto_lib_handle, "OSSL_PROVIDER_load"))) { > + print_dlerror("Unable to link OSSL_PROVIDER_load"); > + return(ENOENT); > + } > + } > + > + if (providers_loaded =3D=3D 0) { > + if ((legacy =3D (*ossl_provider_load)(NULL, "legacy")) =3D=3D NULL) > + return (EINVAL); > + if ((deflt =3D (*ossl_provider_load)(NULL, "default")) =3D=3D NULL) = { > + (*ossl_provider_unload)(legacy); > + return (EINVAL); > + } > + if (atexit(fbsd_ossl_provider_unload)) { > + fbsd_ossl_provider_unload(); > + return (errno); > + } > + providers_loaded =3D 1; > + } > +#endif > + return (0); > +} From nobody Thu Jan 18 08:16:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TFwZH18DLz57nYc; Thu, 18 Jan 2024 08:16:39 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TFwZG5JjYz432d; Thu, 18 Jan 2024 08:16:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id Q6oyrrcHoGAIJQNZlrfbAV; Thu, 18 Jan 2024 08:16:37 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id QNZkrxrVIZR3lQNZlr0Nhf; Thu, 18 Jan 2024 08:16:37 +0000 X-Authority-Analysis: v=2.4 cv=Lo2Bd1Rc c=1 sm=1 tr=0 ts=65a8de65 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=dEuoMetlWLkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=hqGvTmuFqozcHbYXOTQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 1F10CA2F; Thu, 18 Jan 2024 00:16:36 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 15DB9178; Thu, 18 Jan 2024 00:16:36 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Jessica Clarke cc: Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 476d63e091c2 - main - kerberos: Fix numerous segfaults when using weak crypto In-reply-to: References: <202401180748.40I7mt58008173@gitrepo.freebsd.org> Comments: In-reply-to Jessica Clarke message dated "Thu, 18 Jan 2024 08:03:10 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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 Date: Thu, 18 Jan 2024 00:16:36 -0800 Message-Id: <20240118081636.15DB9178@slippy.cwsent.com> X-CMAE-Envelope: MS4xfHFLbXreRqcHwEzYKmc4fk6Fum6dkbyRfWbBX0eJqySn2Lq7JQChs+GYELpNZz8Ro1z3oBFsjRrX3aTmRYHzH9ak26WqLX7Rq9ZPzkT32illK/pOJfYR 5AHcZG2VfW9iUmeqH02r31o+vzB4y0zKsf0CdeBgJPQxIleCr53WkYTZJwismRzKk/eBDmlPqV6jz6jI7SQ1RJ13MTpb8DK3NiUxnkT/DdmPLMG6G8p2GZ+o n0xy3tocQGPZRPSln0topTxyDSIURTpsSIsKNC3TEn5NTtaV3zTpBzPxPUkl0QkBETiWo+Ny3UCOR3f4OXj8ESOoCRkyJgjmlxoYNMSRcaVtx+a6349wd08/ ftCmkdhx X-Rspamd-Queue-Id: 4TFwZG5JjYz432d X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message , Jessica Clarke w rites: > On 18 Jan 2024, at 07:48, Cy Schubert wrote: > >=20 > > The branch main has been updated by cy: > >=20 > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D476d63e091c2e663b51d18acf6acb282= > e1f22bbc > >=20 > > commit 476d63e091c2e663b51d18acf6acb282e1f22bbc > > Author: Cy Schubert > > AuthorDate: 2023-12-06 15:30:05 +0000 > > Commit: Cy Schubert > > CommitDate: 2024-01-18 07:46:57 +0000 > >=20 > > kerberos: Fix numerous segfaults when using weak crypto > >=20 > > Weak crypto is provided by the openssl legacy provider which is > > not load by default. Load the legacy providers as needed. > >=20 > > When the legacy provider is loaded into the default context the = > default > > provider will no longer be automatically loaded. Without the = > default > > provider the various kerberos applicaions and functions will = > abort(). > >=20 > > This is the second attempt at this patch. Instead of linking > > secure/lib/libcrypto at build time we now link it at runtime, = > avoiding > > buildworld failures under Linux and MacOS. This is because > > TARGET_ENDIANNESS is undefined at pre-build time. > >=20 > > PR: 272835 > > MFC after: 3 days > > X-MFC: only to stable/14 > > Tested by: netchild > > Joerg Pulz (previous = > version) > > --- > > crypto/heimdal/lib/kadm5/create_s.c | 4 ++ > > crypto/heimdal/lib/kadm5/kadm5_locl.h | 1 + > > crypto/heimdal/lib/krb5/context.c | 4 ++ > > crypto/heimdal/lib/krb5/crypto.c | 3 + > > crypto/heimdal/lib/krb5/salt.c | 5 ++ > > crypto/heimdal/lib/roken/version-script.map | 1 + > > kerberos5/include/crypto-headers.h | 4 ++ > > kerberos5/include/fbsd_ossl_provider.h | 4 ++ > > kerberos5/lib/libroken/Makefile | 8 ++- > > kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 77 = > ++++++++++++++++++++++++ > > 10 files changed, 109 insertions(+), 2 deletions(-) > >=20 > > diff --git a/crypto/heimdal/lib/kadm5/create_s.c = > b/crypto/heimdal/lib/kadm5/create_s.c > > index 1033ca103239..267e9bbda2a0 100644 > > --- a/crypto/heimdal/lib/kadm5/create_s.c > > +++ b/crypto/heimdal/lib/kadm5/create_s.c > > @@ -169,6 +169,10 @@ kadm5_s_create_principal(void *server_handle, > > ent.entry.keys.len =3D 0; > > ent.entry.keys.val =3D NULL; > >=20 > > + ret =3D fbsd_ossl_provider_load(); > > + if (ret) > > + goto out; > > + > > ret =3D _kadm5_set_keys(context, &ent.entry, password); > > if (ret) > > goto out; > > diff --git a/crypto/heimdal/lib/kadm5/kadm5_locl.h = > b/crypto/heimdal/lib/kadm5/kadm5_locl.h > > index 68b6a5ebf024..63b367ab7e21 100644 > > --- a/crypto/heimdal/lib/kadm5/kadm5_locl.h > > +++ b/crypto/heimdal/lib/kadm5/kadm5_locl.h > > @@ -79,5 +79,6 @@ > > #include > > #include > > #include "private.h" > > +#include "fbsd_ossl_provider.h" > >=20 > > #endif /* __KADM5_LOCL_H__ */ > > diff --git a/crypto/heimdal/lib/krb5/context.c = > b/crypto/heimdal/lib/krb5/context.c > > index 86bfe539b974..681bc9a0982f 100644 > > --- a/crypto/heimdal/lib/krb5/context.c > > +++ b/crypto/heimdal/lib/krb5/context.c > > @@ -392,6 +392,10 @@ krb5_init_context(krb5_context *context) > > } > > HEIMDAL_MUTEX_init(p->mutex); > >=20 > > + ret =3D fbsd_ossl_provider_load(); > > + if(ret) > > + goto out; > > + > > p->flags |=3D KRB5_CTX_F_HOMEDIR_ACCESS; > >=20 > > ret =3D krb5_get_default_config_files(&files); > > diff --git a/crypto/heimdal/lib/krb5/crypto.c = > b/crypto/heimdal/lib/krb5/crypto.c > > index 67ecef62e875..6ee22609a4d5 100644 > > --- a/crypto/heimdal/lib/krb5/crypto.c > > +++ b/crypto/heimdal/lib/krb5/crypto.c > > @@ -2054,6 +2054,9 @@ krb5_crypto_init(krb5_context context, > > *crypto =3D NULL; > > return ret; > > } > > + ret =3D fbsd_ossl_provider_load(); > > + if (ret) > > + return ret; > > (*crypto)->key.schedule =3D NULL; > > (*crypto)->num_key_usage =3D 0; > > (*crypto)->key_usage =3D NULL; > > diff --git a/crypto/heimdal/lib/krb5/salt.c = > b/crypto/heimdal/lib/krb5/salt.c > > index 5e4c8a1c8572..2b1fbee80ab6 100644 > > --- a/crypto/heimdal/lib/krb5/salt.c > > +++ b/crypto/heimdal/lib/krb5/salt.c > > @@ -43,6 +43,8 @@ krb5_salttype_to_string (krb5_context context, > > struct _krb5_encryption_type *e; > > struct salt_type *st; > >=20 > > + (void) fbsd_ossl_provider_load(); > > + > > e =3D _krb5_find_enctype (etype); > > if (e =3D=3D NULL) { > > krb5_set_error_message(context, KRB5_PROG_ETYPE_NOSUPP, > > @@ -75,6 +77,8 @@ krb5_string_to_salttype (krb5_context context, > > struct _krb5_encryption_type *e; > > struct salt_type *st; > >=20 > > + (void) fbsd_ossl_provider_load(); > > + > > e =3D _krb5_find_enctype (etype); > > if (e =3D=3D NULL) { > > krb5_set_error_message(context, KRB5_PROG_ETYPE_NOSUPP, > > @@ -196,6 +200,7 @@ krb5_string_to_key_data_salt_opaque (krb5_context = > context, > > enctype); > > return KRB5_PROG_ETYPE_NOSUPP; > > } > > + (void) fbsd_ossl_provider_load(); > > for(st =3D et->keytype->string_to_key; st && st->type; st++) > > if(st->type =3D=3D salt.salttype) > > return (*st->string_to_key)(context, enctype, password, > > diff --git a/crypto/heimdal/lib/roken/version-script.map = > b/crypto/heimdal/lib/roken/version-script.map > > index 72d2ea7e4f7c..bb2139ed74cc 100644 > > --- a/crypto/heimdal/lib/roken/version-script.map > > +++ b/crypto/heimdal/lib/roken/version-script.map > > @@ -13,6 +13,7 @@ HEIMDAL_ROKEN_1.0 { > > ct_memcmp; > > err; > > errx; > > + fbsd_ossl_provider_load; > > free_getarg_strings; > > get_default_username; > > get_window_size; > > diff --git a/kerberos5/include/crypto-headers.h = > b/kerberos5/include/crypto-headers.h > > index 3ae0d9624ffd..2cc870642964 100644 > > --- a/kerberos5/include/crypto-headers.h > > +++ b/kerberos5/include/crypto-headers.h > > @@ -17,5 +17,9 @@ > > #include > > #include > > #include > > +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > > +#include > > +#include "fbsd_ossl_provider.h" > > +#endif > >=20 > > #endif /* __crypto_headers_h__ */ > > diff --git a/kerberos5/include/fbsd_ossl_provider.h = > b/kerberos5/include/fbsd_ossl_provider.h > > new file mode 100644 > > index 000000000000..013983ca9f83 > > --- /dev/null > > +++ b/kerberos5/include/fbsd_ossl_provider.h > > @@ -0,0 +1,4 @@ > > +#ifndef __fbsd_ossl_provider_h > > +#define __fbsd_ossl_provider_h > > +int fbsd_ossl_provider_load(void); > > +#endif > > diff --git a/kerberos5/lib/libroken/Makefile = > b/kerberos5/lib/libroken/Makefile > > index 0c46ba6c4cb5..ca6d090e64f0 100644 > > --- a/kerberos5/lib/libroken/Makefile > > +++ b/kerberos5/lib/libroken/Makefile > > @@ -74,9 +74,13 @@ SRCS=3D base64.c \ > > vis.c \ > > warnerr.c \ > > write_pid.c \ > > - xfree.c > > + xfree.c \ > > + fbsd_ossl_provider_load.c > >=20 > > -CFLAGS+=3D-I${KRB5DIR}/lib/roken -I. > > +CFLAGS+=3D-I${KRB5DIR}/lib/roken \ > > + -I${SRCTOP}/kerberos5/include \ > > + -I${KRB5DIR}/lib/krb5 \ > > + -I${SRCTOP}/crypto/openssl/include -I. > >=20 > > CLEANFILES=3D roken.h > >=20 > > diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c = > b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > new file mode 100644 > > index 000000000000..497b32124f96 > > --- /dev/null > > +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > @@ -0,0 +1,77 @@ > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > > +static void fbsd_ossl_provider_unload(void); > > +static void print_dlerror(char *); > > +static OSSL_PROVIDER *legacy; > > +static OSSL_PROVIDER *deflt; > > +static int providers_loaded =3D 0; > > +static OSSL_PROVIDER * (*ossl_provider_load)(OSSL_LIB_CTX *, const = > char*) =3D NULL; > > +static int (*ossl_provider_unload)(OSSL_PROVIDER *) =3D NULL; > > +static void *crypto_lib_handle =3D NULL; > > + > > +static void > > +fbsd_ossl_provider_unload(void) > > +{ > > + if (ossl_provider_unload =3D=3D NULL) { > > + if (!(ossl_provider_unload =3D (int (*)(OSSL_PROVIDER*)) = > dlsym(crypto_lib_handle, "OSSL_PROVIDER_unload"))) { > > + print_dlerror("Unable to link OSSL_PROVIDER_unload"); > > + return; > > + } > > + } > > + if (providers_loaded =3D=3D 1) { > > + (*ossl_provider_unload)(legacy); > > + (*ossl_provider_unload)(deflt); > > + providers_loaded =3D 0; > > + } > > +} > > + > > +static void > > +print_dlerror(char *message) > > +{ > > + char *errstr; > > + > > + if ((errstr =3D dlerror()) !=3D NULL) > > + fprintf(stderr, "%s: %s\n", > > + message, errstr); > > +} > > +#endif > > + > > +int > > +fbsd_ossl_provider_load(void) > > +{ > > +#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > > + if (crypto_lib_handle =3D=3D NULL) { > > + if (!(crypto_lib_handle =3D dlopen("/usr/lib/libcrypto.so", > > Doesn=E2=80=99t this need to account for libcompat? And probably best to = > use > the full soname here so old binaries don=E2=80=99t use newer = > incompatible > libraries (or new use old)? At which point can you not just drop the > path and use the file name on its own? That is, I would expect this to > be just "libcrypto.so.30". Probably yes. As long as we remember to update this when the library version number changes. > > Also you can direct link just fine so long as bootstrapping turns it > off, so you can simplify this unless there are other motivating reasons > for using dlopen. That would require some kind of bootstrap flag to be applied to libroken Makefile not to link libcrypto when bootstrapping. That would certainly be a messier proposition. > > Jess > I will add the version number for the reason you have pointed out. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jan 18 13:05:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG2zj0Yt8z58HQY; Thu, 18 Jan 2024 13:05: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 4TG2zj02Gwz4STR; Thu, 18 Jan 2024 13:05:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705583137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uH7reGf6rX+p/tmdxZv8rc3CHrEPzD0y6ncS+I/5cPU=; b=t6YpqqLJ08ECQ0gHHKM642ajx4mjZi9tWCzx7qLY/WXvoL0MnU3vtS0tBBlehR1CFp/nJd 4TSEdTxCzYY5YHj77R1DoTktDzAjpwsuW8NDh2eMS9zWWQRe96l5WkIyJz3HZuSUXBiWCv TaLIcAPQgi19o8ra2G96b/of0thbvJAuozHvvVImnl2Qd29OfF5fvO4ofe3DOiI86jbqht 1Pd7JzsUr4PTjgXPqEJzABRF0yenSgJOniFSEy4zgqwGOB87tF1a1r3INzXxhzV25kQt21 RuR23ywNra8qDQyAuLa6qeQCVIrkq2urEMyajEBofJXuizpOX8jH6ja+uO1W8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705583137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uH7reGf6rX+p/tmdxZv8rc3CHrEPzD0y6ncS+I/5cPU=; b=VOR39nfXOyjkrVQK6tiM6JjwS6d2ZBoXL8rWhAfpsqtw3YVUtLH3OPUsZgT+3yygLc+TDt Hvx/ncFulKHG+DQBvXSXBSS7yvMgqjiRdddMzPSoL7aBE/NopSQdgp0mD6mBJDBbvciAhp rvlO/x/j9LqVwv2urj38LV03/Wi+UaDhB50oZSTIEBCOJ7yKMVpgC+pbGLIL4iHrASoHyE AhxC2eb99KhayoCSNq8OwQ8AxLzFPaKibFjhpMNVFCenb4bha+YW+0Hhew/sTCAg+12nzZ 83Pb8X+EZLazi3y7hjqx0hCb6rq3WCJi0Drdx7otJlWaMH8HD2WBJlfQq5cFJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705583137; a=rsa-sha256; cv=none; b=gsmelX+plo5fNtyriPChCxuc5EBXPVe6hDuuCcNI0u1Hgz7f0szEhFV9BNgsrkfSZqtND9 qSBfP4bHMPRfGmh1bDOe8ehICXT88eFCoR0vTsl/8aEYPcRM/eg7wghkVLPvZLO/Xw7kod H4eNtGwwrbGWNJZvFSwlkGBje41EIwgVZrR8mbqaAcbMPg+vgxzhHnEeVG+aXtxvREmxZs sEioNwP78TSmpPWdwbi+xFw2o9/z/L+0Whr9aVQ7ekWExXG8wL9+p/uDRZCJjlFJ00WL7o n62zW/4dtTB2hshcE2O7AG7dXARuMFZxtVDen5LrblsArUr7M/qel7xJVihCtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG2zh65szz16wf; Thu, 18 Jan 2024 13:05:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ID5acb044338; Thu, 18 Jan 2024 13:05:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ID5aFi044335; Thu, 18 Jan 2024 13:05:36 GMT (envelope-from git) Date: Thu, 18 Jan 2024 13:05:36 GMT Message-Id: <202401181305.40ID5aFi044335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fernando =?utf-8?Q?Apestegu=C3=ADa?= Subject: git: 70445a806122 - main - cksum(1): Add EXAMPLES to manual page List-Id: Commit messages for the main 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: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70445a8061226ad46a7079ce8ad96e89ae45d6c5 Auto-Submitted: auto-generated The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/src/commit/?id=70445a8061226ad46a7079ce8ad96e89ae45d6c5 commit 70445a8061226ad46a7079ce8ad96e89ae45d6c5 Author: Fernando Apesteguía AuthorDate: 2023-09-08 12:27:59 +0000 Commit: Fernando Apesteguía CommitDate: 2024-01-18 13:04:25 +0000 cksum(1): Add EXAMPLES to manual page Approved by: bcr@ --- usr.bin/cksum/cksum.1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/usr.bin/cksum/cksum.1 b/usr.bin/cksum/cksum.1 index debd77de87ff..cd9b78c12306 100644 --- a/usr.bin/cksum/cksum.1 +++ b/usr.bin/cksum/cksum.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 28, 1995 +.Dd January 18, 2024 .Dt CKSUM 1 .Os .Sh NAME @@ -149,6 +149,20 @@ The bit sequence is complemented and the result is the CRC. .Ed .Sh EXIT STATUS .Ex -std cksum sum +.Sh EXAMPLES +Compute the checksum for all available algorithms. +Notice the difference in the size representation (in bytes for algorithm 1 and 2 +and in blocks for 3 and the default algorithm): +.Bd -literal -offset indent +$ echo "hello" | cksum +3015617425 6 +$ echo "hello" | cksum -o 1 +36979 1 +$ echo "hello" | cksum -o 2 +542 1 +$ echo "hello" | cksum -o 3 +909783072 6 +.Ed .Sh SEE ALSO .Xr md5 1 .Pp From nobody Thu Jan 18 15:23:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG63K6GNzz58Vw2; Thu, 18 Jan 2024 15:23: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 4TG63K5d5Hz4lBx; Thu, 18 Jan 2024 15:23:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705591437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E0amQI7BRhnvDVmcrpgn0IO0xfPb55fj88VQnlU0WQo=; b=OhGLB0w8AqMyP6Dx1ogyofjzIebLeSSpwuoMGMoLXV7HJ0v/SwD/9hovgWG88PleHiR7Ag mT1yMa36tAJ/Z81aYc1r8xKsVfofcNmS8CuGKxP+COrCRRBn4oIO1Je9LHV95VnZRxPi9K vk9B6sEjxudZuE6TxizZh6EMu+Uuk+LTIukAOzRg7UzRHtPVjDH7ZWvnkULksR0u1iz12i 2tsEurtt9LshbUSKNnU+hrGigvHh8MYMGQ/OmaYAPVQx2GEbfUY26hSudeMGizA/+MjLdH 9Soz0CaBySHGhruEagWsNKXLQsb2KMaJstv8b2jpdbCpAuNznzdxgN+47mCG3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705591437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E0amQI7BRhnvDVmcrpgn0IO0xfPb55fj88VQnlU0WQo=; b=si7/QT2Y6vrWYVwBkmJwiJ3w7iQteQkAYiAbdMaH1iSqV49QSf84WrnMgd69dO0KB9dKk7 vw2ecdB2ZJiy2GJJom3j1W77BpO/gX+tbuagT2cJMtJsP/DiH1vA0v2MfAxhi5ZuZiTQkk e3JUEeJAcMImGEWf9DSgPFv1JgIOC9gcINkAkqDCpDZFtUwgi0IUScMOT5775aYaYACCMR PUGzhYlUVCb4x8wiy3+hRdr3UrJ182in5GhhfqSa4DEukCYmrag2WHLzulfWBWmGPXXTRw nWn75LLEz+/lTlEcGPuAwxWQAGtGrsHseUOLoCy32kMS14XUBXMGrgmZn8tbQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705591437; a=rsa-sha256; cv=none; b=HC7H6ypHsK24Il+O1XAzqG7tsdGP+SahDWCVGSjaxtsGFxLIwyymhJz3ed7Cy5cytiAuqc Hw0ed5ZsWf1oRl8w214PDh8KGaEMX5p2G3J74KezwFjYBjjhxVfZl84SbupVX2JCxWFSr7 UbMNHAG5IVxYnvho03BioQ8Ex4gNAEkpaMdcu1N+xILcMDUT3aluMVifTgubiHszS5TEIk PYErSrF3KeP+sDMtJhHGlI5w/7unK/Mzbp29Ui6iuQLkARnelwULRm6cB2I1JbN3GaEJjj 44jdCqp8pekUyy5A4qyZsN8Q6dlH58PXsH85CLX/Ljafk0Cc2AFMha3Syri6bA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG63K4gdHz1BTx; Thu, 18 Jan 2024 15:23:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IFNvrw077595; Thu, 18 Jan 2024 15:23:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IFNvXI077592; Thu, 18 Jan 2024 15:23:57 GMT (envelope-from git) Date: Thu, 18 Jan 2024 15:23:57 GMT Message-Id: <202401181523.40IFNvXI077592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 0990136ed175 - main - kerberos5: Mitigate the possibility of using an old libcrypto List-Id: Commit messages for the main 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: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0990136ed1753ac7837206f9c5f4b83ccff6c405 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0990136ed1753ac7837206f9c5f4b83ccff6c405 commit 0990136ed1753ac7837206f9c5f4b83ccff6c405 Author: Cy Schubert AuthorDate: 2024-01-18 08:22:20 +0000 Commit: Cy Schubert CommitDate: 2024-01-18 15:12:14 +0000 kerberos5: Mitigate the possibility of using an old libcrypto By using the full library name (libcrypto.so.30) we avoid the exposure of using an old, possibly vulnerable, library. Reported by: jrtc27 MFC after: 3 days X-MFC with: 476d63e091c2 Fixes: 476d63e091c2 --- kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c index 497b32124f96..2328041bc166 100644 --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c @@ -5,6 +5,7 @@ #include #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) +#define CRYPTO_LIBRARY "/lib/libcrypto.so.30" static void fbsd_ossl_provider_unload(void); static void print_dlerror(char *); static OSSL_PROVIDER *legacy; @@ -46,7 +47,7 @@ fbsd_ossl_provider_load(void) { #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) if (crypto_lib_handle == NULL) { - if (!(crypto_lib_handle = dlopen("/usr/lib/libcrypto.so", + if (!(crypto_lib_handle = dlopen(CRYPTO_LIBRARY, RTLD_LAZY|RTLD_GLOBAL))) { print_dlerror("Unable to load libcrypto.so"); return (EINVAL); From nobody Thu Jan 18 16:27:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG7S74xW6z56QKk; Thu, 18 Jan 2024 16:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG7S737F9z4v38; Thu, 18 Jan 2024 16:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705595223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XUvV1KqFwQX9GWVWBcKdXw5+IZeCBWlI5rRQchMaiLY=; b=piV4PTUYm/ejkuxq9Wg3DC8VlrihDGK1ujgeYxWIGYZHl+pRSZfrB9YGlJpvynTzHf9Gjc 9qk3e8UY/Xoa0LEjI6lXnKYeCnQTv9zHgoA9aEWzLdg9p6bCcEZC/JC+QN4BHT5Ug7PrOV E4nHK2Y0DquiGI6AKoGnM6bOjBdO8Vu8uJ4tiARR7SoD9/gR3b5Vf+nVlpder061/DuALX ItOdJBIO4Vdn3biHs5kRUyBB6P6+mmtFMI9XxwF6bc350/HVHclCspcQB1dpK03x2TqblZ VfPa+7dOTXotOev+3T/K8AGZ4zlrC+GD2zhDXu2odpAfXr8K+RyO1gUEw1y1ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705595223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XUvV1KqFwQX9GWVWBcKdXw5+IZeCBWlI5rRQchMaiLY=; b=KE9Wy3MX4mHmVhoj001kjjrrGdeng2K8BtSvVkRER7TjvymaoCTPXOcZ56c2LooPCdZweQ Qcrrypp9dMG+NiIaXbRBK3c9zjsSfdgw5H7VCTgCQ+SPkg8yCIExYnp8Vz/cPJ8hIqpSVq Ykel/N1u1J46mXRpzEgEwwW+GsGTWLeU3n848tUcMuFLr6HhBYGkiTWOj/0qdfJHaFBWgH 2xxs0U2quNmc/Ak6vq75AHgfBLPTrCxKrGPU0Gi2lVS8TTaGh6iG8ooh+pkNifdGlQZrdk Z+9WES3OawqSI/jHZ4jD78Wswanx5bjpWrnhXO3X9qosAx3+vnAcInIcMTz/YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705595223; a=rsa-sha256; cv=none; b=CjD9oPls6AY67hJjiG8l++gNmEgUDuDInbYirYhMUA6hDZlnMH1JUDnv6gm8TjP4Ih34iq IY+cbCHyHP4U072ZRKGsJHi3H6S7B7LG1hr+KZwiQ1RGOKfpd+Gy6YQiTjwvv80MCPQRXh tTa4jf29TfE8eWAV/1GpcrQJ+Pow5RWTCgC86+2S0QI9+vKimXFX4ljxToHmUl/xURm+Vo FxGKqY5WHELjE3BN3hobuyQskhhrykhQjzZTeiK13S18AVPVoJe7pPuGc2ZjatIh763vz/ Q6pLd7ePQajldykYiAueaVtz7MPHRQadVRv9Md12Bz7+5r+TyM/hwnvCnhRtHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG7S72BZvz1Cjt; Thu, 18 Jan 2024 16:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IGR3OK078666; Thu, 18 Jan 2024 16:27:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IGR3OM078663; Thu, 18 Jan 2024 16:27:03 GMT (envelope-from git) Date: Thu, 18 Jan 2024 16:27:03 GMT Message-Id: <202401181627.40IGR3OM078663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: 6b13d60bf49e - main - contrib/kyua: Merge vendor import List-Id: Commit messages for the main 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: bofh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b13d60bf49ee40626d7e3a5d5a80519f0067307 Auto-Submitted: auto-generated The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/src/commit/?id=6b13d60bf49ee40626d7e3a5d5a80519f0067307 commit 6b13d60bf49ee40626d7e3a5d5a80519f0067307 Merge: 0990136ed175 5f174897f677 Author: Muhammad Moinur Rahman AuthorDate: 2024-01-18 16:26:13 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2024-01-18 16:26:13 +0000 contrib/kyua: Merge vendor import * commit '5f174897f67783925f4ec69122673f9bad6ee6fe': vendor/kyua: Update to snapshot 84c8ec8 Vendor import of freebsd/kyua@a0d44bb356e0c816 Approved by: markj Differential Revision: https://reviews.freebsd.org/D43475 contrib/kyua/.cirrus.yml | 25 +++ contrib/kyua/AUTHORS | 1 + contrib/kyua/admin/travis-build.sh | 2 +- contrib/kyua/cli/cmd_report_html.cpp | 5 +- contrib/kyua/doc/kyua.1.in | 5 + contrib/kyua/doc/manbuild_test.sh | 0 contrib/kyua/integration/cmd_about_test.sh | 0 contrib/kyua/integration/cmd_config_test.sh | 0 contrib/kyua/integration/cmd_db_exec_test.sh | 0 contrib/kyua/integration/cmd_db_migrate_test.sh | 0 contrib/kyua/integration/cmd_debug_test.sh | 0 contrib/kyua/integration/cmd_help_test.sh | 0 contrib/kyua/integration/cmd_list_test.sh | 0 contrib/kyua/integration/cmd_report_html_test.sh | 0 contrib/kyua/integration/cmd_report_junit_test.sh | 0 contrib/kyua/integration/cmd_report_test.sh | 0 contrib/kyua/integration/cmd_test_test.sh | 0 contrib/kyua/integration/global_test.sh | 0 contrib/kyua/integration/utils.sh | 4 +- contrib/kyua/utils/datetime.cpp | 11 +- contrib/kyua/utils/datetime_test.cpp | 10 +- contrib/kyua/utils/process/Kyuafile | 1 + contrib/kyua/utils/process/Makefile.am.inc | 5 + contrib/kyua/utils/process/executor.cpp | 58 ++++-- contrib/kyua/utils/process/executor_pid_test.cpp | 208 ++++++++++++++++++++++ 25 files changed, 304 insertions(+), 31 deletions(-) diff --cc contrib/kyua/.cirrus.yml index 000000000000,000000000000..855693b34fa1 new file mode 100644 --- /dev/null +++ b/contrib/kyua/.cirrus.yml @@@ -1,0 -1,0 +1,25 @@@ ++env: ++ ARCH: amd64 ++ ++task: ++ matrix: ++ - name: 14.0-RELEASE ++ freebsd_instance: ++ image_family: freebsd-14-0 ++ - name: 14.0-STABLE ++ freebsd_instance: ++ image_family: freebsd-14-0-snap ++ - name: 13.2-RELEASE ++ freebsd_instance: ++ image_family: freebsd-13-2 ++ - name: 13.2-STABLE ++ freebsd_instance: ++ image_family: freebsd-13-2-snap ++ env: ++ DO: distcheck ++ install_script: ++ - sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf ++ - ASSUME_ALWAYS_YES=yes pkg bootstrap -f ++ - pkg install -y autoconf automake atf lutok pkgconf sqlite3 ++ script: ++ - ./admin/travis-build.sh diff --cc contrib/kyua/doc/manbuild_test.sh index 87234324e829,87234324e829..87234324e829 mode 100755,100644..100644 --- a/contrib/kyua/doc/manbuild_test.sh +++ b/contrib/kyua/doc/manbuild_test.sh diff --cc contrib/kyua/integration/cmd_about_test.sh index 06d5da5ac4c2,06d5da5ac4c2..06d5da5ac4c2 mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_about_test.sh +++ b/contrib/kyua/integration/cmd_about_test.sh diff --cc contrib/kyua/integration/cmd_config_test.sh index ed457e5c4b37,ed457e5c4b37..ed457e5c4b37 mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_config_test.sh +++ b/contrib/kyua/integration/cmd_config_test.sh diff --cc contrib/kyua/integration/cmd_db_exec_test.sh index c260f23a78e1,c260f23a78e1..c260f23a78e1 mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_db_exec_test.sh +++ b/contrib/kyua/integration/cmd_db_exec_test.sh diff --cc contrib/kyua/integration/cmd_db_migrate_test.sh index 404a4e774019,404a4e774019..404a4e774019 mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_db_migrate_test.sh +++ b/contrib/kyua/integration/cmd_db_migrate_test.sh diff --cc contrib/kyua/integration/cmd_debug_test.sh index b34a96d72eda,b34a96d72eda..b34a96d72eda mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_debug_test.sh +++ b/contrib/kyua/integration/cmd_debug_test.sh diff --cc contrib/kyua/integration/cmd_help_test.sh index d8afbd0e6aba,d8afbd0e6aba..d8afbd0e6aba mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_help_test.sh +++ b/contrib/kyua/integration/cmd_help_test.sh diff --cc contrib/kyua/integration/cmd_list_test.sh index a916e0f2ec4b,a916e0f2ec4b..a916e0f2ec4b mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_list_test.sh +++ b/contrib/kyua/integration/cmd_list_test.sh diff --cc contrib/kyua/integration/cmd_report_html_test.sh index 9c9b4ba81c86,9c9b4ba81c86..9c9b4ba81c86 mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_report_html_test.sh +++ b/contrib/kyua/integration/cmd_report_html_test.sh diff --cc contrib/kyua/integration/cmd_report_junit_test.sh index af1a464f6004,af1a464f6004..af1a464f6004 mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_report_junit_test.sh +++ b/contrib/kyua/integration/cmd_report_junit_test.sh diff --cc contrib/kyua/integration/cmd_report_test.sh index 18a5db386dfd,18a5db386dfd..18a5db386dfd mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_report_test.sh +++ b/contrib/kyua/integration/cmd_report_test.sh diff --cc contrib/kyua/integration/cmd_test_test.sh index bc8c62daf223,bc8c62daf223..bc8c62daf223 mode 100755,100644..100644 --- a/contrib/kyua/integration/cmd_test_test.sh +++ b/contrib/kyua/integration/cmd_test_test.sh diff --cc contrib/kyua/integration/global_test.sh index 9cc8be2d1dec,9cc8be2d1dec..9cc8be2d1dec mode 100755,100644..100644 --- a/contrib/kyua/integration/global_test.sh +++ b/contrib/kyua/integration/global_test.sh diff --cc contrib/kyua/integration/utils.sh index 99565a1c9857,d1462a5a9b01..d1462a5a9b01 mode 100755,100644..100644 --- a/contrib/kyua/integration/utils.sh +++ b/contrib/kyua/integration/utils.sh diff --cc contrib/kyua/utils/process/executor_pid_test.cpp index 000000000000,22e0b90ba14b..22e0b90ba14b mode 000000,100644..100644 --- a/contrib/kyua/utils/process/executor_pid_test.cpp +++ b/contrib/kyua/utils/process/executor_pid_test.cpp From nobody Thu Jan 18 16:41:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG7mf6mBfz56Rsm; Thu, 18 Jan 2024 16:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG7mf5tkjz3x3Q; Thu, 18 Jan 2024 16:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Df2Crbtmgi4LXARGbANoWvB9ENUck2H3XitnKvv+PpE=; b=qv0OmPvjLKkIgo10aRvfrwWvPLYdFDmXMB40NIOb4exipHtm0aIpQ+ubKjk02AuNlP73Ia frq31EQ/Koy+LzvHveDw9uVTJdEmI8AcJ89LFBD4JYCzZXWU8MhlABphG+XkK5P1/1y2O0 9bh4CiLCvBND56t25Nno7G7QUxeR1PDn8wa6ssFdMZQDnKU2j8U5JzAYkuaWc7er7EdfJk c/98Kq/FerlkwzPXXU9XZ0s62GtxbwkF73vAswYZiRP+CjXh4UWDhs/bEpFsxa+deEQbWe m/kl+NlHIhf6e42Ne1OqCSKfQmZqyOBnMBLd1BnRuPGTuyDUUdS8vsn3gTekbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Df2Crbtmgi4LXARGbANoWvB9ENUck2H3XitnKvv+PpE=; b=e1/SzOVbbDxGjWC7qrvIBKtGTmUQT3pDKi8GvS5MVDoCKAh78YjiQhgI8btpoZhrZe3iH5 Stw8HjOOIVBb+jgF/ddzf3sh3fHbXS+wNDbvQPbIWF2BjwvqvWKmBWuwQ0I0A4sM35Gweq ddOiqUwnZ9Sd8e6mB8wEKbJcd7cWexs0DpMaDUs9os8gGpxQJDQNHZOv+HImdWZ4tZcDRN Q4V68xDNJqMXOytn8rFFgDoGCIe4VE9HE8AwZt5TQiz6WpnP1oDPAI2HLHI5US2V3091mg tBmzmQsvvmiYVauIcplN2M/NFsa0ujO15JJ8MsqiXdtVy704xpVNW8WZWtCTNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705596082; a=rsa-sha256; cv=none; b=BWb/bjZ4HhKZMCcXf5upi1hZoT64xWlOO6iYPmd5fJ8OzzT8+/G3/ssM8XzWYSikDdtHp+ V6OdtzHHaoZI9DoFVaE00hr2pbtoYOeXooEi+b5cJlc5i5PKNG0UCAYXy6hRbmT/dnuJtO J+Wnk30CA32sYoBE+hC+QdaqO6iml9yXavChJj1M4SRtBeSwMjMNviP3JLhWgVf9qfPSpO n4qkW5ibYO/Dgt+l5MdP2Drgqbp10gBSrueDEfK9Wj8+WUEXyzCVq+xzqwoU3OtD3LIyJ/ R11PNLLQpk8LnT6Lqnj8T7/HJkL2ax40yK+NcC8x4/qdKVNs2VUDI/MbSWHHzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG7mf4xNmzFP8; Thu, 18 Jan 2024 16:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IGfMRc005398; Thu, 18 Jan 2024 16:41:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IGfMO4005395; Thu, 18 Jan 2024 16:41:22 GMT (envelope-from git) Date: Thu, 18 Jan 2024 16:41:22 GMT Message-Id: <202401181641.40IGfMO4005395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Rabson Subject: git: 9fac39c63c12 - main - arm64: fix the handling of DDB symbols in early boot List-Id: Commit messages for the main 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: dfr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fac39c63c123f02c8022223007772bdb3bee1d3 Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=9fac39c63c123f02c8022223007772bdb3bee1d3 commit 9fac39c63c123f02c8022223007772bdb3bee1d3 Author: Doug Rabson AuthorDate: 2024-01-18 16:41:02 +0000 Commit: Doug Rabson CommitDate: 2024-01-18 16:41:02 +0000 arm64: fix the handling of DDB symbols in early boot The code which installs the kernel symbol table wasn't being compiled because the file did not include opt_ddb.h Reviewed by: kevans emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43490 --- sys/arm64/arm64/machdep_boot.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/arm64/arm64/machdep_boot.c b/sys/arm64/arm64/machdep_boot.c index 19ad2977614f..b8e0c734bbb4 100644 --- a/sys/arm64/arm64/machdep_boot.c +++ b/sys/arm64/arm64/machdep_boot.c @@ -27,6 +27,7 @@ */ #include "opt_platform.h" +#include "opt_ddb.h" #include #include @@ -48,6 +49,10 @@ #include #endif +#ifdef DDB +#include +#endif + extern int *end; static char *loader_envp; From nobody Thu Jan 18 16:48:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG7wn5jbKz56SWL; Thu, 18 Jan 2024 16:48: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 4TG7wn53fwz40hq; Thu, 18 Jan 2024 16:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RUpSOaHdLhvP4YQwWg4MX7viEDU+mjfaHo1np8F1Nr0=; b=S4ryzYRzQBuv/dmxX1BQfnmQmsf5/Qqn0VvqQ1xWpuwhqVyVvbD5DXBEmdxjy/P+XvDBOZ CptDoiJ55ZLEjhTmmUcC4+MyL1zB239+hwpWZ0SJo8Dl36zAUfVP5fMo+ExB+S+Z72WFxM 1Fy8oYtwedCBHGqh9zvoEAEstoyGS1/hYygSQaetBZ624Ov30fQNfzhav22bMe7J6UB5oX a9jkBB1+A0ivu8TyzTsWMwUdeRGKAKX1F0y58A6eubgsnhobvZYyq/1kOOrVOVRYPvDycP Aa+EeWDZ7caFZo+Pw8nMMCCv5ObYmyq4V7iwTv0SNl6XUC+KU6hjqIDRNhYj+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RUpSOaHdLhvP4YQwWg4MX7viEDU+mjfaHo1np8F1Nr0=; b=GRCNkqk+WZIPB5sroN/YSzisuThBThCkLtgGUqaqhbEPU836pDxPSDGt1D2bBmi3D36xs/ B7stRbkVXyvd0+8rOvweqEMgWTopd0xhA4ad61ENgM1kHeD55Lq3sFcvNys5aYCS9MbOZ1 CGRNXtNVSRRqzY2ILTEamb+aJsgsdaBPWpk7qJre+ViL0CmHH/xyQWIPA2D5M+quR6bTKy /40mXmqvaUf2s4eTjP22HLk6J6Ba7/54dwW9M18Ozajfhnqak9FIEoj4q1ZLTxAYcnoRlO dt/Jyb7fagnOBvcq2IILWmVa8sUmY9P76oUEaInDEvJpTJqK3GanKkIvBD9dlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705596505; a=rsa-sha256; cv=none; b=IGhNlgLgf6cIUtPO2ExMaXPcwSLILgrvZyW+FhAC4TNtURNRfE/5l7y0mRtxQcbToGrFW/ flwWXHxMeNTYQeiPymbsTmW0auGE0bjAEIRK0y6sqmtw+0XX7kS6QZq07URJ+Nu8xbz3rr Hrq9WDqhKw2yOjCfxNIitJYbexMKw6IaXsHWWRXwfudnkV1Bo22a+Gi3dyBKAQYEALFq3q 2mtv+QukxBu0ZfaZZTqWyKd4KZVlv2KWiHZcbl0RJF+1GbiyudI9g5pZHHX6Nqt87rpYK3 i9XEHrN85Mp9b3lVy23S3Y4oKDLza21Q05/rpp12XbdDOAqUS1gIKOPXfRLBgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG7wn46B5zFCF; Thu, 18 Jan 2024 16:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IGmPlW013088; Thu, 18 Jan 2024 16:48:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IGmPmk013085; Thu, 18 Jan 2024 16:48:25 GMT (envelope-from git) Date: Thu, 18 Jan 2024 16:48:25 GMT Message-Id: <202401181648.40IGmPmk013085@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: be0df84849ff - main - msdosfs_rename(): handle errors from msdosfs_lookup_ino() List-Id: Commit messages for the main 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: be0df84849ff3e8fb5ec65176ffde88dbefdc434 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be0df84849ff3e8fb5ec65176ffde88dbefdc434 commit be0df84849ff3e8fb5ec65176ffde88dbefdc434 Author: Konstantin Belousov AuthorDate: 2024-01-17 22:55:05 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-18 16:48:05 +0000 msdosfs_rename(): handle errors from msdosfs_lookup_ino() Properly working storage and correct filesystem structure indeed only allow the EJUSTRETURN return code, but since the called function needs to read directory blocks and (re)parse the content, the assert is not neccessary hold. PR: 276408 Reported by: John F. Carr Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43482 --- sys/fs/msdosfs/msdosfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index c17d9f785dc2..726b1d8e5cb7 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1180,8 +1180,8 @@ relock: memcpy(oldname, fip->de_Name, 11); memcpy(fip->de_Name, toname, 11); /* update denode */ error = msdosfs_lookup_ino(tdvp, NULL, tcnp, &scn, &blkoff); - MPASS(error == EJUSTRETURN); - error = createde(fip, tdip, NULL, tcnp); + if (error == EJUSTRETURN) + error = createde(fip, tdip, NULL, tcnp); if (error != 0) { memcpy(fip->de_Name, oldname, 11); goto unlock; From nobody Thu Jan 18 16:48:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG7wp6D73z56Slb; Thu, 18 Jan 2024 16:48: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 4TG7wp5hvYz40hr; Thu, 18 Jan 2024 16:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8SaBYU+aGmwrNNB26EZkT9a3MmvSC7CDW4kq6rqqS1Q=; b=LbWGLW0BqooG1wJFujhffCQrm3OLVy47xvUn1G9hBORBXQeoBdoSggchqrNIJlUn6c3Qyx n/YJxNzgboAN6yVCfviyk3pTTGhUVp9VrgeTMTK7gCpkYbNyyRbFG+L8Nodh1C0Ch2nQNV 1DF7nQnchg1/55aAhPHHyqCTN4UZX8j/Ip3z6r1mPqfDK4oirXTckf1bWWTwk2Ph89Pnsv IMMbgeMTm0sQz/h2gtw66A6jQ/SANygB2CWuXuQDzNJLJI2JOzeelTuz1ygtkpSJl1rzIy 9IVAkD5JAAH1yXZ8hoLTNHxoZoKv9p1yKBV5UHtE39479HDhlBMaRW/wr51HiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8SaBYU+aGmwrNNB26EZkT9a3MmvSC7CDW4kq6rqqS1Q=; b=ZGqjJmS4hUJmcFHMj7reASWbiwRPFgMKAeg4/qTkh9iQH+gCGMpinPOf4rW3FLnxEYsBel 0Tu9LD2nA0LjsabEBevK+J3SxIbmqF+VzT8kMM8QHO4ZlTgi5gX6aPuTlJGIpfbo+w/qD3 ug29morHDy8x6+3/JumnCp7QrKysd/4dhd/3CiCAv/8twM131Qsx3gRE4NQZAYjkqU7icx sXnerc3VRZX/XRlGEf7YWjiIn/LKoMIPL2sgFXr/Il4N0/qqzN1KPv68NQjtWhWLQbj4KZ jnDDsseMUysltTI0pu+c494wI0hMk59eubomAF+kj/QhUAnhEa7So6PKxTOIUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705596506; a=rsa-sha256; cv=none; b=NHX+qfJU7V5q/UmBs/RQSnGV1+G9MkJfQT3kObR8nPQkjs5M85hj/1+U8N2NFRf+xQIoiy QeIwoYzT3Jl1bbhElIBSJoJuM1Z1mSwOBZhNeTIwMne9J+IhU31R6PQcZBCJ2gIeEEkLZn R+c81a5vM5SHCjOcMwgMa2WbdiScPSrO4m2WiuZX1M9JkrM5qvxG8Fa/Fsnjfqddeze2xm GndvtqN3XSR3gAIv0Q7jOqNed+0pqK9CjUKgcP8crotvcgl6awGnGR9neSgDv99TltYF74 MWlCkEaV6jUALW2+bDJbl9A6WwbD8hsCv3we/ldqXN7M7fEpskvEQxJTAGj7zA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG7wp4lrPzFPn; Thu, 18 Jan 2024 16:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IGmQ1a013139; Thu, 18 Jan 2024 16:48:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IGmQkL013136; Thu, 18 Jan 2024 16:48:26 GMT (envelope-from git) Date: Thu, 18 Jan 2024 16:48:26 GMT Message-Id: <202401181648.40IGmQkL013136@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: 661db9b390b4 - main - msdosfs_rename(): implement several XXXs about downgrading to ro List-Id: Commit messages for the main 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: 661db9b390b4a40418d838876b58d2186d72aabf Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=661db9b390b4a40418d838876b58d2186d72aabf commit 661db9b390b4a40418d838876b58d2186d72aabf Author: Konstantin Belousov AuthorDate: 2024-01-17 23:05:55 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-18 16:48:05 +0000 msdosfs_rename(): implement several XXXs about downgrading to ro Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43482 --- sys/fs/msdosfs/msdosfs_vnops.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 726b1d8e5cb7..31d9b003a6fa 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1203,7 +1203,10 @@ relock: MPASS(error == 0); error = removede(fdip, fip); if (error != 0) { - /* XXX should downgrade to ro here, fs is corrupt */ + printf("%s: removede %s %s err %d\n", + pmp->pm_mountp->mnt_stat.f_mntonname, + fdip->de_Name, fip->de_Name, error); + msdosfs_integrity_error(pmp); goto unlock; } if (!doingdirectory) { @@ -1237,7 +1240,10 @@ relock: error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster, NOCRED, &bp); if (error != 0) { - /* XXX should downgrade to ro here, fs is corrupt */ + printf("%s: block read error %d while renaming dir\n", + pmp->pm_mountp->mnt_stat.f_mntonname, + error); + msdosfs_integrity_error(pmp); goto unlock; } dotdotp = (struct direntry *)bp->b_data + 1; @@ -1250,7 +1256,10 @@ relock: if (DOINGASYNC(fvp)) bdwrite(bp); else if ((error = bwrite(bp)) != 0) { - /* XXX should downgrade to ro here, fs is corrupt */ + printf("%s: block write error %d while renaming dir\n", + pmp->pm_mountp->mnt_stat.f_mntonname, + error); + msdosfs_integrity_error(pmp); goto unlock; } } From nobody Thu Jan 18 16:48:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG7wr0ycdz56SdV; Thu, 18 Jan 2024 16:48: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 4TG7wq6tvVz40S4; Thu, 18 Jan 2024 16: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=1705596508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hm5i9WTZG+KZCKTr/w4uoj9iXOONktQsAIVFihavZxQ=; b=a+/pON+25KStiGoOZqr/C7DeIlrgwjfyDxeEUwJ78q+y9Ixi+O++5FQgItZA3MOFhfvhhh dl1OzQ8KOGCklT4vQCQ7IkBOuqzuM0hjom3TYYdUIBUPoBOK1a/hIq2m2c4BOiPOqusC6m ZBjDyvhFVJT/uDO7GsdxM+1cPX2vc1Vu1VOibK0ezMk7hCFvUtqS1c3uk3SytT4v49SWrK 5EJAw1Oj3th2dx6G5d3q7oGuT1aDzH4clFQSIxo9XhTWjbtwnXdn9gHuws7dYZt1LKGYd7 u3w2SV4jiNkYZOD90jVYqvlaJodMMz/jagHp7034Gecr1KaB6y5WmqoZLACLiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705596508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hm5i9WTZG+KZCKTr/w4uoj9iXOONktQsAIVFihavZxQ=; b=tJJwkbMaiJyI0177vRvQQ4RX2mEUhiztem0fKgtj8GiPR0KuiYCdEPwdYIfmDyOLqyJZOP vLucVv7uVja6nX2crjZwhFyxC8h1MNtUIek8azKK4KWTTSBgPsO/XXxDwwQk4T6YViejuC 6r/j1DcpFM96ySluuLGVVNT6rRh6J+GaFEsCOFI+LbmX9j5BTZLwzGpVRE1q7encIRhjdu 4ulVnSReUZE1k9gnmk9xdgJ3iFgLfyc1F3cV2rRZq7ujGVoFZf/z+n38fEzjqoW4OwNkv1 WCDuGcAD+9UAxUftYr/RPnQAcua5fqlyaSpHsHiA3yyBs6ntEnfl/61TUGwkWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705596508; a=rsa-sha256; cv=none; b=pusSkGe9/ZOcngErrYiK+iOy6p4fq7zMcH4VWZoM+seRiS6eV48MOgAfllWDLjBQieqsU5 QHBDx7Grl1oF7G8k80oPAco/htxqlD77htN6jRVoT7a3rS9Hz1NTwQ6lnC3T9woDX6Ub5r P6RD6SGjoPAd0Lfa8iM/AFWVotRyhNlGB68H/X7HsAVWToIr3GO6x7XDH8K7ad1cpcsFmW AUMOmYUftQ+E14bsN1S1DqzqThjj+/AJMmctz/qiIoowY2zE/9m5vbR9LPLP7URn0vEOSo c7iX45u0dA2VQg9v7B6vqYQq8DO7qY31e0aTT/YAPC4+SLGhWOkd9Apc6EFJEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG7wq60TJzFjb; Thu, 18 Jan 2024 16:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IGmRcF013181; Thu, 18 Jan 2024 16:48:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IGmR3L013178; Thu, 18 Jan 2024 16:48:27 GMT (envelope-from git) Date: Thu, 18 Jan 2024 16:48:27 GMT Message-Id: <202401181648.40IGmR3L013178@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: 13ccb04589e2 - main - msdosfs_integrity_error(): plug possible busy leak List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: 13ccb04589e2c5c840e19b407a59e44cb70ac28e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=13ccb04589e2c5c840e19b407a59e44cb70ac28e commit 13ccb04589e2c5c840e19b407a59e44cb70ac28e Author: Konstantin Belousov AuthorDate: 2024-01-18 15:35:56 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-18 16:48:05 +0000 msdosfs_integrity_error(): plug possible busy leak If taskqueue_enqueue() returned error, unbusy(). Handle parallel calls to msdosfs_integrity_error() by unbusying in msdosfs_remount_ro() up to pending times. Noted and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43482 --- sys/fs/msdosfs/msdosfs_vfsops.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index df96bcbfe9c6..03c794bad900 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1006,7 +1006,9 @@ msdosfs_remount_ro(void *arg, int pending) } MSDOSFS_UNLOCK_MP(pmp); - vfs_unbusy(pmp->pm_mountp); + do { + vfs_unbusy(pmp->pm_mountp); + } while (--pending >= 0); } void @@ -1015,11 +1017,19 @@ msdosfs_integrity_error(struct msdosfsmount *pmp) int error; error = vfs_busy(pmp->pm_mountp, MBF_NOWAIT); - if (error == 0) - taskqueue_enqueue(taskqueue_thread, &pmp->pm_rw2ro_task); - else + if (error == 0) { + error = taskqueue_enqueue(taskqueue_thread, + &pmp->pm_rw2ro_task); + if (error != 0) { + printf("%s: integrity error scheduling failed, " + "error %d\n", + pmp->pm_mountp->mnt_stat.f_mntfromname, error); + vfs_unbusy(pmp->pm_mountp); + } + } else { printf("%s: integrity error busying failed, error %d\n", pmp->pm_mountp->mnt_stat.f_mntfromname, error); + } } static int From nobody Thu Jan 18 17:00:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG8BW2jgbz56Tsy; Thu, 18 Jan 2024 17:00: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 4TG8BW244jz42hS; Thu, 18 Jan 2024 17:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705597219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M6Iik1JJgBDn/IGhPWDtW9kQWysZkdu3A3pWOaYhtBk=; b=C27VOiICaqMJAi1n/8WyWHuxc3pZGZELIrj2Ru3767uPG3YXo0jKfUeOLfjrjtpwSvUaaG RBZpGm19E9Esrwc2inqm+2tlaOyb9OGFSJLw98sdgwrzOQaJaxi6rPflRIB1NBx6zqCRAo qN/kcbgI1uE2428gkPlUiav3+SUBz9kFSRPKGunIhOQ4cFpK+ZZZ0R1Gguo7o4pQDdjCPS yIpZqZtKzPaY1dWC4rv6f7KE3EAqa1mlnErEE3/M/65VzVGcDWZONzOF8InDDS3NK5d4Nc MQm5j9HWJht0fbPx/M0sl8yJU8wURCuikj3F3OfxXnJvsRNVsNwN5NdVMSYwPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705597219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M6Iik1JJgBDn/IGhPWDtW9kQWysZkdu3A3pWOaYhtBk=; b=aF74JDcK6hbjsE6JeRIwCsYS30miTjNA9f45g7d1UM/KEQ3JzEVLNJoaYlhCBvmVn5VoKX Hnod4nZRRUM/FsEzMf3DpCuxeahZGLsYY6WHdUrQV00aeJ6HCE2d0CFfFCA9CkRjALpKqx SewyO/jbhL5kq/3H4JHvwQb+z1LNIXe8rAMICfaTSrFiW6yZIglkDTHSNsexrVVqn/tnuR ZC8Ri4T/R0MXUweAe+YB/qzPrLGfxvB7CnVoOVoA3x9Nn8jrvo0yTXIQIM0LcPCTZ8jL7X WO7d9qz7RY+qBPIZFEawrAEfLBnEqi66tQTunOfhBDTT2WXz+2UMOkR0rLKbMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705597219; a=rsa-sha256; cv=none; b=Zl2vXoK4Jm7x8GcweGBW+LETsVTBdgXYortdAHMriivnNFNsClEKehXUZHL7UqU2LsQg5y jRKYrjS3ec8VBSM6ne1K3cYVgBDzFGD68ppxStSdJjn4klLhVXh9Wh2fGVR2AgXmWLWj8i lfjavz6FJWucXJxSUcQNNeYWDLky13tHJwU09l6UA9OtbiUKvHzcoHxK2I84qK/anFODz1 U+fwqwAnn2AfWwAFDd23sKMNvOIwcTqCqSs+zALbidOvYP8vcyFEamKLXPvHxMA5O7090e ZdfFYLgUodHxKXtaska7GZ+9WrHtM56u8doyAN6+mPytLxzbH6yfxDurAa3Chw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG8BW193bzFjC; Thu, 18 Jan 2024 17:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IH0Jgg039388; Thu, 18 Jan 2024 17:00:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IH0JP5039383; Thu, 18 Jan 2024 17:00:19 GMT (envelope-from git) Date: Thu, 18 Jan 2024 17:00:19 GMT Message-Id: <202401181700.40IH0JP5039383@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: 2e297cbb4fc0 - main - arm64: fix db_read_bytes() for size == 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 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: 2e297cbb4fc057e1872114ef8a37a41a6669dd5b Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=2e297cbb4fc057e1872114ef8a37a41a6669dd5b commit 2e297cbb4fc057e1872114ef8a37a41a6669dd5b Author: Mitchell Horne AuthorDate: 2024-01-17 16:45:41 +0000 Commit: Mitchell Horne CommitDate: 2024-01-18 17:00:07 +0000 arm64: fix db_read_bytes() for size == 8 There is a mistake in the cast, resulting in a truncated read to tmp64. Switch from int to uint64_t, and adjust the other casts for clarity. Add a comment explaining why we do this at all. Reported by: dfr Reviewed by: dfr, mmel, emaste, jhb (all a previous version) PR: 276406 MFC after: 3 days Fixes: a67687fcd8f5 ("Use native-sized accesses when accessing memory from kdb") --- sys/arm64/arm64/db_interface.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/db_interface.c b/sys/arm64/arm64/db_interface.c index 8d97ab46a837..0b1c58ca88a0 100644 --- a/sys/arm64/arm64/db_interface.c +++ b/sys/arm64/arm64/db_interface.c @@ -124,14 +124,20 @@ db_read_bytes(vm_offset_t addr, size_t size, char *data) if (ret == 0) { src = (const char *)addr; + + /* + * Perform a native-sized memory access, if possible. This + * enables reading from MMIO devices that don't support single + * byte access. + */ if (size == 8 && (addr & 7) == 0) { - tmp64 = *((const int *)src); + tmp64 = *((const uint64_t *)src); src = (const char *)&tmp64; } else if (size == 4 && (addr & 3) == 0) { - tmp32 = *((const int *)src); + tmp32 = *((const uint32_t *)src); src = (const char *)&tmp32; } else if (size == 2 && (addr & 1) == 0) { - tmp16 = *((const short *)src); + tmp16 = *((const uint16_t *)src); src = (const char *)&tmp16; } while (size-- > 0) From nobody Thu Jan 18 17:22:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG8gd5JRmz56XDM; Thu, 18 Jan 2024 17:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG8gd4tJhz44hT; Thu, 18 Jan 2024 17:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705598525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iOtJnajzQO4E9PH2V5Z1xh/ZQFbw3/aWpo9G3hJAkz8=; b=iY7/vavKHilcBoZB8HyAIpxxxAQv4LTMhli5H0NpGrCrfL8nv0tk3Lj18ftF3QhgYiOIR9 42cD4IQ6bXedSEaZQKeOZNuMtWW1ao0fiu/KwVeRdplU6wwZ3E94Aoiv6EuSXyugNEvpK6 sT4DpX6Lz2QIKUQb5DKhYCBc7g8XqCJJWoIYvjQDDFuKcF/CM1z89Ou4kGY42TO2Lwm5KP 12YBpFO9SG7cwFkehqLW68Dqu7usRRNfNV7J1v7kkjNZd1k69/WN0XucfkjxDKlLsIcuf3 0/BrHAmaqZDfYbxV59MkKI2syhC5aRqesRS1tJy/dJwobNWJkHRDzL58PH/TVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705598525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iOtJnajzQO4E9PH2V5Z1xh/ZQFbw3/aWpo9G3hJAkz8=; b=foTUFM8DkdwrCPObn+MEuk20znqINmPRk0IIBexkL0hYs7V3H2Py4OXVAdnsCLQtQoO+kG NggCCxlwqrD5AOxvUppAsXKdWKEUYz61ouvNTkpebzevHy+tSvA1PNdzSBdJeSTuLQJ8al s5pX3UDoNhe5EUF0b7HEgcDz89IAzVJoQo94dRt/Rcf7H1Nj2cId4amF3HqqzurqCv5rWF aST7Z9yXV924ocn7JPJXQWUod7w/z1RVug7/yXIUflDN1WhoFJkP2OFCo0Bn13owCaeN7A SYnLU99F8Cf23ZQm5rikWfYkhK4cbrbmkQazM1gaKCOyZkf1WyusvUbc1m335A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705598525; a=rsa-sha256; cv=none; b=wC8WSdN5YqHPRpkbNhrKGxFjr2VSf3YUomJw65z3C9l25qH83yu0jn1I7nSK5Hz0cbA0I8 IVTfqLgtxj61KgIxVAUvmjR6KqnSogTiFp2cmS8d4chL0xDH+7N7fv3pBnSGgyeCKTa3mh EVgRo28wkWTaKCfzfTvTBpUouOh4uESl11zJcoY2NFEbxLN32r9geDReyafCCjM3rz3/5L VV/A34eggBNhXzQdEBZJPsF1LRg+R9+o/dnBIUEUCD8lFYJaSa1FN14arG0ni5+etyQ2qJ QTfGpJNKDGpE5YyZw0K1+k/eZyOI2/NnQEEVOfGGimUsBXqLbCFamR2u67ZoUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG8gd3hnvzGSP; Thu, 18 Jan 2024 17:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IHM5N5078735; Thu, 18 Jan 2024 17:22:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IHM52I078733; Thu, 18 Jan 2024 17:22:05 GMT (envelope-from git) Date: Thu, 18 Jan 2024 17:22:05 GMT Message-Id: <202401181722.40IHM52I078733@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: a2544cc8243f - main - Revert "arm64: fix db_read_bytes() for size == 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 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: a2544cc8243f4136a912e08dbe86d8590d25a53d Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=a2544cc8243f4136a912e08dbe86d8590d25a53d commit a2544cc8243f4136a912e08dbe86d8590d25a53d Author: Mitchell Horne AuthorDate: 2024-01-18 17:20:03 +0000 Commit: Mitchell Horne CommitDate: 2024-01-18 17:20:03 +0000 Revert "arm64: fix db_read_bytes() for size == 8" I forgot to include the phabricator link in the commit message. This reverts commit 2e297cbb4fc057e1872114ef8a37a41a6669dd5b. --- sys/arm64/arm64/db_interface.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sys/arm64/arm64/db_interface.c b/sys/arm64/arm64/db_interface.c index 0b1c58ca88a0..8d97ab46a837 100644 --- a/sys/arm64/arm64/db_interface.c +++ b/sys/arm64/arm64/db_interface.c @@ -124,20 +124,14 @@ db_read_bytes(vm_offset_t addr, size_t size, char *data) if (ret == 0) { src = (const char *)addr; - - /* - * Perform a native-sized memory access, if possible. This - * enables reading from MMIO devices that don't support single - * byte access. - */ if (size == 8 && (addr & 7) == 0) { - tmp64 = *((const uint64_t *)src); + tmp64 = *((const int *)src); src = (const char *)&tmp64; } else if (size == 4 && (addr & 3) == 0) { - tmp32 = *((const uint32_t *)src); + tmp32 = *((const int *)src); src = (const char *)&tmp32; } else if (size == 2 && (addr & 1) == 0) { - tmp16 = *((const uint16_t *)src); + tmp16 = *((const short *)src); src = (const char *)&tmp16; } while (size-- > 0) From nobody Thu Jan 18 17:22:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG8gf6VZTz56XXX; Thu, 18 Jan 2024 17:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG8gf5tpCz44kk; Thu, 18 Jan 2024 17:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705598526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sxzB6VYucobm3QWadap1gB/1o7XiYVR2nqFCkg7hDkc=; b=HdbjNQRUqPfqYN3/x8ouSAYG5cWMqlNtcCHSQJTMRmmfzS84eS9YKoPVlwLgm07R7VH8hu PqTuff0VESxSSzxZWPUYI7/QcH1OfPHD1ZI2v4f0fPRgvaUTt2xq3Ck0HWKX1YdzOovrXb OJiu+opeL6RJKzPTc1/HemQMTb3IlFD6inHfGnjaabsTE60X/XcLIG5oy2xtBoxriWtp+Z Z5vFajsnvgrSgYJ909yamvhq+mWWzlKwjcXVRkwWU0OrBw9CLZnKxA432+zVBY6LRtcU4S s14by1U2tP28JwOq48j1s6o0+VnInfoEbndJPbC1f1BGWm9vAewEPzCdfaCUxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705598526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sxzB6VYucobm3QWadap1gB/1o7XiYVR2nqFCkg7hDkc=; b=ajXwa5LELP5QiwSiuxL7guhYEPh0QDaadyRaneg1HsnSRvz/qxqx/rl0PR1MvqH7deCNgR 1nARE0ZvgHkvrNuf41RToiay3Uu6QIDZIJQ984U41RRz7JBPemrhk84xolctUGu7vCij+n ps+1uTbtJkIw9rvL5pKW/1OPc+9zvRkYDYDYuXl+hDrzu+XfEfh0W7i8rTaV8HGlBd1Tru i36SqKVTPvXfbwxEYktqJfp7PonBe2F/CaGKD/Sb0fVUk5OLHl0ALD6pvJPz0BYHxL4m1T Jw5TKuglf+ROnsxOlYzu1t5HPaENThFctVhD12ozUr1Bp0GZbZcxBKlxnQ7JBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705598526; a=rsa-sha256; cv=none; b=lfd/+0VNL1FVGcqVb5KyD0Q8nyHZheVBjasTk4kaSftzAYi03R2gg2oF6hG+SzP4i9rGAW e1xqQXzNyHXKo+NOb9LJFMtOYWEyaz1vxyvWwDa/gyWW8oNZZ5jUCEiwoww+VfYe9x5/l7 eVvcW+tgrLP1fkvjdAJilIk14vBQ26UUYvBPfdHPbO84dg+0kyG8TpMIxww1ZLTjjjk7/j 0dRmswtKv5vJIrke67IL9JD3gWQ7g73K/ihJjqf2LqPfemLQyOLbelA1jjFBgHy5LbCZFn u0MlgNGQ25zyzEpoYEZOv7nePMw4ZIVGe9itG+braf5jEd8idhhD8gNNVvthyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TG8gf4yhLzGhk; Thu, 18 Jan 2024 17:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IHM64p078783; Thu, 18 Jan 2024 17:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IHM6U8078780; Thu, 18 Jan 2024 17:22:06 GMT (envelope-from git) Date: Thu, 18 Jan 2024 17:22:06 GMT Message-Id: <202401181722.40IHM6U8078780@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: 9c2e1a54f71a - main - arm64: fix db_read_bytes() for size == 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 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: 9c2e1a54f71a399fc4645c4b8bed044705629143 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9c2e1a54f71a399fc4645c4b8bed044705629143 commit 9c2e1a54f71a399fc4645c4b8bed044705629143 Author: Mitchell Horne AuthorDate: 2024-01-17 16:45:41 +0000 Commit: Mitchell Horne CommitDate: 2024-01-18 17:20:42 +0000 arm64: fix db_read_bytes() for size == 8 There is a mistake in the cast, resulting in a truncated read to tmp64. Switch from int to uint64_t, and adjust the other casts for clarity. Add a comment explaining why we do this at all. Reported by: dfr Reviewed by: dfr, mmel, emaste, jhb (all a previous version) PR: 276406 MFC after: 3 days Fixes: a67687fcd8f5 ("Use native-sized accesses when accessing memory from kdb") Differential Revision: https://reviews.freebsd.org/D43479 --- sys/arm64/arm64/db_interface.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/db_interface.c b/sys/arm64/arm64/db_interface.c index 8d97ab46a837..0b1c58ca88a0 100644 --- a/sys/arm64/arm64/db_interface.c +++ b/sys/arm64/arm64/db_interface.c @@ -124,14 +124,20 @@ db_read_bytes(vm_offset_t addr, size_t size, char *data) if (ret == 0) { src = (const char *)addr; + + /* + * Perform a native-sized memory access, if possible. This + * enables reading from MMIO devices that don't support single + * byte access. + */ if (size == 8 && (addr & 7) == 0) { - tmp64 = *((const int *)src); + tmp64 = *((const uint64_t *)src); src = (const char *)&tmp64; } else if (size == 4 && (addr & 3) == 0) { - tmp32 = *((const int *)src); + tmp32 = *((const uint32_t *)src); src = (const char *)&tmp32; } else if (size == 2 && (addr & 1) == 0) { - tmp16 = *((const short *)src); + tmp16 = *((const uint16_t *)src); src = (const char *)&tmp16; } while (size-- > 0) From nobody Thu Jan 18 17:29:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG8rm18h8z56YFJ for ; Thu, 18 Jan 2024 17:30:00 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG8rl6dtBz45H3 for ; Thu, 18 Jan 2024 17:29:59 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-40e8801221cso19712025e9.1 for ; Thu, 18 Jan 2024 09:29:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705598998; x=1706203798; 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=n5mn9Py63NDz24w75NWG/mdC75eDLN6f9uuk4m+yX8A=; b=JaW6NgwHogq+vz/vptisk1Pa5aQ/3cffPEO3KOB79uKSXiz9FB9KFte3FG+UoR4mdG CDMYpP1P9MUqB5+Uzo6ijTy1aX5test2LSfsBTIcvKCXqKbBVLij/rSxZnN3xgcJfsqF upLNRRvnm0hP0wpPtkqTjQr/iVbIZqAE3hcfr21FpU4A+9VEhHFK0SFlnJ9ItrTaghjW e4SZpRS/1Lwt2hwYt7Knr3Tom+WHztxxjEsu+LB7YAV7nQyAwjFOt1e8PL1r8+OOAw1A aU90vuUBDvXmkg0cTudAtOFJCbF/hwy7oYLf3NY2H7MJUlpbdUaoSqK6N3aYwKZECouu G3FQ== X-Gm-Message-State: AOJu0YxIh7HnJciBLxDu6t+6jsrP1FARUYUosib+MkhRJ5FnX6iVQW6Y IjeY5a9H35pndU8OwQDm8wOeERSV2YjNnGhVkifQumSghcmWA1QM3/klFJOoVvO7s5g4M13x8tF / X-Google-Smtp-Source: AGHT+IEhuDUfbGjcTM8YB7QuTP2GUV4nIcYftej46Mk/66ZDIIrECwVFzsWu2cRftyuGR5BBPueHNg== X-Received: by 2002:a1c:7415:0:b0:40e:4eed:da7a with SMTP id p21-20020a1c7415000000b0040e4eedda7amr841068wmc.68.1705598998387; Thu, 18 Jan 2024 09:29:58 -0800 (PST) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id u17-20020a05600c19d100b0040e47dc2e8fsm26361491wmq.6.2024.01.18.09.29.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 09:29:58 -0800 (PST) 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 \(3774.200.91.1.1\)) Subject: Re: git: 0990136ed175 - main - kerberos5: Mitigate the possibility of using an old libcrypto From: Jessica Clarke In-Reply-To: <202401181523.40IFNvXI077592@gitrepo.freebsd.org> Date: Thu, 18 Jan 2024 17:29: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: <202401181523.40IFNvXI077592@gitrepo.freebsd.org> To: Cy Schubert X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Rspamd-Queue-Id: 4TG8rl6dtBz45H3 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 18 Jan 2024, at 15:23, Cy Schubert wrote: >=20 > The branch main has been updated by cy: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D0990136ed1753ac7837206f9c5f4b83c= cff6c405 >=20 > commit 0990136ed1753ac7837206f9c5f4b83ccff6c405 > Author: Cy Schubert > AuthorDate: 2024-01-18 08:22:20 +0000 > Commit: Cy Schubert > CommitDate: 2024-01-18 15:12:14 +0000 >=20 > kerberos5: Mitigate the possibility of using an old libcrypto >=20 > By using the full library name (libcrypto.so.30) we avoid the = exposure > of using an old, possibly vulnerable, library. >=20 > Reported by: jrtc27 > MFC after: 3 days > X-MFC with: 476d63e091c2 > Fixes: 476d63e091c2 > --- > kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c = b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > index 497b32124f96..2328041bc166 100644 > --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > @@ -5,6 +5,7 @@ > #include >=20 > #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > +#define CRYPTO_LIBRARY "/lib/libcrypto.so.30" This still assumes the native ABI is in use, i.e. doesn=E2=80=99t = account for libcompat. Can we please just drop the directory, or if it=E2=80=99s = really needed for some reason at least handle the libcompat case? Jess > static void fbsd_ossl_provider_unload(void); > static void print_dlerror(char *); > static OSSL_PROVIDER *legacy; > @@ -46,7 +47,7 @@ fbsd_ossl_provider_load(void) > { > #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > if (crypto_lib_handle =3D=3D NULL) { > - if (!(crypto_lib_handle =3D dlopen("/usr/lib/libcrypto.so", > + if (!(crypto_lib_handle =3D dlopen(CRYPTO_LIBRARY, > RTLD_LAZY|RTLD_GLOBAL))) { > print_dlerror("Unable to load libcrypto.so"); > return (EINVAL); From nobody Thu Jan 18 17:35:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG8z54K2Zz56YhS for ; Thu, 18 Jan 2024 17:35:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 4TG8z52Hb3z474B for ; Thu, 18 Jan 2024 17:35:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-361930931f0so7566835ab.0 for ; Thu, 18 Jan 2024 09:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1705599327; x=1706204127; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=oEzO5poaepMlkTiGq1a3KImHKuNSnnbFRaqdxXiZOQ4=; b=UgLsNHP0StPFjOc52qUc+r501WuAbgaSU9dcGUhTarJa1rzKwTuuv1HMRTB0XMLnOL R6vpnUIR6PAXnDWjzt182cvHYZsDIdO27ku29fsDnQMZJ1Z5CTh6hkLD4vsLky1VtUIF +mGAcI8AM4IcpvmvpKLJbiSrvKzKVhsdFzURJuXhMcFYM9lQzwKg/at8pkHjzo2XhamT 9CU90/KlKN1vClLmIBHquGIhCfBShOH0Sdt5XIusa5voC3tSKLKY9EvBJq+wOiGjDAP1 qx6BdlAhQ/bJC/YMyUotpdcW3kBkbZGEtXrS4o6pbl9K86eHqCTIif6SlhK82PEMp8RP EeqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705599327; x=1706204127; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oEzO5poaepMlkTiGq1a3KImHKuNSnnbFRaqdxXiZOQ4=; b=FIn4dXDEuCd3SZbBISNX/XZiMivJ7bHTUXEM5e3wXc9hKzCAtKzZB1FUfGQsAcPa8c f75gH6j39H8OMEFmJ2qAdmH2qTnfdUQhroRao+m5yNTeeFyF+qGzVoaJej/vQ6hamkdK qzqChnL+TauDZy56bX6slZ7mibOfI27+NXvTamM6ZC6X1sIHCR/2PZqOXrU0+FBpoDJ2 XGDqUEFxFG3u+YNcPNlcjOqI9HSCP/pVRVeX7hZF0gjZw+kKTHk79Ab9LLaXMInfflCd fiT69oU8TvQYvo0WK3PXHtcgXEgKFNVUpidrSGnM6EH0yriXHEvAA3tXuPqbs3oqMOnf IckA== X-Gm-Message-State: AOJu0Yx/oekC7BbSN1mFqQuVh5/tjzqDCvINXZLY+bcfXtPOcOVvBhND mUkOrpVbSq4PCGi9lRnFP8KaIJTEXyG9aVROHEbjOfaCpoA81NPCZeBzGeYlEf0= X-Google-Smtp-Source: AGHT+IGDt22LbJOFz+9bHFN5jhcpIQs7YqOeLD7yXoZ07OVDhGiZmagx+jIQQxLoA0TWvbAlf3XI5w== X-Received: by 2002:a92:de04:0:b0:35f:a46f:f40a with SMTP id x4-20020a92de04000000b0035fa46ff40amr1392482ilm.11.1705599326780; Thu, 18 Jan 2024 09:35:26 -0800 (PST) Received: from mutt-hbsd (174-24-119-231.clsp.qwest.net. [174.24.119.231]) by smtp.gmail.com with ESMTPSA id g15-20020a056e021e0f00b003606b6d1070sm4636909ila.22.2024.01.18.09.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 09:35:25 -0800 (PST) Date: Thu, 18 Jan 2024 17:35:25 +0000 From: Shawn Webb To: Jessica Clarke Cc: Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 0990136ed175 - main - kerberos5: Mitigate the possibility of using an old libcrypto Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202401181523.40IFNvXI077592@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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t4jbi7nbtzycxckb" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4TG8z52Hb3z474B X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --t4jbi7nbtzycxckb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 18, 2024 at 05:29:47PM +0000, Jessica Clarke wrote: > On 18 Jan 2024, at 15:23, Cy Schubert wrote: > >=20 > > The branch main has been updated by cy: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D0990136ed1753ac7837206f9= c5f4b83ccff6c405 > >=20 > > commit 0990136ed1753ac7837206f9c5f4b83ccff6c405 > > Author: Cy Schubert > > AuthorDate: 2024-01-18 08:22:20 +0000 > > Commit: Cy Schubert > > CommitDate: 2024-01-18 15:12:14 +0000 > >=20 > > kerberos5: Mitigate the possibility of using an old libcrypto > >=20 > > By using the full library name (libcrypto.so.30) we avoid the exposu= re > > of using an old, possibly vulnerable, library. > >=20 > > Reported by: jrtc27 > > MFC after: 3 days > > X-MFC with: 476d63e091c2 > > Fixes: 476d63e091c2 > > --- > > kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > >=20 > > diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c b/kerbero= s5/lib/libroken/fbsd_ossl_provider_load.c > > index 497b32124f96..2328041bc166 100644 > > --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > @@ -5,6 +5,7 @@ > > #include > >=20 > > #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > > +#define CRYPTO_LIBRARY "/lib/libcrypto.so.30" >=20 > This still assumes the native ABI is in use, i.e. doesn=E2=80=99t account= for > libcompat. Can we please just drop the directory, or if it=E2=80=99s real= ly > needed for some reason at least handle the libcompat case? Using relative paths might carry a potential security risk if the LD_LIBRARY_PATH environment variable is set to an attacker-controlled directory. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --t4jbi7nbtzycxckb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmWpYVAACgkQ/y5nonf4 4fqryA/9F2cLPzaDGGQ19AbZImSAFplCWJkidv9k+QWZLX9lriXdrdz3qqg+Yu6X bxbETNHo0PjtAZd2hJHp+NdHR497+R+1t0KqmGvRvq0PSuXR/ze68XUjrUS3RfUJ 8fMBOLbdkyXNEeFw5YkjDIGAmhAaCqBEk60dFa8DFfEygbfEZXaws1L4tPsW86B0 sfiPdH57OBEzaiSraK9i+2v9gOPmd5xEuYQ/FK1+xeQ9g2IykibjrO8CfM8J3//4 MoLkqQ+fnaUyaufBg0cEekO0yQhtgfqMrYuB6DjD1NpwWRpKuDnkynflbmrgO7hg SleqZc01cJ1Fa7fCqO+Ds+4l/xVKJ781M7PWbowUtkJQmeUnNVJ4boDPfdIY6v0x GRLgZin1AeWCDRIoV2vR0JqTLf+AVaeeD7iFQnZVR9riWRiHrBWZ0tLoqf1Wk3Sb 4MzEXp/EVhI+aKQ2Cshl1tmNwTncbJ8mR05tjIu5FRSnmJd9rMO/du0ADnGzPDAT 9jB5aw1ht8yIYVay4KWgOt/O4sAVtI6eq8gZOvA6ITP7Z/Htnh3RDC2EhvBdtM90 djUFwwqboMqLDPWw51yO2poicmr88E/kFdt0z4MPoHY1lBipyCGqJ2Gg3ZdTdeqo gnnfAUxaVwrHF3sk/rwpsQtjtI1hnV/S3/RqgVvU2eQOhg+/BK8= =oMkh -----END PGP SIGNATURE----- --t4jbi7nbtzycxckb-- From nobody Thu Jan 18 17:43:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG98j6HpVz56ZVL for ; Thu, 18 Jan 2024 17:43:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG98j4ffHz486j for ; Thu, 18 Jan 2024 17:43:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-337d99f9cdfso60713f8f.0 for ; Thu, 18 Jan 2024 09:43:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705599828; x=1706204628; 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=VFMZvVXjwALmOpUv4E5zZiTla8FRigIiIQnHqXhxKb4=; b=ACKsyCTz2uPyOoJIx3+qW6549Z15Xb32r9ew/v/UXmUyAzvZAHmfNe7caQSHDYBvBr DR6Tuvo+iA5Qvdn0Eeo8Mkh5TQS95rSMATId5L3VRiVE3NRurhmQnkigRAgHNz520GPR vYyJrfqJ02g0LxPYhvFjHw0LX7zd+sLPRwYB8aenweF8P6ES5uXirml6xo90WTPSeK29 s2eqS7+jNhSXXviu/JinGBgMojCv6zEY9U0GYENgMlCAljfB5XUYrCElr++SDSf3avET SiLvqbf+NEmCkdr4vksZVzb8bx5KIymGFXauPQGpVmUVSG6dKc8/ywpjNy4L5+IeAUFG K7tw== X-Gm-Message-State: AOJu0YzBiX/3MuaKoGClfG26tocBYvJJnQ3VGUzUNreI5srQDSR4Ks9T iAIn90eQbnbVfCuTxSZpmKs6Efd/NpjGugSjyH4WR1D5AxkX9bVAmZE4bsWPCR8= X-Google-Smtp-Source: AGHT+IHhQUfGqmY86yZDdPUbw4/VuS5mF88uklz3SZYpXxZJmpbkcKDGlxPdRfrCEDS5ivLuM7YfGw== X-Received: by 2002:adf:fa8a:0:b0:337:c80f:6e19 with SMTP id h10-20020adffa8a000000b00337c80f6e19mr604699wrr.69.1705599827272; Thu, 18 Jan 2024 09:43:47 -0800 (PST) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id y8-20020a5d4ac8000000b00337af95c1d2sm4540809wrs.14.2024.01.18.09.43.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 09:43:46 -0800 (PST) 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 \(3774.200.91.1.1\)) Subject: Re: git: 0990136ed175 - main - kerberos5: Mitigate the possibility of using an old libcrypto From: Jessica Clarke In-Reply-To: Date: Thu, 18 Jan 2024 17:43:36 +0000 Cc: Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org> References: <202401181523.40IFNvXI077592@gitrepo.freebsd.org> To: Shawn Webb X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Rspamd-Queue-Id: 4TG98j4ffHz486j X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 18 Jan 2024, at 17:35, Shawn Webb wrote: >=20 > On Thu, Jan 18, 2024 at 05:29:47PM +0000, Jessica Clarke wrote: >> On 18 Jan 2024, at 15:23, Cy Schubert wrote: >>>=20 >>> The branch main has been updated by cy: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D0990136ed1753ac7837206f9c5f4b83c= cff6c405 >>>=20 >>> commit 0990136ed1753ac7837206f9c5f4b83ccff6c405 >>> Author: Cy Schubert >>> AuthorDate: 2024-01-18 08:22:20 +0000 >>> Commit: Cy Schubert >>> CommitDate: 2024-01-18 15:12:14 +0000 >>>=20 >>> kerberos5: Mitigate the possibility of using an old libcrypto >>>=20 >>> By using the full library name (libcrypto.so.30) we avoid the = exposure >>> of using an old, possibly vulnerable, library. >>>=20 >>> Reported by: jrtc27 >>> MFC after: 3 days >>> X-MFC with: 476d63e091c2 >>> Fixes: 476d63e091c2 >>> --- >>> kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>=20 >>> diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c = b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c >>> index 497b32124f96..2328041bc166 100644 >>> --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c >>> +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c >>> @@ -5,6 +5,7 @@ >>> #include >>>=20 >>> #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) >>> +#define CRYPTO_LIBRARY "/lib/libcrypto.so.30" >>=20 >> This still assumes the native ABI is in use, i.e. doesn=E2=80=99t = account for >> libcompat. Can we please just drop the directory, or if it=E2=80=99s = really >> needed for some reason at least handle the libcompat case? >=20 > Using relative paths might carry a potential security risk if the > LD_LIBRARY_PATH environment variable is set to an attacker-controlled > directory. That=E2=80=99s true for direct linking too, yet we don=E2=80=99t = hard-code everything everywhere there. What=E2=80=99s special about dlopen? Jess From nobody Thu Jan 18 17:55:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TG9R33m17z56bZd; Thu, 18 Jan 2024 17:56:15 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TG9R32J1Tz4CY4; Thu, 18 Jan 2024 17:56:15 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id QR3vrJOh3xDxGQWcOrk7Ga; Thu, 18 Jan 2024 17:55:56 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id QWcMrEUePwbmvQWcNriIvc; Thu, 18 Jan 2024 17:55:55 +0000 X-Authority-Analysis: v=2.4 cv=O6wqATxW c=1 sm=1 tr=0 ts=65a9662b a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=dEuoMetlWLkA:10 a=6I5d2MoRAAAA:8 a=ypVJL4-jAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=Cv665yLbTFUad3qPkJUA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=khIbc0fXALFIcTpOSxgJ:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id B9061EB; Thu, 18 Jan 2024 09:55:53 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 9CC5E19B; Thu, 18 Jan 2024 09:55:53 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Jessica Clarke cc: Shawn Webb , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 0990136ed175 - main - kerberos5: Mitigate the possibility of using an old libcrypto In-reply-to: <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org> References: <202401181523.40IFNvXI077592@gitrepo.freebsd.org> <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org> Comments: In-reply-to Jessica Clarke message dated "Thu, 18 Jan 2024 17:43:36 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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 Date: Thu, 18 Jan 2024 09:55:53 -0800 Message-Id: <20240118175553.9CC5E19B@slippy.cwsent.com> X-CMAE-Envelope: MS4xfCWzkpbqix54pOr7D0zhuXtPwQH7I4vDDcHnYGFBtoIgujU2kgGqW9IRwn+sluwWqTF94J33qgOx3EWJFV3r2y0XImZLfrygpQXPppcHIGnl4QQ993VF jRLdGTvLws6xZLEb8U8iedpEhtKzCqUdAKZsm//AV3Qkx24Vw02HOHGBAp7FSd/q5iampmandaOG1K3HfWxDHnLwl5ZQ4mlrieH494uFCW0E3l6Tyhnj7B5W Ept67z8ZZyDjjvgLg2oQnWvvXZe/KUgEmH2aojfakO1ZWb8khvGL2jkjBLyo1WwpdMV5WJ5wuCFowFNkYzxs2p3U55Etk12++B3oGUc31tURZQL5WIklgoVu xb/DOf2tYT1zD+d0Gl5SwnTJ/O5Ip+gY4vUmnyXzc5J+q2lZTBM= X-Rspamd-Queue-Id: 4TG9R32J1Tz4CY4 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org>, Jessica Clarke w rites: > On 18 Jan 2024, at 17:35, Shawn Webb wrote: > >=20 > > On Thu, Jan 18, 2024 at 05:29:47PM +0000, Jessica Clarke wrote: > >> On 18 Jan 2024, at 15:23, Cy Schubert wrote: > >>>=20 > >>> The branch main has been updated by cy: > >>>=20 > >>> URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D0990136ed1753ac7837206f9c5f4b83c= > cff6c405 > >>>=20 > >>> commit 0990136ed1753ac7837206f9c5f4b83ccff6c405 > >>> Author: Cy Schubert > >>> AuthorDate: 2024-01-18 08:22:20 +0000 > >>> Commit: Cy Schubert > >>> CommitDate: 2024-01-18 15:12:14 +0000 > >>>=20 > >>> kerberos5: Mitigate the possibility of using an old libcrypto > >>>=20 > >>> By using the full library name (libcrypto.so.30) we avoid the = > exposure > >>> of using an old, possibly vulnerable, library. > >>>=20 > >>> Reported by: jrtc27 > >>> MFC after: 3 days > >>> X-MFC with: 476d63e091c2 > >>> Fixes: 476d63e091c2 > >>> --- > >>> kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 3 ++- > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > >>>=20 > >>> diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c = > b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > >>> index 497b32124f96..2328041bc166 100644 > >>> --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > >>> +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > >>> @@ -5,6 +5,7 @@ > >>> #include > >>>=20 > >>> #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > >>> +#define CRYPTO_LIBRARY "/lib/libcrypto.so.30" > >>=20 > >> This still assumes the native ABI is in use, i.e. doesn=E2=80=99t = > account for > >> libcompat. Can we please just drop the directory, or if it=E2=80=99s = > really > >> needed for some reason at least handle the libcompat case? > >=20 > > Using relative paths might carry a potential security risk if the > > LD_LIBRARY_PATH environment variable is set to an attacker-controlled > > directory. > > That=E2=80=99s true for direct linking too, yet we don=E2=80=99t = > hard-code everything > everywhere there. What=E2=80=99s special about dlopen? The reason for dlopen is to avoid building libcrypto during pre-build. libcrypto requires TARGET_ENDIANNESS to be defined. It is not defined when cross building from Linux or MacOS. TARGET_ENDIANNESS is defined by bsd.endian.mk, which state: # During bootstrapping on !FreeBSD OSes, we need to define some value. Short of # having an exhaustive list for all variants of Linux and MacOS we simply do not # set TARGET_ENDIANNESS and poison the other variables. They should be unused # during the bootstrap phases (apart from one place that's adequately protected # in bsd.compiler.mk) where we're building the bootstrap tools. To avoid this requirement during we let libroken build as usual during prebuild and load libcrypto, which is built later, thereby circumventing the prebuild requirement and avoiding redesigning our prebuild to define TARGET_ENDIANNESS for non-FreeBSD OSes. I don't think anyone here is prepared to redesign prebuild for this one single case. And, since Heimdal will be replaced by MIT, the requirement for our old Heimdal to work with OpenSSL 3.0 will disappear. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jan 18 21:35:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGGJL1gBgz573X1; Thu, 18 Jan 2024 21:35:46 +0000 (UTC) (envelope-from jhb@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 4TGGJK6Xtyz4mbJ; Thu, 18 Jan 2024 21:35:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705613745; 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=J7VT2fbyC2ibwMh/iMZvAsCHOdKyRWaUOIn+cO7bVm0=; b=InWY/6qgjXeWIyJbz/qWyu77CQJiCV09/q7gAy92fpMHZrtQ+IieIwV9q/EZ0AAZIBdYTR fwNGeDt/QHBWcW2uue+EEidcs5RyrOHjDBgHPVSFZsJ/x19O9HZ0hPr/WNe4T0pRmeJwsS FBPAjW5Wm9J4NXB/lLovg0Ex09tGtOmn5zEfz2Mzhl+HjjwXBzMG3aNKlbyywMVgtDXLyt rMUJoVdYncdPcxJMKlNqM05aZkkiRL/joDZ96yUtCU+3bfvSJFiMoWUCNCGUQukwYWCIq3 u1pgIlFq2chEQtj0XX4gN0+deVvyFRgEM/he1DAfH0pXxOM1sabTv2E0mW1LLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705613745; 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=J7VT2fbyC2ibwMh/iMZvAsCHOdKyRWaUOIn+cO7bVm0=; b=cCmacYZI97yhr9KObi19kjefLl2w5s6cV+fddQ5IlJjq+RWCC4JjyvIAu/8b8bXU4BznsD OCK5vHF6NPfJknVMV282hh5wbobLmsEejkcOkbmGMerdQl11DdE/N0tRlZYUtlbn8SIXb4 X0/bsBnh6xUBYGW0ko++Q4m2TPucigHPxmYVA/U89BiJpnXPsRQBOKRGEUw6jaY0mI/gy3 I/j0RVuTF90V+V/aXzEqUo0fR1McZ/iiRjLx9PCLi9ih5KzyusbWrlYanrSEYwHQ0DLDjd NdrmuFatMoKm7RJzH3USVfHPgsXVVFcQc5suJjkGrFbXKIVSQhbQfdeAnRI6Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705613745; a=rsa-sha256; cv=none; b=LJCxJW7S9Wd5aH/ZJHJqciiuxvncE6kI66eOVcNg6Ye1qQKBnQ5z6MWF9SiyAgaDhRejd2 xjVV3oa0MNNtNvsy96ehtqc0pt1ax+mkW3QKLCvmtlVnLzRMBrjsJLM5H84Kl+hXGxi5lM uWFybaWkqHh4dROEDc8cPHYFGDx+vVn3fhBhWH+QO6f18398s6OaT7DfwxDddWtXzdUTxY CE0k+XO8D+NjGcflu5fU8rkU0hpYfu8edbIXIUoOWtMHdQcN5bAQo5PrwXZaJQouif62V1 luxUwtfjXLBmOj5EE33i5pAZ5Zzb54aISxIHA/upiAWas2y4/IYYHgO87PpqEg== Received: from [IPV6:2601:644:9381:f410:6096:c3ae:806c:48da] (unknown [IPv6:2601:644:9381:f410:6096:c3ae:806c:48da]) (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: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4TGGJK25pwz15tj; Thu, 18 Jan 2024 21:35:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Thu, 18 Jan 2024 13:35:43 -0800 List-Id: Commit messages for the main 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 Thunderbird Subject: Re: git: 773c13c686e4 - main - kldxref: skip .pkgsave files Content-Language: en-US To: Warner Losh Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202302251737.31PHb2R8072300@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/6/23 5:35 PM, Warner Losh wrote: > On Wed, Dec 6, 2023, 2:53 PM John Baldwin wrote: > >> On 12/6/23 1:41 PM, Warner Losh wrote: >>> Hey John, >>> >>> On Wed, Dec 6, 2023 at 2:13 PM John Baldwin wrote: >>> >>>> On 12/6/23 1:02 PM, Warner Losh wrote: >>>>> On Wed, Dec 6, 2023, 1:04 PM John Baldwin wrote: >>>>> >>>>>> On 2/25/23 9:37 AM, Warner Losh wrote: >>>>>>> The branch main has been updated by imp: >>>>>>> >>>>>>> URL: >>>>>> >>>> >> https://cgit.FreeBSD.org/src/commit/?id=773c13c686e4b6ae9dbbc150b342b82c3f47d73a >>>>>>> >>>>>>> commit 773c13c686e4b6ae9dbbc150b342b82c3f47d73a >>>>>>> Author: Mina Galić >>>>>>> AuthorDate: 2023-02-25 17:31:58 +0000 >>>>>>> Commit: Warner Losh >>>>>>> CommitDate: 2023-02-25 17:35:43 +0000 >>>>>>> >>>>>>> kldxref: skip .pkgsave files >>>>>>> >>>>>>> This should help people transitioning from traditional setups >> to >>>>>> pkgbase >>>>>>> experience a lot less friction. >>>>>>> >>>>>>> We do this by skipping all files containing two dots. >>>>>>> >>>>>>> Reviewed by: imp >>>>>>> Pull Request: https://github.com/freebsd/freebsd-src/pull/661 >>>>>>> Differential Revision: https://reviews.freebsd.org/D27959 >>>>>> >>>>>> This restriction is too broad and omits all of the modern wifi >> firmware >>>>>> klds from linker.hints, e.g. >>>>>> >>>>>> /boot/kernel/iwlwifi-3160-17.ucode.ko >>>>>> /boot/kernel/iwlwifi-3168-29.ucode.ko >>>>>> /boot/kernel/iwlwifi-7260-17.ucode.ko >>>>>> /boot/kernel/iwlwifi-7265-17.ucode.ko >>>>>> /boot/kernel/iwlwifi-7265D-29.ucode.ko >>>>>> /boot/kernel/iwlwifi-8000C-36.ucode.ko >>>>>> /boot/kernel/iwlwifi-8265-36.ucode.ko >>>>>> /boot/kernel/iwlwifi-9000-pu-b0-jf-b0-46.ucode.ko >>>>>> /boot/kernel/iwlwifi-9260-th-b0-jf-b0-46.ucode.ko >>>>>> /boot/kernel/iwlwifi-Qu-b0-hr-b0-77.ucode.ko >>>>>> /boot/kernel/iwlwifi-Qu-b0-jf-b0-77.ucode.ko >>>>>> /boot/kernel/iwlwifi-Qu-c0-hr-b0-77.ucode.ko >>>>>> /boot/kernel/iwlwifi-Qu-c0-jf-b0-77.ucode.ko >>>>>> /boot/kernel/iwlwifi-QuZ-a0-hr-b0-77.ucode.ko >>>>>> /boot/kernel/iwlwifi-QuZ-a0-jf-b0-77.ucode.ko >>>>>> /boot/kernel/iwlwifi-cc-a0-77.ucode.ko >>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0-83.ucode.ko >>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0.pnvm.ko >>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0-83.ucode.ko >>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0.pnvm.ko >>>>>> /boot/kernel/iwlwifi-so-a0-hr-b0-81.ucode.ko >>>>>> /boot/kernel/iwlwifi-so-a0-jf-b0-77.ucode.ko >>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0-83.ucode.ko >>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0.pnvm.ko >>>>>> /boot/kernel/rtw8723d_fw.bin.ko >>>>>> /boot/kernel/rtw8821c_fw.bin.ko >>>>>> /boot/kernel/rtw8822b_fw.bin.ko >>>>>> /boot/kernel/rtw8822c_fw.bin.ko >>>>>> /boot/kernel/rtw8822c_wow_fw.bin.ko >>>>>> >>>>>> all match this pattern and are skipped. >>>>>> >>>>>> I'm busy rewriting a bunch of kldxref to be a cross tool using libelf, >>>>>> but I think here you want to probably revert this and just add pkgsave >>>>>> to the list of "known bad" suffixes. >>>>>> >>>>> >>>>> Sure. Any reason to not just require .ko? Or do we have to index the >>>> kernel >>>>> too? >>>> >>>> We do index the kernel as well, yes. However, we could probably get by >>>> with "kernel" and ends in ".ko" as a valid set of files. This would >> also >>>> avoid bogusly warning about linker.hints not being a valid ELF file on >>>> re-runs if you use -v. >>>> >>> >>> Yea, that sounds good. I'll code it up and add you to the review. >>> >>> But why does it matter for these? Firmware is usually loaded by filename >>> and need not be elf... or are these wrapped in elf sections... >>> >>> I haven't noticed it breaking my linuxkpi wifi driver that have >> autoloaded >>> firmware... >> >> Hmm, afaik firmwares are loaded by "module name" where a firmware .ko >> contains >> one or more of the firmware modules. We happen today to generally only >> store one module in a single .ko (and with the same name), and in that case >> kern_linker.c may fallback to just trying to load "foo".ko if it doesn't >> find >> an entry in linker.hints, but if that is why it is working that is >> certainly >> by happy accident. >> >> I only found this by comparing klxref output btw on a stale i386 VM between >> the native kldxref in the VM (before this change) and my cross-arch version >> of kldxref. >> > > Ok. That all makes sense. I'll update my working tree tomorrow with the > revert and the replacement. Since it "works" today, I'll push the revert > and the fix at the same time unless the review takes too long. Ping, do you still have this fix in your pending tree? I noticed it is still there when doing MFC's of the libelf kldxref changes today. -- John Baldwin From nobody Thu Jan 18 21:47:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGGZH1Xd2z5751f for ; Thu, 18 Jan 2024 21:47:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 4TGGZG6fC6z4nsx for ; Thu, 18 Jan 2024 21:47:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e880121efso1155735e9.3 for ; Thu, 18 Jan 2024 13:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705614469; x=1706219269; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=U7W8V3V7WOTk/Nr7yZARoa8uVuLUDDaKvk/kPdvKXC4=; b=hMtU6GnaL/tzIVY0/1p7aPKskdQfNgyw76aqOL0jpneBe//YWnJSgGD0y679pIRH8c RmkUaVZM01yvSi2LnpQ9D/KibTuqSlTKxMy+JjaDxfRVXWZYqEnKgF5haoSAQi1jr3nE 5uVywu4/8IgnE5eOq9e0Qpe9KAzjaYuYn33Ft7Lj9Lz4lAsk/adD7qHxYtM3axhwrN05 RQwMr1QjXB3FbjUop6FYFb3LVygmYfAhJhlbIYgB9FDmIlLSwAhm8r9bwzjDrvzG9u/d QGRnCgiu+xwt70ml8KW2jZwGlUl/Nr87ZclZg/aySJKWlRHNvD/ydkD7YDM/eeunFUhm Idgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705614469; x=1706219269; 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=U7W8V3V7WOTk/Nr7yZARoa8uVuLUDDaKvk/kPdvKXC4=; b=CBrE8oq+Y3USwzZnuMW61PFX4YP+gKQd7i20E3DmjAM1E/0WuJU1kDzCZgjfSDFFzC k6GHnmm/rejSdMQ8RQ9IRMdNHkEuATyaFtvaKMU+7SCacNxc0TDEuviHeSWeWlY/YWVE 6BIFbvD740dTynv4um8qJO7U+oJrVSeNIpByGDUeyA22wjl562A8xQedbO1XT5x9YQB3 /3I9uny3qyLd9Pdm3adMx6a4INkLymL7KiqVStMpdYxLszcIUUnSenY5zzDbfJOYoYm8 RyCKSQ82Vh3hdlTP9p/Awk1MNMwukrdezYHcXPVHmQ3FjEq+Tp5/7S7nCKBNhAUdJILc bLHw== X-Gm-Message-State: AOJu0Yx8FCeL0mwFeELbXJtH5AVJewIADFFb5mHuJfs7IZxjOWotHFTF Agd3o7hwpq3HHUUOlTr+cFN14PaghOtFRILILjnP+yqtnr8iYXcyGEGGc0G9woREAxxiVtbkLAT V0MM78EchSPBv5G9y24H9k/WY+AritSgrAjKhhQ== X-Google-Smtp-Source: AGHT+IHEO7heJxqYjMmxnncPKR3EAXvFCUDpDcYG9NnRGNpgkXOJZwzLBpkNkj8qo7ne7wl95w2kYRFhRQFMGs6Uiao= X-Received: by 2002:a05:600c:19cb:b0:40e:50e9:9b0c with SMTP id u11-20020a05600c19cb00b0040e50e99b0cmr854768wmq.181.1705614469179; Thu, 18 Jan 2024 13:47:49 -0800 (PST) List-Id: Commit messages for the main 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: <202302251737.31PHb2R8072300@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 18 Jan 2024 14:47:37 -0700 Message-ID: Subject: Re: git: 773c13c686e4 - main - kldxref: skip .pkgsave files To: John Baldwin Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000008f3cd6060f3f506b" X-Rspamd-Queue-Id: 4TGGZG6fC6z4nsx X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --0000000000008f3cd6060f3f506b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Doh! This is what I have hanging around diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index 1694f069564b..25bfab7129e1 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -842,10 +842,10 @@ main(int argc, char *argv[]) continue; /* * Skip files that generate errors like .debug, .symbol and .pkgsave - * by generally skipping all files with 2 dots. + * by generally skipping all files not ending with ".ko". */ - dot =3D strchr(p->fts_name, '.'); - if (dot && strchr(dot + 1, '.') !=3D NULL) + dot =3D strrchr(p->fts_name, '.'); + if (dot =3D=3D NULL || strcmp(dot, ".ko") !=3D 0) continue; read_kld(p->fts_path, p->fts_name); } See anything obviously wrong with it before I make it into a phab? Sorry for the delay... Warner On Thu, Jan 18, 2024 at 2:35=E2=80=AFPM John Baldwin wrot= e: > On 12/6/23 5:35 PM, Warner Losh wrote: > > On Wed, Dec 6, 2023, 2:53 PM John Baldwin wrote: > > > >> On 12/6/23 1:41 PM, Warner Losh wrote: > >>> Hey John, > >>> > >>> On Wed, Dec 6, 2023 at 2:13=E2=80=AFPM John Baldwin = wrote: > >>> > >>>> On 12/6/23 1:02 PM, Warner Losh wrote: > >>>>> On Wed, Dec 6, 2023, 1:04 PM John Baldwin wrote: > >>>>> > >>>>>> On 2/25/23 9:37 AM, Warner Losh wrote: > >>>>>>> The branch main has been updated by imp: > >>>>>>> > >>>>>>> URL: > >>>>>> > >>>> > >> > https://cgit.FreeBSD.org/src/commit/?id=3D773c13c686e4b6ae9dbbc150b342b82= c3f47d73a > >>>>>>> > >>>>>>> commit 773c13c686e4b6ae9dbbc150b342b82c3f47d73a > >>>>>>> Author: Mina Gali=C4=87 > >>>>>>> AuthorDate: 2023-02-25 17:31:58 +0000 > >>>>>>> Commit: Warner Losh > >>>>>>> CommitDate: 2023-02-25 17:35:43 +0000 > >>>>>>> > >>>>>>> kldxref: skip .pkgsave files > >>>>>>> > >>>>>>> This should help people transitioning from traditional > setups > >> to > >>>>>> pkgbase > >>>>>>> experience a lot less friction. > >>>>>>> > >>>>>>> We do this by skipping all files containing two dots. > >>>>>>> > >>>>>>> Reviewed by: imp > >>>>>>> Pull Request: > https://github.com/freebsd/freebsd-src/pull/661 > >>>>>>> Differential Revision: https://reviews.freebsd.org/D27959 > >>>>>> > >>>>>> This restriction is too broad and omits all of the modern wifi > >> firmware > >>>>>> klds from linker.hints, e.g. > >>>>>> > >>>>>> /boot/kernel/iwlwifi-3160-17.ucode.ko > >>>>>> /boot/kernel/iwlwifi-3168-29.ucode.ko > >>>>>> /boot/kernel/iwlwifi-7260-17.ucode.ko > >>>>>> /boot/kernel/iwlwifi-7265-17.ucode.ko > >>>>>> /boot/kernel/iwlwifi-7265D-29.ucode.ko > >>>>>> /boot/kernel/iwlwifi-8000C-36.ucode.ko > >>>>>> /boot/kernel/iwlwifi-8265-36.ucode.ko > >>>>>> /boot/kernel/iwlwifi-9000-pu-b0-jf-b0-46.ucode.ko > >>>>>> /boot/kernel/iwlwifi-9260-th-b0-jf-b0-46.ucode.ko > >>>>>> /boot/kernel/iwlwifi-Qu-b0-hr-b0-77.ucode.ko > >>>>>> /boot/kernel/iwlwifi-Qu-b0-jf-b0-77.ucode.ko > >>>>>> /boot/kernel/iwlwifi-Qu-c0-hr-b0-77.ucode.ko > >>>>>> /boot/kernel/iwlwifi-Qu-c0-jf-b0-77.ucode.ko > >>>>>> /boot/kernel/iwlwifi-QuZ-a0-hr-b0-77.ucode.ko > >>>>>> /boot/kernel/iwlwifi-QuZ-a0-jf-b0-77.ucode.ko > >>>>>> /boot/kernel/iwlwifi-cc-a0-77.ucode.ko > >>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0-83.ucode.ko > >>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0.pnvm.ko > >>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0-83.ucode.ko > >>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0.pnvm.ko > >>>>>> /boot/kernel/iwlwifi-so-a0-hr-b0-81.ucode.ko > >>>>>> /boot/kernel/iwlwifi-so-a0-jf-b0-77.ucode.ko > >>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0-83.ucode.ko > >>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0.pnvm.ko > >>>>>> /boot/kernel/rtw8723d_fw.bin.ko > >>>>>> /boot/kernel/rtw8821c_fw.bin.ko > >>>>>> /boot/kernel/rtw8822b_fw.bin.ko > >>>>>> /boot/kernel/rtw8822c_fw.bin.ko > >>>>>> /boot/kernel/rtw8822c_wow_fw.bin.ko > >>>>>> > >>>>>> all match this pattern and are skipped. > >>>>>> > >>>>>> I'm busy rewriting a bunch of kldxref to be a cross tool using > libelf, > >>>>>> but I think here you want to probably revert this and just add > pkgsave > >>>>>> to the list of "known bad" suffixes. > >>>>>> > >>>>> > >>>>> Sure. Any reason to not just require .ko? Or do we have to index th= e > >>>> kernel > >>>>> too? > >>>> > >>>> We do index the kernel as well, yes. However, we could probably get > by > >>>> with "kernel" and ends in ".ko" as a valid set of files. This would > >> also > >>>> avoid bogusly warning about linker.hints not being a valid ELF file = on > >>>> re-runs if you use -v. > >>>> > >>> > >>> Yea, that sounds good. I'll code it up and add you to the review. > >>> > >>> But why does it matter for these? Firmware is usually loaded by > filename > >>> and need not be elf... or are these wrapped in elf sections... > >>> > >>> I haven't noticed it breaking my linuxkpi wifi driver that have > >> autoloaded > >>> firmware... > >> > >> Hmm, afaik firmwares are loaded by "module name" where a firmware .ko > >> contains > >> one or more of the firmware modules. We happen today to generally onl= y > >> store one module in a single .ko (and with the same name), and in that > case > >> kern_linker.c may fallback to just trying to load "foo".ko if it doesn= 't > >> find > >> an entry in linker.hints, but if that is why it is working that is > >> certainly > >> by happy accident. > >> > >> I only found this by comparing klxref output btw on a stale i386 VM > between > >> the native kldxref in the VM (before this change) and my cross-arch > version > >> of kldxref. > >> > > > > Ok. That all makes sense. I'll update my working tree tomorrow with the > > revert and the replacement. Since it "works" today, I'll push the rever= t > > and the fix at the same time unless the review takes too long. > > Ping, do you still have this fix in your pending tree? I noticed it is > still there when doing MFC's of the libelf kldxref changes today. > > -- > John Baldwin > > --0000000000008f3cd6060f3f506b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Doh! This is what I have hanging around

diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c
in= dex 1694f069564b..25bfab7129e1 100644
--- a/usr.sbin/kldxref/kldxref.c+++ b/usr.sbin/kldxref/kldxref.c
@@ -842,10 +842,10 @@ main(int argc, = char *argv[])
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0* Skip files that generate errors like .debug, .symbol and= .pkgsave
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* by generally skip= ping all files with 2 dots.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* by gen= erally skipping all files not ending with ".ko".
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
- =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 dot =3D strchr(p->fts_name, '.');
- =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dot && strchr(dot + 1, '.')= !=3D NULL)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 dot =3D strrchr(p->fts_name= , '.');
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dot =3D=3D NULL || str= cmp(dot, ".ko") !=3D 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 read_kld(p->fts_path, p->ft= s_name);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

See = anything obviously wrong with it before I make it into a phab?
Sorry for the delay...

Warner

On= Thu, Jan 18, 2024 at 2:35=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrote:
On 12/6/23 5:35 PM, Warner Losh wrote:
> On Wed, Dec 6, 2023, 2:53 PM John Baldwin <jhb@freebsd.org> wrote:
>
>> On 12/6/23 1:41 PM, Warner Losh wrote:
>>> Hey John,
>>>
>>> On Wed, Dec 6, 2023 at 2:13=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrot= e:
>>>
>>>> On 12/6/23 1:02 PM, Warner Losh wrote:
>>>>> On Wed, Dec 6, 2023, 1:04 PM John Baldwin <jhb@freebsd.org> wrote= :
>>>>>
>>>>>> On 2/25/23 9:37 AM, Warner Losh wrote:
>>>>>>> The branch main has been updated by imp:
>>>>>>>
>>>>>>> URL:
>>>>>>
>>>>
>> https://c= git.FreeBSD.org/src/commit/?id=3D773c13c686e4b6ae9dbbc150b342b82c3f47d73a
>>>>>>>
>>>>>>> commit 773c13c686e4b6ae9dbbc150b342b82c3f47d73= a
>>>>>>> Author:=C2=A0 =C2=A0 =C2=A0Mina Gali=C4=87 <= ;
freebsd@igalic.co>
>>>>>>> AuthorDate: 2023-02-25 17:31:58 +0000
>>>>>>> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp= @FreeBSD.org>
>>>>>>> CommitDate: 2023-02-25 17:35:43 +0000
>>>>>>>
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0kldxref: skip= .pkgsave files
>>>>>>>
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0This should h= elp people transitioning from traditional setups
>> to
>>>>>> pkgbase
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0experience a = lot less friction.
>>>>>>>
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0We do this by= skipping all files containing two dots.
>>>>>>>
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Reviewed by: = imp
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Pull Request:=
https://github.com/freebsd/freebsd-src/pull/661<= br> >>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Differential = Revision: https://reviews.freebsd.org/D27959
>>>>>>
>>>>>> This restriction is too broad and omits all of the= modern wifi
>> firmware
>>>>>> klds from linker.hints, e.g.
>>>>>>
>>>>>> /boot/kernel/iwlwifi-3160-17.ucode.ko
>>>>>> /boot/kernel/iwlwifi-3168-29.ucode.ko
>>>>>> /boot/kernel/iwlwifi-7260-17.ucode.ko
>>>>>> /boot/kernel/iwlwifi-7265-17.ucode.ko
>>>>>> /boot/kernel/iwlwifi-7265D-29.ucode.ko
>>>>>> /boot/kernel/iwlwifi-8000C-36.ucode.ko
>>>>>> /boot/kernel/iwlwifi-8265-36.ucode.ko
>>>>>> /boot/kernel/iwlwifi-9000-pu-b0-jf-b0-46.ucode.ko<= br> >>>>>> /boot/kernel/iwlwifi-9260-th-b0-jf-b0-46.ucode.ko<= br> >>>>>> /boot/kernel/iwlwifi-Qu-b0-hr-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-Qu-b0-jf-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-Qu-c0-hr-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-Qu-c0-jf-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-QuZ-a0-hr-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-QuZ-a0-jf-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-cc-a0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0-83.ucode.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0.pnvm.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0-83.ucode.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0.pnvm.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-hr-b0-81.ucode.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-jf-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0-83.ucode.ko
>>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0.pnvm.ko
>>>>>> /boot/kernel/rtw8723d_fw.bin.ko
>>>>>> /boot/kernel/rtw8821c_fw.bin.ko
>>>>>> /boot/kernel/rtw8822b_fw.bin.ko
>>>>>> /boot/kernel/rtw8822c_fw.bin.ko
>>>>>> /boot/kernel/rtw8822c_wow_fw.bin.ko
>>>>>>
>>>>>> all match this pattern and are skipped.
>>>>>>
>>>>>> I'm busy rewriting a bunch of kldxref to be a = cross tool using libelf,
>>>>>> but I think here you want to probably revert this = and just add pkgsave
>>>>>> to the list of "known bad" suffixes.
>>>>>>
>>>>>
>>>>> Sure. Any reason to not just require .ko? Or do we hav= e to index the
>>>> kernel
>>>>> too?
>>>>
>>>> We do index the kernel as well, yes.=C2=A0 However, we cou= ld probably get by
>>>> with "kernel" and ends in ".ko" as a v= alid set of files.=C2=A0 This would
>> also
>>>> avoid bogusly warning about linker.hints not being a valid= ELF file on
>>>> re-runs if you use -v.
>>>>
>>>
>>> Yea, that sounds good. I'll code it up and add you to the = review.
>>>
>>> But why does it matter for these? Firmware is usually loaded b= y filename
>>> and need not be elf... or are these wrapped in elf sections...=
>>>
>>> I haven't noticed it breaking my linuxkpi wifi driver that= have
>> autoloaded
>>> firmware...
>>
>> Hmm, afaik firmwares are loaded by "module name" where a= firmware .ko
>> contains
>> one or more of the firmware modules.=C2=A0 We happen today to gene= rally only
>> store one module in a single .ko (and with the same name), and in = that case
>> kern_linker.c may fallback to just trying to load "foo".= ko if it doesn't
>> find
>> an entry in linker.hints, but if that is why it is working that is=
>> certainly
>> by happy accident.
>>
>> I only found this by comparing klxref output btw on a stale i386 V= M between
>> the native kldxref in the VM (before this change) and my cross-arc= h version
>> of kldxref.
>>
>
> Ok. That all makes sense. I'll update my working tree tomorrow wit= h the
> revert and the replacement. Since it "works" today, I'll= push the revert
> and the fix at the same time unless the review takes too long.

Ping, do you still have this fix in your pending tree?=C2=A0 I noticed it i= s
still there when doing MFC's of the libelf kldxref changes today.

--
John Baldwin

--0000000000008f3cd6060f3f506b-- From nobody Thu Jan 18 21:49:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGGcb0Dx0z5756d for ; Thu, 18 Jan 2024 21:49:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (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 4TGGcY5rFNz4pMw for ; Thu, 18 Jan 2024 21:49:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=vw9s5Kh0; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::22e) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2cdb50d8982so1578081fa.2 for ; Thu, 18 Jan 2024 13:49:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705614588; x=1706219388; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WetM1GnJ4YYPzpFkB3Ln5b8E78qUyxndtR6Zq4owRM8=; b=vw9s5Kh0jm72BszNJ1ua7TMoGV+0zriy4GCM+7tOCscRnTY+2IRkSDdoIZgNLV8a+1 bY4rIX1otyAbhKGpCfStyUelUu8m+7IZ9NRlQaNgyb6g2xtGxTg6a4c2UCwH1RsT63iA rEsJxagnee/E5SYUZ4cha/irVYmJ1qkMaVBzwoDnlnwfar0eP21DhnMPvx7Ak6Ez459d tWOXrOIYQIOYZpXmM8etFHnW8uMBUfxZ0eceehPZRWxXbuuL5ksD/b4tgSrOMMrDoXrv tPoUQci58dhdvGY8w1R4cVJ+qzxfWx1GpGyxXYjzJfTinv3HIc6YRhTisguge7wYKfP/ ujEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705614588; x=1706219388; 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=WetM1GnJ4YYPzpFkB3Ln5b8E78qUyxndtR6Zq4owRM8=; b=abIbKHa0JnjtFkP0mkwfebKrZfi+7yUd4UUkisVajI/Ajpz+6C9iNg4ko3ZCr7/mba +cztQJtKdKnG0jEA1VVIRyhDSq5uqGB99ZlxQ3athqU+TvrY8GsY+6BbNxWuQELGez1W DydBRhIMwNtIAs7ptM6l5sjWMlPhM3ic9TAzPpJj7dOcNEgU2u2F1Jw0sqxJ8Hph8KPl BvHvHVBt7rR48UyEfyTIcQaB3A4cx7jmHLa2d7SrCQfHnegu9fgxIAEUKGTKxln68Tme H72V54MzEWCNMDc7bZHNe/3tJM5D2mdyj1QY5VijJZqTi/KES9XT2ZXfMxO3/I5PGKDa XwgA== X-Gm-Message-State: AOJu0YyKMuhMeruNc/fwciBdB4uIJy3Dn4YX1DKQ/f8+xTtuwZy6mXeG Bo56M5Mj38DWcgokPb6hIZNR6emAljvpMYX2//5WBrrMGicZZnVL+jGCJFaanKkWBsxUlhtdCZm hTTDlO+fITS9JMZVH05JjKeH8pvQqH1qR1qOblg== X-Google-Smtp-Source: AGHT+IHhtMEEeguXdL8QkcCx7qijYnpQJHDVu3c5S6JCRbhI76AFryicAWGtWjRJP4Wowx5oOqyoNRcT4bJgn4Cy40M= X-Received: by 2002:a05:651c:1991:b0:2cc:f163:fb6a with SMTP id bx17-20020a05651c199100b002ccf163fb6amr1171103ljb.53.1705614587724; Thu, 18 Jan 2024 13:49:47 -0800 (PST) List-Id: Commit messages for the main 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: <202302251737.31PHb2R8072300@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 18 Jan 2024 14:49:36 -0700 Message-ID: Subject: Re: git: 773c13c686e4 - main - kldxref: skip .pkgsave files To: John Baldwin Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000a01678060f3f577c" X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::22e:from]; DMARC_NA(0.00)[bsdimp.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; R_SPF_NA(0.00)[no SPF record]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4TGGcY5rFNz4pMw --000000000000a01678060f3f577c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 18, 2024 at 2:47=E2=80=AFPM Warner Losh wrote: > Doh! This is what I have hanging around > > diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c > index 1694f069564b..25bfab7129e1 100644 > --- a/usr.sbin/kldxref/kldxref.c > +++ b/usr.sbin/kldxref/kldxref.c > @@ -842,10 +842,10 @@ main(int argc, char *argv[]) > continue; > /* > * Skip files that generate errors like .debug, .symbol > and .pkgsave > - * by generally skipping all files with 2 dots. > + * by generally skipping all files not ending with ".ko". > */ > - dot =3D strchr(p->fts_name, '.'); > - if (dot && strchr(dot + 1, '.') !=3D NULL) > + dot =3D strrchr(p->fts_name, '.'); > + if (dot =3D=3D NULL || strcmp(dot, ".ko") !=3D 0) > continue; > read_kld(p->fts_path, p->fts_name); > } > > See anything obviously wrong with it before I make it into a phab? > > Sorry for the delay... > https://reviews.freebsd.org/D43507 Warner > Warner > > On Thu, Jan 18, 2024 at 2:35=E2=80=AFPM John Baldwin wr= ote: > >> On 12/6/23 5:35 PM, Warner Losh wrote: >> > On Wed, Dec 6, 2023, 2:53 PM John Baldwin wrote: >> > >> >> On 12/6/23 1:41 PM, Warner Losh wrote: >> >>> Hey John, >> >>> >> >>> On Wed, Dec 6, 2023 at 2:13=E2=80=AFPM John Baldwin wrote: >> >>> >> >>>> On 12/6/23 1:02 PM, Warner Losh wrote: >> >>>>> On Wed, Dec 6, 2023, 1:04 PM John Baldwin wrote: >> >>>>> >> >>>>>> On 2/25/23 9:37 AM, Warner Losh wrote: >> >>>>>>> The branch main has been updated by imp: >> >>>>>>> >> >>>>>>> URL: >> >>>>>> >> >>>> >> >> >> https://cgit.FreeBSD.org/src/commit/?id=3D773c13c686e4b6ae9dbbc150b342b8= 2c3f47d73a >> >>>>>>> >> >>>>>>> commit 773c13c686e4b6ae9dbbc150b342b82c3f47d73a >> >>>>>>> Author: Mina Gali=C4=87 >> >>>>>>> AuthorDate: 2023-02-25 17:31:58 +0000 >> >>>>>>> Commit: Warner Losh >> >>>>>>> CommitDate: 2023-02-25 17:35:43 +0000 >> >>>>>>> >> >>>>>>> kldxref: skip .pkgsave files >> >>>>>>> >> >>>>>>> This should help people transitioning from traditional >> setups >> >> to >> >>>>>> pkgbase >> >>>>>>> experience a lot less friction. >> >>>>>>> >> >>>>>>> We do this by skipping all files containing two dots. >> >>>>>>> >> >>>>>>> Reviewed by: imp >> >>>>>>> Pull Request: >> https://github.com/freebsd/freebsd-src/pull/661 >> >>>>>>> Differential Revision: https://reviews.freebsd.org/D2795= 9 >> >>>>>> >> >>>>>> This restriction is too broad and omits all of the modern wifi >> >> firmware >> >>>>>> klds from linker.hints, e.g. >> >>>>>> >> >>>>>> /boot/kernel/iwlwifi-3160-17.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-3168-29.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-7260-17.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-7265-17.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-7265D-29.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-8000C-36.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-8265-36.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-9000-pu-b0-jf-b0-46.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-9260-th-b0-jf-b0-46.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-Qu-b0-hr-b0-77.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-Qu-b0-jf-b0-77.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-Qu-c0-hr-b0-77.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-Qu-c0-jf-b0-77.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-QuZ-a0-hr-b0-77.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-QuZ-a0-jf-b0-77.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-cc-a0-77.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0-83.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0.pnvm.ko >> >>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0-83.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0.pnvm.ko >> >>>>>> /boot/kernel/iwlwifi-so-a0-hr-b0-81.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-so-a0-jf-b0-77.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0-83.ucode.ko >> >>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0.pnvm.ko >> >>>>>> /boot/kernel/rtw8723d_fw.bin.ko >> >>>>>> /boot/kernel/rtw8821c_fw.bin.ko >> >>>>>> /boot/kernel/rtw8822b_fw.bin.ko >> >>>>>> /boot/kernel/rtw8822c_fw.bin.ko >> >>>>>> /boot/kernel/rtw8822c_wow_fw.bin.ko >> >>>>>> >> >>>>>> all match this pattern and are skipped. >> >>>>>> >> >>>>>> I'm busy rewriting a bunch of kldxref to be a cross tool using >> libelf, >> >>>>>> but I think here you want to probably revert this and just add >> pkgsave >> >>>>>> to the list of "known bad" suffixes. >> >>>>>> >> >>>>> >> >>>>> Sure. Any reason to not just require .ko? Or do we have to index t= he >> >>>> kernel >> >>>>> too? >> >>>> >> >>>> We do index the kernel as well, yes. However, we could probably ge= t >> by >> >>>> with "kernel" and ends in ".ko" as a valid set of files. This woul= d >> >> also >> >>>> avoid bogusly warning about linker.hints not being a valid ELF file >> on >> >>>> re-runs if you use -v. >> >>>> >> >>> >> >>> Yea, that sounds good. I'll code it up and add you to the review. >> >>> >> >>> But why does it matter for these? Firmware is usually loaded by >> filename >> >>> and need not be elf... or are these wrapped in elf sections... >> >>> >> >>> I haven't noticed it breaking my linuxkpi wifi driver that have >> >> autoloaded >> >>> firmware... >> >> >> >> Hmm, afaik firmwares are loaded by "module name" where a firmware .ko >> >> contains >> >> one or more of the firmware modules. We happen today to generally on= ly >> >> store one module in a single .ko (and with the same name), and in tha= t >> case >> >> kern_linker.c may fallback to just trying to load "foo".ko if it >> doesn't >> >> find >> >> an entry in linker.hints, but if that is why it is working that is >> >> certainly >> >> by happy accident. >> >> >> >> I only found this by comparing klxref output btw on a stale i386 VM >> between >> >> the native kldxref in the VM (before this change) and my cross-arch >> version >> >> of kldxref. >> >> >> > >> > Ok. That all makes sense. I'll update my working tree tomorrow with th= e >> > revert and the replacement. Since it "works" today, I'll push the reve= rt >> > and the fix at the same time unless the review takes too long. >> >> Ping, do you still have this fix in your pending tree? I noticed it is >> still there when doing MFC's of the libelf kldxref changes today. >> >> -- >> John Baldwin >> >> --000000000000a01678060f3f577c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Jan 18, 2024 at 2:47=E2=80=AF= PM Warner Losh <imp@bsdimp.com>= wrote:
Doh! This is what I have hanging around

diff --= git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c
index 1694= f069564b..25bfab7129e1 100644
--- a/usr.sbin/kldxref/kldxref.c
+++ b/= usr.sbin/kldxref/kldxref.c
@@ -842,10 +842,10 @@ main(int argc, char *ar= gv[])
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 continue;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0* Skip files that generate errors like .debug, .symbol and .pkgsave<= br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* by generally skipping all f= iles with 2 dots.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* by generally ski= pping all files not ending with ".ko".
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
- =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 dot =3D strchr(p->fts_name, '.');
- =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 if (dot && strchr(dot + 1, '.') !=3D N= ULL)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 dot =3D strrchr(p->fts_name, '= .');
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dot =3D=3D NULL || strcmp(dot= , ".ko") !=3D 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 read_kld(p->fts_path, p->fts_name)= ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

See anythin= g obviously wrong with it before I make it into a phab?

Sorry for the delay...


Warner=C2=A0
Warner

On Thu, Jan 18, 2024 at 2:35=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrote:
On 12/6/23 5:35 PM, Warn= er Losh wrote:
> On Wed, Dec 6, 2023, 2:53 PM John Baldwin <jhb@freebsd.org> wrote:
>
>> On 12/6/23 1:41 PM, Warner Losh wrote:
>>> Hey John,
>>>
>>> On Wed, Dec 6, 2023 at 2:13=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrot= e:
>>>
>>>> On 12/6/23 1:02 PM, Warner Losh wrote:
>>>>> On Wed, Dec 6, 2023, 1:04 PM John Baldwin <jhb@freebsd.org> wrote= :
>>>>>
>>>>>> On 2/25/23 9:37 AM, Warner Losh wrote:
>>>>>>> The branch main has been updated by imp:
>>>>>>>
>>>>>>> URL:
>>>>>>
>>>>
>> https://c= git.FreeBSD.org/src/commit/?id=3D773c13c686e4b6ae9dbbc150b342b82c3f47d73a
>>>>>>>
>>>>>>> commit 773c13c686e4b6ae9dbbc150b342b82c3f47d73= a
>>>>>>> Author:=C2=A0 =C2=A0 =C2=A0Mina Gali=C4=87 <= ;
freebsd@igalic.co>
>>>>>>> AuthorDate: 2023-02-25 17:31:58 +0000
>>>>>>> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp= @FreeBSD.org>
>>>>>>> CommitDate: 2023-02-25 17:35:43 +0000
>>>>>>>
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0kldxref: skip= .pkgsave files
>>>>>>>
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0This should h= elp people transitioning from traditional setups
>> to
>>>>>> pkgbase
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0experience a = lot less friction.
>>>>>>>
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0We do this by= skipping all files containing two dots.
>>>>>>>
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Reviewed by: = imp
>>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Pull Request:=
https://github.com/freebsd/freebsd-src/pull/661<= br> >>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Differential = Revision: https://reviews.freebsd.org/D27959
>>>>>>
>>>>>> This restriction is too broad and omits all of the= modern wifi
>> firmware
>>>>>> klds from linker.hints, e.g.
>>>>>>
>>>>>> /boot/kernel/iwlwifi-3160-17.ucode.ko
>>>>>> /boot/kernel/iwlwifi-3168-29.ucode.ko
>>>>>> /boot/kernel/iwlwifi-7260-17.ucode.ko
>>>>>> /boot/kernel/iwlwifi-7265-17.ucode.ko
>>>>>> /boot/kernel/iwlwifi-7265D-29.ucode.ko
>>>>>> /boot/kernel/iwlwifi-8000C-36.ucode.ko
>>>>>> /boot/kernel/iwlwifi-8265-36.ucode.ko
>>>>>> /boot/kernel/iwlwifi-9000-pu-b0-jf-b0-46.ucode.ko<= br> >>>>>> /boot/kernel/iwlwifi-9260-th-b0-jf-b0-46.ucode.ko<= br> >>>>>> /boot/kernel/iwlwifi-Qu-b0-hr-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-Qu-b0-jf-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-Qu-c0-hr-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-Qu-c0-jf-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-QuZ-a0-hr-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-QuZ-a0-jf-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-cc-a0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0-83.ucode.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-gf-a0.pnvm.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0-83.ucode.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-gf4-a0.pnvm.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-hr-b0-81.ucode.ko
>>>>>> /boot/kernel/iwlwifi-so-a0-jf-b0-77.ucode.ko
>>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0-83.ucode.ko
>>>>>> /boot/kernel/iwlwifi-ty-a0-gf-a0.pnvm.ko
>>>>>> /boot/kernel/rtw8723d_fw.bin.ko
>>>>>> /boot/kernel/rtw8821c_fw.bin.ko
>>>>>> /boot/kernel/rtw8822b_fw.bin.ko
>>>>>> /boot/kernel/rtw8822c_fw.bin.ko
>>>>>> /boot/kernel/rtw8822c_wow_fw.bin.ko
>>>>>>
>>>>>> all match this pattern and are skipped.
>>>>>>
>>>>>> I'm busy rewriting a bunch of kldxref to be a = cross tool using libelf,
>>>>>> but I think here you want to probably revert this = and just add pkgsave
>>>>>> to the list of "known bad" suffixes.
>>>>>>
>>>>>
>>>>> Sure. Any reason to not just require .ko? Or do we hav= e to index the
>>>> kernel
>>>>> too?
>>>>
>>>> We do index the kernel as well, yes.=C2=A0 However, we cou= ld probably get by
>>>> with "kernel" and ends in ".ko" as a v= alid set of files.=C2=A0 This would
>> also
>>>> avoid bogusly warning about linker.hints not being a valid= ELF file on
>>>> re-runs if you use -v.
>>>>
>>>
>>> Yea, that sounds good. I'll code it up and add you to the = review.
>>>
>>> But why does it matter for these? Firmware is usually loaded b= y filename
>>> and need not be elf... or are these wrapped in elf sections...=
>>>
>>> I haven't noticed it breaking my linuxkpi wifi driver that= have
>> autoloaded
>>> firmware...
>>
>> Hmm, afaik firmwares are loaded by "module name" where a= firmware .ko
>> contains
>> one or more of the firmware modules.=C2=A0 We happen today to gene= rally only
>> store one module in a single .ko (and with the same name), and in = that case
>> kern_linker.c may fallback to just trying to load "foo".= ko if it doesn't
>> find
>> an entry in linker.hints, but if that is why it is working that is=
>> certainly
>> by happy accident.
>>
>> I only found this by comparing klxref output btw on a stale i386 V= M between
>> the native kldxref in the VM (before this change) and my cross-arc= h version
>> of kldxref.
>>
>
> Ok. That all makes sense. I'll update my working tree tomorrow wit= h the
> revert and the replacement. Since it "works" today, I'll= push the revert
> and the fix at the same time unless the review takes too long.

Ping, do you still have this fix in your pending tree?=C2=A0 I noticed it i= s
still there when doing MFC's of the libelf kldxref changes today.

--
John Baldwin

--000000000000a01678060f3f577c-- From nobody Thu Jan 18 21:51:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGGfG346tz5759S; Thu, 18 Jan 2024 21:51: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 4TGGfG2Y0xz4prN; Thu, 18 Jan 2024 21:51:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705614678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jcWZTwug0P7qUTI70lgvOp54xhralSH9yBSIK5xJy/A=; b=sW5iX0tj2ZJAXZDK+ApvSyhnuTV8p3kDrkfnEmO/xPZqwarVN3zD2nlcwnmdFbu2V7pnJF nv7ktMOgp59lY1J+Rm3Dh8SRB9jQn3F7xEFl614xj7zwMgfUDTBTHfXF0rpMYpqO2pAKBY 9YnTRNLm7/LTbRQNOway0LjHJlyA+S9iO6Cz3SXiISn3MU8HdyWXhb5Kd30QY/TihKeyrN OzYQB3hSDYTsRaFPmaemI7spp55+4LHRtXbvKWroCR9WexwB0Lf7gbKDaaPzhtdBfNked9 uU+nu6rqfuojPptmvXKpVGFKEaIsrrdqSkIEtXaT8216k7dRBh5RQ+ncU/IV7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705614678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jcWZTwug0P7qUTI70lgvOp54xhralSH9yBSIK5xJy/A=; b=Rdh34VMPJH5/3GiBfuaC9o/2OkB3i2Y+JSIHlM55EhB+uoapJv82RSE8JgGHhaKoSV7R21 xRzkM2P+1QtzDLcH1izNghNHtPs3+G9gErFs9fwDB7UuYQc5DcVKqtL5ZkUixtVZnmLlTa oplweWdueCKGjOmPE+YgS/NcgwkkBQp+mFZ11xoHctTTtYyVHbC2LOgd9mcSE0Y87+nlFv tK5YnUZhA3HGbGVzQ4kXhhyyXgpK0CT9PgDi+Lt1COZNWex7SBYTNUyk+U/OxOtwvN4Qeb cIY/eT+fhLE97K0W2hzPO3SfvPEPrJBP88O+rtu9A9HV/28HoIynfqgOwU6XDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705614678; a=rsa-sha256; cv=none; b=J85uSfIMvazU4DVzi72OsW0CnRsp2nvePK7ialKJ8T2PC3Xhf3SvhTR698lJazXtO8ndA/ Il4Uqe35cqCjaXxSlwl2h5jFhjI5wm3Mo5lGzEME3E3ZWuoB4gLbEsj2tog0us3OFWcxDv T50IlsI0VdO9m2tq8DgrHwbANHS7KFIq2JSZfBSBaE6sJ27IDOSI70qcTI5WaqGi/uvoKn lfX0m4d0Hv6qMWbtm0QsDemEXsit8+kYckvJRGv+0Cd8l7WxjRk1R6pYT0K5Un4FSsfp0L jlNMAoRaLanJZlA64DI1Oy3aJ/Tbyw5DaHHvWrIrg2HqeJv5eI5jLxQhCDIcmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGGfG1cVFzPDM; Thu, 18 Jan 2024 21:51:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ILpImv034380; Thu, 18 Jan 2024 21:51:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ILpIJg034377; Thu, 18 Jan 2024 21:51:18 GMT (envelope-from git) Date: Thu, 18 Jan 2024 21:51:18 GMT Message-Id: <202401182151.40ILpIJg034377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Gabriel M. Dutra" Subject: git: 1abc64bfbdb8 - main - committers-ports.dot: add myself (dutra) as a new ports committer List-Id: Commit messages for the main 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: dutra X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1abc64bfbdb8b977fd86de18b66b1ef28ce6650b Auto-Submitted: auto-generated The branch main has been updated by dutra: URL: https://cgit.FreeBSD.org/src/commit/?id=1abc64bfbdb8b977fd86de18b66b1ef28ce6650b commit 1abc64bfbdb8b977fd86de18b66b1ef28ce6650b Author: Gabriel M. Dutra AuthorDate: 2024-01-18 21:02:19 +0000 Commit: Gabriel M. Dutra CommitDate: 2024-01-18 21:02:19 +0000 committers-ports.dot: add myself (dutra) as a new ports committer Add entries about new ports committer (dutra) Update Mentor and Mentee Information Approved by: dbaio(mentor), garga(mentor) Differential Revision: https://reviews.freebsd.org/D43502 --- share/misc/committers-ports.dot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index cc20d7bdbd20..dd6e3d402166 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -52,6 +52,7 @@ daichi [label="Daichi Goto\ndaichi@FreeBSD.org\n2002/10/17\n2018/06/01"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03\n2015/06/11"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25\n2018/11/06"] dteske [label="Devin Teske\ndteske@FreeBSD.org\n2018/03/01\n2019/11/05"] +dutra [label="Gabriel M. Dutra\ndutra@FreeBSD.org\n2024/01/12"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22\n2016/11/16"] eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2003/11/12\n2006/12/14"] erwin [label="Erwin Lansing\nerwin@FreeBSD.org\n2003/06/04\n2016/10/12"] @@ -414,6 +415,7 @@ culot -> wg db -> tj db -> shurd +dbaio -> dutra dbaio -> eduardo decke -> sperber @@ -491,6 +493,7 @@ gabor -> scheidell garga -> acm garga -> alepulver garga -> dbaio +garga -> dutra garga -> eduardo garga -> mandree garga -> mm From nobody Thu Jan 18 21:54:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGGk35gqLz575LG; Thu, 18 Jan 2024 21:54: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 4TGGk34tSMz4qbM; Thu, 18 Jan 2024 21:54:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705614875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YWTwCnCXFf404N+hifEbavLp2IyCpus9zyjBB0g2Yoo=; b=xMArUbu/kP/Y6sI4Qfqw2NYGNRQvMC8uM1C2CN7EPYeXT9kDnmU5sYrocnu9+ZzWIqZcwv JuPTrIQcuCyihi2J5syOQQzZjSMuSsSuDTCbjLPbxACgbdANSGOCeqScCI/8KEc9fgERCf vWhqI2gcH9gHsfDRc2YZwaYD7VO6/5RGJJ8vgb3SW+Woa0pcG3n+MKuEJQZVxyDXjsrahO /wYGwpxCvNz/mNVAecJ+GNqfQcvxAVBuGgyUN6UutYEjSCYFE1v0dylcGk6JTm50syMob3 C8ilQAW71V73RKN+35atTnT0fsV/0ZER2rQWE+XGokMNyZl28LN3RKoWSSH/8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705614875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YWTwCnCXFf404N+hifEbavLp2IyCpus9zyjBB0g2Yoo=; b=GPzogn6/n2m/KI99MF6R9ser+UIHBLcHxU/58y6YpOlin1gSIehk0ggR3I4tLPUbVzVWAK ZDqT0XHaYB9A+/eVpkVaab73MNoqNZpHh2kA2KyealRpJFqx6vg9Focxn2fONgLg/TKnwd 9xFVcEAnqaNlLW7z5Q298wtQJ7UzVKxtx3fdh9qJd1syPxBHFR9MjIjtSApADXhZWTfSmj +jZi5Of8wjjuvSBXZ1wNLkf9pQSrSBliRCPqNBGuikoT1WsBxmCIcXDOQAgd2PIMhj06Dr rHrugQ4t7wAN5OBAw9eQFt8HBnH02R2zOKw/Qm2YpnViX/b6n2Y72Dlhcb5TJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705614875; a=rsa-sha256; cv=none; b=JwAJcf7JoNJ/JC1744Ym1ZF+qw4XPLZVkikvOEliqcHpiB2vqRpl3x3CNsfWcwr354i+xS zf1SjKy/7bb17yefupb4nd3Z/OtKGv3lzgiFc4N/ZEL/omL1N+KPqBnQINmyXoPr4RRKtD 33vLCJUrw3cqeDxhdDA9b1M4uI1Z+X3V1+VUK3C2ygi46XilKKTB6zNTepSt/c0pk5inVg /E3uVURq4nxsOrSOV9C6FYs+DKSia9dTRn/bcBpzvmcliwKRfFE/3eyiNRsJAA7vZiSEt0 c7pxyv4xVdiefJC5dFewyBj/h5O3b0i5R2JXjUH2IuEzKAxcz1g16cUdbvfnjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGGk33vQ2zPNQ; Thu, 18 Jan 2024 21:54:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40ILsZU1037059; Thu, 18 Jan 2024 21:54:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40ILsZcT037056; Thu, 18 Jan 2024 21:54:35 GMT (envelope-from git) Date: Thu, 18 Jan 2024 21:54:35 GMT Message-Id: <202401182154.40ILsZcT037056@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: 47a6fb9d5a2e - main - mlx5: Zero DMA memory mlx5_alloc_cmd_msg() and alloc_cmd_page() List-Id: Commit messages for the main 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: 47a6fb9d5a2ebec12114a604053ffbd2929f0021 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=47a6fb9d5a2ebec12114a604053ffbd2929f0021 commit 47a6fb9d5a2ebec12114a604053ffbd2929f0021 Author: Mark Johnston AuthorDate: 2024-01-18 21:47:52 +0000 Commit: Mark Johnston CommitDate: 2024-01-18 21:52:17 +0000 mlx5: Zero DMA memory mlx5_alloc_cmd_msg() and alloc_cmd_page() These functions may map more memory for DMA than is actually used, since the allocator operates on multiples of a 4KB page size. Thus, bus_dmamap_sync() can trigger KMSAN reports when the unused portion of a page is not zero-ed. Reported by: KMSAN Reviewed by: kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D43133 --- sys/dev/mlx5/mlx5_core/mlx5_cmd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c index 721b27b9120c..d46feb4b9e5b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c @@ -1113,11 +1113,16 @@ mlx5_alloc_cmd_msg(struct mlx5_core_dev *dev, gfp_t flags, size_t size) block = mlx5_fwp_get_virt(msg, i * MLX5_CMD_MBOX_SIZE); - memset(block, 0, MLX5_CMD_MBOX_SIZE); - if (i != (n - 1)) { + memset(block, 0, MLX5_CMD_MBOX_SIZE); + u64 dma = mlx5_fwp_get_dma(msg, (i + 1) * MLX5_CMD_MBOX_SIZE); block->next = cpu_to_be64(dma); + } else { + /* Zero the rest of the page to satisfy KMSAN. */ + memset(block, 0, MLX5_ADAPTER_PAGE_SIZE - + (i % MLX5_NUM_CMDS_IN_ADAPTER_PAGE) * + MLX5_CMD_MBOX_SIZE); } block->block_num = cpu_to_be32(i); } @@ -1508,6 +1513,7 @@ alloc_cmd_page(struct mlx5_core_dev *dev, struct mlx5_cmd *cmd) } cmd->dma = mlx5_fwp_get_dma(cmd->cmd_page, 0); cmd->cmd_buf = mlx5_fwp_get_virt(cmd->cmd_page, 0); + memset(cmd->cmd_buf, 0, MLX5_ADAPTER_PAGE_SIZE); return (0); failure_alloc_page: From nobody Fri Jan 19 00:10:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGKkZ3Cm0z57Lck; Fri, 19 Jan 2024 00:10:14 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.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 4TGKkZ1MBcz4Zc5; Fri, 19 Jan 2024 00:10:14 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6ddeb7b4366so121156a34.2; Thu, 18 Jan 2024 16:10:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705623013; x=1706227813; 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=tlpO9fcvaJ8qp0vscqdK+JkwxzftthaDeEz17JlrV24=; b=W2OvdXfwrjKJq7wNtqpmavUc8x4eh2zrkSyAervGUbDfE2PK52/Xa9QWrA/W607YzI eB2rIoG8vkCd1s4eN3ml/+mLefFSPqSKXP+rw2aEvZomKbTvTjNIR1ViawQnrd+W36Ug iqekmc1XEv5G/WXHKFaY1k7zlTlVVg4Y7qG8B/A7Z7Cz5SRYYKKIPRQV+hz+1N7mi5Ww rhp1LLhBLx3PwFe5PrTojyH3Zgq4sSRtYvOIJ2CDUGeYihI2VFF6a/jMBPnPm9MB1MwG f4xdoMgspTjdE7OPf/AM92R6zw11cmKdMiyTqHfVTcvdA2gEjSd3R/TyhIJXiRhv63zY saRQ== X-Gm-Message-State: AOJu0YyIU9yTdz/69GvQx6IkLEpqZ6ROiR4asNvnWvol3pWP6OEtWZiQ NlnrAoY1ofhYKbKc8GzbDhgmVuiaf6FbvPXPAgBnwb+mPoncK0+eUfN/O5ptpvwWKw== X-Google-Smtp-Source: AGHT+IFdY13jrCHJTvl1WpBmPo9AjqaJ0ieM2MI3sRhHMmhun4IbCM5xGEe/aBj1JxtRcUe54oz6Rg== X-Received: by 2002:a9d:630f:0:b0:6e0:ba99:8e43 with SMTP id q15-20020a9d630f000000b006e0ba998e43mr1566300otk.36.1705623012590; Thu, 18 Jan 2024 16:10:12 -0800 (PST) Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com. [209.85.161.47]) by smtp.gmail.com with ESMTPSA id a5-20020a9d5c85000000b006dbfbdeb12fsm405415oti.10.2024.01.18.16.10.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jan 2024 16:10:12 -0800 (PST) Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-59927972125so103930eaf.3; Thu, 18 Jan 2024 16:10:11 -0800 (PST) X-Received: by 2002:a05:6358:5bc6:b0:175:78e5:5e45 with SMTP id i6-20020a0563585bc600b0017578e55e45mr1917379rwf.29.1705623011709; Thu, 18 Jan 2024 16:10:11 -0800 (PST) List-Id: Commit messages for the main 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: <202401181523.40IFNvXI077592@gitrepo.freebsd.org> <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org> <20240118175553.9CC5E19B@slippy.cwsent.com> In-Reply-To: <20240118175553.9CC5E19B@slippy.cwsent.com> From: Alexander Richardson Date: Thu, 18 Jan 2024 16:10:00 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 0990136ed175 - main - kerberos5: Mitigate the possibility of using an old libcrypto To: Cy Schubert Cc: Jessica Clarke , Shawn Webb , Cy Schubert , "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: 4TGKkZ1MBcz4Zc5 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On Thu, 18 Jan 2024 at 10:06, Cy Schubert wrote: > > In message <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org>, Jessica > Clarke w > rites: > > On 18 Jan 2024, at 17:35, Shawn Webb wrote: > > >=20 > > > On Thu, Jan 18, 2024 at 05:29:47PM +0000, Jessica Clarke wrote: > > >> On 18 Jan 2024, at 15:23, Cy Schubert wrote: > > >>>=20 > > >>> The branch main has been updated by cy: > > >>>=20 > > >>> URL: = > > https://cgit.FreeBSD.org/src/commit/?id=3D0990136ed1753ac7837206f9c5f4b83c= > > cff6c405 > > >>>=20 > > >>> commit 0990136ed1753ac7837206f9c5f4b83ccff6c405 > > >>> Author: Cy Schubert > > >>> AuthorDate: 2024-01-18 08:22:20 +0000 > > >>> Commit: Cy Schubert > > >>> CommitDate: 2024-01-18 15:12:14 +0000 > > >>>=20 > > >>> kerberos5: Mitigate the possibility of using an old libcrypto > > >>>=20 > > >>> By using the full library name (libcrypto.so.30) we avoid the = > > exposure > > >>> of using an old, possibly vulnerable, library. > > >>>=20 > > >>> Reported by: jrtc27 > > >>> MFC after: 3 days > > >>> X-MFC with: 476d63e091c2 > > >>> Fixes: 476d63e091c2 > > >>> --- > > >>> kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 3 ++- > > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > > >>>=20 > > >>> diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c = > > b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > >>> index 497b32124f96..2328041bc166 100644 > > >>> --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > >>> +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > >>> @@ -5,6 +5,7 @@ > > >>> #include > > >>>=20 > > >>> #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > > >>> +#define CRYPTO_LIBRARY "/lib/libcrypto.so.30" > > >>=20 > > >> This still assumes the native ABI is in use, i.e. doesn=E2=80=99t = > > account for > > >> libcompat. Can we please just drop the directory, or if it=E2=80=99s = > > really > > >> needed for some reason at least handle the libcompat case? > > >=20 > > > Using relative paths might carry a potential security risk if the > > > LD_LIBRARY_PATH environment variable is set to an attacker-controlled > > > directory. > > > > That=E2=80=99s true for direct linking too, yet we don=E2=80=99t = > > hard-code everything > > everywhere there. What=E2=80=99s special about dlopen? > > The reason for dlopen is to avoid building libcrypto during pre-build. > libcrypto requires TARGET_ENDIANNESS to be defined. It is not defined when > cross building from Linux or MacOS. > > TARGET_ENDIANNESS is defined by bsd.endian.mk, which state: > > # During bootstrapping on !FreeBSD OSes, we need to define some value. > Short of > # having an exhaustive list for all variants of Linux and MacOS we simply > do not > # set TARGET_ENDIANNESS and poison the other variables. They should be > unused > # during the bootstrap phases (apart from one place that's adequately > protected > # in bsd.compiler.mk) where we're building the bootstrap tools. > > To avoid this requirement during we let libroken build as usual during > prebuild and load libcrypto, which is built later, thereby circumventing > the prebuild requirement and avoiding redesigning our prebuild to define > TARGET_ENDIANNESS for non-FreeBSD OSes. If the problem is just missing TARGET_ENDIANESS, we can add something like TARGET_ENDIANESS!=echo "__BYTE_ORDER__" | ${CC} -E -P - for the bootstrapping case. But it seems to me that we just need to define the L_ENDIAN/B_ENDIAN macros, can't that be done using the compiler-provided macros (or endian.h) from some internal config header instead (or even a new file injected via -include)? Alex > > I don't think anyone here is prepared to redesign prebuild for this one > single case. And, since Heimdal will be replaced by MIT, the requirement > for our old Heimdal to work with OpenSSL 3.0 will disappear. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > From nobody Fri Jan 19 01:53:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGN2B24prz57WKx; Fri, 19 Jan 2024 01:53:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TGN296fxRz4j6Z; Fri, 19 Jan 2024 01:53:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id QUzLrspJIGAIJQe4vriOyQ; Fri, 19 Jan 2024 01:53:53 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id Qe4rr3FF70nMNQe4srgak2; Fri, 19 Jan 2024 01:53:51 +0000 X-Authority-Analysis: v=2.4 cv=Qcx1A+Xv c=1 sm=1 tr=0 ts=65a9d62f a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=dEuoMetlWLkA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=ypVJL4-jAAAA:8 a=EkcXrb_YAAAA:8 a=6US-aupUcI2Dbu4WfqUA:9 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=khIbc0fXALFIcTpOSxgJ:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 8C4255B3; Thu, 18 Jan 2024 17:53:49 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 7E16A249; Thu, 18 Jan 2024 17:53:49 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Alexander Richardson cc: Cy Schubert , Jessica Clarke , Shawn Webb , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 0990136ed175 - main - kerberos5: Mitigate the possibility of using an old libcrypto In-reply-to: References: <202401181523.40IFNvXI077592@gitrepo.freebsd.org> <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org> <20240118175553.9CC5E19B@slippy.cwsent.com> Comments: In-reply-to Alexander Richardson message dated "Thu, 18 Jan 2024 16:10:00 -0800." List-Id: Commit messages for the main 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 Date: Thu, 18 Jan 2024 17:53:49 -0800 Message-Id: <20240119015349.7E16A249@slippy.cwsent.com> X-CMAE-Envelope: MS4xfIqn6ne7PHvWBajXlYZFJCfVcCWZi7+iFf5oObAIv94sSABX0QwqRZXeTf2p/sE9m6thSYAv7fwLvwC7NAWthDG0798mvZYD105z5eibcvmXWzoCStDG c13xYx6CSYZ8yqQO7QIbo77jCNWHf5hE2AH2Oy2G3aorVajucBXKrydFOKz5CfA+PwCiIOaTkdidcMdPa/3j1lv5xnnwRoq3zQtfX6c/XbfBkQHepVmudu85 AxPQaxxG8t7EUYAjUVxn6LJUhTEgoaXKDd1VybnGiedYU/sc810LE9nW+Np3EdbeTV/8y02MOpo0O2CbuKpUZEbjQutC7IBC+obUsD+MN/qTtNnRQCZxrtPa TEfCDpXlaD89LwWs7UqIT+SF2cAEGGKXfv64BrqficNJUo51lKTUe6+lmUWRgaMLHtpeYDeZnMzioUWAlyjIpmPJZyRagg== X-Rspamd-Queue-Id: 4TGN296fxRz4j6Z X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message , Alexander Richardson writes: > On Thu, 18 Jan 2024 at 10:06, Cy Schubert wrote: > > > > In message <973524D3-FCB2-47E1-B04F-BB42E18550C5@freebsd.org>, Jessica > > Clarke w > > rites: > > > On 18 Jan 2024, at 17:35, Shawn Webb wrote: > > > >=20 > > > > On Thu, Jan 18, 2024 at 05:29:47PM +0000, Jessica Clarke wrote: > > > >> On 18 Jan 2024, at 15:23, Cy Schubert wrote: > > > >>>=20 > > > >>> The branch main has been updated by cy: > > > >>>=20 > > > >>> URL: = > > > https://cgit.FreeBSD.org/src/commit/?id=3D0990136ed1753ac7837206f9c5f4b83 > c= > > > cff6c405 > > > >>>=20 > > > >>> commit 0990136ed1753ac7837206f9c5f4b83ccff6c405 > > > >>> Author: Cy Schubert > > > >>> AuthorDate: 2024-01-18 08:22:20 +0000 > > > >>> Commit: Cy Schubert > > > >>> CommitDate: 2024-01-18 15:12:14 +0000 > > > >>>=20 > > > >>> kerberos5: Mitigate the possibility of using an old libcrypto > > > >>>=20 > > > >>> By using the full library name (libcrypto.so.30) we avoid the = > > > exposure > > > >>> of using an old, possibly vulnerable, library. > > > >>>=20 > > > >>> Reported by: jrtc27 > > > >>> MFC after: 3 days > > > >>> X-MFC with: 476d63e091c2 > > > >>> Fixes: 476d63e091c2 > > > >>> --- > > > >>> kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 3 ++- > > > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > > > >>>=20 > > > >>> diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c = > > > b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > > >>> index 497b32124f96..2328041bc166 100644 > > > >>> --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > > >>> +++ b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c > > > >>> @@ -5,6 +5,7 @@ > > > >>> #include > > > >>>=20 > > > >>> #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >=3D 3) > > > >>> +#define CRYPTO_LIBRARY "/lib/libcrypto.so.30" > > > >>=20 > > > >> This still assumes the native ABI is in use, i.e. doesn=E2=80=99t = > > > account for > > > >> libcompat. Can we please just drop the directory, or if it=E2=80=99s = > > > really > > > >> needed for some reason at least handle the libcompat case? > > > >=20 > > > > Using relative paths might carry a potential security risk if the > > > > LD_LIBRARY_PATH environment variable is set to an attacker-controlled > > > > directory. > > > > > > That=E2=80=99s true for direct linking too, yet we don=E2=80=99t = > > > hard-code everything > > > everywhere there. What=E2=80=99s special about dlopen? > > > > The reason for dlopen is to avoid building libcrypto during pre-build. > > libcrypto requires TARGET_ENDIANNESS to be defined. It is not defined when > > cross building from Linux or MacOS. > > > > TARGET_ENDIANNESS is defined by bsd.endian.mk, which state: > > > > # During bootstrapping on !FreeBSD OSes, we need to define some value. > > Short of > > # having an exhaustive list for all variants of Linux and MacOS we simply > > do not > > # set TARGET_ENDIANNESS and poison the other variables. They should be > > unused > > # during the bootstrap phases (apart from one place that's adequately > > protected > > # in bsd.compiler.mk) where we're building the bootstrap tools. > > > > To avoid this requirement during we let libroken build as usual during > > prebuild and load libcrypto, which is built later, thereby circumventing > > the prebuild requirement and avoiding redesigning our prebuild to define > > TARGET_ENDIANNESS for non-FreeBSD OSes. > > If the problem is just missing TARGET_ENDIANESS, we can add something like > TARGET_ENDIANESS!=echo "__BYTE_ORDER__" | ${CC} -E -P - > for the bootstrapping case. But it seems to me that we just need to define th > e > L_ENDIAN/B_ENDIAN macros, can't that be done using the compiler-provided > macros (or endian.h) from some internal config header instead (or even > a new file injected via -include)? That would be a solution to making it possible for TARGET_ENDIANNESS consumers to build during prebuild. I can submit a phabricator review if people want. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Fri Jan 19 05:32:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGStV0hNfz57smp; Fri, 19 Jan 2024 05:32:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 4TGStS5rhtz43DZ; Fri, 19 Jan 2024 05:32:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b="e/b6ORx3"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::62a as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1d720c7fc04so1112135ad.2; Thu, 18 Jan 2024 21:32:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705642350; x=1706247150; darn=freebsd.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ro2QgUw34J644O8K9TNy/lP9YvQqc/WYggG3GI84/bc=; b=e/b6ORx3UdWxqOnEs0GdnW1XKGV13KbDyyolKDXGneygVomTm5Ud0PAradbT4AkrxN v0qnwXR0a1cF5izN5zYRoBFJmzU/tb8WeZg5Wk3oPzKAnCC2JvqY6a4QpyRXdOPx/jY8 byi5GQLRy9n3bWF3W9ldRSm2JYec+71PgC9wXuub8girrJ/H0gjZyRtdOlMeAZWr1MI4 8rhGUOmoUuPeRxTtwqSOa+YTsR595iVQ1lheM5oYPcsUL8W+VsmraRMvRez0ZbESmz8g eOCNdAdL34wkf7xDTgHTCppVdIpJexN7NJ6OyJnxjedIGuHQvFPrm+xPbY73UX4jIqXS PHkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705642350; x=1706247150; 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=ro2QgUw34J644O8K9TNy/lP9YvQqc/WYggG3GI84/bc=; b=FQLykxyR6LgEKGyWeOHuuQAD43AZOqk9VWEhJHpkjqmdDmRnv6cGR27yNjBMW/rBoI +rVYnQyGk9qNby6g6KrpjdnC/pMQILmFpyPZMwSUqp60lt2rZC5vwXFqiUzBNtv8Zv4d kYp0+kjOyLBQiA5mbVxOm3VxUMYzfrXOuHajZc1FoU0BHYzJDORhVWW4b9/f6K7Z8Rc8 avxnZpe973t8CdesQb5D2zhLEu1Le9s5/lQXnom/dQHm9UlRAkNgWgcG1wRnO3aHz3HU xLZeqiap33DC8qLXR1l2NddtWWai9jI1MBsz/9SBSLGCRfxmT9rr20PkEaEqvlUYzVYe Tqtw== X-Gm-Message-State: AOJu0Yz9KK6ZQUmY7l6lIzEaVorAIhKqNXgepqgv1HZG6iA2Jf7+16XC n0wzf95Ml0Su9kgtUobPL8SaRGCkFU3L2biMWs7//M5htOZA4T7eOgiwC35A X-Google-Smtp-Source: AGHT+IEwERI1Fw4HQZdS+lafpHb5tzI8oHrJn12D8Ou3T6TZW/pPEtvPmDMY4X62DwpCpnNAK5TPlA== X-Received: by 2002:a17:902:8ec5:b0:1d5:c0d5:221 with SMTP id x5-20020a1709028ec500b001d5c0d50221mr1799193plo.111.1705642350586; Thu, 18 Jan 2024 21:32:30 -0800 (PST) Received: from smtpclient.apple ([2601:601:782:be00:d5bb:cf41:87db:fb8a]) by smtp.gmail.com with ESMTPSA id u19-20020a170903305300b001d714a6eff7sm1113470pla.80.2024.01.18.21.32.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2024 21:32:30 -0800 (PST) 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 \(3774.300.61.1.2\)) Subject: Re: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free From: Enji Cooper In-Reply-To: <202401172250.40HMo4O9003460@gitrepo.freebsd.org> Date: Thu, 18 Jan 2024 21:32:19 -0800 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <8F36170D-9592-46D5-A275-12E24C3A13D8@gmail.com> References: <202401172250.40HMo4O9003460@gitrepo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62a:from] X-Rspamd-Queue-Id: 4TGStS5rhtz43DZ > On Jan 17, 2024, at 2:50=E2=80=AFPM, Alan Somers = wrote: >=20 > The branch main has been updated by asomers: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D8bae22bbbe6571da9259e0d43ffa8a56= f4b3e171 >=20 > commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 > Author: Alan Somers > AuthorDate: 2024-01-15 23:49:47 +0000 > Commit: Alan Somers > CommitDate: 2024-01-17 22:49:41 +0000 >=20 > fusefs: prefer new/delete over malloc/free >=20 > MFC after: 2 weeks > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D43464 Why not use smart pointers instead? -Enji From nobody Fri Jan 19 13:50:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGgwv2nqLz56XNC; Fri, 19 Jan 2024 13:50: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 4TGgwv2G9Dz4q4X; Fri, 19 Jan 2024 13:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705672223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fPH39f5ZEW9/3MMHKJOqQ2mpfjeeCB+K07lzGw+2YGA=; b=vOgyKmeyCRKWcr7BHnJfPbTVbIhxm63v0vV9+sNVqE6OV8FkKsHV8wQhZJM2IYI8L8+z7w LKbqoVWeZPjdoKQqL5lBnIArdlDt4sr58OjHiQfgplYrI2P6tMilnmoLmmuLsXvZgLqbko JvylM7wJ2LjbcyKyusIjulX1DzmBWY0xY9Px4++WOkGOY5fX5IQ022c5SJXDKwabmmMuQU 9eVgkqz8qaVFYvan+LqZnDsszQj7tMtN1j+gBINEaZqgz1jU4NMaUyT6JtEhP5NzVFKafa HDHRkfgg22C03qAZWSEE7F23FiepOE6p4K1qksQdE7KWeziFvdcsiDSOlyD4lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705672223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fPH39f5ZEW9/3MMHKJOqQ2mpfjeeCB+K07lzGw+2YGA=; b=nRYwUw3fDiMAZJUBsG2KtwhNsbi/rzu8De5pfowneJwYcRYMPx7jcq2rgv+jZUZiz1/dN7 CeD2X7GrmuO9frjM2qz78XnXPIy37xMZMy6My/wPR4i6sEs9UkykPhEhWNec619XHuhbLi gP+fhX9QBCbWR9gAR8EyiGk//UXjwOQRFWQvpiJGeSr2XhIPOxtQmnrvcEx0wmzYGPUNAK BznLpVuO8qxOLLTVqVVjIbZgWqB/TcI0Y88+qTRRsiPOL+FoFFppvveE7aezN3ZH1syUMe ATn8YXklH7GPo/bVj+DKes/tn+C03SGZ4ETsHWA25zBXUsR9JFJea0dryugSRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705672223; a=rsa-sha256; cv=none; b=SWXskMn1/XF+yVyywl7Olb2p/PczAACW4k/YKh4y4CYnbQkwqRyiduS2ueclQ1U12/Or+b Mp0Ed4LXTdqiw7zLBlQs15um3HWIpwqP5xVWYHI5aSc6Ox9xQW3C6DJK3ZRLwoEPNJd1td AuPjAg0fWu8r3CyVlS0GPTiEO/sZNp75tBjsoei1piwxvcrKAFHeou+VZ8+8FIwpPXUXaG 3u72bhdBFeYi6uJt5JrOC9H3gxppLMC6uj89Xd2d4lgeWP8hNOFEj+Xo1eHYslxP+/DPhz x6WOp0hu3Z8AdgFPFYVVTB1HNkppY3YIq+3pMifzdsY6pDpOFAImEAEo9CpU/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGgwv1JvPztHF; Fri, 19 Jan 2024 13:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40JDoNeg046705; Fri, 19 Jan 2024 13:50:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JDoNfu046703; Fri, 19 Jan 2024 13:50:23 GMT (envelope-from git) Date: Fri, 19 Jan 2024 13:50:23 GMT Message-Id: <202401191350.40JDoNfu046703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: dfe30e41967f - main - tcp: remove unused tcp_sack_output_debug() function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfe30e41967f9b5112c42ca20ec2c366db74cef9 Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=dfe30e41967f9b5112c42ca20ec2c366db74cef9 commit dfe30e41967f9b5112c42ca20ec2c366db74cef9 Author: Richard Scheffenegger AuthorDate: 2024-01-19 13:48:11 +0000 Commit: Richard Scheffenegger CommitDate: 2024-01-19 13:48:32 +0000 tcp: remove unused tcp_sack_output_debug() function This debugging code has been lingering for years with no known use. No functional change. Reviewed by: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43511 --- sys/netinet/tcp_sack.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 48efe855f689..f9ca83850c09 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -994,32 +994,6 @@ tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th) (void) tcp_output(tp); } -#if 0 -/* - * Debug version of tcp_sack_output() that walks the scoreboard. Used for - * now to sanity check the hint. - */ -static struct sackhole * -tcp_sack_output_debug(struct tcpcb *tp, int *sack_bytes_rexmt) -{ - struct sackhole *p; - - INP_WLOCK_ASSERT(tptoinpcb(tp)); - *sack_bytes_rexmt = 0; - TAILQ_FOREACH(p, &tp->snd_holes, scblink) { - if (SEQ_LT(p->rxmit, p->end)) { - if (SEQ_LT(p->rxmit, tp->snd_una)) {/* old SACK hole */ - continue; - } - *sack_bytes_rexmt += (p->rxmit - p->start); - break; - } - *sack_bytes_rexmt += (SEQ_MIN(p->rxmit, p->end) - p->start); - } - return (p); -} -#endif - /* * Returns the next hole to retransmit and the number of retransmitted bytes * from the scoreboard. We store both the next hole and the number of From nobody Fri Jan 19 13:56:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGh3t3Wmvz56YBW; Fri, 19 Jan 2024 13:56:26 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) (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 4TGh3t1CC4z4rJb; Fri, 19 Jan 2024 13:56:26 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-4b71b86ef81so214524e0c.2; Fri, 19 Jan 2024 05:56:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705672585; x=1706277385; h=content-transfer-encoding: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=d4SV6dNlejOC0OMMsrSbM3y8cUxHIzTKQbh4uqHhHzk=; b=g3u6GuB/ICfuQYKQTqOYCl3qg9P0K63XS3kYsy0AuiXk036Kei4Wun+YejredXJnQj 8EEq00T3Yq0wkD2aVuXGC5xomXRabk13PvDs+eNgxkNAXkMrCSJ0ZOLIiR/K2rBEuVW7 cAcIkRq79kLFftbTpQV9OiiDFQjh7kdjPludb+FAVBI19ArhifJ+p8KilKojnE+HtW2m /eyO+r1kGKEQntwTEnvK3OcGRiHopyxmmVpX2Xl3vj41k88TuO/x32X+rJMKEDVfZqW9 skzmSwNrH6kwedynTa507uYiepEBRY7Q2O1hJjbnjkYmsGXyo+F3Xd7XjTvdKQohMak5 q1iA== X-Gm-Message-State: AOJu0Yxn63JLMgrV0CkrjWx6QhJP3ZpJC2nq6okC/vx8h+OrcrpMuOAk sHHUGvUEzlsUXzFEn7Jepv7EY2/Q7phmuf7WyAlmzZWYAIXolA/HxBB0SZKeQHDjUxoxX7Mvr44 O2/jNMwLth5aw4f8Ratfi+EzEGQU= X-Google-Smtp-Source: AGHT+IHuxZ+9Ep0oW4mR3eZZpeERr8ENEZwPyuTBs82JRvjBqJx21/PKQcj11ZSz0Zcz4qLQa9tzav6VgqH+fxXyGgo= X-Received: by 2002:a1f:f848:0:b0:4ba:4a6f:5b11 with SMTP id w69-20020a1ff848000000b004ba4a6f5b11mr2153715vkh.23.1705672585226; Fri, 19 Jan 2024 05:56:25 -0800 (PST) List-Id: Commit messages for the main 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: <202401172250.40HMo4O9003460@gitrepo.freebsd.org> <8F36170D-9592-46D5-A275-12E24C3A13D8@gmail.com> In-Reply-To: <8F36170D-9592-46D5-A275-12E24C3A13D8@gmail.com> From: Alan Somers Date: Fri, 19 Jan 2024 06:56:13 -0700 Message-ID: Subject: Re: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free To: Enji Cooper 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-Rspamd-Queue-Id: 4TGh3t1CC4z4rJb X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On Thu, Jan 18, 2024 at 10:32=E2=80=AFPM Enji Cooper wrote: > > > > On Jan 17, 2024, at 2:50=E2=80=AFPM, Alan Somers = wrote: > > > > The branch main has been updated by asomers: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8bae22bbbe6571da9259e0d4= 3ffa8a56f4b3e171 > > > > commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 > > Author: Alan Somers > > AuthorDate: 2024-01-15 23:49:47 +0000 > > Commit: Alan Somers > > CommitDate: 2024-01-17 22:49:41 +0000 > > > > fusefs: prefer new/delete over malloc/free > > > > MFC after: 2 weeks > > Reviewed by: kib > > Differential Revision: https://reviews.freebsd.org/D43464 > > Why not use smart pointers instead? > -Enji Only because this stuff all evolved from C code. Smart pointers would certainly work. From nobody Fri Jan 19 15:38:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGkLR5y99z56kvx for ; Fri, 19 Jan 2024 15:39:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) (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 4TGkLQ5HDCz55lN for ; Fri, 19 Jan 2024 15:39:10 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.222.52 as permitted sender) smtp.mailfrom=asomers@gmail.com Received: by mail-ua1-f52.google.com with SMTP id a1e0cc1a2514c-7cbeaacbcb8so254718241.0 for ; Fri, 19 Jan 2024 07:39:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705678749; x=1706283549; h=content-transfer-encoding:cc: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=hBLEVoP8GcmMrt2vW2C4r1kCwjlz8+qHPjm+Xwcbedg=; b=egA/Y6GhbdbN+6A5qXHL2llQr3A6wyYzUSz31kwtQYFdMDQbXzbh4VVt2yRTTzfTHc fm4hG0/PERoauVlqDQzR+ti5/JrhjOEZ7M0mY3iB3s7nfRmqHN3x3hJ2fX1RC1eZbdru gv1pl/ZXCcTjaZx1YpKzuNsC9rLuMGlc+bRrRuayR20Rwn0D9nv3/P3kzyE9i18Ur1a+ NepfKraX+E4BLpKzJYPvsBdyIyNt5VjMOR8+NKzKrY6rQm+UuxOwxJ+NWQuFxP9IY+bN 87QElJv0AA3AoYK/7cBWQ5ZtpvtjjE/7ZbaHsH4lSINIbtUKVl3qU158K+Bt4iaYL7Hg DWOw== X-Gm-Message-State: AOJu0Yy03KJC/CCucgYDTxm7+k4fqbPORmPWgx3EpmLfVbpUAHERg4BY 9W9sOeCa4vytxgB9RJBsRCKmVvF0xWIw74nxY9TR7UwnezhESjvJ9dAV+NsJhWdADmnqxcBmj4S 6WLe4iPtroAr0WLQJTTwbe3+SjnE= X-Received: by 2002:a1f:cdc2:0:b0:4b6:ce62:adcd with SMTP id d185-20020a1fcdc2000000b004b6ce62adcdmt2313714vkg.3.1705678749195; Fri, 19 Jan 2024 07:39:09 -0800 (PST) List-Id: Commit messages for the main 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: <202401172250.40HMo4O9003460@gitrepo.freebsd.org> <8F36170D-9592-46D5-A275-12E24C3A13D8@gmail.com> In-Reply-To: From: Alan Somers Date: Fri, 19 Jan 2024 08:38:57 -0700 Message-ID: Subject: Re: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free Cc: Enji Cooper , "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-Spamd-Bar: / X-Spamd-Result: default: False [-0.49 / 15.00]; MISSING_TO(2.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.81)[-0.811]; NEURAL_HAM_SHORT(-0.78)[-0.783]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[209.85.222.52:from]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; MISSING_XM_UA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.222.52:from]; R_DKIM_NA(0.00)[]; FREEFALL_USER(0.00)[asomers]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4TGkLQ5HDCz55lN On Fri, Jan 19, 2024 at 6:56=E2=80=AFAM Alan Somers w= rote: > > On Thu, Jan 18, 2024 at 10:32=E2=80=AFPM Enji Cooper wrote: > > > > > > > On Jan 17, 2024, at 2:50=E2=80=AFPM, Alan Somers wrote: > > > > > > The branch main has been updated by asomers: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8bae22bbbe6571da9259e0= d43ffa8a56f4b3e171 > > > > > > commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 > > > Author: Alan Somers > > > AuthorDate: 2024-01-15 23:49:47 +0000 > > > Commit: Alan Somers > > > CommitDate: 2024-01-17 22:49:41 +0000 > > > > > > fusefs: prefer new/delete over malloc/free > > > > > > MFC after: 2 weeks > > > Reviewed by: kib > > > Differential Revision: https://reviews.freebsd.org/D43464 > > > > Why not use smart pointers instead? > > -Enji > > Only because this stuff all evolved from C code. Smart pointers would > certainly work. Actually, TBH it's because I'm not real great with C++. It's a difficult language, and after 2016 I stopped even trying to improve my C++ skills. Instead, I've been focusing on Rust. Even when I wrote these tests in 2019, I strongly considered using Rust instead of C++. In the end, the only thing that forced me to use C++ is because I wanted them to live in the base system, rather than in ports. I still dream about the day when Rust is allowed in the base system. If it were, then in addition to these tests, I would've converted gstat to Rust (rather than add sysutils/gstat-rs to ports), added the nfs-exporter (instead of putting it in net-mgmt/nfs-exporter), added a ctl-exporter (which is impossible to do in ports, so I had to do that one in C), and converted tools/regression/fsx in place (instead of putting in devel/fsx-rs). Maybe a couple of other things, too. Like ztop, or the geom-exporter that I have half-written. I've also been tempted to rewrite zfsd in Rust. Alas, I sense that there is little appetite for bringing Rust into contrib. -Alan From nobody Fri Jan 19 17:51:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGnGZ19lWz571v3; Fri, 19 Jan 2024 17:51: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 4TGnGZ0Y9Jz4W1b; Fri, 19 Jan 2024 17:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705686662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N4/ERfMSobQ+HhNM36bAN3A8HET2usB+ik8j0azBsSA=; b=cCngyc1jWRC3abDMZJNwF4Q3RtNWP6fnQuJBjzDRDiFDUDkjqCsRfKan+hZumAnICsILEt 5HpSAupBdOL0FNNF6pPVtzE+HnTihgHzkD+WnvnwMjk6+BrAoIjjA8jhFlgKkaGPl0PfzT hQxpxXhfp/pxH09bvjCihA7jWmx/thFK04wS8AKl/qOZUm4ZzIYXILou01WqWH09Alseye ms5MYysVx3lYe0HJwDJDv6m30W/agym8EX8coMhTpAqt5j8WIfNrxPI79il2loqtiN+hqe n7W5btG1L7FMWZGYnH/RPiqEWWmcAk7mbloDvva1EjanFhvky++akOoFjhjxRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705686662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N4/ERfMSobQ+HhNM36bAN3A8HET2usB+ik8j0azBsSA=; b=Lc4zh9UrN7LRFgzX126qfEAO3BBrxbpfeTPnMF3B2T4886U8v/poppuuDWrNg/df4T0hRC aqEVACQGtgege+fWcoAcn89hewCLCK49KyTpSf3xj0SrIFnnexJSkLAX1x5gnSZrXXf/2G R79IWzaURHzBbG9fJwg0njocGM9LSnF0hqjRxFY36XOAT/t4aCuNkuTuEkIxbdyj1OJMi8 XsRxRmuu1ectsh3Jpt/dN8YBCm+CFM7DOMzDM4OkDkucnpvHqL9W0uFo7BmWvjIVCIQsEf P/k6fn15poQyp9UEwylKvzxawwo646ag3QRPIJebhxSmTXoMbi2B+n369hKlig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705686662; a=rsa-sha256; cv=none; b=Zh/hNXZj7s2znzGqOBSnUVTPROoVJsAvfMaHlOUc0l2zJo6pFdvEeUmV81EUL8itTC0Xfi e5QN/P2a1afEOvqSJTAxP69ydhq1MrAXCbndnmSROqe6n1kFYK5tjmZDxgfnfYnb2Gprau Wo9VLeTx8xMSCOMHiAokPPKCtjuUq/5F+9swswp/Rbt1cZQwJJ79vbuVmW55qW7f6C4/3l c/SGRJwIXEoK1BPz9gtq0gC4fmD65ejeuk+YEX8QfNbZnA8EUG1/wj1AQE+m0R3zZIbFkU RGXjsZ9Eib0fxzx5jKXATAI3b2OvwO333hqY/tSFfGRt6FaLGOV85esQgWKyCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGnGY6l57z11Bs; Fri, 19 Jan 2024 17:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40JHp1lK058792; Fri, 19 Jan 2024 17:51:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JHp1QI058789; Fri, 19 Jan 2024 17:51:01 GMT (envelope-from git) Date: Fri, 19 Jan 2024 17:51:01 GMT Message-Id: <202401191751.40JHp1QI058789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 39f5d8dd1b2f - main - fusefs: fix some memory leaks in the tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39f5d8dd1b2fea7cff0770efb0bc3d6e33e24279 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=39f5d8dd1b2fea7cff0770efb0bc3d6e33e24279 commit 39f5d8dd1b2fea7cff0770efb0bc3d6e33e24279 Author: Alan Somers AuthorDate: 2024-01-17 21:13:05 +0000 Commit: Alan Somers CommitDate: 2024-01-19 17:44:32 +0000 fusefs: fix some memory leaks in the tests MFC after: 2 weeks --- tests/sys/fs/fusefs/fallocate.cc | 2 ++ tests/sys/fs/fusefs/mockfs.cc | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/sys/fs/fusefs/fallocate.cc b/tests/sys/fs/fusefs/fallocate.cc index 92e327be5ade..ff5e3eb4f4bb 100644 --- a/tests/sys/fs/fusefs/fallocate.cc +++ b/tests/sys/fs/fusefs/fallocate.cc @@ -302,6 +302,7 @@ TEST_F(Fspacectl, erofs) build_iovec(&iov, &iovlen, "fspath", (void*)statbuf.f_mntonname, -1); build_iovec(&iov, &iovlen, "from", __DECONST(void *, "/dev/fuse"), -1); ASSERT_EQ(0, nmount(iov, iovlen, newflags)) << strerror(errno); + free_iovec(&iov, &iovlen); EXPECT_EQ(-1, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL)); EXPECT_EQ(EROFS, errno); @@ -633,6 +634,7 @@ TEST_F(PosixFallocate, erofs) build_iovec(&iov, &iovlen, "fspath", (void*)statbuf.f_mntonname, -1); build_iovec(&iov, &iovlen, "from", __DECONST(void *, "/dev/fuse"), -1); ASSERT_EQ(0, nmount(iov, iovlen, newflags)) << strerror(errno); + free_iovec(&iov, &iovlen); EXPECT_EQ(EROFS, posix_fallocate(fd, offset, length)); diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index 92fc0c0d97a1..bd7bd1b663f9 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -521,6 +521,7 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, if (nmount(iov, iovlen, 0)) throw(std::system_error(errno, std::system_category(), "Couldn't mount filesystem")); + free_iovec(&iov, &iovlen); // Setup default handler ON_CALL(*this, process(_, _)) From nobody Fri Jan 19 18:15:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGnpP6SnPz574VT; Fri, 19 Jan 2024 18:15:09 +0000 (UTC) (envelope-from jhb@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 4TGnpP5r7Zz4Yv4; Fri, 19 Jan 2024 18:15:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705688109; 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=Mm0HbSTroYFeYmdXr21ppxegljJqwIE0ss4ZIqZyYik=; b=IqRW5OOsHtUjzZuAQ6aGxWGXf09V1SizwSzVq+Bg9jOMklEKmrtwDXWBZDB4Ishv8z8gOh G0TW+Ylc1oyGPfh1gPpfUTlCy7JOuMi6SzWJ9MD97s/Ha7tcDnF9k3FSNslLMoSISRbuIY UCJwDHsg0T2zEMDvG9l9gu59ZRsskA/YJFCgZ2DHNO/Ynh8mRLICSjQumPsULJfzuiZsNk sHihh0LLXvSYPgXRWu4vKWVS31JBfhzp/ZC0VpyftylvlYsLgFhhvVtS9Dkhrrs2wOKaYJ ZnkbH+6c8erL70BQNqTenMfRaIg+9RyVHxoHau61OO5W9ovWUCzjtkHgxTVzkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705688109; 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=Mm0HbSTroYFeYmdXr21ppxegljJqwIE0ss4ZIqZyYik=; b=cnvBgs5dy3SEcIBFr09ltV5pu59E5zrFsW8af6PWGf1AakrQJd80zMLOQtR2iny/s1FxIv StxHyqOVQZJ6NF+Px6GSY0xadDl4Vpv646kk411KNExn4e8Y3fyzXpjLZthF1bUk5Pxlib 9VHgpADFzUOtMjnTRrPBS9OqPKBUWcJTPhzngPETA+oFyYYsAFung0FdJdEbD1IpujZDpM c3OT0k1+dR7Fmft3eMl94iRRQSwGYWJpMLm73gSC+Gy10D72dfJt9+jZETMz732+SAEUQM HYh9QWQSuLhULejfMt9VJsggjSS7HEWPiM1Jbz4L4g/yDjCjXfnVtdzC0tJvRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705688109; a=rsa-sha256; cv=none; b=k+sqPbJjzeoLsj2MdDFVAzayfgnAWon0XbDyS+RTOHwR1dhfUjhe12kory6zAzuzE5SVWf CkaisfPjDoVCmz0zy7Zt7yd4kHlOp/7Nl+sFvQd3EpWEaLTySIHjnRP3SDTkWgdaUeqV9C ng4sVs9EX7Zh83YXFS3uSJfDQc1yDpWspzybdYK6uTI0xPyRrQIokI9PRqdVOLgq/A+G3c k3zHFx1n/S+6oV7GGTA2IUw1+4JsiXJJZ2hZ0mms1YXpVZGhwk7IQ5S4jAEVVI22mq6/GF JOQPP79iLKMmN3I8mJkT35xYP0BvhpAzA9sBGYGV/I3KEWPkBGKKfxhlaeA+6A== Received: from [IPV6:2601:644:9381:f410:f1f8:727d:5b89:e1a] (unknown [IPv6:2601:644:9381:f410:f1f8:727d:5b89:e1a]) (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: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4TGnpP1C2YzGQp; Fri, 19 Jan 2024 18:15:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Fri, 19 Jan 2024 10:15:06 -0800 List-Id: Commit messages for the main 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 Thunderbird Subject: Re: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free Content-Language: en-US To: Alan Somers Cc: Enji Cooper , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202401172250.40HMo4O9003460@gitrepo.freebsd.org> <8F36170D-9592-46D5-A275-12E24C3A13D8@gmail.com> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/19/24 7:38 AM, Alan Somers wrote: > On Fri, Jan 19, 2024 at 6:56 AM Alan Somers wrote: >> >> On Thu, Jan 18, 2024 at 10:32 PM Enji Cooper wrote: >>> >>> >>>> On Jan 17, 2024, at 2:50 PM, Alan Somers wrote: >>>> >>>> The branch main has been updated by asomers: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 >>>> >>>> commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 >>>> Author: Alan Somers >>>> AuthorDate: 2024-01-15 23:49:47 +0000 >>>> Commit: Alan Somers >>>> CommitDate: 2024-01-17 22:49:41 +0000 >>>> >>>> fusefs: prefer new/delete over malloc/free >>>> >>>> MFC after: 2 weeks >>>> Reviewed by: kib >>>> Differential Revision: https://reviews.freebsd.org/D43464 >>> >>> Why not use smart pointers instead? >>> -Enji >> >> Only because this stuff all evolved from C code. Smart pointers would >> certainly work. > > Actually, TBH it's because I'm not real great with C++. It's a > difficult language, and after 2016 I stopped even trying to improve my > C++ skills. Instead, I've been focusing on Rust. Even when I wrote > these tests in 2019, I strongly considered using Rust instead of C++. > In the end, the only thing that forced me to use C++ is because I > wanted them to live in the base system, rather than in ports. > > I still dream about the day when Rust is allowed in the base system. > If it were, then in addition to these tests, I would've converted > gstat to Rust (rather than add sysutils/gstat-rs to ports), added the > nfs-exporter (instead of putting it in net-mgmt/nfs-exporter), added a > ctl-exporter (which is impossible to do in ports, so I had to do that > one in C), and converted tools/regression/fsx in place (instead of > putting in devel/fsx-rs). Maybe a couple of other things, too. Like > ztop, or the geom-exporter that I have half-written. I've also been > tempted to rewrite zfsd in Rust. > > Alas, I sense that there is little appetite for bringing Rust into contrib. Brooks' opinion is that to support Rust in base we probably need to require always using an external toolchain as otherwise we would need to keep two copies of LLVM in base. -- John Baldwin From nobody Fri Jan 19 18:19:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGnw01vc5z574vW for ; Fri, 19 Jan 2024 18:20:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (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 4TGnw00Hgnz4ZfM for ; Fri, 19 Jan 2024 18:20:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-55a539d205aso1302348a12.3 for ; Fri, 19 Jan 2024 10:20:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705688398; x=1706293198; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xZh5mpH9wxIPQR3uCCooct92F8NqAH7a6N+nmjbwaXQ=; b=Uck27CiyJljjHgClcjjYI4+4b3GX+DZRHWiyE88cS2tsPuyeo2O5UZXLWDWnqNp1YH OzAV5zM83tPJZoTnMLVdo5DEYVV7QcMdmvQjyk3mWToF78HhufF7mnMmLrayzxpbBmv4 im8x7JY4AptMoqt0FDKvOyFkRX/GJwsmMsgIZ7lQ2mSp8uGJT0CA4NJFRZqMIB+aQOil Dy0mhZ72t2T9g8ZJERLqnhi4Z3U5QknO21Odk4TCGEr72qBRtuZRHVb2ETMv0VrwbVuc pSAuU4P/CZblGkeHUO88nDgEV+NQS08OMdSSTgaEXXUR9T6ZhHSzP5fSnbIV8Mj+8Vpx trOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705688398; x=1706293198; 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=xZh5mpH9wxIPQR3uCCooct92F8NqAH7a6N+nmjbwaXQ=; b=q4B9cMjTVKGKmHn2KjU2I3Gnj5RviRB9HM+MQKLl4A5cf7VvE3VNeXwalXodfMWDoF yEUDfWVCI/LN7VWrfhyARG6Hf84va8O2szFmHCYV/Zj5uhtjp/mUpvoeDPxgn8QFmJ43 OTkQKwsDarkQrJq2nNaT2U4rVdGUNk9DPs9GMLL7kjsFhVg5nWTt1gso4C1Ui7Lr3IHf CkpUzuui0z3nVM2yHqN6f6iLh/im1Q4Ug7a+EjTrxuMWzZL7B7/QkVALK7E/buBL9KNg f1vNN+9ZNtYWt+40Z6kuEyvDzy99e1XZBizZMMosTQT1lM/LKJLhYDgyFJ/WwOWH+dv4 2ZBA== X-Gm-Message-State: AOJu0YxJcdcko5PjVQ7NEGCukVQ6x18mrTeHbTf6pv2WiNzzi37L9GmM 7N8JxxETaM+FIll+0aPvVPa97BfEneWWo1M5zCMTNdbSz3EZNtmvKum/Z8ls9y5UR6aXoeIOYfy +8BwQIMgVrGQEA5IH9PQWsUADcriT6RTArCb84A== X-Google-Smtp-Source: AGHT+IH9wa6hpbdKB+ip5gjH9TLucb6C+bjjNnCOW6j6Jr7L6NtZggihHkC1qTCkDed0QWCHSu8SDF6mRlGs7y+lkh4= X-Received: by 2002:a05:6402:b21:b0:558:2ed7:3bfd with SMTP id bo1-20020a0564020b2100b005582ed73bfdmr79703edb.68.1705688398410; Fri, 19 Jan 2024 10:19:58 -0800 (PST) List-Id: Commit messages for the main 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: <202401172250.40HMo4O9003460@gitrepo.freebsd.org> <8F36170D-9592-46D5-A275-12E24C3A13D8@gmail.com> In-Reply-To: From: Warner Losh Date: Fri, 19 Jan 2024 11:19:47 -0700 Message-ID: Subject: Re: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free To: Alan Somers Cc: Enji Cooper , src-committers , "" , "" Content-Type: multipart/alternative; boundary="00000000000015c6b8060f50870e" X-Rspamd-Queue-Id: 4TGnw00Hgnz4ZfM X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --00000000000015c6b8060f50870e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 19, 2024, 8:39=E2=80=AFAM Alan Somers wro= te: > On Fri, Jan 19, 2024 at 6:56=E2=80=AFAM Alan Somers = wrote: > > > > On Thu, Jan 18, 2024 at 10:32=E2=80=AFPM Enji Cooper > wrote: > > > > > > > > > > On Jan 17, 2024, at 2:50=E2=80=AFPM, Alan Somers > wrote: > > > > > > > > The branch main has been updated by asomers: > > > > > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D8bae22bbbe6571da9259e0d43ffa8a5= 6f4b3e171 > > > > > > > > commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 > > > > Author: Alan Somers > > > > AuthorDate: 2024-01-15 23:49:47 +0000 > > > > Commit: Alan Somers > > > > CommitDate: 2024-01-17 22:49:41 +0000 > > > > > > > > fusefs: prefer new/delete over malloc/free > > > > > > > > MFC after: 2 weeks > > > > Reviewed by: kib > > > > Differential Revision: https://reviews.freebsd.org/D43464 > > > > > > Why not use smart pointers instead? > > > -Enji > > > > Only because this stuff all evolved from C code. Smart pointers would > > certainly work. > > Actually, TBH it's because I'm not real great with C++. It's a > difficult language, and after 2016 I stopped even trying to improve my > C++ skills. Instead, I've been focusing on Rust. Even when I wrote > these tests in 2019, I strongly considered using Rust instead of C++. > In the end, the only thing that forced me to use C++ is because I > wanted them to live in the base system, rather than in ports. > > I still dream about the day when Rust is allowed in the base system. > If it were, then in addition to these tests, I would've converted > gstat to Rust (rather than add sysutils/gstat-rs to ports), added the > nfs-exporter (instead of putting it in net-mgmt/nfs-exporter), added a > ctl-exporter (which is impossible to do in ports, so I had to do that > one in C), and converted tools/regression/fsx in place (instead of > putting in devel/fsx-rs). Maybe a couple of other things, too. Like > ztop, or the geom-exporter that I have half-written. I've also been > tempted to rewrite zfsd in Rust. > > Alas, I sense that there is little appetite for bringing Rust into contri= b. > I'd love there to be more tests written. One of the problems (one of many) with the tests is they are build during buildworld. This constrains them a bit too much, imho. While we can add a bunch of tests that are written in interpreted languages like python, per= l or pdksh, it's harder to add one written in an alternative language that's then compiled. Sometimes I think we should have a separate buildtests installtests which assume a post-installworld environment. That would let us build go, rust, etc tests. Though managing the crates, etc for the build might prove to be an interesting, though ports manage fairly well with carefully constructed packages. Rust is still evolving quickly relative to C. While C++ is also, it's not widely used in the tree so that evolution doesn't matter so much (though devd likely needs a full re-write) For rust to be considered in base, the community of developers likely would need to see visible success stories. While the ports that do the testing you mentioned are a good start, I'm of the opinion that having in-tree rust test cases would be helpful. Though there's no rust integration for kyua / ATF right now. I'd love to find some way to make this happen, possibly with the requirement that pkg install rust be done prior to the build, to show it's possible and to raise awareness of rust's viability and to shake out the inevitable growing pains that this will necessarily case. Tests are a good place to start since we already have a high burden on the users of the tests in terms of packages installed. We could have an opt-in set of rust tests that would fail if you didn't have the right ports installed (which we could encode into a metaport to keep it easy). But rust, itself, in the base has a lot of logistical issues since it isn't quite supported in llvm out of the box (I see john's note just now touching on this as well). But to put up with the logistical issues, there needs to be clearly demonstrated wins in our environment first, imho. I really, though, would be concerned if this means we go from 2 llvm builds to 4. Warner > --00000000000015c6b8060f50870e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Jan 19, 2024, 8:39=E2=80=AFAM= Alan Somers <a= somers@freebsd.org> wrote:
O= n Fri, Jan 19, 2024 at 6:56=E2=80=AFAM Alan Somers <asomers@freebsd.org= > wrote:
>
> On Thu, Jan 18, 2024 at 10:32=E2=80=AFPM Enji Cooper <yaneurabey= a@gmail.com> wrote:
> >
> >
> > > On Jan 17, 2024, at 2:50=E2=80=AFPM, Alan Somers <asomers= @FreeBSD.org> wrote:
> > >
> > > The branch main has been updated by asomers:
> > >
> > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8bae22bbbe6571da9259= e0d43ffa8a56f4b3e171
> > >
> > > commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171
> > > Author:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.o= rg>
> > > AuthorDate: 2024-01-15 23:49:47 +0000
> > > Commit:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.o= rg>
> > > CommitDate: 2024-01-17 22:49:41 +0000
> > >
> > >=C2=A0 =C2=A0 fusefs: prefer new/delete over malloc/free
> > >
> > >=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks
> > >=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kib
> > >=C2=A0 =C2=A0 Differential Revision: http= s://reviews.freebsd.org/D43464
> >
> > Why not use smart pointers instead?
> > -Enji
>
> Only because this stuff all evolved from C code.=C2=A0 Smart pointers = would
> certainly work.

Actually, TBH it's because I'm not real great with C++.=C2=A0 It= 9;s a
difficult language, and after 2016 I stopped even trying to improve my
C++ skills.=C2=A0 Instead, I've been focusing on Rust.=C2=A0 Even when = I wrote
these tests in 2019, I strongly considered using Rust instead of C++.
In the end, the only thing that forced me to use C++ is because I
wanted them to live in the base system, rather than in ports.

I still dream about the day when Rust is allowed in the base system.
If it were, then in addition to these tests, I would've converted
gstat to Rust (rather than add sysutils/gstat-rs to ports), added the
nfs-exporter (instead of putting it in net-mgmt/nfs-exporter), added a
ctl-exporter (which is impossible to do in ports, so I had to do that
one in C), and converted tools/regression/fsx in place (instead of
putting in devel/fsx-rs).=C2=A0 Maybe a couple of other things, too.=C2=A0 = Like
ztop, or the geom-exporter that I have half-written.=C2=A0 I've also be= en
tempted to rewrite zfsd in Rust.

Alas, I sense that there is little appetite for bringing Rust into contrib.=

I'd love = there to be more tests written.

One of the problem= s (one of many) with the tests is they are build during
buildworl= d. This constrains them a bit too much, imho. While we can add
a = bunch of tests that are written in interpreted languages like python, perl<= /div>
or pdksh, it's harder to add one written in an alternative la= nguage that's
then compiled. Sometimes I think we should have= a separate buildtests
installtests=C2=A0which assume a post-inst= allworld environment. That would let
us build go, rust, etc tests= . Though managing the crates, etc for the build
might prove to be= an interesting, though ports manage fairly well with carefully
c= onstructed packages.

Rust is still evolving quickl= y relative to C. While C++ is also, it's not widely
used in t= he tree so that evolution doesn't matter so much (though devd
likely needs a full re-write)

For rust to be cons= idered=C2=A0in base, the community=C2=A0of developers=C2=A0likely
would need to see visible success stories. While the ports that do
the testing you mentioned are a good start, I'm of the opinion that<= /div>
having in-tree rust test cases would be helpful. Though there'= ;s no
rust integration for kyua / ATF right now. I'd love to = find some way to
make this happen, possibly with the requirement = that pkg install rust
be done prior to the build, to show it'= s possible and to raise awareness
of rust's viability and to = shake out the inevitable growing pains that
this will necessarily= case. Tests are a good place to start since
we already have a hi= gh burden on the users of the tests in terms of
packages installe= d. We could have an opt-in set of rust tests that
would fail if y= ou didn't have the right ports installed (which we could
enco= de into a metaport to keep it easy).

But rust, its= elf, in the base has a lot of logistical issues since it isn't
quite supported in llvm out of the box (I see john's note just now to= uching
on this as well). But to put up with the logistical issues= , there needs to
be clearly demonstrated wins in our environment = first, imho. I really,
though, would be concerned if this means w= e go from 2 llvm builds to 4.

Warner
--00000000000015c6b8060f50870e-- From nobody Fri Jan 19 18:24:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGp1M4tkgz575Pk; Fri, 19 Jan 2024 18:24:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TGp1M2vCfz4bn0; Fri, 19 Jan 2024 18:24:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5ce9555d42eso930368a12.2; Fri, 19 Jan 2024 10:24:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705688677; x=1706293477; darn=freebsd.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=f0t7h/WGwFpAztwlYon7ZOur4glBqMyz4aJj06k74Cg=; b=RxaHAWC51wTGPkH9OVTA9qBGKh7avT/ZICTjs2vVDv5Q3e4qmPhmoFbPeOv7NnEAQh iGJxx17DhkqhREXgeJ4xI17bfEFxZ9pEcVHX1XvFw1070zwtVuujDJxd5G8aRp/qqtA7 qqX6c0JduINRXBfyecHQ2li1Gogvnln4ggPgZ4IXlscgcsThSlmsjZ42QpEPAB4o+z4Q 403KI1GG0iS3YNlHcN4qYRz4fI0xQ2eO8IXaNq0ADUFZXBp9y4Dgt6YipC5WnFsI87n8 PXmdHu8Kmp7E9hrEwVnKjAkBOo40NLCEL+mtNrgh6E3kmLpdOM2Qnpwo0XDQQetmw5dr XRdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705688677; x=1706293477; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f0t7h/WGwFpAztwlYon7ZOur4glBqMyz4aJj06k74Cg=; b=Vw8KVS2qERI9pbh7gD8Q6DF9HP0iT5bbfORlFylB/VXrp3DaQa3qi6V7sUQTX0PVDU Xk7n9p4lYA9aHWBjm6KRm7yvBDY5Bd3eJpQR4eBDSul3eE5dI93u7/CWvnparARl4Z0h 8kzdiOPw6yWVGkBlfoCwZxyPh5p7SOpasO124rE2eZCcsCoLvcH0EvlMIVo3O6XMllji KbYM5ga9ggxuHegsfM4RNIExNcZUXxp6/n9I74n18d8raydc6L3sOoJewIdDjLvvyPob tAFicLmCqssKZVzBy8s1Pfz54kT60+X5XycXvFwPSoyBHsjieYmpMAgm394+duH5MOyx XFyw== X-Gm-Message-State: AOJu0Yyc/L4Cz1hi0HiMkgl2FA0wgGQbR0RTh9HMGMXvlwGIIURtZdd0 9zmfgbAmwsRfITD6buNblml3I+gLd52xgWrQ65YLJ6b/UkZFF+Ei6Gp+c1vj X-Google-Smtp-Source: AGHT+IFYsb57ftHtn4drd82zMr32Q42qOmuPhMUSxUG7MttWQxZtixQxV7uSkl22X7FtHXuncVoikw== X-Received: by 2002:a05:6a20:3c94:b0:199:93de:f61f with SMTP id b20-20020a056a203c9400b0019993def61fmr331276pzj.34.1705688676687; Fri, 19 Jan 2024 10:24:36 -0800 (PST) Received: from smtpclient.apple ([2601:601:782:be00:5c74:acf5:5e74:533d]) by smtp.gmail.com with ESMTPSA id p17-20020a056a0026d100b006da2ee05031sm5469435pfw.117.2024.01.19.10.24.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Jan 2024 10:24:36 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Enji Cooper List-Id: Commit messages for the main 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 (1.0) Subject: Re: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free Date: Fri, 19 Jan 2024 10:24:25 -0800 Message-Id: <2A5657AE-C55D-492A-9013-9CFE1F80ED9C@gmail.com> References: Cc: Alan Somers , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org In-Reply-To: To: John Baldwin X-Mailer: iPhone Mail (21C66) X-Rspamd-Queue-Id: 4TGp1M2vCfz4bn0 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] > On Jan 19, 2024, at 10:15, John Baldwin wrote: >=20 > =EF=BB=BFOn 1/19/24 7:38 AM, Alan Somers wrote: >>> On Fri, Jan 19, 2024 at 6:56=E2=80=AFAM Alan Somers wrote: >>>=20 >>> On Thu, Jan 18, 2024 at 10:32=E2=80=AFPM Enji Cooper wrote: >>>>=20 >>>>=20 >>>>> On Jan 17, 2024, at 2:50=E2=80=AFPM, Alan Somers = wrote: >>>>>=20 >>>>> The branch main has been updated by asomers: >>>>>=20 >>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D8bae22bbbe6571da9259e0d= 43ffa8a56f4b3e171 >>>>>=20 >>>>> commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 >>>>> Author: Alan Somers >>>>> AuthorDate: 2024-01-15 23:49:47 +0000 >>>>> Commit: Alan Somers >>>>> CommitDate: 2024-01-17 22:49:41 +0000 >>>>>=20 >>>>> fusefs: prefer new/delete over malloc/free >>>>>=20 >>>>> MFC after: 2 weeks >>>>> Reviewed by: kib >>>>> Differential Revision: https://reviews.freebsd.org/D43464 >>>>=20 >>>> Why not use smart pointers instead? >>>> -Enji >>>=20 >>> Only because this stuff all evolved from C code. Smart pointers would >>> certainly work. >> Actually, TBH it's because I'm not real great with C++. It's a >> difficult language, and after 2016 I stopped even trying to improve my >> C++ skills. Instead, I've been focusing on Rust. Even when I wrote >> these tests in 2019, I strongly considered using Rust instead of C++. >> In the end, the only thing that forced me to use C++ is because I >> wanted them to live in the base system, rather than in ports. >> I still dream about the day when Rust is allowed in the base system. >> If it were, then in addition to these tests, I would've converted >> gstat to Rust (rather than add sysutils/gstat-rs to ports), added the >> nfs-exporter (instead of putting it in net-mgmt/nfs-exporter), added a >> ctl-exporter (which is impossible to do in ports, so I had to do that >> one in C), and converted tools/regression/fsx in place (instead of >> putting in devel/fsx-rs). Maybe a couple of other things, too. Like >> ztop, or the geom-exporter that I have half-written. I've also been >> tempted to rewrite zfsd in Rust. >> Alas, I sense that there is little appetite for bringing Rust into contri= b. >=20 > Brooks' opinion is that to support Rust in base we probably need to requir= e > always using an external toolchain as otherwise we would need to keep two > copies of LLVM in base. Based on my recent adventures with this, I concur. Our version of LLVM in ba= se is not compatible with the copy rust needs, so rust would always need to b= e bootstrapped with world. It would need to be a full toolchain as well to build all of the rust target= s. Using llvm built for a single target would only function as the initial b= ootstrap toolchain. Finally, the bootstrap compiler (via rustup) has tight requirements around v= ersioning and is precompiled for the host. It turns into a nightmare if new s= yscall support is added or if compat support is required to run the binary=E2= =80=A6 We=E2=80=99d be better off importing golang instead of rust. HTH, -Enji=20= From nobody Fri Jan 19 18:36:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGpGs4bydz576wR for ; Fri, 19 Jan 2024 18:36:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 4TGpGs0866z4gKk for ; Fri, 19 Jan 2024 18:36:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-559533e2503so1149380a12.1 for ; Fri, 19 Jan 2024 10:36:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1705689380; x=1706294180; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ITjVZRcx6VKjuN1hK6cWuF5KCQrtlHqD7IJ31OEygU0=; b=1lkv4bzPqwGH4Dd223tYtZonv/vaph6GMKKFBq34yy6FjnRndGh7a2VmMSJEiP3ona rJOu2flD2t0LfRSnjwNdmggafueMqHrAUM5aUxS1yVn54iHU4VzaFZWFnClAYS3ssfzx RsfFEeo/cg8P9S3Lj7LMxqU6drwCbV8gX7DvU5SZdHEjozuygrn9KYzaAm8j1JhFhy+d /ZK0LBucr8w4M81av2uKk4SxfYjk6ABiveCljim/zXTHbipLS/6XkFcOoMLlICmPCsCP F/xwEgJXuymApUXHeb1tM7R/036yvxUeiklcRzpNuUTDbMvPxqjbhlJHNyhCWOestyna qkPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705689380; x=1706294180; 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=ITjVZRcx6VKjuN1hK6cWuF5KCQrtlHqD7IJ31OEygU0=; b=G5FWaU7ZOK9P2OgVmQWdfaEhPrSGQxWnGPM21Xapzd8VaPQH9mafYJT+9IePCkXmaX laJlfRey0Lg6uzpq3wI5dc86W/gDLlqygZGJpTTG5IkLxIAPmv5dldgg+aE6Z/MO4Zl6 68E5sx18u+Dv2Lt8LGbumz5OznmE/AzYigEtLPPdOBknM82rMZid3vlrqhcZe1ipbTlw xEl0se2p3kbKCPJs2x9lhfAbNSYYZQHGzU3ZJ4tNXW5qNjSMet4LedUn7p9AREbInk7i JSJk5jUdx707/knHyBkPOGyznD3SdiSGKCexmbO1mQWU3yWe31OlYPzuHiX/6DDyhegD nZCA== X-Gm-Message-State: AOJu0YxVcMMmpBsElx0wvVPR4gM3L1QLhc2Vb900ahs2ShSe0hkbZHoR YpdyswZWteED9rz0mRO1eHFJ1OveYGCO6Nwwg3yK2UZoa4N/s3agUcHSVGqzIsfMjzG03bsl+03 RAzEkUCzJDn+2DrDZHsDfn6vg7udjGfnUWcTD0Q== X-Google-Smtp-Source: AGHT+IHJY2+Iu5/ZCrQhN30ZiNCuSASP+yxwATfMVVQ3sv7C0arcFaEGGwNJUmVc3lt98Z3OItIYbE6qOWMXRbDN1Ck= X-Received: by 2002:a05:6402:1497:b0:55a:4e80:5b0e with SMTP id e23-20020a056402149700b0055a4e805b0emr93671edv.68.1705689379727; Fri, 19 Jan 2024 10:36:19 -0800 (PST) List-Id: Commit messages for the main 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: <2A5657AE-C55D-492A-9013-9CFE1F80ED9C@gmail.com> In-Reply-To: <2A5657AE-C55D-492A-9013-9CFE1F80ED9C@gmail.com> From: Warner Losh Date: Fri, 19 Jan 2024 11:36:08 -0700 Message-ID: Subject: Re: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free To: Enji Cooper Cc: John Baldwin , Alan Somers , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000937bef060f50c177" X-Rspamd-Queue-Id: 4TGpGs0866z4gKk X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --000000000000937bef060f50c177 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 19, 2024 at 11:24=E2=80=AFAM Enji Cooper wrote: > > > On Jan 19, 2024, at 10:15, John Baldwin wrote: > > > > =EF=BB=BFOn 1/19/24 7:38 AM, Alan Somers wrote: > >>> On Fri, Jan 19, 2024 at 6:56=E2=80=AFAM Alan Somers > wrote: > >>> > >>> On Thu, Jan 18, 2024 at 10:32=E2=80=AFPM Enji Cooper > wrote: > >>>> > >>>> > >>>>> On Jan 17, 2024, at 2:50=E2=80=AFPM, Alan Somers > wrote: > >>>>> > >>>>> The branch main has been updated by asomers: > >>>>> > >>>>> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D8bae22bbbe6571da9259e0d43ffa8a5= 6f4b3e171 > >>>>> > >>>>> commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 > >>>>> Author: Alan Somers > >>>>> AuthorDate: 2024-01-15 23:49:47 +0000 > >>>>> Commit: Alan Somers > >>>>> CommitDate: 2024-01-17 22:49:41 +0000 > >>>>> > >>>>> fusefs: prefer new/delete over malloc/free > >>>>> > >>>>> MFC after: 2 weeks > >>>>> Reviewed by: kib > >>>>> Differential Revision: https://reviews.freebsd.org/D43464 > >>>> > >>>> Why not use smart pointers instead? > >>>> -Enji > >>> > >>> Only because this stuff all evolved from C code. Smart pointers woul= d > >>> certainly work. > >> Actually, TBH it's because I'm not real great with C++. It's a > >> difficult language, and after 2016 I stopped even trying to improve my > >> C++ skills. Instead, I've been focusing on Rust. Even when I wrote > >> these tests in 2019, I strongly considered using Rust instead of C++. > >> In the end, the only thing that forced me to use C++ is because I > >> wanted them to live in the base system, rather than in ports. > >> I still dream about the day when Rust is allowed in the base system. > >> If it were, then in addition to these tests, I would've converted > >> gstat to Rust (rather than add sysutils/gstat-rs to ports), added the > >> nfs-exporter (instead of putting it in net-mgmt/nfs-exporter), added a > >> ctl-exporter (which is impossible to do in ports, so I had to do that > >> one in C), and converted tools/regression/fsx in place (instead of > >> putting in devel/fsx-rs). Maybe a couple of other things, too. Like > >> ztop, or the geom-exporter that I have half-written. I've also been > >> tempted to rewrite zfsd in Rust. > >> Alas, I sense that there is little appetite for bringing Rust into > contrib. > > > > Brooks' opinion is that to support Rust in base we probably need to > require > > always using an external toolchain as otherwise we would need to keep t= wo > > copies of LLVM in base. > > Based on my recent adventures with this, I concur. Our version of LLVM in > base is not compatible with the copy rust needs, so rust would always nee= d > to be bootstrapped with world. > > It would need to be a full toolchain as well to build all of the rust > targets. Using llvm built for a single target would only function as the > initial bootstrap toolchain. > > Finally, the bootstrap compiler (via rustup) has tight requirements aroun= d > versioning and is precompiled for the host. It turns into a nightmare if > new syscall support is added or if compat support is required to run the > binary=E2=80=A6 > > We=E2=80=99d be better off importing golang instead of rust. > I have no problems supporting rust via an external toolchain, but I'd also view that support to be provisional: Show us what can be done better and the niggling issues that one hits around toolchain stuff somehow is paid for with something that's way cooler than we could otherwise have. Tests seem like a natural first step in that. I mean, if we can't even support tests without it being a hassle, then it's a complete no-go. If we can, then what else can we support? For more ambitious things, there's always ports and the base / ports distinction is likely to fade somewhat as pkgbase becomes more mature. Warner --000000000000937bef060f50c177 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Jan 19, 2024 at 11:24=E2=80= =AFAM Enji Cooper <yaneurabeya@= gmail.com> wrote:

> On Jan 19, 2024, at 10:15, John Baldwin <jhb@freebsd.org> wrote:
>
> =EF=BB=BFOn 1/19/24 7:38 AM, Alan Somers wrote:
>>> On Fri, Jan 19, 2024 at 6:56=E2=80=AFAM Alan Somers <asomers@freebsd.org&= gt; wrote:
>>>
>>> On Thu, Jan 18, 2024 at 10:32=E2=80=AFPM Enji Cooper <yaneurabeya@gmail.com= > wrote:
>>>>
>>>>
>>>>> On Jan 17, 2024, at 2:50=E2=80=AFPM, Alan Somers <a= somers@FreeBSD.org> wrote:
>>>>>
>>>>> The branch main has been updated by asomers:
>>>>>
>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D8bae22bbbe6571da9259e0d43= ffa8a56f4b3e171
>>>>>
>>>>> commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171
>>>>> Author:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@Fre= eBSD.org>
>>>>> AuthorDate: 2024-01-15 23:49:47 +0000
>>>>> Commit:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@Fre= eBSD.org>
>>>>> CommitDate: 2024-01-17 22:49:41 +0000
>>>>>
>>>>>=C2=A0 =C2=A0 fusefs: prefer new/delete over malloc/fre= e
>>>>>
>>>>>=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks >>>>>=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kib
>>>>>=C2=A0 =C2=A0 Differential Revision: https://r= eviews.freebsd.org/D43464
>>>>
>>>> Why not use smart pointers instead?
>>>> -Enji
>>>
>>> Only because this stuff all evolved from C code.=C2=A0 Smart p= ointers would
>>> certainly work.
>> Actually, TBH it's because I'm not real great with C++.=C2= =A0 It's a
>> difficult language, and after 2016 I stopped even trying to improv= e my
>> C++ skills.=C2=A0 Instead, I've been focusing on Rust.=C2=A0 E= ven when I wrote
>> these tests in 2019, I strongly considered using Rust instead of C= ++.
>> In the end, the only thing that forced me to use C++ is because I<= br> >> wanted them to live in the base system, rather than in ports.
>> I still dream about the day when Rust is allowed in the base syste= m.
>> If it were, then in addition to these tests, I would've conver= ted
>> gstat to Rust (rather than add sysutils/gstat-rs to ports), added = the
>> nfs-exporter (instead of putting it in net-mgmt/nfs-exporter), add= ed a
>> ctl-exporter (which is impossible to do in ports, so I had to do t= hat
>> one in C), and converted tools/regression/fsx in place (instead of=
>> putting in devel/fsx-rs).=C2=A0 Maybe a couple of other things, to= o.=C2=A0 Like
>> ztop, or the geom-exporter that I have half-written.=C2=A0 I'v= e also been
>> tempted to rewrite zfsd in Rust.
>> Alas, I sense that there is little appetite for bringing Rust into= contrib.
>
> Brooks' opinion is that to support Rust in base we probably need t= o require
> always using an external toolchain as otherwise we would need to keep = two
> copies of LLVM in base.

Based on my recent adventures with this, I concur. Our version of LLVM in b= ase is not compatible with the copy rust needs, so rust would always need t= o be bootstrapped with world.

It would need to be a full toolchain as well to build all of the rust targe= ts. Using llvm built for a single target would only function as the initial= bootstrap toolchain.

Finally, the bootstrap compiler (via rustup) has tight requirements around = versioning and is precompiled for the host. It turns into a nightmare if ne= w syscall support is added or if compat support is required to run the bina= ry=E2=80=A6

We=E2=80=99d be better off importing golang instead of rust.

I have no problems supporting rust via an external to= olchain, but I'd also view that support
to be provisional: Sh= ow us what can be done better and the niggling issues that one hits
around toolchain stuff somehow is paid for with something that's way= cooler than we could
otherwise have. Tests seem like a natural f= irst step in that. I mean, if we can't even support
tests wit= hout it being a hassle, then it's a complete no-go. If we can, then wha= t else can we
support? For more ambitious things, there's alw= ays ports and the base / ports distinction is
likely to fade some= what as pkgbase becomes more mature.

Warner
<= /div>
--000000000000937bef060f50c177-- From nobody Fri Jan 19 18:49:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGpZ44Wj2z577ry; Fri, 19 Jan 2024 18:49:32 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_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 4TGpZ42qHDz4jk4; Fri, 19 Jan 2024 18:49:32 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 3FC203C019A; Fri, 19 Jan 2024 18:49:31 +0000 (UTC) Date: Fri, 19 Jan 2024 18:49:31 +0000 From: Brooks Davis To: John Baldwin Cc: Alan Somers , Enji Cooper , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 8bae22bbbe65 - main - fusefs: prefer new/delete over malloc/free Message-ID: References: <202401172250.40HMo4O9003460@gitrepo.freebsd.org> <8F36170D-9592-46D5-A275-12E24C3A13D8@gmail.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: X-Rspamd-Queue-Id: 4TGpZ42qHDz4jk4 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] On Fri, Jan 19, 2024 at 10:15:06AM -0800, John Baldwin wrote: > On 1/19/24 7:38 AM, Alan Somers wrote: > > On Fri, Jan 19, 2024 at 6:56???AM Alan Somers wrote: > > > > > > On Thu, Jan 18, 2024 at 10:32???PM Enji Cooper wrote: > > > > > > > > > > > > > On Jan 17, 2024, at 2:50???PM, Alan Somers wrote: > > > > > > > > > > The branch main has been updated by asomers: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 > > > > > > > > > > commit 8bae22bbbe6571da9259e0d43ffa8a56f4b3e171 > > > > > Author: Alan Somers > > > > > AuthorDate: 2024-01-15 23:49:47 +0000 > > > > > Commit: Alan Somers > > > > > CommitDate: 2024-01-17 22:49:41 +0000 > > > > > > > > > > fusefs: prefer new/delete over malloc/free > > > > > > > > > > MFC after: 2 weeks > > > > > Reviewed by: kib > > > > > Differential Revision: https://reviews.freebsd.org/D43464 > > > > > > > > Why not use smart pointers instead? > > > > -Enji > > > > > > Only because this stuff all evolved from C code. Smart pointers would > > > certainly work. > > > > Actually, TBH it's because I'm not real great with C++. It's a > > difficult language, and after 2016 I stopped even trying to improve my > > C++ skills. Instead, I've been focusing on Rust. Even when I wrote > > these tests in 2019, I strongly considered using Rust instead of C++. > > In the end, the only thing that forced me to use C++ is because I > > wanted them to live in the base system, rather than in ports. > > > > I still dream about the day when Rust is allowed in the base system. > > If it were, then in addition to these tests, I would've converted > > gstat to Rust (rather than add sysutils/gstat-rs to ports), added the > > nfs-exporter (instead of putting it in net-mgmt/nfs-exporter), added a > > ctl-exporter (which is impossible to do in ports, so I had to do that > > one in C), and converted tools/regression/fsx in place (instead of > > putting in devel/fsx-rs). Maybe a couple of other things, too. Like > > ztop, or the geom-exporter that I have half-written. I've also been > > tempted to rewrite zfsd in Rust. > > > > Alas, I sense that there is little appetite for bringing Rust into contrib. > > Brooks' opinion is that to support Rust in base we probably need to require > always using an external toolchain as otherwise we would need to keep two > copies of LLVM in base. I think the most sensible route is to start bringing in Rust code that requires an external toolchain. The first step would probably be to figure out how to build a helloworld with a RUST_TOOLCHAIN variable set and no network access. There are a bunch of bootstrapping and reproducibility issues to consider, but I think the fixes mostly lie outside the src tree. -- Brooks From nobody Sat Jan 20 00:01:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGxVX6MDqz57jH3; Sat, 20 Jan 2024 00:01: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 4TGxVX4CDKz4NX6; Sat, 20 Jan 2024 00:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705708916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+PHy8PyR5wsUpJNhIJga2s3F5FQYCUyAld934nSCOOk=; b=YLAgHxDlDEzyMOfZJ3PsB06vgouRhTxpoV3TZGU8030u9XUs6WjGJwibL2VsOK/9BOjuBJ V2w+EU3Te5l4E9OtS1Dqf2YJlYOtA1E1YkpvB6exRcEUA7qdMMiONNBEiqWWgBTk1uYrBa AFRwvdaMbbB0dCHqamhlXGVUe0Bmj5yL22ojMCu9pgW1WRyvbom/lKa9oEwkqZeNNe00Iy QPq8v1kIvEHr+Mt9ZF/jgvEWjF61ZgPf1ubgNADzCuFndTPfgrTMTHHLjYU5SUj3ZwAnZm XfkqOXryHQ0b/t0Rt7BdcHa6JKM1e2DjvvznaQB56DwJ8+3dvWTGqGzl0sxiBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705708916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+PHy8PyR5wsUpJNhIJga2s3F5FQYCUyAld934nSCOOk=; b=IK2dy9aLw1fQAkaQ0Ti1M0TNIvRukl+V9vnTyh+kVQtFJRPllRTLetZPb6ubQA4mtwHFm0 zwxrGE5a6DWQ/IaH4fsjFbJk0+nDKiDgfcsczdy3dEwClHJzDzhUhvpiUy956WXgonzHaF AKVwmHI6v35ZvvsUTFXBIMosBYs3jFBxr6EhjTNqr+hHZT+incuML3di9SFYWAYNtRKkrY O5kFen0sCzt5FfNnqEKeMrTVhvjXMXIrc62UD386AfVpXzx3IRv/+lZXCDV24gyr+8JukZ Qju/7IOou78USy9DRpDESOdSmSNCbz1zo78irxuyGdvQu5C1khPJNuvO9FIxdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705708916; a=rsa-sha256; cv=none; b=T8LHvtcZj2Kv9IwXR84DlbuSGFc6EW1DkGhHqK3WyaYJaf7cdm924vaNWu/QT0c5gsjuX1 qJ8VsurF2as87xVlt1zLGyZqmxOV6/9hMJkwixkywgbmeJsJmFxGdJcNIO66DxdFhYAnVR 6FQ46LtgBO/haCTuBEtt8js5/pgc0PSpLzltJaj3vCHgpe1jowd70xk379W1WWqhVYc+Ax OydFrtQAzJI4nB552pv6BPvk8Q4r0aN2RqrOXkh/qYXCRNkxcN3LHe3ZDf58dkONUKnEA/ YRJXiFhq8T4VWWcn8A3iFUKOFjp+bonurl1DdbOvpnJ0t7W76cLlYZGCT1uS3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGxVX3Hd5z1BjT; Sat, 20 Jan 2024 00:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40K01uGL084623; Sat, 20 Jan 2024 00:01:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40K01ueX084620; Sat, 20 Jan 2024 00:01:56 GMT (envelope-from git) Date: Sat, 20 Jan 2024 00:01:56 GMT Message-Id: <202401200001.40K01ueX084620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chuck Silvers Subject: git: 2f2da21740b4 - main - mpi3mr: add missing terminator entry to mpi3mr_identifiers array List-Id: Commit messages for the main 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: chs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f2da21740b462e52e81880c82b4584be5ce6195 Auto-Submitted: auto-generated The branch main has been updated by chs: URL: https://cgit.FreeBSD.org/src/commit/?id=2f2da21740b462e52e81880c82b4584be5ce6195 commit 2f2da21740b462e52e81880c82b4584be5ce6195 Author: Chuck Silvers AuthorDate: 2024-01-19 23:58:41 +0000 Commit: Chuck Silvers CommitDate: 2024-01-19 23:58:41 +0000 mpi3mr: add missing terminator entry to mpi3mr_identifiers array Reported by: KASAN Sponsored by: Netflix Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43519 --- sys/dev/mpi3mr/mpi3mr_pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/mpi3mr/mpi3mr_pci.c b/sys/dev/mpi3mr/mpi3mr_pci.c index c1c0211aab4e..1548d577a726 100644 --- a/sys/dev/mpi3mr/mpi3mr_pci.c +++ b/sys/dev/mpi3mr/mpi3mr_pci.c @@ -89,6 +89,7 @@ struct mpi3mr_ident { } mpi3mr_identifiers[] = { { MPI3_MFGPAGE_VENDORID_BROADCOM, MPI3_MFGPAGE_DEVID_SAS4116, 0xffff, 0xffff, 0, "Broadcom MPIMR 3.0 controller" }, + { 0 } }; DRIVER_MODULE(mpi3mr, pci, mpi3mr_pci_driver, 0, 0); From nobody Sat Jan 20 00:51:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGycF0YPrz57nMR; Sat, 20 Jan 2024 00:51: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 4TGycF06ZGz4TnW; Sat, 20 Jan 2024 00:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705711917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DZnGoOnEiiExzVKaBCZL9/iq1k8MWdSRyd0Uz3KbOvk=; b=NUYfMEyR534MPouuDXFBgPLh+YkV8a9cJiQVRqZ03RsARh7KCLAO8hxip2VTvWWhJG4+B6 mfBnDy+XgCVZqSFAgLqdenegZOidcmAvCGxADwRSeFS5WWDuugAwMVS6Sxe+6xnFU0zZtZ LXHTA1sAaHqgcr3v0+S9I825++67pQyi/jpPL9hWK9ZNJwf9X5Q3D5TeBVvQrdOSkFRRzC 3j65+qyVoip/PKBghbcFhaPMW5yTjLAOf4U0ENareVAoO8uJZOVRrnvI7GP2CYzsh07S7o AnVQOK8Z2cv69I9NAmZ46J+IKoyu7Rfqn0NfjdUW6xiUNpVykGbMP18/b+q4Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705711917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DZnGoOnEiiExzVKaBCZL9/iq1k8MWdSRyd0Uz3KbOvk=; b=YbnYMoHuHWvSg3zbnA+0bZvDFlexCWaBDUtOQEUSUPh4IUSo3ffYLJNwyjsS8GfpXXRE/R yKSfr2uhGY7I1rptUlKfcPj5w6RbzH86LVPW1O9bWxmBKRxG9E7eyaKmaVZE/lV0JG82Nm 6T8rhElLrwWL5j/ZGOjvqG/WM/VS7aHAWSs6QeKI69y8rtw+k09l8uuLTciCJik22j7Jqj BMoKvZWFu8ePsvuS79P1njxMIHdDvphJCxl8f9zGexSEGgVwPeugks9pmTXdv3RuyPkdID n3+QJblIwmxSnCKoA8p46KH8k5S5g0wmnnmO9Tna0RcUQrGOY9DeYzA+FkzeoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705711917; a=rsa-sha256; cv=none; b=nGvOBPikEttm7Ht0nPDfSeYCb1XBH91U/i0EkIzsR6244zuTUyScfiyFEYe1N2TDM6O/NK v9fsJwfKr218yym9M2h3XNh7yoR7dcSLhUWTjO0j3Ujxe/daP3B/7sOqDKzJLzLhkqJOQf +LMHZXyyF5odT97cMDptB0TWh8i3DKbjrk2z6RV56KSm6A3yaq48czKJUGRapaATcYFIO+ hudLHndjCC7eZq8ZzdblR3/C4xNr1YHxMuCtJ0yjxalQtY3IJ1KsGwdt1iJQcIKUiEwZOq 27ScS/JElw0yMz9BCJgkX6kHA9+A8yKh9M2/FUt91zqbEzM7nhw1W/rRHEmV8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGycD6H8ZzDw6; Sat, 20 Jan 2024 00:51:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40K0pugf066718; Sat, 20 Jan 2024 00:51:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40K0pu6a066715; Sat, 20 Jan 2024 00:51:56 GMT (envelope-from git) Date: Sat, 20 Jan 2024 00:51:56 GMT Message-Id: <202401200051.40K0pu6a066715@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: e0deb85065ef - main - makefs: Make it possible to silence warnings about duplicate paths List-Id: Commit messages for the main 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: e0deb85065efbcd2123d65f65eb54bd1dcf0588c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e0deb85065efbcd2123d65f65eb54bd1dcf0588c commit e0deb85065efbcd2123d65f65eb54bd1dcf0588c Author: Mark Johnston AuthorDate: 2024-01-19 19:06:16 +0000 Commit: Mark Johnston CommitDate: 2024-01-20 00:50:56 +0000 makefs: Make it possible to silence warnings about duplicate paths When generating a VM image from an installworld mtree manifest, makefs spits out several thousand warnings about duplicate paths in the manifest. These are harmless and have been around for a long time (see the phabricator revision for some more details), so let's at least have a way to make makefs quieter. Reviewed by: brooks, imp, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43513 --- usr.sbin/makefs/makefs.8 | 4 +++- usr.sbin/makefs/makefs.c | 2 +- usr.sbin/makefs/mtree.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index fde375885a37..4601e6278046 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -33,7 +33,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 2, 2024 +.Dd January 19, 2024 .Dt MAKEFS 8 .Os @@ -110,6 +110,8 @@ suffix may be provided to indicate that indicates a percentage of the calculated image size. .It Fl D Treat duplicate paths in an mtree manifest as warnings not error. +If this flag is specified more than once, warnings about duplicate paths +are not printed at all. .It Fl d Ar debug-mask Enable various levels of debugging, depending upon which bits are set in diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c index 14f43dcb3b24..dbd8f3a4d39e 100644 --- a/usr.sbin/makefs/makefs.c +++ b/usr.sbin/makefs/makefs.c @@ -164,7 +164,7 @@ main(int argc, char *argv[]) break; case 'D': - dupsok = 1; + dupsok++; break; case 'd': diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c index 1951c13601df..fddc32b85322 100644 --- a/usr.sbin/makefs/mtree.c +++ b/usr.sbin/makefs/mtree.c @@ -894,11 +894,11 @@ read_mtree_spec1(FILE *fp, bool def, const char *name) if (strcmp(name, node->name) == 0) { if (def == true) { - if (!dupsok) + if (dupsok == 0) mtree_error( "duplicate definition of %s", name); - else + else if (dupsok == 1) mtree_warning( "duplicate definition of %s", name); From nobody Sat Jan 20 01:36:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGzbt1YdMz57sm0; Sat, 20 Jan 2024 01:36: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 4TGzbt14p4z4ZSR; Sat, 20 Jan 2024 01:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705714602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLmC/4eOh6Sr6BFfABKoecbnqBbrg0loEnm8VyxQJIg=; b=dFcFbRTRuXn23eaymvqEfXfQvs8HI0StEvavKZUwpk6n02lYaZa0AbfIoGUSkIHs/9pAmB djjxjP4uQbopkQc+uKTuSVb+Vdp/2erbCvvuCrqYW+KnPZeDdW1U9wr92sS5YCsITKuvmM EIj335sqOydyAwNEZUyNbBKvpSqVuaaAvUHxxWsd++ZpwWbnsq8OI5aT6gsibRMN/UFHYp 8fmiSrwlpTFn2b1VsN1FqbBuA9QKSCIKnfB23cNKBfQ2y2kB6CX0+gsmzLf83zOyKGl8IJ lS2l8ErM+m7FGZKlEWJvgAGQczhUWXuFLw5grqxVy+2Yb8JcKEQAHQ6tqP5lrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705714602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLmC/4eOh6Sr6BFfABKoecbnqBbrg0loEnm8VyxQJIg=; b=egGHdK9Aow1hAk9qmEqGjIO0gVTOnw5y4k7BPjqU2uj0lE5ODG0STdTiw7e0bzLcms1xrs 3Yq7DXxsaKa9z2+8oFWPuX+ljK40NkEzOcDpnJu0u2yZsG6x/CDS1NtDezy1kU22qVpSDg 8UISDBOuPHp5YIiBeW/04rddreca5e+uLZgcrhifcLT1l8C5rDHcIs0ldvdNrxGutDDPL9 0fjNVnxCAIxhhmXOoLmRq/AoFX69zW6xG2SiuHmMjoTQdwRtVYWf0q0LlUNIUdBM2b2Jex kdseBztEG0c9BQKxrzbfk4PawtNoN8C9tnzVIHHfceQIlJHsmqo+KObkxob2Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705714602; a=rsa-sha256; cv=none; b=KyRlUDROMtc3V/ij5UjDxxfGdDuk1YkBle4rDRCSd+/Bq3wM5ac7TPOsZlRyIEQZfW6hzL xhiugi5Xmppve8YoG0yA7XGdzbzySQEWgLnzrI//VbVJoozngMDggxjUZJ3y5ItNTbCv32 idF+lbAVW0tw4aFO0TXaL2+srSh4c7LOwX9Wnn6m8TajbH9V3KryzHxQGyRXJX5+vSmgwy KjA34Hh6941R9v0eRDJdyJBGlbdip0hmhHoOf07l7d9dZs886zM5IOA7G468DI/SbRY7xB Xr+Aot2fjKJwVW8Hs2D/rSxul96teSZyenRQ7v9+J/tZy0AFMfpvnTkTYb3m4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGzbt07wtzFyB; Sat, 20 Jan 2024 01:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40K1afds038474; Sat, 20 Jan 2024 01:36:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40K1afGj038471; Sat, 20 Jan 2024 01:36:41 GMT (envelope-from git) Date: Sat, 20 Jan 2024 01:36:41 GMT Message-Id: <202401200136.40K1afGj038471@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: 4b3ffc5918b9 - main - msdosfs_remount_ro(): correct vfs_unbusy() loop List-Id: Commit messages for the main 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: 4b3ffc5918b9968ea6ddee6f6cdf3538072e5ef4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4b3ffc5918b9968ea6ddee6f6cdf3538072e5ef4 commit 4b3ffc5918b9968ea6ddee6f6cdf3538072e5ef4 Author: Konstantin Belousov AuthorDate: 2024-01-19 23:50:48 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-20 01:36:35 +0000 msdosfs_remount_ro(): correct vfs_unbusy() loop PR: 276408 Reported by: John F. Carr Fixes: 13ccb04589e2c5c840e19b407a59e44cb70ac28e Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/fs/msdosfs/msdosfs_vfsops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 03c794bad900..258c701bd300 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1006,9 +1006,8 @@ msdosfs_remount_ro(void *arg, int pending) } MSDOSFS_UNLOCK_MP(pmp); - do { + while (--pending >= 0) vfs_unbusy(pmp->pm_mountp); - } while (--pending >= 0); } void From nobody Sat Jan 20 16:24:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMJR2SKhz57SDN; Sat, 20 Jan 2024 16:24:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4THMJR1wqLz47LG; Sat, 20 Jan 2024 16:24:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705767879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6oUTLDOiD8YaDLFsHPPaGRb3HTCb5VAgPCrpWJ/EmUk=; b=ZkA/ksHhO5pGP0QuXWxha9mBY1G+eM/G+2+/SOw+pDbDjLDMtQY/b7sI0cNiTXV4FlwqHY vCNnHYjzvDgRpx1IqeS42gsFO8G+QCNo3A1XpY+nUzFCsBxw2Ah9J4ah6xQ3v/dbbEY0U0 Y63Z42hBks8YBHFpyZEOAWKFL2hv9C8wJ2eICx4ImZBmVD6MeRHycxG82OsN/FDGo4BOUp /rS1sQeGWm89+sc5otn793C7fiBA4cNmiWd/ldNzQ3uuuVIxQR1m/BD3dkJNSU+WczdavU ayeftNLAvL4qWhBkyM2zxIZJO0elfMAo+efjNZS/fdn76KNRj7Vkq91dyfObgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705767879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6oUTLDOiD8YaDLFsHPPaGRb3HTCb5VAgPCrpWJ/EmUk=; b=XzEnrffU17jBqXgODPjTFdzIa4E7rU13tze1SuheF5oYgUIXrKp0CtX3t/37b4tsS159Ja Qx2BEeFD4n/gZ45DB8O8fbfJYOepISX3Vn4WRQ7OrtU0nEY1Wuml8fo5YoK/0B2TwmUmsI yeuESTb/d6QfYztwOZTFqkfly13QXbSDbGcyxoofdxWKScR7U8hNDpBhQd6NOqAZTsn0gf uwokAc0XIoUQ0hQ2GaJblriymdo5GVdrtPMcLhV28g3Wu1rf6yxiHLyLvAHZtn0K3sLQng +UWgPhCp7Yfn9m7o5XavHdNvHTGipW+E/7SPWus3uOrdWIt40TsP8uJGUqo8/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705767879; a=rsa-sha256; cv=none; b=OXFUtV3Yjbx41EyM/c0IlK2ZwVYkWvYM1jKCaQML1W8Rmxqj4znlN9jYquSXnKsOOLOjOz ncduAzFkY1fRNri0U1btk5bxmvMenxdr/o7zc+JVOxJxGo2j96Mif71GsLUkDAPnFqJJDI 8fAkY9Zy26n/v2CWWhgXdeaQeE0QUj/NwxwlXBpX5liYdFDQvyMddr3rntGgYKHdU8Bb+U 95WlrGa6No7i7Obz0NvOQLPmOr+x4jumxmrqODRlUYaFEEEybfzXQzPsoUORbEvgmqb/F9 Hnk+B1Z6zWFL7U5uG3fUQ2YfKjY799DSrLKtk1d9XX+ii/EPvJfJg76eYHfv+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMJR0zdxzh8c; Sat, 20 Jan 2024 16:24:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGOdZx035322; Sat, 20 Jan 2024 16:24:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGOdiQ035319; Sat, 20 Jan 2024 16:24:39 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:24:39 GMT Message-Id: <202401201624.40KGOdiQ035319@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: 7037ebe63dd1 - main - netgraph: Fix two typos in source code 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7037ebe63dd1a2ff2a818359c58ca24b6d44388a Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=7037ebe63dd1a2ff2a818359c58ca24b6d44388a commit 7037ebe63dd1a2ff2a818359c58ca24b6d44388a Author: Gordon Bergling AuthorDate: 2024-01-20 16:22:28 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:22:28 +0000 netgraph: Fix two typos in source code comments - s/bascially/basically/ - s/simpliest/simplest/ MFC after: 3 days --- sys/netgraph/ng_sample.h | 2 +- sys/netgraph/ng_tag.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/ng_sample.h b/sys/netgraph/ng_sample.h index 994f322cf05a..f7f7cb417626 100644 --- a/sys/netgraph/ng_sample.h +++ b/sys/netgraph/ng_sample.h @@ -73,7 +73,7 @@ struct ngxxxstat { /* * This is used to define the 'parse type' for a struct ngxxxstat, which - * is bascially a description of how to convert a binary struct ngxxxstat + * is basically a description of how to convert a binary struct ngxxxstat * to an ASCII string and back. See ng_parse.h for more info. * * This needs to be kept in sync with the above structure definition diff --git a/sys/netgraph/ng_tag.c b/sys/netgraph/ng_tag.c index ea84148e59ef..31417417c0ed 100644 --- a/sys/netgraph/ng_tag.c +++ b/sys/netgraph/ng_tag.c @@ -258,7 +258,7 @@ NETGRAPH_INIT(tag, &typestruct); * One could ask why to have this structures at all when we have * ng_tag_hookinfo initialized to zero and don't need in and out structures * at all to operate. Unfortunatelly, we have to return thisHook field - * in response to messages so the fastest and simpliest way is to have + * in response to messages so the fastest and simplest way is to have * this default structures and initialize thisHook once at hook creation * rather than to do it on every response. */ From nobody Sat Jan 20 16:24:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMJS5Wpjz57S7V; Sat, 20 Jan 2024 16:24: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 4THMJS2vLHz47R0; Sat, 20 Jan 2024 16:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705767880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VSGHPJSfe7snnV7YIuXUElSB6tFm0pDNYe1M9bc8z9U=; b=lU9RkFWCNhNLGNv7d8aAtoxbTWS0n7Vph90ROFkzGThW1wLFriHZXZncnZds0GiqCeNwQX vhP8zSPbX5fhfGUWsDSCnIshHJ1gV5MQKd5polaomb5i3kPqhTZefR/6Rg+nM7+yxRUOav X+6h8wV8uL+lzyFj5rLgXYIj7GkJyjIILzvB79j2Fu6peHJpx/oqrFX9CbKIVtb1dgxinB /Ngd9IcaBRwh8kNVET4Ml1Ch0rW4y4wGs1HxiyAztnMUKG9eZI4THebAm5BNOHxFiRqmD4 4PfxFw2qZw17B051CpalgThWYKdwsRa8BYV+DfS1rfaVFgzZwqUe+ojQwDzqEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705767880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VSGHPJSfe7snnV7YIuXUElSB6tFm0pDNYe1M9bc8z9U=; b=sgzyH1vhQRpy/2fkeXS6rzjzhQm6tovZxKJ6An41tcugWJ57R4iznE+E8KskZl+q4uQNx8 JfXJkhl8O7isMMrmr5A7dsf5P9yaDI1bP2Ld5K0mNeJJI+WTS+Zo8XUqzpqalNqA9liyh2 zo1KRUciXjQOp65Hqy5Hn9DMp4hSvJ7qZR2Pg37HBb+2VZnFo+ndiH3choM+e+cIBPXLbB mZB79EsMPWWY1H94RNlHFg59PZ8KBGqvMjAXb6kkHHW+7dzCZ6icEtnIHxijF3jkRuymOl BGnrz2EEdoFq2DQghI4O89ZGeJsoq1IbDK5BKdkWrjTHoScPVDVg/ZZJuBFzEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705767880; a=rsa-sha256; cv=none; b=s8W2yxxYdAu8BZvEOJxudpLRzcQWFzntBt24xeBoBMAo4OMeUQfecmJo1JDk9STLq/5mUT g6dRXqUEVDUKeC5obNf/Q3eiGlOji1t3hoa1UGSUE5Pm+GTAfn3HXzI9i53sC4LPRe68tW Evi5agSyUe42F+ZFHhEUhV5MZ+JLd+SY7Os1bLj96ziLbsjiZai4YSEU+G5eB5/v45yti9 gAcgZEbKE1SnImL3J6xEDeut1pI/jnrXz5CVb3ubT2K6CULuuRb4FoVvhExg+ZmTZ3JOXN BsmW0wIsvY0qt2/RuopmpUWXtCEqu3BRicGLc7KoXGTs8EB34WPv/JyMRZPxGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMJS21JQzj6V; Sat, 20 Jan 2024 16:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGOeb0035373; Sat, 20 Jan 2024 16:24:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGOepg035370; Sat, 20 Jan 2024 16:24:40 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:24:40 GMT Message-Id: <202401201624.40KGOepg035370@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: 6f0da017c973 - main - fusefs(5): Fix a typo in a SDT probe List-Id: Commit messages for the main 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: 6f0da017c973f40c1bc70552c922c500a0a8c858 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=6f0da017c973f40c1bc70552c922c500a0a8c858 commit 6f0da017c973f40c1bc70552c922c500a0a8c858 Author: Gordon Bergling AuthorDate: 2024-01-20 16:24:22 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:24:22 +0000 fusefs(5): Fix a typo in a SDT probe - s/userpace/userspace/ MFC after: 5 days --- sys/fs/fuse/fuse_internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index 55ac7f1b1bed..f4a2e7efc908 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -996,7 +996,7 @@ fuse_internal_init_callback(struct fuse_ticket *tick, struct uio *uio) * But there would be little payoff. */ SDT_PROBE2(fusefs, , internal, trace, 1, - "userpace version too low"); + "userspace version too low"); err = EPROTONOSUPPORT; goto out; } From nobody Sat Jan 20 16:26:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMM55TGSz57SBD; Sat, 20 Jan 2024 16:26: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 4THMM54D0yz48vL; Sat, 20 Jan 2024 16:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ki5jEGZn0GDzp3HK3E0Th2relshnTg/ZXcviqTsPc90=; b=R0Tn50TTZJ2dVBsjUEgiugIzVHIi1RiXID3yJbJtY9ysdfsoy8U+mEQ0adZMcWScYYMwwo +fji/vW57K0/+Iyhe56xvy9dfbLVryQ3ASJxqXIxOvhNrMz5ZhmWFy8OcdplHHd5K+MId8 muZEGAACZcXWA2bba8edag0vKlpDerYk/mo4JVyxtI3KzMtgVLPG6jGrofeSoekRWj3jgN EtOur664VNFnM1aV7wZF60Ge5Fy0gPrVO/bFwQapEB9csN9FjM5NlPGKvPB/TtPm24YJyg yZzYufSf0eLP308ROVKPDHd/Gy/0DG77z5UAIyJFZVCvOLdyJaS6pU69f2smiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ki5jEGZn0GDzp3HK3E0Th2relshnTg/ZXcviqTsPc90=; b=jHLjl7kmBn3/e/OkHAnBwYl91g2hkhKcjjd7OgGQfU1k6+dc2nw5KXoRqSXSulJD2D2E9S 0WtQjBjqijXhS0bsc5CmRmP76j1w2nue6C5UgjjMgsw7OhLdPKS9zJB6rYO91DhU0t1qrD IRYoCbztqwhYCC4hGp0GG2R7LUoh6pkbcFnQgmhKwvUiiKp/8RTDYjKUAIHkgq2jlk728C bIA0vv1LOHM4w7RJZ8GBxRv6xdoo/IkTQAOMaiFmVp/7sEGt2XqjPfYIyq130YQ8TgaACY 479lmySm5i4JAchwcImKUaDTzvoioJ4aijMq5kt2mEa/FXwQpNmrPxchz1SjlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768017; a=rsa-sha256; cv=none; b=kTq6X4n696LbTK8vEz7+pBehdW6bNLqML12sEH24eYKoVfUF5vppLwvg2XFRf4rp1SjpSZ NOWtsZA71bZ84320tAvknZuOeQhzS5y0hvkOHgPJZcaxMWKSH21vn/kQaue0DhWakcnarG rE6LarM/GlU6Rqfq9afNrv3AjiBSyFB3NNQdw5AYpJlurryWBjnBedflW2D+0leQR5L6Rq O9BlikPcybhYP0aNfDLofPOxarX/IknTB85nOyqYRUdsV5p5aOZ0WGChS+k9+B1g4ssLr9 1ljnomqCps1aOHEJU9Z7PiJvfLMM08to7QVGMaTxRK5TvZvV8zKwBBWJhN3URQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMM53GvFzhpk; Sat, 20 Jan 2024 16:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGQv6Z035963; Sat, 20 Jan 2024 16:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGQvX7035960; Sat, 20 Jan 2024 16:26:57 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:26:57 GMT Message-Id: <202401201626.40KGQvX7035960@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: 7cf293536eba - main - devfs(5): Fix a typo in a source code 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7cf293536ebacc92150be12e0be928500e670610 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=7cf293536ebacc92150be12e0be928500e670610 commit 7cf293536ebacc92150be12e0be928500e670610 Author: Gordon Bergling AuthorDate: 2024-01-20 16:25:45 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:25:45 +0000 devfs(5): Fix a typo in a source code comment - s/interpeted/interpreted/ MFC after: 3 days --- sys/fs/devfs/devfs_rule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/devfs/devfs_rule.c b/sys/fs/devfs/devfs_rule.c index 66fc00dfcb39..37d24577792d 100644 --- a/sys/fs/devfs/devfs_rule.c +++ b/sys/fs/devfs/devfs_rule.c @@ -45,7 +45,7 @@ * * A note on "special" identifiers: Ruleset 0 is the NULL, or empty, * ruleset; it cannot be deleted or changed in any way. This may be - * assumed inside the code; e.g., a ruleset of 0 may be interpeted to + * assumed inside the code; e.g., a ruleset of 0 may be interpreted to * mean "no ruleset". The interpretation of rule 0 is * command-dependent, but in no case is there a real rule with number * 0. From nobody Sat Jan 20 16:26:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMM65HG9z57SMD; Sat, 20 Jan 2024 16:26: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 4THMM64nvyz48vM; Sat, 20 Jan 2024 16:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JK+4rdeSunmy7VA8z6t9HtRh/xyrcsNnRx1UG2UNLfs=; b=C8/TYNiVVgBKo3L3YBzBExgGXvaI8z43zBKjykYRJePee4Zbz08OG9E//yUaBs25f+0Cq1 kZBMVWSVQcJ+cHpB1fAMvjNx0dsR9XgGNr9IAmCHjBC0vnNr8w4JCPCh+4JbjFy/ml/F6W rq2444Am5y0X9aVubDQF6m5mx7L4pbaVeAbTl78CU+x76nQJan4zvjbTX3TWBOLWLeel1q co6UfQ8fbeTRUf8A7q4U5BmdfvR8tte4iLiHaNdhqK4sWh5OSIgltPjFDrh9kEGd9dR6ro ySY90+97uouppgcPIBANHKftyi/KoBJo3Fh1ttBsZpn8webYn47/goJkBIjxQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JK+4rdeSunmy7VA8z6t9HtRh/xyrcsNnRx1UG2UNLfs=; b=JCGEK++GJ2usc5s7tiKARed9Ro7lS2n3wx40tEvMbXNFplA6uiv3iuVNXs6xNuPcZuH8qa GGr9bIgKtx3aEXBgaR5wK33mzcVzLdalhxy1dECDl3K7V7X9YvVFsIs9NGadQfcErSZFLS TOYkuWQytFpDCBB7gz5T5O1nmAVyGD0NpSrgAD2aDtlAwKG6cCoI0fEA2KB/I3akIEpojQ Qk6Wsj/mMUpsFchx2mvceqziH2+ZxmmddMdJxoVWeINZMBZqyTdo/9GW0gidoWU0jB8YA2 XBtttClfDO3MkV5AeJgSq8RL4XPmzS9AyOFGTejxdC5yT2bFMZl4Fxi3ag6l7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768018; a=rsa-sha256; cv=none; b=iygT1dLZN64abNWv1Pj64QWzZg198AKfX/kgUVyxYPJl187IbaUfbkC4G7RbnqJTYyTQYR qqN/smEhKLV+1w353CsvQOX9Pm+9XMZ28X8kop1AHAMcHfJcfEVysNfQ1GdYdIynpRLwXH LN0TruwlVJKxiodiclnzfeDYR5gAZRm2pGt/tLQfDU8jyGK+G0JCSmPaAq0g1hHZ5axCqm qKteEA0Ay98fevV/RyCOjW3HkKbcP/ckwpI58VQJ6dEXjTmE81NIlqwxP4vJamoRH4iFqY PiJR/O5tXebTqcrRS/XoUAMiZaoyDkTvkeraegnZHjtC6rGRXxTxG0rVHfeGhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMM63tFZzhyZ; Sat, 20 Jan 2024 16:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGQwAT036022; Sat, 20 Jan 2024 16:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGQwOM036019; Sat, 20 Jan 2024 16:26:58 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:26:58 GMT Message-Id: <202401201626.40KGQwOM036019@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: b2ec175fcaac - main - _umtx_op.2: Fix a typo in the manual page List-Id: Commit messages for the main 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: b2ec175fcaac90fc6a1caf066656eaa092f32611 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=b2ec175fcaac90fc6a1caf066656eaa092f32611 commit b2ec175fcaac90fc6a1caf066656eaa092f32611 Author: Gordon Bergling AuthorDate: 2024-01-20 16:26:34 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:26:34 +0000 _umtx_op.2: Fix a typo in the manual page - s/interpeted/interpreted/ MFC after: 3 days --- lib/libc/sys/_umtx_op.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/_umtx_op.2 b/lib/libc/sys/_umtx_op.2 index 9c0f1f425e47..60f90c32ba35 100644 --- a/lib/libc/sys/_umtx_op.2 +++ b/lib/libc/sys/_umtx_op.2 @@ -424,7 +424,7 @@ regardless of the kind of backing memory. Only the address of the start byte of the variable specified as key is important for determining corresponding sleep queue. The size of the variable does not matter, so, for example, sleep on the same -address interpeted as +address interpreted as .Vt uint32_t and .Vt long From nobody Sat Jan 20 16:29:39 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMQC4GPZz57Shf; Sat, 20 Jan 2024 16:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4THMQC3rsRz4B43; Sat, 20 Jan 2024 16:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/KoZ1JiWirjBtqN/purGU9vbSmHH0JeM7C0ptVe1gxc=; b=k9kYA1ybv4wdUmggwXZhzWBoSC7ffZ3TZm/d17wPR9tBz1lKzgLDzu/fUb/6VehI/x7Igu FfBUhST38+QanOzcIAsNra/Qjh532ZMYjxANZmZEWtRrC3die1lpo0ZPTvOe6/68cswfa2 K5zNvkwFwspHMWnnoUO8b4yPaVBg5erjygNBNks6ceWjTHSrg3wetLbAJzFVNSGj0mrnu0 bsS2FAM3jNxhcJ2/1GKcI+JXGUnT3gUpt53wecmRIPuz/r3iuK5uW2f1MfQ002xCWiLHnE MUvYWfgDxX+pJLk50888Mk1RVGsyUbZyTHEPUbSi+NM4t0Jp6/ArHW8ob0m+0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/KoZ1JiWirjBtqN/purGU9vbSmHH0JeM7C0ptVe1gxc=; b=Yzx0Tq0gSubVba+bqxlPlohRX1jwc2+m0jGxzTELUg3gylVKm3nArPuvOezEFh0q4fv0oQ 3lDRQntnfA9KhKdatYO/r/jYn9WQYojvTjevZFJvRnPFizDhD4lPuw+cxUmosukvYndLz6 fWnaKGJpkSlMkxc7y19Eu2Fcvazf77l4XiM0wx47QO/222nPQ9ImqE9u++4WBWKYwutpTM bu0m1dHtprlCiN5tjyfKfEUTMlr4JPu9dKJgOnP/zEPZqmDYNFbGJnJLmQiFCbY5qN9gB2 fI/z+LvzLIbmrMoQs6J+11qSJm53dRF4bTrFVaG0p3CZ3Mn15UQRVx1in3Io4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768179; a=rsa-sha256; cv=none; b=ltO60DY3VRqlIN7S6ggMsxcDdtFA3iUP0seULy2FKFBodw9E6XEha84KMGZKID2fzTII/q SW94ZNO9XJFMFJJDCoS7WC+kTt/cOazMdmvtdHBKxhzSmi/5FZCWNv7M9693exiwGaIvBY AMwzU4DlfmQeLKX4nG7IcULPwURm3+bzLyola0jNQ2yX/TFj9t7Bnbk/PM1O+8/jYkzRBh 9BbcSiS4fKVh1aJK1G+6VBCOczJzlZ5Je5YAKXbpppPdID4G1XQ2RaXzX800pQguRuLTsG TsPbBZamFa3Ke9XaUvQxx23IMv5QQXoJ5GSHYRQXbg99UpGGe2lRZNBzyh57Gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMQC2ymJzj8F; Sat, 20 Jan 2024 16:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGTdqH036572; Sat, 20 Jan 2024 16:29:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGTdiO036569; Sat, 20 Jan 2024 16:29:39 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:29:39 GMT Message-Id: <202401201629.40KGTdiO036569@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: a2fcd3af5c8a - main - net: Fix two typos in source code 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2fcd3af5c8ad43e8d2c7b89f7bbe3edf2f22e2a Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=a2fcd3af5c8ad43e8d2c7b89f7bbe3edf2f22e2a commit a2fcd3af5c8ad43e8d2c7b89f7bbe3edf2f22e2a Author: Gordon Bergling AuthorDate: 2024-01-20 16:28:12 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:28:12 +0000 net: Fix two typos in source code comments - s/strucutres/structures/ MFC after: 3 days --- sys/net/if.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if.h b/sys/net/if.h index 64b115a17fbb..cbd69b4912ed 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -336,7 +336,7 @@ struct if_msghdr { * extensible after ifm_data_off or within ifm_data. Both the if_msghdr and * if_data now have a member field detailing the struct length in addition to * the routing message length. Macros are provided to find the start of - * ifm_data and the start of the socket address strucutres immediately following + * ifm_data and the start of the socket address structures immediately following * struct if_msghdrl given a pointer to struct if_msghdrl. */ #define IF_MSGHDRL_IFM_DATA(_l) \ @@ -378,7 +378,7 @@ struct ifa_msghdr { * extensible after ifam_metric or within ifam_data. Both the ifa_msghdrl and * if_data now have a member field detailing the struct length in addition to * the routing message length. Macros are provided to find the start of - * ifm_data and the start of the socket address strucutres immediately following + * ifm_data and the start of the socket address structures immediately following * struct ifa_msghdrl given a pointer to struct ifa_msghdrl. */ #define IFA_MSGHDRL_IFAM_DATA(_l) \ From nobody Sat Jan 20 16:29:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMQD61yzz57SWQ; Sat, 20 Jan 2024 16:29: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 4THMQD5MP9z49wb; Sat, 20 Jan 2024 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qlLoZ7qChXaFQvngstTCGpKgW0ZPACZQ4ndSPFlvz9g=; b=hgXm5nX0LeS29b/h5fCWb5rvhyLSxex38vCpwUHipOn6JJgvkpvbQYIqFMW0OyVjeP55Yz eNZytWuUYdBsq6mqByydWURQt8EPqwlaNg4GVMQOE0VsF7ZT8ZmzEqbatG7Y4poWpGdnXo hGFrCEEM91eXae6Ua2kP3sFZunc1ijvlq7FcqM7YbehL9mEWlEoXodX6Kgb6WKsmUVYsFO KM3xK05tEXP8bMPZuQkQiOfhH1sWwCVLRmVaXI8S32aQnYMM2BHH19RQdXa6v76YvcZyDI zHaQoXCveb0O69Xf6KkObLETNjWItOij5aSDv94HM2MEwSHOMUIhLVn2U8A3tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qlLoZ7qChXaFQvngstTCGpKgW0ZPACZQ4ndSPFlvz9g=; b=TgecCpxXACh+hfIE4ajP3qkOkfriN8T510bW6EP9zPKxyz0G2+ycbQ2ThuXwwR1yYUMeJb 0B7mutqnMPgGVeI/1gJ4/1LO1496z+aubYa+ia7XGwv8ZlP8JGRZkkvejfu4CpXFBr6M0W 7jdvXcs/0WQ+SJym/L7Jfw1hcp7Y8dUJsYwqkVradTFxuA7LakXsa3PD4ZCGo2KgO1sAHT g+l/myNa8tsqGk5FsY9VYRuGBr3nHAWVfpC7uBR9xvt7P+puagcREDiZaLQh0VfXd2mV2P BntTAPiciIX/EwXaIRHQtRR1eSy/jujZA6EW6jG4iR9Y8VSKxYtmpM/j963+4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768180; a=rsa-sha256; cv=none; b=YLMeZozdn6J5eSUViINjomn6mFVLrCg8DSn1aJSpLNHGfPaKIRmLC9LGFFSdnU+kyvybzA F+4BB8SiCR1VkgDmJWqoc3vlR2E5cZEvMzg0ioQ6skuQv/gf5HI+zdzp+qmMSJHVYTuS1o osICTFkJWd8muTXW9rZhJjP5oZP+5CWn9wIH99i4LOQ2Y2ZqcIXVpZCLst/0+Jd89LzCGt Fvt500RObjRJnSGJBTYx42ATlbMfqjPWeIkRfwha3Ux98v4HK37a7wCnY178H2YsYDHGFf 7Wk5uPCAVZ5YrErjaE81z614M70W9L2oCyFqD1j7Jy2P7vBTey/J5JhHX+wvWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMQD4JHBzhmC; Sat, 20 Jan 2024 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGTeJL036632; Sat, 20 Jan 2024 16:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGTeDa036629; Sat, 20 Jan 2024 16:29:40 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:29:40 GMT Message-Id: <202401201629.40KGTeDa036629@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: ef0ac0a1ad67 - main - tcp_hpts: Fix a typo of a function name in a 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef0ac0a1ad6750291b881203030384b7f7241efb Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=ef0ac0a1ad6750291b881203030384b7f7241efb commit ef0ac0a1ad6750291b881203030384b7f7241efb Author: Gordon Bergling AuthorDate: 2024-01-20 16:29:28 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:29:28 +0000 tcp_hpts: Fix a typo of a function name in a comment - s/tcp_ouput/tcp_output/ MFC after: 3 days --- sys/netinet/tcp_hpts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 73e9997c060f..9d192b17c41a 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -47,7 +47,7 @@ * * tcp_hpts_insert(tp, HPTS_USEC_TO_SLOTS(550)); * - * The above would schedule tcp_ouput() to be called in 550 useconds. + * The above would schedule tcp_output() to be called in 550 useconds. * Note that if using this mechanism the stack will want to add near * its top a check to prevent unwanted calls (from user land or the * arrival of incoming ack's). So it would add something like: From nobody Sat Jan 20 16:32:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMTW2RgZz57SgY; Sat, 20 Jan 2024 16:32: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 4THMTW22D2z4Clv; Sat, 20 Jan 2024 16:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59x4TBT0fv9otdxvaLb2H34uyj7b90xmj77kcJkunXc=; b=e50tOmB/wcDm27pgSZZG4MzXCSZ92v0h791U2UgEsgSj38bTohVnyNHUOn3OgT0TorFlg/ VjtZxrDqVxhKeqr9WMwiXnoqAWhdXkRBJbWkcKxLJMcsOrIcND2wpgakFd8BmwS2aZqRsG Lmq3+DdRrEK0FTOHmpbA5+0SGcuAUCa44Dou77TvvwLwJ2WeuAvBYhyxC6lrrfm6QbP/gu 5vJJma7jXFTHZXXYR56wDh+ylJFrMNN08UxTV0i4EIVBOEPNf2DEu8U1V9vOCkV5brfm/J fS76GxTLTj8iG+59dKVp5DDjGOZQBQnplKj9KB/MuC4vpVZIKIozzb6gMtXKNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59x4TBT0fv9otdxvaLb2H34uyj7b90xmj77kcJkunXc=; b=i1G4szJ9BAUHSzsSGf21eVzt8k0WMi5jGBVsJVl02o+TdeEDADHW23ZNJ42acJIthPfIL8 SrCJOiXX0PpHv3t+0RGiDfspa+Gr8DQwyPiVjNtHFpEPmu0YSVvGZCQp6fc5QM3YIYDGqI qmskpWby3I2Zn7yKQl4hi8pNbSCScoaQhBKw6dKyjI0Ai4sz2BQ52975TD06FydpBgp14N c2rvZfIWALbOic1cSuqqJOgKtJ8azqhjskXdpJPYJGWYxs+18ubJcxjwJYWZLHOl4xNmpY sGzHK1wIwtnxJNNALVcwikVxlLBqtLvN/TcgVVyCkZMrNQBpz8kEIav6mCRpPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768351; a=rsa-sha256; cv=none; b=c4mlKGaUGLQzRLIPxfrUdLMcmCnIWfvwot8uGSUglHSLn2Brr88D16wYuY0DW5dwKUgIOW hBdfpZve6dvuiRILpCw5oLl3BDONOOvu/oV9prX11sy449dowScwz4G5JVcHQ/28FkAgFt ryAv6RkyB7nJZXiQWlr0GlfdEpV+3bLOUP/yCU4Iw1q/PKx79uEgLfNL1X79gF5AqDaw8P nmL18N6ozZTictXSA51ylE4UGqsi0Sy9YkS61ifQnEVOCPKFWa0fr9lduYZkMHeuBk/APz Km4z28W3aKS+y3d1CGV5sMJaHl2yumM9tOxTaUajU5bQ2h0m3RiTGHV3iMocVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMTW17Xzzj8j; Sat, 20 Jan 2024 16:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGWVec052073; Sat, 20 Jan 2024 16:32:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGWV0H052070; Sat, 20 Jan 2024 16:32:31 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:32:31 GMT Message-Id: <202401201632.40KGWV0H052070@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: 938918a9f478 - main - netpfil: Fix two typos in source code 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 938918a9f478e94fbe65ba84510e4755024560be Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=938918a9f478e94fbe65ba84510e4755024560be commit 938918a9f478e94fbe65ba84510e4755024560be Author: Gordon Bergling AuthorDate: 2024-01-20 16:30:57 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:30:57 +0000 netpfil: Fix two typos in source code comments - s/withing/within/ MFC after: 3 days --- sys/netpfil/ipfw/ip_fw_dynamic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 5b756cd4c980..283032048845 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -2456,7 +2456,7 @@ dyn_send_keepalive_ipv4(struct ip_fw_chain *chain) CK_SLIST_FOREACH(s, &V_dyn_ipv4[bucket], entry) { /* * Only established TCP connections that will - * become expired withing dyn_keepalive_interval. + * become expired within dyn_keepalive_interval. */ if (s->proto != IPPROTO_TCP || (s->data->state & BOTH_SYN) != BOTH_SYN || @@ -2563,7 +2563,7 @@ dyn_send_keepalive_ipv6(struct ip_fw_chain *chain) CK_SLIST_FOREACH(s, &V_dyn_ipv6[bucket], entry) { /* * Only established TCP connections that will - * become expired withing dyn_keepalive_interval. + * become expired within dyn_keepalive_interval. */ if (s->proto != IPPROTO_TCP || (s->data->state & BOTH_SYN) != BOTH_SYN || From nobody Sat Jan 20 16:32:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMTX3Qlnz57SjQ; Sat, 20 Jan 2024 16:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4THMTX2qMwz4CWb; Sat, 20 Jan 2024 16:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ZnziwiRKZdeSo/nJDp+FSKdGLu3aLWKk7VgVPC3ueE=; b=b0IE9klxV73J3s02EIy9iRnSXUUo86pjQF5CbhsqABrG6ul+xOL27fTnWPl+L5ghXeohVj uHhnC+6UKeY0VAWKjweST4PbD/G7OWLOZ6B8+88pIhFp1ncd5gUOxYZ3ixrSAVp0mJDDH5 cGyO6rFGtHioFIqDXf8cJUiaEb3WW51kxVycwK8b2f97+SgH8jveMl7Gsj7Nd+q/5ytH8P XJwxwgrcV1A5ovl+33o6KpDvQhKC/s4aQJ40I81e85gafFDcmDDvny/tJTHPCTANqhHT+Y XZmiYUM2yxOcpD19VF+BSSxGCKgDyHYUJVkllzgpuIALfOe8Ga2Ui/VgxMZjpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ZnziwiRKZdeSo/nJDp+FSKdGLu3aLWKk7VgVPC3ueE=; b=dweQTJJpu7STR/WUsjCXQG7HboNHKfD1bVv4WnwXL0xxaOz0iiIGrppP8cfI3wBqgujgzW z/zHXv3gO2OXfQAMKH2ZcWlx2YWHO4DiDK0Ty1hh9ULamSEaj88NK0aDL4YgYEVFdOqTES KncassTrLBW8+AlRxtlBkk5Pjq8dxHpLeZ8Y5l18VnubGXs6eVMYo7L2XQ3QOzdJhHbQeq G3k1Kir6GK/1NTgfMJnAcvb3MngFWs+bpdnPB7WYB8WI98wbo8V1+oIE+FFaEXTc0lEi2B NiGIsl3lIZCUTAYKZG1sBCu4NWTlm7n/lcVTpwe8PweW8vvggbJBdSody8xjZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768352; a=rsa-sha256; cv=none; b=Y+vwyd3RgNu88Lh92FSYOP2hu+4jNIXF07l8u82JjfqN64YX5l3Z84BcrgPTuh1u5yO/Hp uzcxX9RfELRH0YjvEh91kx9SYIbnNMaifbNLz5ItVTTMcgh+nHOuGAQ1g6d9voMA+WfcM0 EZyJLDiQr0eEgngrh214sTybFbJdt3R6HVjH8B9Tq46nBvX2/PlvvDzsSv2GZgBQ5D8J5i dQDQBOLhXeGLjM6Uvw5dld+nVMoBLP5RCdhu9SFfAbygCUJP8jvo+LKHgxikDGjZpmMFGU zJAqrcu1/fajYjnArAdCAqaEgP8ByZHINkvgfM1xac8hrBK/tzm0ZqQfD2R+qQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMTX1vXbzhV6; Sat, 20 Jan 2024 16:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGWWTb052136; Sat, 20 Jan 2024 16:32:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGWWTl052133; Sat, 20 Jan 2024 16:32:32 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:32:32 GMT Message-Id: <202401201632.40KGWWTl052133@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: f5e3329a5a48 - main - usb: Fix two typos in source code 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5e3329a5a480aa1b2904106b2fdfd999439455b Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=f5e3329a5a480aa1b2904106b2fdfd999439455b commit f5e3329a5a480aa1b2904106b2fdfd999439455b Author: Gordon Bergling AuthorDate: 2024-01-20 16:32:20 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:32:20 +0000 usb: Fix two typos in source code comments - s/bascially/basically/ - s/assistence/assistance/ MFC after: 3 days --- sys/dev/usb/misc/udbp.h | 2 +- sys/dev/usb/serial/uftdi_reg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/misc/udbp.h b/sys/dev/usb/misc/udbp.h index eb2c27d5f9ef..a12cc739ef80 100644 --- a/sys/dev/usb/misc/udbp.h +++ b/sys/dev/usb/misc/udbp.h @@ -63,7 +63,7 @@ struct ngudbpstat { /* * This is used to define the 'parse type' for a struct ngudbpstat, which - * is bascially a description of how to convert a binary struct ngudbpstat + * is basically a description of how to convert a binary struct ngudbpstat * to an ASCII string and back. See ng_parse.h for more info. * * This needs to be kept in sync with the above structure definition diff --git a/sys/dev/usb/serial/uftdi_reg.h b/sys/dev/usb/serial/uftdi_reg.h index 80936f80b6fa..19794413cf2f 100644 --- a/sys/dev/usb/serial/uftdi_reg.h +++ b/sys/dev/usb/serial/uftdi_reg.h @@ -8,7 +8,7 @@ * USB on the other. * * Thanx to FTDI (http://www.ftdi.co.uk) for so kindly providing details - * of the protocol required to talk to the device and ongoing assistence + * of the protocol required to talk to the device and ongoing assistance * during development. * * Bill Ryder - bryder@sgi.com of Silicon Graphics, Inc. is the original From nobody Sat Jan 20 16:33:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMVn37vXz57T2Z; Sat, 20 Jan 2024 16:33: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 4THMVn2YYwz4DPw; Sat, 20 Jan 2024 16:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6gfhPUjl7QqaAoHKjc+cId4PVeaSLtPDZKZ72dasL7k=; b=by1CxtP/O/UesLZy5Ax8mb7psLntUYZ70YqHk4YNEY5Nr2kvdlV1vNBzHYDduua1XbPJf+ HFkC10l2nM5+bKcOlxahPvnN+blABSGAPDLKQrHAGuV9BJTWPPCBdQIpscfMv4sL1stRQF T6dJAamhM2+MHID+yKOvqLm1DiSlQ2JdmqXSHRaLLDvmtTEpEQrN3M1FTAy89nJSFku0JJ UzlhnoMzjB+621df0qpVpIe6i9mymSjEGIFqBPqCynUKdaIzcq5wg/wkF2HgTXHsdZnjGl ZeWs1TyXE5jFt/882eIsQgOcKWuOjtHOZuazTgIdm5Cf7QE39QO+gXjnkre6EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6gfhPUjl7QqaAoHKjc+cId4PVeaSLtPDZKZ72dasL7k=; b=nJC7dx+v4HwfwJZsiVxy7i8MuasA6l/9oSPGSvS40Cz5GGvaPaDUB714g9i2lLb/3JFV94 iMY2BGM70AREvMH9T9NAEGkM//wSRJxboJdkBkwTGgT3Qp9G9la3vDRn9O6Kz0ESjsfo/0 wW9tObRMtc9CkaWiEepMjQXJs2KMvZbFtiRKQEi7VdO/oh2W6IRvzMzdIQWwHqXZgb/oII KyH755olhcbhdIyvAWh3QXqDbmaD3wXsuLJk62SW/4Q/MBoWNBT20WPmJ3NGYWZBpBjuZS tL2VGJAO5TkvBs6LAmWXdB4wtAf70wXgXmcA2aHnwidIO7X/DLpcn+tOK8GYLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768417; a=rsa-sha256; cv=none; b=o4ITNkOjxqFf5XBgVbHs4Dusgn9yoQXe3yh7sxs3eo+GIvE20DtN41sBd81Dxrx4deESpv qbaC9JaUBOhSGuJAOBLd2eh1aZyQ73FmnCY2xyLppsqQRI76UWDfFvmGCf8mtnV6JYqPdD h+Dux34KFheiOQxWY9oBz6ulxJFk0dsgJMB/DFs3FHNCxiqKf0lFUDKT5Fxkxov9Cos2Ir ISPe2x4H4x44GxTijMbZA8W1z77bqQasQMkBUVkIq5eJ88uE73p11S0Cw9kJzpt6U6TpHC VLpuuJAgxbdf9l7zmx1mQjcJEWXQ6pFW8yRutD5aMvoQX8uylpAN4+dZrgTzBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMVn1bwyzj76; Sat, 20 Jan 2024 16:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGXbrA052519; Sat, 20 Jan 2024 16:33:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGXbNr052516; Sat, 20 Jan 2024 16:33:37 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:33:37 GMT Message-Id: <202401201633.40KGXbNr052516@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: 623848af6041 - main - vmware: Fix a typo in a source code 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 623848af604116aa33bc8a66d2ac45b4cbaccfd8 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=623848af604116aa33bc8a66d2ac45b4cbaccfd8 commit 623848af604116aa33bc8a66d2ac45b4cbaccfd8 Author: Gordon Bergling AuthorDate: 2024-01-20 16:33:27 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:33:27 +0000 vmware: Fix a typo in a source code comment - s/withing/within/ MFC after: 3 days --- sys/dev/vmware/vmci/vmci_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vmware/vmci/vmci_defs.h b/sys/dev/vmware/vmci/vmci_defs.h index cfa302ad11aa..466712c41cee 100644 --- a/sys/dev/vmware/vmci/vmci_defs.h +++ b/sys/dev/vmware/vmci/vmci_defs.h @@ -259,7 +259,7 @@ static const struct vmci_handle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID, #define VMCI_ERROR_QUEUEPAIR_NOT_READY (-40) #define VMCI_ERROR_WOULD_BLOCK (-41) -/* VMCI clients should return error code withing this range */ +/* VMCI clients should return error code within this range */ #define VMCI_ERROR_CLIENT_MIN (-500) #define VMCI_ERROR_CLIENT_MAX (-550) From nobody Sat Jan 20 16:34:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMWz1XCzz57T9t; Sat, 20 Jan 2024 16:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4THMWz0yK9z4Dyl; Sat, 20 Jan 2024 16:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AKmqtDqfksMfv+YRqKQZYh+ehF2vu3gO3OPmF0Utoac=; b=BODsY5m7mkpvEtOFULj8Hfh2KwwvdCtq7KdFWZ59WYFt2iPAb6yCnLWTffoFofMbnqSdKk pg0UBlP5/4RWLctSiD+PiVl+lovXlC4N2CFfezOU6bfrWDXm4WefIyjB6Cm6XMmBH2rY+e 1m6C59nrJZjuMWwZ1zy2cP6mLjckgrEG6N74+yA81cv7WHUrGe4Dkh0zRF9jGgOCswsWss C9VtcwsDynLr5f4n63rwgMBBJy+Nxq7kwHTPl1DkDY0poSSPpgl14VXIAXF2UinKF9OFyY 0cTIVEzPQEWAOQ0U7lHctjHKh46KTSUpAIQ1+wxVOI3bKV4+MvcIEVULsbUVag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AKmqtDqfksMfv+YRqKQZYh+ehF2vu3gO3OPmF0Utoac=; b=EwiHzGt8oIhqMf5XA2e+Y4ysIr16raXTpZ4yzXn7TqXUxWuuR0PVN83CzFRUTMtt/Yq+2v F7Ax+Iob9S3qFzzsDMiHgqDdjZgjfu4SpOzr9YapZXYWQqccqnuS2K7Djl209LeDGZ65RH Ab3iLNXQZD15TMRPvPDdhoZnKKckhZ7dGdlw5bPPziDgxJNMXngKIhK8COpFZAti61YBvQ Dk+T91YbevXl3FEeMdgjLGfI5lxqZWqlouE6AFJpceVoZzRT3LNO/iv5lUqGbQAYzoyphw s4/gI1du09U6BT0ZYuQcoxAXnrsvrmLDX6PnKUYSH69XmiqCNZBJVzXAFDPxRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768479; a=rsa-sha256; cv=none; b=uVjfKROkqjMiIMD/UC5iHufkVgoL6sqac2CTxR/4Gl+nbjcE5SnjQ82ayaiGgyQL4+N3rv VO8d89HRLgCDyEu/aJOdv2baq/99iO4mtM0U6Vb88zg0bf7+LF2tgbsAm9ByNzkZCUEFlf ANfQNyxKrhkjxnrLcYjStUhTkXnyQhM3HEfQqQeC7qy1EiRuAb7EEDzFy3iZZxyxvrASrQ /MSIQwFsN5VNbRJOHY0ZwUzwzAZuOVsWhm6i1AyTwlJzzaQh0aUm8LIZKTSoY61BvgHk04 dRTf99Wf+RtY7XBZYTllK1ObykNAZ8L22m7dgY3i/WOrpZRhSq8PVeHqp1f7RA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMWz024gzj8l; Sat, 20 Jan 2024 16:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGYcUv052949; Sat, 20 Jan 2024 16:34:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGYcVS052946; Sat, 20 Jan 2024 16:34:38 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:34:38 GMT Message-Id: <202401201634.40KGYcVS052946@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: ced92d000a94 - main - ciss(4): Fix a typo in a source code 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ced92d000a9435745ca2891734e6e37ab1c5e873 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=ced92d000a9435745ca2891734e6e37ab1c5e873 commit ced92d000a9435745ca2891734e6e37ab1c5e873 Author: Gordon Bergling AuthorDate: 2024-01-20 16:34:25 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:34:25 +0000 ciss(4): Fix a typo in a source code comment - s/strucutre/structure/ MFC after: 3 days --- sys/dev/ciss/cissreg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ciss/cissreg.h b/sys/dev/ciss/cissreg.h index 9e7434b74291..14cc8d7abf96 100644 --- a/sys/dev/ciss/cissreg.h +++ b/sys/dev/ciss/cissreg.h @@ -691,7 +691,7 @@ struct ciss_bmic_id_table { /* * Below here I have no documentation on the rest of this data structure. It is * inferred from the opensource cciss_vol_status application. I assume that this - * data strucutre is 512 bytes in total size, do not exceed it. + * data structure is 512 bytes in total size, do not exceed it. */ u_int8_t bDdffVersion[4]; /* DDFF update engine version */ u_int16_t usMaxLogicalUnits; /* Maximum logical units supported */ From nobody Sat Jan 20 16:36:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THMYZ27BQz57T6v; Sat, 20 Jan 2024 16:36: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 4THMYZ1Z3Wz4F3g; Sat, 20 Jan 2024 16:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bIpOcU6LO9Oy1UF6XUajSfZLc4wwWr35eAixuqCRjlM=; b=wHPox6UP6Cs1Cal5aCl85jcmpn24G2y2nkhiSRedWIqe2DaGxhTK9Pqxr/VYZ2lq+CPh74 ZDON/7yCISpY1qxymsRn95x3ue2j0dEuG27djVyWMzzJjLKo/VfrPdpbI69XihVrPmHr8/ 28DLFDi/xAjAMt6rx5ptBcl92UTM/FVdKUtkKVjzxhRY4nB/aXEyyTCVIA73MrUIFnMXia L44USdUqgJqC8PgOC2JED/96HIP/OmHAQFaIcIDc8Ez01gOiwOjqY519lpljn7M5pvLxuQ VSRb99xa5UQwe2LFXUz73r86bYUkNqJ74rbEtNn7QJmQSC8raoRhQqL9xK51PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705768562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bIpOcU6LO9Oy1UF6XUajSfZLc4wwWr35eAixuqCRjlM=; b=UIZL46RZN50vYRUIb+6VfVRjdpybsXiATl5U6c/V7EGJwFORTZOgT/Mn1egfvkzs5suuSG q9OfrlX1Gzq3a1xfQkbNEWJTEG7o/y4t5cQyH/5x0WjLhqpu4EicItH+NxOoUrCe9KAGni wo8RctF4N+DfEKaG3dURpYWNBO04kNoaKETzUVGBlYsPfKbl46FHTjcpV1yWddbpICRMpV DDlq7tWjuu4lsAmf6eU5svS5TuW7boa5LlR26k2Lsp4L/KuiUumFpkoIDsoIao3MNypfhZ 2xbo7WWIMIyFSrgIM9BsqS4iEVYZyWmjn/spenbM0uoM7yd2NhrQVHL6djh6CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705768562; a=rsa-sha256; cv=none; b=bDvNhTIVNBkh7i7ts8IjhI3BHBuV5+VsqNTnES7bALe/YdLdQO9MrELNcyfY/WIfb9r6fz 55WJghhbm9xGtgTV4XHo5EZVey7XYrp5aW5lJfUgPGiyovy209j+6Q+yYMagr+pgBNvlS8 drQ0TcdTwDI9+sFwv9toujsoEfT0Bj2sqiJ0GHKDJ+zO5mI6o0jUPNtcvDEP4AEOTFJSv/ WSQoixELzHL00ef1JoAGTw+m+auYL+lVNWajsxGd6L9P46tUB69WDgE7zBDGBm5rVXotgm oiePSGyXGzta1J9buR9K7luYzOyYI+E6E4yp3NCNn5ByaIbUF3vwUeqiYTo4ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THMYZ0dGSzhqp; Sat, 20 Jan 2024 16:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KGa1YG053312; Sat, 20 Jan 2024 16:36:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KGa1qR053309; Sat, 20 Jan 2024 16:36:01 GMT (envelope-from git) Date: Sat, 20 Jan 2024 16:36:01 GMT Message-Id: <202401201636.40KGa1qR053309@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: 2b1e4e5be304 - main - atse(4): Fix a typo in a source code 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b1e4e5be3047411df5e4d5442aa7de6489a0309 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=2b1e4e5be3047411df5e4d5442aa7de6489a0309 commit 2b1e4e5be3047411df5e4d5442aa7de6489a0309 Author: Gordon Bergling AuthorDate: 2024-01-20 16:35:51 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 16:35:51 +0000 atse(4): Fix a typo in a source code comment - s/addresss/address/ MFC after: 3 days --- sys/dev/altera/atse/if_atse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/altera/atse/if_atse.c b/sys/dev/altera/atse/if_atse.c index bd252693e6df..923292484207 100644 --- a/sys/dev/altera/atse/if_atse.c +++ b/sys/dev/altera/atse/if_atse.c @@ -580,7 +580,7 @@ atse_get_eth_address(struct atse_softc *sc) sc->atse_eth_addr[4] = atse_ethernet_option_bits[8]; sc->atse_eth_addr[5] = atse_ethernet_option_bits[9]; - /* Handle factory default ethernet addresss: 00:07:ed:ff:ed:15 */ + /* Handle factory default ethernet address: 00:07:ed:ff:ed:15 */ if (sc->atse_eth_addr[0] == 0x00 && sc->atse_eth_addr[1] == 0x07 && sc->atse_eth_addr[2] == 0xed && sc->atse_eth_addr[3] == 0xff && sc->atse_eth_addr[4] == 0xed && sc->atse_eth_addr[5] == 0x15) { From nobody Sat Jan 20 18:55:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THQfH1lZqz56WSW; Sat, 20 Jan 2024 18:55: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 4THQfH0hj1z4fQG; Sat, 20 Jan 2024 18:55:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705776919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbqBkLC3rARGTtbdD90oU+8Bycgpb4S47rBsZ4c9Kg0=; b=jOXEFPZE2jHApwdzEeFj3EXApgLR6mEClfnNSgBzlT8YRaXDX3GzT45PDHLn/+6qKdirBz aQRTeFAbpSVVTPkXcohSKSgZHAwbnvlHTIQY1COTTVBZQfF7C0Nox/07sVYgjOp+oxt1tu nTc4TJWEKzten4cyOlorQpXzGHDe4GGuKCybRd9tOBLY1nFIRoy6QzsZTg+9RFw3zQvJh3 c9FuNtwlt0kR0D76/IlFFsny0yl4z7Vy/wZRA1RPFePFTDSHXGgDAwwqV9cxTKhvV4NFCp KIMl+HukqNLWglvk3GcroEuuYBRU9UPwVLenn7B2b3Vvz4z8mDj566qyHzcKCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705776919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbqBkLC3rARGTtbdD90oU+8Bycgpb4S47rBsZ4c9Kg0=; b=x/7KrIgmHbJ9uNrGRIBgX0H1ax95w7mEd9uWepfU96YepFPdrZcpqAyYbYL/J8xfsX+wdS ywVFFBBq2VPHz/quvaxXUw8a12ZbwsxuZBZ6uSJAW0GCNyPAD1aX6fPZqRaAp2L93hn26N kOd8n41I++o4QEaPV5UFgpAyfIVoAcyVle9KFKmyt9fTc9fRDpM5Z7aQ9nLCCo1b46zldY HSMoF9xG1vxg2hNbzAv5KTzV3LDDypNlWvDbB4EFU8ZMrCWdcpccRCfdlcw52G9tvGCk+s V77k+Dkft7UWckn66gfs4wbzAg+UsC+/KU9qIM8ackswFw72w2T93Khu3KSfeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705776919; a=rsa-sha256; cv=none; b=DbRfvg2N91KRlwrqm6dpG27csr7pF1zZxVfYN3/h5kDs6ynn8ckOLB18/A4v54ml+V1beC +gFK9D/qHYlVluYOtz5FPZHGEXzaL4D8wwZmQBLtagzBeVCOnGSF+IcJ+bZ1KjuSxrDE8w m7vdiWcTU/uLmMFmx/05gZsz2DNAHwP/giU72i913exYc/PHe7qFgz8nDmEAmZnEe4FN/8 eSB/hUdeeOzVmgTXPujUlQwU0eV00mONmAa2qHY70EvyZ2G2XkM0hYOBaN7mGJ1Iao9fZT ErluA6Er7R2/q/NUgUXNnh6tc6P7tdqcGQ+Y6Tda8JCe41DZ4Y5sR8AyMEPcLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THQfG6dYCzmqD; Sat, 20 Jan 2024 18:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KItIXe089436; Sat, 20 Jan 2024 18:55:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KItIXO089433; Sat, 20 Jan 2024 18:55:18 GMT (envelope-from git) Date: Sat, 20 Jan 2024 18:55:18 GMT Message-Id: <202401201855.40KItIXO089433@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: a70008e95b90 - main - sigfastblock.2: Fix a typo in the manual page List-Id: Commit messages for the main 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: a70008e95b907336bddbcc2aa9d567df6e3a41b6 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=a70008e95b907336bddbcc2aa9d567df6e3a41b6 commit a70008e95b907336bddbcc2aa9d567df6e3a41b6 Author: Gordon Bergling AuthorDate: 2024-01-20 18:54:33 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 18:54:33 +0000 sigfastblock.2: Fix a typo in the manual page - s/successfull/successful/ MFC after: 3 days --- lib/libc/sys/sigfastblock.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/sigfastblock.2 b/lib/libc/sys/sigfastblock.2 index 84ce6cd15090..72897191c4bc 100644 --- a/lib/libc/sys/sigfastblock.2 +++ b/lib/libc/sys/sigfastblock.2 @@ -129,7 +129,7 @@ The variable address passed to is not aligned naturally. The .Dv SIGFASTBLOCK_UNSETPTR -operation was attempted without prior successfull call to +operation was attempted without prior successful call to .Dv SIGFASTBLOCK_SETPTR . .It Bq Er EFAULT Attempt to read or write to the sigblock variable failed. From nobody Sat Jan 20 18:55:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THQfJ2YvFz56WP7; Sat, 20 Jan 2024 18:55: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 4THQfJ1Q28z4fHn; Sat, 20 Jan 2024 18:55:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705776920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yZzPyL0sYP3wVqBCko/Z0Jw1yPcGOunZzhPC6fJpG8g=; b=snROkNqzBGfD+na1L8FepLnBi+w+7NtayZSxRzZ4exw834nhSxzzhLkuiWhn5YRQwgPZM5 yRtecZKP/jilYTZz5iTsvJnYjgZHxnE+QI/fLkOCfp/0QrTt+G4oVnwhnPoYGmTAK8isq7 W9lXNPzTaKgv5ObUScJan8xY2/bao2HlFn53zCylIkadb293fZmVxEoQoc5uVsk/tcFx/8 v94KmdAXY2IE4h7p3r/AwJEbSy/xpbnHB5HH97D9CXOFSOdDrddXmat/PN8Uc/uymVY6+d J1IOqXCA9W9NZ6masBlMx0ud1wmK61EAPDW4AgbMy4DlWr7Ro5c6MzDJdDcNRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705776920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yZzPyL0sYP3wVqBCko/Z0Jw1yPcGOunZzhPC6fJpG8g=; b=fPhbZ4B3WO9zUrtZSSp0lmRvCo8BotdAcuRwD2t0ezZ/kjaqiCK33jlrsxZw5y2NBdCLRt fkQwSYhf0BaVVo9k5no+WjZHdvP0TJDvXcMN7FiETOW5vmX598pqmw2yAVvTR/0DBUDkOq puhlKDhR++1H4SuFmMGm/GgtLrKPYmuqdEazrMp6VT1qc6gPC21jV0iVAnmGYpVOAhZOnA xBBO5BNUNIGBP1RRvjaHv8Ck8dEgRW776s51q2FeF0kROJVV9yn3ZcUyIthR7XhefZDW9O cPmK1H05SwrJ6nXVZfAYlWK1w7Cladb+Q1aoGyodeVMCnqTP3xybIJteg2wmHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705776920; a=rsa-sha256; cv=none; b=bs8n58o34OsLs4QQtJLdJbCiyVv1HUQ6GDvHL8Y8k4O0TDLs00Oa0rm4LJijHJJ3SKdh9V 09w8UwbGyQKoBaCye4pJLeoqoEvaQuoJ46pwoaHf/81nAIpLUmZcp4wOY//4b/5p5sWgA2 PIWFF6MzzzRSHcqE2K+gfyOnEJpjovCv8pbt9PJA0eQP+mJOBJDDMuRmf1SFdfGHdvU0PS V0zQPABUrZpGnGZIeGfRvl1I/1gXPf65TEFNsc6ttljUGkqOcvd7ipUwXRCt2UmgFbT2YP nVsUCi4RnDb2Zs9WtIRuQVMKg3GD7oI0mC1CVzq6yhIMwKu0UHZL5NNsWAqalQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THQfJ0FQYzmY8; Sat, 20 Jan 2024 18:55:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KItJVE089487; Sat, 20 Jan 2024 18:55:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KItJq4089484; Sat, 20 Jan 2024 18:55:19 GMT (envelope-from git) Date: Sat, 20 Jan 2024 18:55:19 GMT Message-Id: <202401201855.40KItJq4089484@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: 8593b5b2addf - main - pkru.3: Fix a typo in the manual page List-Id: Commit messages for the main 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: 8593b5b2addf91987f81ebac0d8b2e51207e4793 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=8593b5b2addf91987f81ebac0d8b2e51207e4793 commit 8593b5b2addf91987f81ebac0d8b2e51207e4793 Author: Gordon Bergling AuthorDate: 2024-01-20 18:55:08 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 18:55:08 +0000 pkru.3: Fix a typo in the manual page - s/successfull/successful/ MFC after: 3 days --- lib/libc/x86/sys/pkru.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/x86/sys/pkru.3 b/lib/libc/x86/sys/pkru.3 index 1785f93cf4b6..2bcb6a64baaa 100644 --- a/lib/libc/x86/sys/pkru.3 +++ b/lib/libc/x86/sys/pkru.3 @@ -106,7 +106,7 @@ and having length .Fa len . Starting address is truncated to the page start, and the end is rounded up to the end of the page. -After a successfull call, the range has the specified key assigned, +After a successful call, the range has the specified key assigned, even if the key is zero and it did not change the page table entries. .Pp The From nobody Sat Jan 20 19:10:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THQzs0Pxyz56XcZ; Sat, 20 Jan 2024 19:10: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 4THQzr70Pmz4hDV; Sat, 20 Jan 2024 19:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705777833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nfrxTTgnBTmt5xdMAyt9Pg1doK/6kiSpdQSRLFswk8E=; b=K4jiO7tW90Isbl0IaREaGFews8WBk07N23dhBb899RqzEC9JYdQOmf+IhqByiY8z/QCqmK XyK4ru6EZo2Ez+Ucdy8DQ7vQtdb1gGnRHlfekDXWPo8qXVohtM9Ck7X4zk/jajACw7PoEl 8t8rUBrINbtUVnKEHijNrZ77m1iUKsLLT0PHCd1E2/ESnC0WhEfg3gdEWieUo+QuioUH+Z lpR5UGIaV3/71euNPg85VV2hMyGRPD1y2ZXI9R0X9DxL9wqt7BraYCxdZonfN2+0mYzp5C ZwHe9v6Wri4YXLDVfI2+se+q5ZtY5upA+cmeZgiW4ZOOAe2C8cdFSQMEaG/ccw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705777833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nfrxTTgnBTmt5xdMAyt9Pg1doK/6kiSpdQSRLFswk8E=; b=iZS2au8KSitWwgPpqPTq/MfYkmeCJIzG1U5ElVBWDCyJdl/9Hc/EWiLAlR2hr8eI5wPFTe o13NqwyX8H9XPKGmsNs4N0W+pg9n6qWXxxanEyWM4g74t4GAfv3YEdNczPrDkoRou3l2b2 VUxPQzziaeJELCLbLANxF0RctAE3FaHvnVQbMmGQpSciCkLt1JAiU6A/+wChSj/AXYNmbs EgPY/Sg3tWfw+tbMpgvPdGqJgLZav3aQkCY/BXULWvJ6hecjF5dWXHWaOf2c8gLQjHNZU3 tblPCsOa3RUOxD/BAnDFUM56aQm+heA8p1OhJvNrigjfCxu9We+yXkMtaEZI9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705777833; a=rsa-sha256; cv=none; b=C2ECg0tTwyC+kaCxuHKjdzDnsNrT2YR8TTRodaeM7/ISWPV4y4T6BVbwKrPhe+AevHV1D8 WhrBspjK+UvaDltn87oHqhOx1ATNMZRpJnD63EKmSNLPAV57jb75lQ+9WWcxg0QPEHAriT ElvCF1VALINKZruI1HcgiYhrOYNdzPBkmfYYKEEG/pX0mFT/5EErCollAeYoste5uSz1u8 cJ64JARBrlKTwySW1/D4c1lbt+UTAe5aLHgvRLWP4RqTrYJfTwJ8vsitADHHeh05yg9jZd 8abe3slYjElM3kcxMSeh1DayiAQIJ2nd7b+qd9IkEUk1mJz/Q70CIR9s+T2vUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THQzr63nPzmx3; Sat, 20 Jan 2024 19:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KJAWju016693; Sat, 20 Jan 2024 19:10:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KJAWdm016672; Sat, 20 Jan 2024 19:10:32 GMT (envelope-from git) Date: Sat, 20 Jan 2024 19:10:32 GMT Message-Id: <202401201910.40KJAWdm016672@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: e1c0d368d630 - main - bce(4): Fix a typo in a kernel 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1c0d368d630cce01691e1967ada9f36d6b8c751 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=e1c0d368d630cce01691e1967ada9f36d6b8c751 commit e1c0d368d630cce01691e1967ada9f36d6b8c751 Author: Gordon Bergling AuthorDate: 2024-01-20 19:10:21 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 19:10:21 +0000 bce(4): Fix a typo in a kernel message - s/adddress/address/ MFC after: 5 days --- sys/dev/bce/if_bce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 53b503ab2fc8..33158b75486c 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -10661,7 +10661,7 @@ bce_dump_driver_state(struct bce_softc *sc) val_hi = BCE_ADDR_HI(sc->tx_bd_chain); val_lo = BCE_ADDR_LO(sc->tx_bd_chain); BCE_PRINTF("0x%08X:%08X - (sc->tx_bd_chain) tx_bd chain " - "virtual adddress\n", val_hi, val_lo); + "virtual address\n", val_hi, val_lo); val_hi = BCE_ADDR_HI(sc->rx_bd_chain); val_lo = BCE_ADDR_LO(sc->rx_bd_chain); From nobody Sat Jan 20 20:00:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THS5b1YWkz57Nhv; Sat, 20 Jan 2024 20:00: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 4THS5b0xCVz4my1; Sat, 20 Jan 2024 20:00:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705780835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P87g43sISu1/Rx45f0jLJgvJDn+OGmGS3xqa6pn8yuU=; b=A9dSC8yRkkT9rTjUQ+Jg1l+5OMU5XQDYJHB1AAisUM61kVjnfdRzy5jTrrpJUdLRhYFV3e sK/QLNxVbNj1AyHUIAfFonGeQntiZ4JXIOEnJdUsEsmpWxqx+N7uIdFPVs8BSMyuQP8u2/ a7neozbVGEX2iaDMPzVbg0lK4sOw0aqaL5VlfK/qQzVmVBIYYHqCTcrarr6CO0hBHrxvY9 hdUiSU7WGJ+S8OGcnZu0rW0DMk3fhbkgFb6ICl8+K/+YHAxJ5tbUlD/PNC2WCTC4xqkPpt rJfUqrzLCaovwOYQQQtryY/FXtCjurF6IwST3UaMpWbUMg7UflJPjkNSQzhbWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705780835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P87g43sISu1/Rx45f0jLJgvJDn+OGmGS3xqa6pn8yuU=; b=cWWtlKYdLyyLtmuWD53ZblXat/ngamMeag71MNW20nrAKS6odLvErivePvoO7ha/xnr1r8 JJqFSiwIsB18hoXQTQktZA5Bm5y+anJX+cATYSpmBkK2mWuotvK6WIyQ2AcFs8srqodV4h Oddj1jVayVo2U77HfimjAfRkvO5ASaXZFNvlHlu6xPr3zkogkQ/Y2X6GwAAIz4uXYe9gnd Q9BKv8QeQBz2GMhNlPm1Ass6ZshJZAess9MWMipcNvn21+1R7qgzHMb2EqieAGotvcYL8v +AYyEMDr12CH20PYkM7SC00q05RjA4SkgpxlWH3FapLeOjWgkGZzSu1oFTbLYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705780835; a=rsa-sha256; cv=none; b=HV2kcJJJ6reYWtUQ+H4upfmmuiYbMbiEyT16SVieJjGCQLaOSTE4HFb/DMT9LsLyMirbYl iNDnPS/Z57WJuVqPXKne5i77ErVdMWDT/fW8Lo0NCA4Q/Czvdkj0In0z+pc+dmR7AhPMMO VkG46M0UM7kcUZjzxh5eZrPBfCvKm1RGqtgfbo5dAGTrRPpdaSZ0l5Tf+CpqP9nMuyga5k b6B7Hf1mcUpqjATgSRQjmkyS/OSiY5lkbNxCAEtZyU/tlbV0bnGfbv9oPvk7OKC8pCngI9 sDjzbnMliSg64B2bWcilJCyGp4wPGKRdtptas70Tf9VFSLXMYWi9WCQ98TAxEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THS5Z73VlzpGm; Sat, 20 Jan 2024 20:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KK0Y0U099412; Sat, 20 Jan 2024 20:00:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KK0YXd099409; Sat, 20 Jan 2024 20:00:34 GMT (envelope-from git) Date: Sat, 20 Jan 2024 20:00:34 GMT Message-Id: <202401202000.40KK0YXd099409@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: bce295fcbe53 - main - PCI_IOV_INIT.9: Fix a typo in the manual page List-Id: Commit messages for the main 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: bce295fcbe533d46d2f600168403c7968599b86b Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=bce295fcbe533d46d2f600168403c7968599b86b commit bce295fcbe533d46d2f600168403c7968599b86b Author: Gordon Bergling AuthorDate: 2024-01-20 19:20:32 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 19:20:32 +0000 PCI_IOV_INIT.9: Fix a typo in the manual page - s/infrastucture/infrastructure/ MFC after: 3 days --- share/man/man9/PCI_IOV_INIT.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/PCI_IOV_INIT.9 b/share/man/man9/PCI_IOV_INIT.9 index 3e71a65e4132..66b1e693cedb 100644 --- a/share/man/man9/PCI_IOV_INIT.9 +++ b/share/man/man9/PCI_IOV_INIT.9 @@ -40,7 +40,7 @@ The .Fn PCI_IOV_INIT method is called by the PCI Single-Root I/O Virtualization (SR-IOV) -infrastucture when the user requests that SR-IOV be enabled on a Physical +infrastructure when the user requests that SR-IOV be enabled on a Physical Function (PF). The number of Virtual Functions (VFs) that will be created is passed to this method in the From nobody Sat Jan 20 20:00:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THS5c2vP7z57NLs; Sat, 20 Jan 2024 20:00: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 4THS5c1hLKz4my3; Sat, 20 Jan 2024 20:00:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705780836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YGBy5Qmg7THaoLmtlpvlH2kiWMTg8faKLODClfxrhUs=; b=OOzvBKP/WYCxOGM4Iunnq8yz7qk1jdRjMD/nQhpKRKXsJwKEKBo1qnB7Y0AgKKS/ckOtcU W+Zww2SuVrRZ8CXl6N4ectgcYvlrqV/kE3PLimRIsrD0GaH2jAwAKdpe67r+IAB1MVZp3J OHakB5dAN/NkcrQ4dNYZZq4nsYDpbCijDkafdGkWojTuv6kNK/u3F4AXMaIxBBVRLxhhfy zMlj9qvhLYsFr1JG3b73HQLCXDL1BMOUJbw4wWEZEsxLaGzfcIOjR7DKabWzXxseWqR7mM slI/boHVEtsL4x0zb6AvcfKbQyUpg1srxomxKMKDyfOuVwEYVSgP+3sRPB8/Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705780836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YGBy5Qmg7THaoLmtlpvlH2kiWMTg8faKLODClfxrhUs=; b=DKMA2tW4qs1IB+xYXy6SWo38c0mlkgWX8Gk9N8qeqfvXu/qSwET2+Fpg/1kJruB80NDBQ9 4BN1U7ToEu8uZUN0X835gZFr0RbsE5d/g2LJFQfKUcPrEsSMfKDERK0o5W/IIZJsZKQnbr HrpSiIecL0ujv9MgCpfCZGQx2+z82GCWYG8wA0USSCBghHgLlF3DdbOZxHD1Gp4JP9eGss UqQPjgufHG0u99RHcfogaFE1CI/zK4eXKWF9+OQAsbZo3lOOGOXw0ea2b9hhWfW20sYejN YhlFi+D6dIzLKmuEEzxDFNTpNPtwqFfMCWEYL9fXE2qjBCrmIzdDIqDwRvzUSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705780836; a=rsa-sha256; cv=none; b=EJ3eGac8x8Jg6mYdV3TMsyJAYSOZeqdNArLrcQ9a5o1ReRvBh2NDome5ocltv6b5Q3JlaM GqVQMXfhYsfcf9JPDXAR8qkCHFhQPxOvMeN4xrBFjoKfniAG0GODdpZipokmTrQKal1Z7d DNpCAG36iUuQRYVx7/F6oSjHpGT/Ll3BtsZZBPvqUhYpcf2YJVsTpVMKW1sMoN4OO1mLxL iJZfkK2bTxGvInybTTbN/k9ziWZ5jvjfckzTC1X3BT9O3bzltf7LKYCF03nKwdNMGSsKqf yqw/GOryCu9d6q0OM5K0M4nganeo7j8Y2ujjC/lej9N+sM0iJiPjSRvY2zYnSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THS5c0mg0zp3L; Sat, 20 Jan 2024 20:00:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KK0alT099466; Sat, 20 Jan 2024 20:00:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KK0aJV099463; Sat, 20 Jan 2024 20:00:36 GMT (envelope-from git) Date: Sat, 20 Jan 2024 20:00:36 GMT Message-Id: <202401202000.40KK0aJV099463@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: 3fb6adb07915 - main - gjournal(8): Fix a typo in a sysctl description List-Id: Commit messages for the main 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: 3fb6adb07915b6759892c937fe4ae8a07ed1a029 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=3fb6adb07915b6759892c937fe4ae8a07ed1a029 commit 3fb6adb07915b6759892c937fe4ae8a07ed1a029 Author: Gordon Bergling AuthorDate: 2024-01-20 19:58:08 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 19:58:08 +0000 gjournal(8): Fix a typo in a sysctl description - s/entires/entries/ MFC after: 5 days --- sys/geom/journal/g_journal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c index 92c197d98aa3..6d9f6239e632 100644 --- a/sys/geom/journal/g_journal.c +++ b/sys/geom/journal/g_journal.c @@ -131,7 +131,7 @@ g_journal_record_entries_sysctl(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern_geom_journal, OID_AUTO, record_entries, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, g_journal_record_entries_sysctl, "I", - "Maximum number of entires in one journal record"); + "Maximum number of entries in one journal record"); SYSCTL_UINT(_kern_geom_journal, OID_AUTO, optimize, CTLFLAG_RW, &g_journal_do_optimize, 0, "Try to combine bios on flush and copy"); From nobody Sat Jan 20 20:00:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THS5d5c5Vz57NZD; Sat, 20 Jan 2024 20:00: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 4THS5d34b2z4msQ; Sat, 20 Jan 2024 20:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705780837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aQtCdunjQT0sg5VSk53W0poLmYwqgNoJk1c5HN3e0K8=; b=m7bZ2TnU6V1y+IYXqGBDXB9ce3ufzO7FpBlLO/NqFr5abXeLSxjsK9FXCK/ENT5wsYNJvq NCM0hmrE3a2FChyhUhM7CDVlddtKmP7DRFFiK1jMdbIL1FY/MzlhTacJNBcHmla2Wy/qbV vAi8p7N+ggpg8JW/rLKDQNUZGsXIWHHLt+E1GBQmdQWKylA0aOkzfxMLiFW+7+VKoRIIAE cObfKFVMBcv+TLhpbmeeowAP4uEYnwnFuGdquzA9ETAPRmxacE/t8JR3q3aWcMHFQtoZzY 2iQtHeENNqL61K9WHSe++IuLkSxD85lgAwWLPW5DziFvONMOiHvR8Cj934/Cuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705780837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aQtCdunjQT0sg5VSk53W0poLmYwqgNoJk1c5HN3e0K8=; b=K7c06I6J9SGvxFNumzq78l3klf/p6FIMclaWFeRgDpsLGSTh+WygQ86abBGgHglAnbQH5Y hkfxlc3NsrrlQSACBg4YQ7N3pCic3Gxzxj10OJmcx11Q82guuCBZY85T1JqmKBWZTmaOL0 EJ0pulokI/fkADzsBg/h2gl6eWDiitW2xITfb/YI12sZH6etZe069eIr2Wx8veSyTu8yTG AWHOr0MSWJxSW6EAzAkl+53eXDfDTe4ONGDYAZ97PP6OaMh0IX8R6SutY1Z4nHR4hRSvvJ ZgWWl+Gql2F1bLXcoo0GTVEKJ2QdRGkb60IxAcAyB9ebmix9HRBafxrbxNGZNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705780837; a=rsa-sha256; cv=none; b=T/Z0k+ha7QtKVEi9H0/bii9IFnguFHhZZZEjjeGTStKkMzoTwn0npNiMutSALXL5IVC5AK 4BR0gCV4qNBgq1NSWhDHCTBZlEyNV0aHAfJ5yXifsVNFU5cHBqr7bnHZzTxqDS3OZyrwU9 Z0DKcCcxzpaGWW8pOoLYi4B/uq0ooQz9QFr776+cxnSJICPoIc3QEQtK9I7ivo8Ky+6BRP HweuH9r+FTM2TQz7/dqMOHCtMaBPwKKy2qMygJh9PBt8T/abwve/pqyJxIFq8o0TFZZP6u s779lLEApv4Zxz6+uP8YhpHOgGhZFKXxt+imxqWRe3+2aWU5DeYhO8RG04n7Cg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THS5d1pJ1zp5F; Sat, 20 Jan 2024 20:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KK0b0X099522; Sat, 20 Jan 2024 20:00:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KK0b28099519; Sat, 20 Jan 2024 20:00:37 GMT (envelope-from git) Date: Sat, 20 Jan 2024 20:00:37 GMT Message-Id: <202401202000.40KK0b28099519@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: b4c94968d1bd - main - if_llatbl: Fix a typo in a KASSERT 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4c94968d1bd1ffdd43976b0315e2b6c2b620ee2 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=b4c94968d1bd1ffdd43976b0315e2b6c2b620ee2 commit b4c94968d1bd1ffdd43976b0315e2b6c2b620ee2 Author: Gordon Bergling AuthorDate: 2024-01-20 20:00:22 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 20:00:22 +0000 if_llatbl: Fix a typo in a KASSERT message - s/entires/entries/ MFC after: 5 days --- sys/net/if_llatbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c index fe5273cf19c0..f6bfeff8a9b0 100644 --- a/sys/net/if_llatbl.c +++ b/sys/net/if_llatbl.c @@ -706,7 +706,7 @@ lltable_free(struct lltable *llt) llentry_free(lle); } - KASSERT(llt->llt_entries == 0, ("%s: lltable %p (%s) entires not 0: %d", + KASSERT(llt->llt_entries == 0, ("%s: lltable %p (%s) entries not 0: %d", __func__, llt, llt->llt_ifp->if_xname, llt->llt_entries)); llt->llt_free_tbl(llt); From nobody Sat Jan 20 21:01:20 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THTRj0gvgz57V8F; Sat, 20 Jan 2024 21:01: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 4THTRj0CHtz4s2Y; Sat, 20 Jan 2024 21:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705784481; h=from:from:reply-to:subject:subject: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+mXb1cCghWnsFEyqxrL4Icpec2Tn3JJHxjHpqrwXMQ=; b=wJxfAaSOdlOaLiCXb+x2RT/6tV45+Fz4G7JtwuVKTpmaljEjramnYsZ+0NjaODsOpMThF7 jUGlgTnVjthqiFL7A4rOnDkIRLP9OXh1z23xUyVYMjfuDw3+q9vA8pmXB5wjRWfA+dUcnp lq+hFQh934SxywsPeqb8awmcR2g9sHtWdudBAvvrz0Uo7CcmLPOumMzlLsLT8/VUjDraV9 fkZSImIEG+MxThU0OtusdTaoHy1nrLFJojMGmGMEKkOb7WwlPpIrULJ1J1SHeqeamqoM0Y I3yMW6CyHR1zuOkfx5hGLt98uigxsQo0DAncItKT2kCVmBvOJJmMSorFQ4MXJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705784481; h=from:from:reply-to:subject:subject: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+mXb1cCghWnsFEyqxrL4Icpec2Tn3JJHxjHpqrwXMQ=; b=bYQiFv5Ua4ZT4C+llN2qqKj8YXVNYpSDTcPBU6DhRJ2ObhxkhfIqh+ptL3nCSFtwAHGeRy y6xgplevb9kA+JZESnfzlIXqLnA6na9D64Jg/AreqL0hh5xRpWKjgn6qrqX04br+3y3avi cGN3SRMQHslHPjUlW2SM8DPkH0UwblN0UH3XqCdjFcxDHWkk0D/VJZHv3MK+4T6gV2zn4h db+QdAWk6WOspyCFCGPSOAf/u01ygOBOpRNLZ7l5xs+US54+J+1ESy4Y9Mg8Du0tIrlsS0 VR1gGlWALEEaYP6q7TN2p/EcFZ/Gf0kQsNt+w83es6cRj6mbP0MpElJxKe4PIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705784481; a=rsa-sha256; cv=none; b=AmlL5lFNozv6Pn1yDAQJbP7tMfneIeFp3J734JhGmxQxjIW3dHnJBZRUiwyZcvj3CjAk9I 7z3nYN2odZEdyxPzOEVw4tN+m/vGRZhgAvE4LHcStp4LVbSSveki49jnk7DEKj2tIMAgp7 TWotz+mWsKeOeE1SLqiwaFmIbcLhZtU2kqHihfdkfu2HRsKE+AoDdJSVU7w6AC6v4UVS+q l2QJcrTb6LDF/AzRTNIKwhfqedDy2/CNYz4twfeCU3nWgmhvmSAYc6iGK0fnSZ2r5INDXQ be2ZrKEpxdr6xu4oi2n8RkID6wiBHafjWF0od6JgiXWUCw71wv2HotakBN1SNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THTRh6P8bzqyw; Sat, 20 Jan 2024 21:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KL1KgX003397; Sat, 20 Jan 2024 21:01:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KL1Keo003394; Sat, 20 Jan 2024 21:01:20 GMT (envelope-from git) Date: Sat, 20 Jan 2024 21:01:20 GMT Message-Id: <202401202101.40KL1Keo003394@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: 54e047b13baa - main - aic7xxx: Fix a typo in a kernel 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: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54e047b13baaa5eb613e98991f807e7b6f893f78 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=54e047b13baaa5eb613e98991f807e7b6f893f78 commit 54e047b13baaa5eb613e98991f807e7b6f893f78 Author: Gordon Bergling AuthorDate: 2024-01-20 21:01:10 +0000 Commit: Gordon Bergling CommitDate: 2024-01-20 21:01:10 +0000 aic7xxx: Fix a typo in a kernel message - s/recevied/received/ MFC after: 5 days --- sys/dev/aic7xxx/aic7xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c index ea80c9d0602f..4b62f76b9cf8 100644 --- a/sys/dev/aic7xxx/aic7xxx.c +++ b/sys/dev/aic7xxx/aic7xxx.c @@ -1109,7 +1109,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) printf("\tCRC Value Mismatch\n"); if ((sstat2 & CRCENDERR) != 0) printf("\tNo terminal CRC packet " - "recevied\n"); + "received\n"); if ((sstat2 & CRCREQERR) != 0) printf("\tIllegal CRC packet " "request\n"); From nobody Sat Jan 20 21:23:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THTwl3JhSz57X4P; Sat, 20 Jan 2024 21:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4THTwl2nCvz4vWD; Sat, 20 Jan 2024 21:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705785783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zETwuUJk86NlpiNelm+am6IXB1essWTo2qt/0AsLXaY=; b=alvMsLDLeWlT9SSKguzeNdUr/wuK99I3QVfnPfS/1yx3F/x2ItE2Fl0c+CKsBj3uvqFjXa k4KKWkeFU8bkPAumZkakNX9JWjfkoMxuprQBGsEcsb3GxWNTdaMpjkI9Qga6iSbTZFifJX +Hr+rNcCh4Z0LKcbWQ5u/CnRKSNEyi9PrS41r2BvpSJAQS1buDYp43JOS6MSr/soI6HR5F 2qtxOSXX/kEFaM6+SQ6lMm0ytJHc9IStxfcV8bszJOlg+Cxec3tYK9k9IoMVgHdbS/Z7GN HzJIO8PjaNCA4E+g6OoxXOG/Qipm8+TDMVwSMlLI/YPPlWh9cegn/1vAqup9Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705785783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zETwuUJk86NlpiNelm+am6IXB1essWTo2qt/0AsLXaY=; b=ZVYl0IxuIndZzYsOmaJsiApt2PKkpAnU/UBxwVlVRUaAEizto9k1LJ06WlpCX/mtjxujFa a/vXNgf3sXrfPjCGv4khgbTuPZQ3/raC15Qi9fGLfreCWAUS4+qC/woC2LoNtc858NtpHf 7kqJ8FAiWkPF3eRg9u7glpOEqgYyUKh+Vmewt/XAtqZXo2BwcMwrJZH+5wAkBdW5zbA+EZ j+6Jt3E06dKcegiiHMvbKf7S2hHo5GvCEoA5t8MVliVLnztahegvuSrYW+Wg7F5Yp0Qesu uExQbrfhCB2+Qws1G4lquopvbTRNc8LxvVcOYsT3JxA00gcKjuqocE20e5Cg7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705785783; a=rsa-sha256; cv=none; b=sRVAhjbhs0QmPu9ruFFpXNapSr47/O89e5n6BmIBdT4tAbLuegOTvSllS6K6e89ULXp8mr /qmQCKDEj23wh3a4TyJGiFGU4FooD+875njIYWL2mpSQymwece74FOj+P3Rn8DX09CTcip i89V8j5PHjqjVyxLh1w/S090TAUGHcOQvxM3dAW/beTZf2FB8Up3i5qWcqMF5qZYlbK5j3 lj0YYI2Mgr6dg+djnJzMdxZTJ5B/rU0f/iqUWf5GlkgM62PTOHVMoLBoqXK+FTl8BiBZiP gbsFEfCkXQjiAWaw29h0iGUN4EMPusqi7ILIm5noipUBomXeoWmfNaHFNSaNNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THTwl1r4lzrTC; Sat, 20 Jan 2024 21:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KLN3o0041827; Sat, 20 Jan 2024 21:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KLN3LP041824; Sat, 20 Jan 2024 21:23:03 GMT (envelope-from git) Date: Sat, 20 Jan 2024 21:23:03 GMT Message-Id: <202401202123.40KLN3LP041824@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: c3d7bb5aca77 - main - netipsec: fix LINT-NOINET 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3d7bb5aca7749626b5c70dfa86ee8f07960f44a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c3d7bb5aca7749626b5c70dfa86ee8f07960f44a commit c3d7bb5aca7749626b5c70dfa86ee8f07960f44a Author: Kristof Provost AuthorDate: 2024-01-20 14:37:40 +0000 Commit: Kristof Provost CommitDate: 2024-01-20 21:22:21 +0000 netipsec: fix LINT-NOINET build udp_ipsec_input() is used for INET6, so we need it even in NOINET builds. Build the relevant file if either of INET or INET6 are set. --- sys/modules/ipsec/Makefile | 4 +++- sys/netipsec/ipsec_support.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/modules/ipsec/Makefile b/sys/modules/ipsec/Makefile index 7aaac6f79525..08a2e88d5794 100644 --- a/sys/modules/ipsec/Makefile +++ b/sys/modules/ipsec/Makefile @@ -5,6 +5,8 @@ KMOD= ipsec SRCS= if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_mod.c \ ipsec_output.c xform_ah.c xform_esp.c xform_ipcomp.c \ opt_inet.h opt_inet6.h opt_ipsec.h opt_kern_tls.h opt_sctp.h -SRCS.INET= udpencap.c +.if "${MK_INET}" != "no" || "${MK_INET6}" != "no" +SRCS+= udpencap.c +.endif .include diff --git a/sys/netipsec/ipsec_support.h b/sys/netipsec/ipsec_support.h index 905b2b6cd764..b7be62104d12 100644 --- a/sys/netipsec/ipsec_support.h +++ b/sys/netipsec/ipsec_support.h @@ -49,9 +49,11 @@ int ipsec_init_pcbpolicy(struct inpcb *); int ipsec_delete_pcbpolicy(struct inpcb *); int ipsec_copy_pcbpolicy(struct inpcb *, struct inpcb *); -#ifdef INET +#if defined(INET) || defined(INET6) int udp_ipsec_input(struct mbuf *, int, int); int udp_ipsec_pcbctl(struct inpcb *, struct sockopt *); +#endif +#ifdef INET int ipsec4_in_reject(const struct mbuf *, struct inpcb *); int ipsec4_input(struct mbuf *, int, int); int ipsec4_forward(struct mbuf *); From nobody Sat Jan 20 22:09:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THVy93fLyz57cjb; Sat, 20 Jan 2024 22:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4THVy938R8z50j3; Sat, 20 Jan 2024 22:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705788561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=67w55Xp/UeozhXELLbCWlxBs2+Mn4XgPb22RkrJAwkE=; b=APU8OYP7AYfv39fLZrLQ1y5PoaYZBegXq6DhgBpUnegPMys9eiJMdE1QQN8miuzMODLfih +Yj6b7T/CnYCHZq5KYBjL8HVVti/I40p2AWzda0yUppkdMaCdp+TAZWJ1iCVe/bEw/7Zgp OyAtz2a4TcEDIKgIDk3kkhPkB2XO6Oo8qOX8YrWMT0Ri2X+XQ3N/sNPG2BU81ctV84ZHqJ vfV6Q9ow3n9+elxPlSvHjVV8HOQ8muqp/WzHasLo447eKxPJRK/Ddfa4TpdOj2/5MkF17A Jv9ATNF6C9/QuupTlM29+s2AcX7hRkSgbuDM2G8Ym+jne4itcMyqPCxurMCFug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705788561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=67w55Xp/UeozhXELLbCWlxBs2+Mn4XgPb22RkrJAwkE=; b=MkNqCGy/okotgJ6nyJ8fhTyWVNNMJjGn0erjxmRCEEXcZf69aWd3wsgd1T6I7k83hgK5cS hDqo58jFHmI2gw0s/ehyX4RreuQhkokVn9H5eyDbvaBzFEZiGCpQgn12su0dF++oxL65gP gF5uJBQtxhZeOTGMZcmc2kdYqJBmKveflmLDX7yya7JzCu5AQpt1Bc++AD5cH5pD6Wef1A +Iv9OLOEmQgh9cgHqQ179cTDKEHdXUC1TFRT1SKAVA7ZD6Clr7Te2g/+QEbfGVYvAT0Ylj Tl/WEtWYQwo1u+f6O5V9nSaIrEGgc47/NPVCx6XA2OVQGOJeoT+nI9D/lLr+6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705788561; a=rsa-sha256; cv=none; b=x1r/A3kKK+AZrIoB9a+DcdQybgAj05EECz9YRSkLZorBpc1rB4MQcK08EI5HPh0JpF2L/H IVg/H0fhL2qPYjWnSssQDSK6iudP052ebhgI6u2HR2rCtx9gQCtHYyNO/WfmUxRi5356yC AwOTw+oshigko6+RkUyx543YOxpRC+MSqaKPItWQAbtzun1DWWvQnUZqDZm21EcOClpBdW g8iUhM4r9aDUsePlAa5LbFqQv96cppYdMNj52c1f9W7zquLX5BG7yHXn8DqB9QWyf7jVMO MGQXxGp3cPHauXmYlVAh8N7qpef9a1E6ioWkMCYn7atZU6eD1buYcHSCqsxQ5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THVy926XLzsXF; Sat, 20 Jan 2024 22:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KM9L0w009854; Sat, 20 Jan 2024 22:09:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KM9LRa009851; Sat, 20 Jan 2024 22:09:21 GMT (envelope-from git) Date: Sat, 20 Jan 2024 22:09:21 GMT Message-Id: <202401202209.40KM9LRa009851@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: edec803c5b72 - main - tools/build/make.py: Add missing comma to fix tinderbox and worlds List-Id: Commit messages for the main 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: edec803c5b72681b39ce969cc16d634e08bb3ac2 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=edec803c5b72681b39ce969cc16d634e08bb3ac2 commit edec803c5b72681b39ce969cc16d634e08bb3ac2 Author: Jessica Clarke AuthorDate: 2024-01-20 22:07:48 +0000 Commit: Jessica Clarke CommitDate: 2024-01-20 22:07:48 +0000 tools/build/make.py: Add missing comma to fix tinderbox and worlds The missing comma meant this was interpreted as a single target called "tinderboxworlds", and so neither tinderbox nor worlds were recognised as being MI targets (i.e. still required TARGET(_ARCH) to be given). Fixes: 5157b451c654 ("tools/build/make.py: Grow the list of MI targets") --- tools/build/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/make.py b/tools/build/make.py index 5c483e8b45be..1cca5b14ec70 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -55,7 +55,7 @@ mach_indep_targets = [ "cleanuniverse", "universe", "universe-toolchain", - "tinderbox" + "tinderbox", "worlds", "kernels", "kernel-toolchains", From nobody Sat Jan 20 23:21:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THXYP6k8Bz57kW0; Sat, 20 Jan 2024 23:21: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 4THXYP68hrz59SV; Sat, 20 Jan 2024 23:21:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705792889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SA2HXEInf5aPdVxD/8wMvoRBLWQmrlNhV2HJxrAGReU=; b=puqi0lRsonrCOMR7LDh7IvXX/Y+LZt/qqFxos2En57KggO5xZ+rc4zUGjFz3QhGyT5IYyL +oq2lPu6hidPJG9u+0R/yqQf+70jxlasOX8WDK1cvQpl1LNAzPCsS84UBzsg/bveqHGeJJ cJgRLMMgktASD42hhrcPinSGag07/YRixgbQqiCXDmJSsx9HNiTeVLegKoGcG1u++6pMXU bAYru/QZYvOhs6L7eUitdeTbWttZ/MzROBLpOH1PMuK9Ba8j6v/5qppGJNrzmzHos6Xy7u mUSFlUcLQcv55+YCkaAMGwvK9eYzXYJzGBiqVOiMPBqe6Srd/rVfx7PjXXRyYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705792889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SA2HXEInf5aPdVxD/8wMvoRBLWQmrlNhV2HJxrAGReU=; b=qeRlCBmeJjzd8y5KTvJYs8G2a8Io0ob3KBe+ft/ax0rL9jnjf6NtsVmybUck7wR6Qjff4P Q4v7NooUhzvUnkq1sYOqQw73Qf5LTXbMmvjhhHouPfUCMo+AdOjWzSky6D4qRwPb5zs7wf ea/MB/fcFCOjOqBoNCm0ZaVOo0qBj8IfoXKn+fCpFnBxxDSHWxknqX3WVxmR2ABsoPmshv YbFVH3RipHiLbttnAnlTrnEeOaaeXtDKCDf4/c/gegdDm9fAyJom4GMcvD8ecWrLBUFmds 3U4EE8/Bemrvmzwx9TpkbSX0qRuDAuC+WUiWEMA9SgLdsUmrN53wpZIpzMoZEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705792889; a=rsa-sha256; cv=none; b=gRCiN7eZNcva+8DbvF+r4JTEukpoST/3ULQ8pSQN7AyEDXWY7S4Snjmto11R2OdEmPh97p 5N90Z5HHuMf5UuWkFalKXAcOvXtCtNg5Y1uW+yi6Y23O5ZCYPT9QoVrBtvS88C2qb8h4wP JXwAnIRs5O1uRSAcuhxbIRouIbZEiH9oj0E5p3C1WFSXB9JE7jw1wy4cTrol+wJ1spET1H rnD/Fe4pX6SwxJ7frpIC6d5guEVLZ1iJ/i92TSE2I4HkP5dF8i1b2yhACK89TQDZ5U4fZL TWKxm4Vt9hxaC12QKqrbL6Twnwpa+2AUE54ooE7XElj/Kn4lWdl7dIJAqeEYyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THXYP5FH0zv5j; Sat, 20 Jan 2024 23:21:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40KNLT2k039344; Sat, 20 Jan 2024 23:21:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40KNLTGl039341; Sat, 20 Jan 2024 23:21:29 GMT (envelope-from git) Date: Sat, 20 Jan 2024 23:21:29 GMT Message-Id: <202401202321.40KNLTGl039341@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: deeb1d34024b - main - fsck_msdosfs: do not call checksize() if the cluster is bad List-Id: Commit messages for the main 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: deeb1d34024b3f843d965cdf204c745165c9bac0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=deeb1d34024b3f843d965cdf204c745165c9bac0 commit deeb1d34024b3f843d965cdf204c745165c9bac0 Author: John F. Carr AuthorDate: 2024-01-20 23:18:18 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-20 23:20:24 +0000 fsck_msdosfs: do not call checksize() if the cluster is bad PR: 276464 MFC after: 1 week --- sbin/fsck_msdosfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c index c60eaab59b12..19516d882e2a 100644 --- a/sbin/fsck_msdosfs/dir.c +++ b/sbin/fsck_msdosfs/dir.c @@ -995,7 +995,7 @@ readDosDirSection(struct fat_descriptor *fat, struct dosDirEntry *dir) n->next = pendingDirectories; n->dir = d; pendingDirectories = n; - } else { + } else if (!(mod & FSERROR)) { mod |= k = checksize(fat, p, &dirent); if (k & FSDIRMOD) mod |= THISMOD; From nobody Sun Jan 21 05:22:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4THhYg3Rntz56ZfK; Sun, 21 Jan 2024 05:22: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 4THhYg2SC5z4h10; Sun, 21 Jan 2024 05:22:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705814535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZzmNdHR5plXo4YyyG1xN476SAadbYQVOuRL9gNnAjXI=; b=cphxzUDoZrx+yoe9l4jF6YfUYs2q5pWg1gClOwjfxUJpjkby9C+sfV4h5tt0qVJ8/dIfFg j3Nm40Sp70VMspX5zRdsKT99g630yNFQ6h70rAPpR3h27AQoHTAr9NdGvtdpypGL8pap5O 4kMjIB5kHgcfwVrQ/w1DeUayQaToppZ4aBfNS9Ju/DTw/ZktIlKU6c/kfHgtQWQFKvrCm4 EyktkPttSRkOagAIW1LNu5scUOsc7ZH7WNORSbGw5S3Sk//yeYPUQ2TkE/Pg+Y/qON5YKb 8e+6Qb5/W7Antyb7WdcncSyuhe0qqokbTf9Wg9QCePK8eRNiCjITbPgcmzkY6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705814535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZzmNdHR5plXo4YyyG1xN476SAadbYQVOuRL9gNnAjXI=; b=aJrDb5/26pZuWJ28JWyjeafz48ZxOw5JO8m9RJkicVpjR+9CwsYmPHPAv8dxhr8ZyBkoOM jL/1ViDYWuh6nIILOFeWjk9xwmU7QVS5J8u59ajI0iwE5c10vGHj6zwutaYW5tWZihIxqv k+o9bbxsCV2w8jI1lQSPUntscd0RHtzRiR73hpA2yvfOPQepHIRUICRxBpnJF05jM6Y1Uy EunZdZdJc4w5KvaelAZsv3FsmkBSYvKA47RO/NkJHRjGTA6BY1i+Ul3ZDQbZNFqhEq97ld AEeqiFbAkXv5pCwqsQ+b0yhb8a0OmybEzjI2/hJV7Cw4I58ClKokiNkNDJAFzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705814535; a=rsa-sha256; cv=none; b=ncBepqmUT9RLi68OJhJ7Zec4NbyghUPD0/zaT0H2XFX7xr76Dl1ji6Lv9DIFe31V1OfXi5 NdGECzlF/J1+4wqJLHj1jmPYG5f0rkpDGzq8ilzkEaStr+SabpKDRr9sVbGGUrsvxjQ5mC 9vVjT1gfefI3UWvKQMqOuN2nPvIhF8fSOGEymeenFYqCMYQHqmE61N4eWeulJQcjeV7MkQ P07xzatGAMLxnmMNpM4xHA/CGVZ49vg1QNjzeLbzM8J7C5LjMefWAAA0wupFgliBszliO9 pKir5wcaKArzw+fRyeZSjKdcmGztLulzCoVWSdoIqqREAsLkWCErMPDRvYzn+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4THhYg1XCLz15NJ; Sun, 21 Jan 2024 05:22:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40L5MFTA047210; Sun, 21 Jan 2024 05:22:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40L5MFvp047207; Sun, 21 Jan 2024 05:22:15 GMT (envelope-from git) Date: Sun, 21 Jan 2024 05:22:15 GMT Message-Id: <202401210522.40L5MFvp047207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 768149ff156e - main - jail: make sure jail.conf parse errors exit, and not crash. Reported by: Mason Loring Bliss List-Id: Commit messages for the main 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: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 768149ff156e7d34a035853030bf946ca94cb461 Auto-Submitted: auto-generated The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=768149ff156e7d34a035853030bf946ca94cb461 commit 768149ff156e7d34a035853030bf946ca94cb461 Author: Jamie Gritton AuthorDate: 2024-01-21 05:20:59 +0000 Commit: Jamie Gritton CommitDate: 2024-01-21 05:20:59 +0000 jail: make sure jail.conf parse errors exit, and not crash. Reported by: Mason Loring Bliss --- usr.sbin/jail/jailparse.y | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/jail/jailparse.y b/usr.sbin/jail/jailparse.y index 047ca882e59f..048cfcf11c2b 100644 --- a/usr.sbin/jail/jailparse.y +++ b/usr.sbin/jail/jailparse.y @@ -234,16 +234,19 @@ extern int YYLEX_DECL(); static void YYERROR_DECL() { + struct cflex *cflex = yyget_extra(scanner); + if (!yyget_text(scanner)) warnx("%s line %d: %s", - yyget_extra(scanner)->cfname, yyget_lineno(scanner), s); + cflex->cfname, yyget_lineno(scanner), s); else if (!yyget_text(scanner)[0]) warnx("%s: unexpected EOF", - yyget_extra(scanner)->cfname); + cflex->cfname); else warnx("%s line %d: %s: %s", - yyget_extra(scanner)->cfname, yyget_lineno(scanner), + cflex->cfname, yyget_lineno(scanner), yyget_text(scanner), s); + cflex->error = 1; } /* Handle special parameters (i.e. the include directive). From nobody Sun Jan 21 17:01:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TJ04z2ZGSz57pBf; Sun, 21 Jan 2024 17:01: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 4TJ04z1mJnz46yP; Sun, 21 Jan 2024 17:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705856515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DX2NgjaemQDx3Vy5kj1qHBY/Jwx2pk0R8Vk7ohwommg=; b=dXtmj5RSc1JJExIIWLfQFyyc2bEE+I43MGmUM+UPw8TghzhN0qkHtENXxopiyh3QUEQp8+ k9KKUMKYeoWFSDF4MeZi2Xuri/aXY6H6RmXVnwlCetX6XPE4yrbZy1ZZnvf2+SGzqPbHyL loc6Zfi/67Ay8B7fXxrvQ7hOvG+NGz8WJuLqUPf7UQx/u9Ji1v1GchuqNkm71mOk5oAooe 0JMPtiOJrXYyQi5pm9QLo0xevgwvnX7/uMyH3sYOf2+/nVlOYvF3zmwVycZb3lCCIO943F jAw+lFAq1ufEzP4Nm4b0Kb1QDk+s+zMXtArQIjWyA+dIb6DuFEbCUhi+95a/Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705856515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DX2NgjaemQDx3Vy5kj1qHBY/Jwx2pk0R8Vk7ohwommg=; b=CPcG7yHkQvz267BGTpfoYuvBQYVPm8uzFamD5afT2ZMDcH2YxNmxwAZMMrMW4pyQt24nZJ FzEA2jOLu31homxPwSAgMbmMM36GY0qduajjAquvQdRgps0F8Dykf3IaNvPi1oARjIKm2f 44gITynpsmI8iHlNU+YQvhoC+4qbahJJTaLW2LivDVvu7qhLVpEPXdZILMrCR0YP1EQNcC NeULYBBc3EZ3Yz7vJjvpAm1N4qxvShaOPAYTHELOmqXHeMv1SqMSU5ZCZsZusu5dSWmZLg G1dh3YQyBB+Hi4Ksemj4GyR5K8BZToug0guMdZB0WVUaXoAG/pa0bl+7ZxiLCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705856515; a=rsa-sha256; cv=none; b=w6e+DL3kfhlvAkV8mbzgl5WuIHR6ylmafPem7BzvZINj0DnEreYS231rURnJRjDINo33zJ u5mOTro0xC7p2CkW2uK0rS6UfSojWJoBCGND30xspl16RQALUzKzMu9QzJWWgFYjcqb60K o30FhZ39EC9zoV6+YYRW+5oNC00wEpzX+OGk0gZCuEF6Akrqtbyu1PHNLr66Pn9EsSirML F7uhX7A2I/BoOvPUMDVr4t53Om0DEbx7orsf32lLN95KaS2LkA7urwj5cMfjWOsIaH2Pfo ttF1HgtEflt3F7lrHRuPRHJRQ9M2OJd7lwJc4DQqMlFAQtID/+1e1WOw4Uhr1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TJ04z0s5dzQ7H; Sun, 21 Jan 2024 17:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40LH1tUZ029601; Sun, 21 Jan 2024 17:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40LH1tXZ029598; Sun, 21 Jan 2024 17:01:55 GMT (envelope-from git) Date: Sun, 21 Jan 2024 17:01:55 GMT Message-Id: <202401211701.40LH1tXZ029598@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: 5a1af07a045a - main - firmware(9): Update example List-Id: Commit messages for the main 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: 5a1af07a045ae2f2d5af0e5939facd454e962897 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5a1af07a045ae2f2d5af0e5939facd454e962897 commit 5a1af07a045ae2f2d5af0e5939facd454e962897 Author: Warner Losh AuthorDate: 2024-01-20 04:32:16 +0000 Commit: Warner Losh CommitDate: 2024-01-21 16:20:53 +0000 firmware(9): Update example Update the example to include a firmware module in the kernel from npe to iwn. Npe was deleted 6 years ago so makes a poor example of how to embed firmware in the kernel. Sponsored by: Netflix --- share/man/man9/firmware.9 | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/share/man/man9/firmware.9 b/share/man/man9/firmware.9 index af869b6fa593..1ee2cd655002 100644 --- a/share/man/man9/firmware.9 +++ b/share/man/man9/firmware.9 @@ -21,7 +21,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 27, 2021 +.Dd January 19, 2024 .Dt FIRMWARE 9 .Os .Sh NAME @@ -252,26 +252,24 @@ colon-separated tuples indicating the image_file's to be embedded in the module, the imagename and version of each firmware image. .Pp If you need to embed firmware images into a system, you should write -appropriate entries in the file, e.g. this example is +appropriate entries in the or file, e.g. this example is from -.Nm sys/arm/xscale/ixp425/files.ixp425 : +.Nm sys/conf/files .Bd -literal -ixp425_npe_fw.c optional npe_fw \\ - compile-with "${AWK} -f $S/tools/fw_stub.awk \\ - IxNpeMicrocode.dat:npe_fw -mnpe -c${.TARGET}" \\ - no-implicit-rule before-depend local \\ - clean "ixp425_npe_fw.c" +iwn1000fw.c optional iwn1000fw | iwnfw \\ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn1000.fw:iwn1000fw -miwn1000fw -c${.TARGET}" \\ + no-ctfconvert no-implicit-rule before-depend local \\ + clean "iwn1000fw.c" # # NB: ld encodes the path in the binary symbols generated for the # firmware image so link the file to the object directory to # get known values for reference in the _fw.c file. # -IxNpeMicrocode.fwo optional npe_fw \\ - dependency "IxNpeMicrocode.dat" \\ - compile-with "${LD} -b binary -d -warn-common \\ - -r -d -o ${.TARGET} IxNpeMicrocode.dat" \\ - no-implicit-rule \\ - clean "IxNpeMicrocode.fwo" +iwn1000fw.fwo optional iwn1000fw | iwnfw \\ + dependency "iwn1000.fw" \\ + compile-with "${NORMAL_FWO}" \\ + no-implicit-rule \\ + clean "iwn1000fw.fwo" .Ed .Pp Firmware was previously committed to the source tree as uuencoded files, From nobody Sun Jan 21 17:01:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TJ0505gCQz57pPm; Sun, 21 Jan 2024 17:01: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 4TJ05031Rrz47JB; Sun, 21 Jan 2024 17:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705856516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PN2x5DjSbjPR02tco2s0OTtcSG4+usRbedlzamTg9ik=; b=yRa083BlhZa7MBoZq2AMxqZZJQc69oLIaIuJF1stJEbPbUiXXWzV3xguGz/TzrrweUFeNh 1wYIwV3bVoxW+NG8hVwZrqQX8hNtWfnqn+cmnKbjU5bT9ohBwFotZp0mPVmTzcnrpm8xUY nOS29J/3C8H3lZGMkl9xL4OKa+ibgHCBrI94G3eCusf1a2euA5elAV5OhaNfijf0FWN9HW nJfyXV5VCGHrcU8O5X0ZFrnUWGkixBaotYSWGsdarPABCsYEajw2I1DWnK3SIA6Ns0ky1h ZrlCmjNyUS9GMQSZ3dsPgeYOPHI7CUc8WuSY6Fmt9t71Y/30XUVjI465r17gOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705856516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PN2x5DjSbjPR02tco2s0OTtcSG4+usRbedlzamTg9ik=; b=wk5INr83w6D386/5m052a4yI5FLNqj+3sL+YTU69r87QYfuJLw2nnibedkSXSGi6MwPKOm 6uTz5F88LEjGJS0B0TYVGYjsznqhcGphNiU5Il92yFP2kFoAN0Kwao66d4OoEKRS8pcgM1 52XfS5hSnErEBwDOLQxrVxIaXy8tXneKhqrFCjRiDCmSG0x1JVamGSFXRj9/LqMaoT611V BTqL98vafW8vcBIyc1ZvexrJeWgWgIwkmBqzdSc6raZKlUKBBm0YTKpbIFpFqjzifWeDrV r8PmLwDnIBr4XS0Q3gKTrvoqeCpSUts36WKzZ7B+IEEQD95cTLBltnkRokSEAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705856516; a=rsa-sha256; cv=none; b=MJeX5PKydeSUIG99nMkhaX8pHWfGksIASu4qJUdDAteBkYUvBaQ2sKGY5EmI8jAScCUioQ yVdFglcFb9zDTXwRhOWUPVKP6CuBTojWnw7tULxpZNc4S3fWDz1O0rf94wkrVcqYR8bI3z ZhmRNdEc5XHXvn+J0bFUt/9iFTZWLsiLS9LFu5qjDaI/1bBzTn8YpiFwTIO31esNnfSesm rPWUg4fsMGkdao5w+zZqUTEiJzVXYVOAzCOjTP0Ty6STzg3C8AbHeYKYgBlQLtwbuAEzFA skRzzD3Mxf9JxKajaIQhX1YuqfrSHBmYhygmGjgHK7p5riqOATgFEYt3TyQMIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TJ05026DYzQ7K; Sun, 21 Jan 2024 17:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40LH1u1Z029643; Sun, 21 Jan 2024 17:01:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40LH1uER029640; Sun, 21 Jan 2024 17:01:56 GMT (envelope-from git) Date: Sun, 21 Jan 2024 17:01:56 GMT Message-Id: <202401211701.40LH1uER029640@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: bf531bcc5f70 - main - altq: Remove stale driver references List-Id: Commit messages for the main 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: bf531bcc5f70e180807b6c58733b9e3b08a0eefa Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bf531bcc5f70e180807b6c58733b9e3b08a0eefa commit bf531bcc5f70e180807b6c58733b9e3b08a0eefa Author: Warner Losh AuthorDate: 2024-01-21 17:00:49 +0000 Commit: Warner Losh CommitDate: 2024-01-21 17:01:45 +0000 altq: Remove stale driver references Remove xr to an(4) and npe(4) since they no longer exist in the tree. Sponsored by: Netflix --- share/man/man4/altq.4 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/share/man/man4/altq.4 b/share/man/man4/altq.4 index 4761daa8d37e..2a6acc96ed86 100644 --- a/share/man/man4/altq.4 +++ b/share/man/man4/altq.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 10, 2022 +.Dd January 21, 2024 .Dt ALTQ 4 .Os .Sh NAME @@ -128,7 +128,6 @@ They have been applied to the following hardware drivers: .Xr age 4 , .Xr alc 4 , .Xr ale 4 , -.Xr an 4 , .Xr aue 4 , .Xr axe 4 , .Xr bce 4 , @@ -152,7 +151,6 @@ They have been applied to the following hardware drivers: .Xr my 4 , .Xr nfe 4 , .Xr nge 4 , -.Xr npe 4 , .Xr qlxgb 4 , .Xr re 4 , .Xr rl 4 ,