From owner-dev-commits-src-main@freebsd.org Mon Oct 4 07:24:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 733196786C9; Mon, 4 Oct 2021 07:24:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_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 4HNC0Q20FWz3nhm; Mon, 4 Oct 2021 07:24:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3ED7226052B; Mon, 4 Oct 2021 09:24:52 +0200 (CEST) Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Shawn Webb , Eric van Gyzen Cc: Mateusz Piotrowski <0mp@freebsd.org>, "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Christos Margiolis References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <8D7B0F4D-D996-4AE5-85DC-FB74B8D7510F@vangyzen.net> <20211003230814.pqfaioaqu2yvileg@mutt-hbsd> From: Hans Petter Selasky Message-ID: <825619dc-7486-9d6f-2648-f041cba85dc8@selasky.org> Date: Mon, 4 Oct 2021 09:24:40 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211003230814.pqfaioaqu2yvileg@mutt-hbsd> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HNC0Q20FWz3nhm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 07:24:54 -0000 On 10/4/21 1:08 AM, Shawn Webb wrote: > On Sun, Oct 03, 2021 at 05:46:04PM -0500, Eric van Gyzen wrote: >> >>> On Oct 3, 2021, at 11:03 AM, Mateusz Piotrowski <0mp@freebsd.org> wrote: >>> >>> Perhaps we could change the name of the new mixer to, e.g., newmixer. >> >> I realize that suggestion was just a quick example, but please don’t call anything “new,” because it isn’t new for long. ;) > > My bikeshed is now painted with a color called "Freshmixer". What's > your bikeshed called? ;-) > > (This is meant in jest.) > Hi, Feel free to move this discussion to freebsd-multimedia@freebsd.org . --HPS From owner-dev-commits-src-main@freebsd.org Mon Oct 4 08:06:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 788A2679463; Mon, 4 Oct 2021 08:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNCwh2mSWz3rK6; Mon, 4 Oct 2021 08:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BAA815A7E; Mon, 4 Oct 2021 08:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19486iwM054591; Mon, 4 Oct 2021 08:06:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19486iBG054590; Mon, 4 Oct 2021 08:06:44 GMT (envelope-from git) Date: Mon, 4 Oct 2021 08:06:44 GMT Message-Id: <202110040806.19486iBG054590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: 662087dfd066 - main - vendor/bc: update to upstream version 5.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 662087dfd0668dee82ed20d00ced662aa3595059 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 08:06:44 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=662087dfd0668dee82ed20d00ced662aa3595059 commit 662087dfd0668dee82ed20d00ced662aa3595059 Author: Stefan Eßer AuthorDate: 2021-09-19 12:41:20 +0000 Commit: Stefan Eßer CommitDate: 2021-10-04 07:37:19 +0000 vendor/bc: update to upstream version 5.0.2 (cherry picked from commit a60ef1802a36f2f2a5611564191440ea1c1e2f17) --- contrib/bc/NEWS.md | 30 ++++++++++++++++++++++++++++++ contrib/bc/include/status.h | 4 ++++ contrib/bc/include/vector.h | 4 ++-- contrib/bc/include/version.h | 2 +- contrib/bc/src/vector.c | 2 +- contrib/bc/tests/all.sh | 3 +++ contrib/bc/tests/bc/timeconst.sh | 6 ++++-- contrib/bc/tests/dc/errors/33.txt | Bin 329 -> 323 bytes contrib/bc/tests/errors.sh | 26 +++----------------------- contrib/bc/tests/history.py | 15 +++++---------- contrib/bc/tests/other.sh | 14 ++++++++------ contrib/bc/tests/read.sh | 4 +++- contrib/bc/tests/script.sh | 4 +++- contrib/bc/tests/stdin.sh | 4 +++- contrib/bc/tests/test.sh | 4 +++- 15 files changed, 73 insertions(+), 49 deletions(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 3b1477cafb26..f35d593b807a 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,35 @@ # News +## 5.0.2 + +This is a production release with one fix for a flaky test. If you have not +experienced problems with the test suite, you do ***NOT*** need to upgrade. + +The test was one that tested whether `bc` fails gracefully when it can't +allocate memory. Unfortunately, there are cases when Linux and FreeBSD lie and +pretend to allocate the memory. + +The reason they do this is because a lot of programs don't use all of the memory +they allocate, so those OS's usually get away with it. + +However, this `bc` uses all of the memory it allocates (at least at page +granularity), so when it tries to use the memory, FreeBSD and Linux kill it. + +This only happens sometimes, however. Other times (on my machine), they do, in +fact, refuse the request. + +So I changed the test to not test for that because I think the graceful failure +code won't really change much. + +## 5.0.1 + +This is a production release with two fixes: + +* Fix for the build on Mac OSX. +* Fix for the build on Android. + +Users that do not use those platforms do ***NOT*** need to update. + ## 5.0.0 This is a major production release with several changes: diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index 781248ad4020..662f2b89c04d 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -53,6 +53,10 @@ #define DC_ENABLED (1) #endif // DC_ENABLED +#ifndef BC_ENABLE_LIBRARY +#define BC_ENABLE_LIBRARY (0) +#endif // BC_ENABLE_LIBRARY + // This is error checking for fuzz builds. #if BC_ENABLE_AFL #ifndef __AFL_HAVE_MANUAL_CONTROL diff --git a/contrib/bc/include/vector.h b/contrib/bc/include/vector.h index 8f7cbbcc2b50..c35d22c9eff7 100644 --- a/contrib/bc/include/vector.h +++ b/contrib/bc/include/vector.h @@ -441,7 +441,7 @@ void bc_slabvec_print(BcVec *v, const char *func); * contain @a s. * @param s The source string. */ -#define strcpy(d, l, s) strcpy(d, s) +#define bc_strcpy(d, l, s) strcpy(d, s) #else // _WIN32 @@ -452,7 +452,7 @@ void bc_slabvec_print(BcVec *v, const char *func); * contain @a s. * @param s The source string. */ -#define strcpy(d, l, s) strcpy_s(d, l, s) +#define bc_strcpy(d, l, s) strcpy_s(d, l, s) #endif // _WIN32 diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 5127c28e2b4a..071b123cccf1 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 5.0.0 +#define VERSION 5.0.2 #endif // BC_VERSION_H diff --git a/contrib/bc/src/vector.c b/contrib/bc/src/vector.c index 1cd90f729956..ebc2e76ca8c8 100644 --- a/contrib/bc/src/vector.c +++ b/contrib/bc/src/vector.c @@ -461,7 +461,7 @@ static char* bc_slab_add(BcSlab *s, const char *str, size_t len) { ptr = (char*) (s->s + s->len); - strcpy(ptr, len, str); + bc_strcpy(ptr, len, str); s->len += len; diff --git a/contrib/bc/tests/all.sh b/contrib/bc/tests/all.sh index 04afdb391d0e..a4a9c8bc8936 100755 --- a/contrib/bc/tests/all.sh +++ b/contrib/bc/tests/all.sh @@ -129,6 +129,9 @@ sh "$testdir/errors.sh" "$d" "$exe" "$@" # Other tests. sh "$testdir/other.sh" "$d" "$extra" "$exe" "$@" +# History tests. +sh "$testdir/history.sh" "$d" -a + printf '\nAll %s tests passed.\n' "$d" printf '\n%s\n' "$stars" diff --git a/contrib/bc/tests/bc/timeconst.sh b/contrib/bc/tests/bc/timeconst.sh index 5c5ec3806ab8..45e10c77bdf4 100755 --- a/contrib/bc/tests/bc/timeconst.sh +++ b/contrib/bc/tests/bc/timeconst.sh @@ -32,6 +32,8 @@ script="$0" testdir=$(dirname "$script") +outputdir=${BC_TEST_OUTPUT_DIR:-$testdir/..} + # Gets the timeconst script, which could be a command-line argument. if [ "$#" -gt 0 ]; then timeconst="$1" @@ -49,8 +51,8 @@ else fi # -out1="$testdir/bc_outputs/bc_timeconst.txt" -out2="$testdir/bc_outputs/bc_timeconst_results.txt" +out1="$outputdir/bc_outputs/bc_timeconst.txt" +out2="$outputdir/bc_outputs/bc_timeconst_results.txt" outdir=$(dirname "$out1") diff --git a/contrib/bc/tests/dc/errors/33.txt b/contrib/bc/tests/dc/errors/33.txt index 524b548e6f4d..7d01c535c665 100644 Binary files a/contrib/bc/tests/dc/errors/33.txt and b/contrib/bc/tests/dc/errors/33.txt differ diff --git a/contrib/bc/tests/errors.sh b/contrib/bc/tests/errors.sh index d6c120aab4e7..c8c82cfe356f 100755 --- a/contrib/bc/tests/errors.sh +++ b/contrib/bc/tests/errors.sh @@ -34,6 +34,8 @@ testdir=$(dirname "$script") . "$testdir/../scripts/functions.sh" +outputdir=${BC_TEST_OUTPUT_DIR:-$testdir} + # Command-line processing. if [ "$#" -eq 0 ]; then printf 'usage: %s dir [exec args...]\n' "$script" @@ -56,7 +58,7 @@ unset BC_LINE_LENGTH unset DC_ENV_ARGS unset DC_LINE_LENGTH -out="$testdir/${d}_outputs/errors_results.txt" +out="$outputdir/${d}_outputs/errors_results.txt" outdir=$(dirname "$out") # Make sure the directory exists. @@ -146,33 +148,11 @@ for testfile in $testdir/$d/*errors.txt; do done -# I need to skip a test here on FreeBSD. -os=$(uname) - -# The list of files we need to skip. -skip_files=" -33.txt -" - # Test all the files in the errors directory. While the loop above does one test # for every line, this does one test per file, but it runs the file through # stdin and as a file on the command-line. for testfile in $testdir/$d/errors/*.txt; do - # If we are on FreeBSD... - if [ "$os" = "FreeBSD" ] && [ "$d" = "dc" ]; then - - b=$(basename "$testfile") - - # If the file is one of the skip files... - if [ -z "${skip_files##*$b*}" ]; then - - printf 'On FreeBSD; skipping %s...\n' "$testfile" - continue - - fi - fi - printf 'Running %s error file %s...' "$d" "$testfile" printf '%s\n' "$halt" | "$exe" "$@" $opts "$testfile" 2> "$out" > /dev/null diff --git a/contrib/bc/tests/history.py b/contrib/bc/tests/history.py index ae25c7cf2854..fff531652b1b 100755 --- a/contrib/bc/tests/history.py +++ b/contrib/bc/tests/history.py @@ -41,6 +41,11 @@ except ImportError: script = sys.argv[0] testdir = os.path.dirname(script) +if "BC_TEST_OUTPUT_DIR" in os.environ: + outputdir = os.environ["BC_TEST_OUTPUT_DIR"] +else: + outputdir = testdir + prompt = ">>> " # This array is for escaping characters that are necessary to escape when @@ -67,16 +72,6 @@ utf8_stress_strs = [ ] -def spawn(exe, args, env, encoding=None, codec_errors='strict'): - if do_test: - f = open(testdir + "/" + exedir + "_outputs/history_test.txt", "wb") - return pexpect.popen_spawn.PopenSpawn([ exe ] + args, env=env, - encoding=encoding, codec_errors=codec_errors, stderr=f) - else: - return pexpect.spawn(exe, args, env=env, encoding=encoding, - codec_errors=codec_errors) - - # Check that the child output the expected line. If history is false, then # the output should change. def check_line(child, expected, prompt=">>> ", history=True): diff --git a/contrib/bc/tests/other.sh b/contrib/bc/tests/other.sh index 0a856f4a6e22..4a26582457e3 100755 --- a/contrib/bc/tests/other.sh +++ b/contrib/bc/tests/other.sh @@ -34,6 +34,8 @@ testdir=$(dirname "$script") . "$testdir/../scripts/functions.sh" +outputdir=${BC_TEST_OUTPUT_DIR:-$testdir} + # Command-line processing. if [ "$#" -ge 2 ]; then @@ -135,8 +137,8 @@ if [ "$d" = "bc" ]; then unset BC_ENV_ARGS - redefine_res="$testdir/bc_outputs/redefine.txt" - redefine_out="$testdir/bc_outputs/redefine_results.txt" + redefine_res="$outputdir/bc_outputs/redefine.txt" + redefine_out="$outputdir/bc_outputs/redefine_results.txt" outdir=$(dirname "$easter_out") @@ -201,8 +203,8 @@ else printf 'Running dc Easter script...' - easter_res="$testdir/dc_outputs/easter.txt" - easter_out="$testdir/dc_outputs/easter_results.txt" + easter_res="$outputdir/dc_outputs/easter.txt" + easter_out="$outputdir/dc_outputs/easter_results.txt" outdir=$(dirname "$easter_out") @@ -222,8 +224,8 @@ else fi -out1="$testdir/../.log_$d.txt" -out2="$testdir/../.log_${d}_test.txt" +out1="$outputdir/${d}_outputs/${d}_other.txt" +out2="$outputdir/${d}_outputs/${d}_other_test.txt" printf 'Running %s line length tests...' "$d" diff --git a/contrib/bc/tests/read.sh b/contrib/bc/tests/read.sh index 1186a19c99bd..a1915eb271ac 100755 --- a/contrib/bc/tests/read.sh +++ b/contrib/bc/tests/read.sh @@ -34,6 +34,8 @@ testdir=$(dirname "$script") . "$testdir/../scripts/functions.sh" +outputdir=${BC_TEST_OUTPUT_DIR:-$testdir} + # Command-line processing. if [ "$#" -lt 1 ]; then printf 'usage: %s dir [exe [args...]]\n' "$0" @@ -58,7 +60,7 @@ name="$testdir/$d/read.txt" results="$testdir/$d/read_results.txt" errors="$testdir/$d/read_errors.txt" -out="$testdir/${d}_outputs/read_results.txt" +out="$outputdir/${d}_outputs/read_results.txt" outdir=$(dirname "$out") # Make sure the directory exists. diff --git a/contrib/bc/tests/script.sh b/contrib/bc/tests/script.sh index f8fdd67ee137..162437af8f22 100755 --- a/contrib/bc/tests/script.sh +++ b/contrib/bc/tests/script.sh @@ -35,6 +35,8 @@ testdir=$(dirname "${script}") . "$testdir/../scripts/functions.sh" +outputdir=${BC_TEST_OUTPUT_DIR:-$testdir} + # Command-line processing. if [ "$#" -lt 2 ]; then printf 'usage: %s dir script [run_extra_tests] [run_stack_tests] [generate_tests] [time_tests] [exec args...]\n' "$script" @@ -126,7 +128,7 @@ if [ "$run_stack_tests" -eq 0 ]; then fi -out="$testdir/${d}_outputs/${name}_script_results.txt" +out="$outputdir/${d}_outputs/${name}_script_results.txt" outdir=$(dirname "$out") # Make sure the directory exists. diff --git a/contrib/bc/tests/stdin.sh b/contrib/bc/tests/stdin.sh index 56bd1aae227b..c9e02253c30a 100755 --- a/contrib/bc/tests/stdin.sh +++ b/contrib/bc/tests/stdin.sh @@ -35,6 +35,8 @@ testdir=$(dirname "$script") . "$testdir/../scripts/functions.sh" +outputdir=${BC_TEST_OUTPUT_DIR:-$testdir} + # Command-line processing. if [ "$#" -lt 1 ]; then printf 'usage: %s dir [exe [args...]]\n' "$0" @@ -55,7 +57,7 @@ else exe="$testdir/../bin/$d" fi -out="$testdir/${d}_outputs/stdin_results.txt" +out="$outputdir/${d}_outputs/stdin_results.txt" outdir=$(dirname "$out") # Make sure the directory exists. diff --git a/contrib/bc/tests/test.sh b/contrib/bc/tests/test.sh index ec7f6ba920c9..9d557a715dc0 100755 --- a/contrib/bc/tests/test.sh +++ b/contrib/bc/tests/test.sh @@ -35,6 +35,8 @@ testdir=$(dirname "$script") . "$testdir/../scripts/functions.sh" +outputdir=${BC_TEST_OUTPUT_DIR:-$testdir} + # Command-line processing. if [ "$#" -lt 2 ]; then printf 'usage: %s dir test [generate_tests] [time_tests] [exe [args...]]\n' "$0" @@ -74,7 +76,7 @@ else exe="$testdir/../bin/$d" fi -out="$testdir/${d}_outputs/${t}_results.txt" +out="$outputdir/${d}_outputs/${t}_results.txt" outdir=$(dirname "$out") # Make sure the directory exists. From owner-dev-commits-src-main@freebsd.org Mon Oct 4 08:06:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E204679464; Mon, 4 Oct 2021 08:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNCwj3WGVz3rZy; Mon, 4 Oct 2021 08:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59C1815D28; Mon, 4 Oct 2021 08:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19486jeT054619; Mon, 4 Oct 2021 08:06:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19486jVT054618; Mon, 4 Oct 2021 08:06:45 GMT (envelope-from git) Date: Mon, 4 Oct 2021 08:06:45 GMT Message-Id: <202110040806.19486jVT054618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: ea31d1a5c490 - main - contrib/bc: remove files ommitted from the release MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea31d1a5c490193348e0b71fdda6d08a2c80a2eb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 08:06:45 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=ea31d1a5c490193348e0b71fdda6d08a2c80a2eb commit ea31d1a5c490193348e0b71fdda6d08a2c80a2eb Author: Stefan Eßer AuthorDate: 2021-10-04 07:41:06 +0000 Commit: Stefan Eßer CommitDate: 2021-10-04 07:41:06 +0000 contrib/bc: remove files ommitted from the release A number of files have been removed from the release distribution of this bc implementation. They were mostly relevant for pre release testing and benchmarking to identify regressions. The Markdown sources of the man pages are only relevant for combinations of build options not used in FreeBSD and need non-default conversion tools (available as ports in FreeBSD). All the omitted files can be found in the upstream git repository, and they are fetched when building this software as a port. But they have never been used in the FreeBSD base system. --- contrib/bc/benchmarks/bc/add.bc | 21 - contrib/bc/benchmarks/bc/arrays.bc | 34 - contrib/bc/benchmarks/bc/arrays_and_constants.bc | 35 - contrib/bc/benchmarks/bc/bitfuncs.bc | 18 - contrib/bc/benchmarks/bc/constants.bc | 41 - contrib/bc/benchmarks/bc/divide.bc | 26 - contrib/bc/benchmarks/bc/functions.bc | 34 - contrib/bc/benchmarks/bc/irand_long.bc | 9 - contrib/bc/benchmarks/bc/irand_short.bc | 5 - contrib/bc/benchmarks/bc/lib.bc | 7 - contrib/bc/benchmarks/bc/multiply.bc | 23 - contrib/bc/benchmarks/bc/postfix_incdec.bc | 7 - contrib/bc/benchmarks/bc/power.bc | 2 - contrib/bc/benchmarks/bc/strings.bc | 36 - contrib/bc/benchmarks/bc/subtract.bc | 22 - contrib/bc/benchmarks/dc/modexp.dc | 42 - contrib/bc/manuals/development.md | 4950 ---------------------- contrib/bc/manuals/release.md | 72 - contrib/bc/scripts/afl.py | 245 -- contrib/bc/scripts/alloc.sh | 84 - contrib/bc/scripts/benchmark.sh | 159 - contrib/bc/scripts/bitgen.c | 101 - contrib/bc/scripts/fuzz_prep.sh | 81 - contrib/bc/scripts/manpage.sh | 175 - contrib/bc/scripts/ministat.c | 670 --- contrib/bc/scripts/package.sh | 173 - contrib/bc/scripts/radamsa.sh | 133 - contrib/bc/scripts/radamsa.txt | 17 - contrib/bc/scripts/randmath.py | 421 -- contrib/bc/scripts/release.sh | 779 ---- contrib/bc/scripts/release_settings.txt | 16 - contrib/bc/scripts/test_settings.sh | 77 - contrib/bc/scripts/test_settings.txt | 93 - contrib/bc/tests/fuzzing/bc_afl.yaml | 125 - contrib/bc/tests/fuzzing/bc_afl_continue.yaml | 122 - contrib/bc/tests/fuzzing/bc_inputs1/strings.txt | 14 - contrib/bc/tests/fuzzing/dc_inputs/stack_len.txt | 1 - 37 files changed, 8870 deletions(-) diff --git a/contrib/bc/benchmarks/bc/add.bc b/contrib/bc/benchmarks/bc/add.bc deleted file mode 100644 index 90a83e4758d9..000000000000 --- a/contrib/bc/benchmarks/bc/add.bc +++ /dev/null @@ -1,21 +0,0 @@ -#! /usr/bin/bc -lq - -print "scale = 20\n" -print "x = 1234567890 / scale\n" -print "len = length(x) + 1 + scale\n" -print "len *= 2\n" - -scale = 20 -x = 1234567890 / scale -len = length(x) + 1 + scale -len *= 2 - -for (i = 0; i <= len; ++i) { - print "a[", i, "] = x * (10^", i, ")\n" -} - -for (i = 1; i <= 10000; ++i) { - for (j = 0; j < len; ++j) { - print "v = a[", i, "] + a[", j, "]\n" - } -} diff --git a/contrib/bc/benchmarks/bc/arrays.bc b/contrib/bc/benchmarks/bc/arrays.bc deleted file mode 100644 index e3c463187d78..000000000000 --- a/contrib/bc/benchmarks/bc/arrays.bc +++ /dev/null @@ -1,34 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. -# -# 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 HOLDER 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. -# - -max = 1000000 - -for (i = 0; i < max; ++i) { - print "a", i, "[0] = ", i, "\n" -} diff --git a/contrib/bc/benchmarks/bc/arrays_and_constants.bc b/contrib/bc/benchmarks/bc/arrays_and_constants.bc deleted file mode 100644 index 93c5594bec20..000000000000 --- a/contrib/bc/benchmarks/bc/arrays_and_constants.bc +++ /dev/null @@ -1,35 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. -# -# 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 HOLDER 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. -# - -max = 1000000 - -for (i = 0; i < max; ++i) { - print "b", i, "[100] = ", i, "\n" -} - diff --git a/contrib/bc/benchmarks/bc/bitfuncs.bc b/contrib/bc/benchmarks/bc/bitfuncs.bc deleted file mode 100644 index 1c2a6529d04b..000000000000 --- a/contrib/bc/benchmarks/bc/bitfuncs.bc +++ /dev/null @@ -1,18 +0,0 @@ -#! /usr/bin/bc -lq - -scale = 0 -max = 10000 - -print "scale = 0\n" - -for (i = 0; i < max; ++i) { - - a = rand() - b = rand() - - print "band(", a, ", ", b, ")\n" - print "bor(", a, ", ", b, ")\n" - print "bxor(", a, ", ", b, ")\n" - print "blshift(", a, ", ", b % 32, ")\n" - print "brshift(", a, ", ", b % 32, ")\n" -} diff --git a/contrib/bc/benchmarks/bc/constants.bc b/contrib/bc/benchmarks/bc/constants.bc deleted file mode 100644 index 1f7b92d47566..000000000000 --- a/contrib/bc/benchmarks/bc/constants.bc +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. -# -# 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 HOLDER 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. -# - -max = 1000 -max2 = 1000 - -for (i = 0; i < max; ++i) { - - print "c = ", i, "\n" - print "e = 0.", i, "\n" - - for (j = 0; j < max2; ++j) { - print "d = ", i, ".", j, "\n" - } -} diff --git a/contrib/bc/benchmarks/bc/divide.bc b/contrib/bc/benchmarks/bc/divide.bc deleted file mode 100644 index 227794badbcb..000000000000 --- a/contrib/bc/benchmarks/bc/divide.bc +++ /dev/null @@ -1,26 +0,0 @@ -#! /usr/bin/bc -lq - -print "scale = 20\n" -print "x = 1234567890 * 10^(-scale)\n" -print "len = 1 + 2 * scale\n" -print "scale += 10\n" - -scale = 20 -x = 1234567890 * 10^(-scale) -len = 1 + 2 * scale - -scale += 10 - -for (i = 0; i <= len; ++i) { - print "a[", i, "] = x * (10^", i, ")\n" -} - -for (i = 1; i <= 10000; ++i) { - for (j = 0; j < len; ++j) { - print "v = a[0] / a[", j, "]\n" - print "v = a[", i, "] / a[", j, "]\n" - print "v = (a[0] * ", i, ") / a[", j, "]\n" - print "v = a[0] / (a[", j, "] * ", i, ")\n" - print "v = (a[0] * ", i, ") / (a[", j, "] * ", i, ")\n" - } -} diff --git a/contrib/bc/benchmarks/bc/functions.bc b/contrib/bc/benchmarks/bc/functions.bc deleted file mode 100644 index dc6ae8d6edc5..000000000000 --- a/contrib/bc/benchmarks/bc/functions.bc +++ /dev/null @@ -1,34 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. -# -# 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 HOLDER 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. -# - -max = 1000000 - -for (i = 0; i < max; ++i) { - print "define etsna", i, "(n) {\n\tn\n}\n" -} diff --git a/contrib/bc/benchmarks/bc/irand_long.bc b/contrib/bc/benchmarks/bc/irand_long.bc deleted file mode 100644 index 9274f8953b60..000000000000 --- a/contrib/bc/benchmarks/bc/irand_long.bc +++ /dev/null @@ -1,9 +0,0 @@ -#! /usr/bin/bc -lq - -start = 2^256 -end = start + 10000000 - -for (i = start; i < end; ++i) { - print "irand(", i, ")\n" -} - diff --git a/contrib/bc/benchmarks/bc/irand_short.bc b/contrib/bc/benchmarks/bc/irand_short.bc deleted file mode 100644 index 16ae863f2e2b..000000000000 --- a/contrib/bc/benchmarks/bc/irand_short.bc +++ /dev/null @@ -1,5 +0,0 @@ -#! /usr/bin/bc -lq - -for (i = 2; i < 10000000; ++i) { - print "irand(", i, ")\n" -} diff --git a/contrib/bc/benchmarks/bc/lib.bc b/contrib/bc/benchmarks/bc/lib.bc deleted file mode 100644 index 87b5f9168458..000000000000 --- a/contrib/bc/benchmarks/bc/lib.bc +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/bc -lq - -print "for (i = 100; i < 1000; ++i) {\n" -print " v = pi(i)\n" -print " v = e(v)\n" -print " v = l(v)\n" -print "}\n" diff --git a/contrib/bc/benchmarks/bc/multiply.bc b/contrib/bc/benchmarks/bc/multiply.bc deleted file mode 100644 index d4ed08e055c8..000000000000 --- a/contrib/bc/benchmarks/bc/multiply.bc +++ /dev/null @@ -1,23 +0,0 @@ -#! /usr/bin/bc -lq - -print "scale = 20\n" -print "x = 1234567890 / scale\n" -print "len = length(x) + 1 + scale\n" - -scale = 20 -x = 1234567890 / scale -len = length(x) + 1 + scale - -for (i = 0; i <= len; ++i) { - print "a[", i, "] = x * (10^", i, ")\n" -} - -for (i = 1; i <= 10000; ++i) { - for (j = 0; j < len; ++j) { - print "v = a[0] * a[", j, "]\n" - print "v = a[", i, "] * a[", j, "]\n" - print "v = (a[0] * ", i, ") * a[", j, "]\n" - print "v = a[0] * (a[", j, "] * ", i, ")\n" - print "v = (a[0] * ", i, ") * (a[", j, "] * ", i, ")\n" - } -} diff --git a/contrib/bc/benchmarks/bc/postfix_incdec.bc b/contrib/bc/benchmarks/bc/postfix_incdec.bc deleted file mode 100644 index 922a065a8172..000000000000 --- a/contrib/bc/benchmarks/bc/postfix_incdec.bc +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/bc -lq - -max = 1000000 - -for (i = 0; i < max; ++i) { - print "i++\ni--\n" -} diff --git a/contrib/bc/benchmarks/bc/power.bc b/contrib/bc/benchmarks/bc/power.bc deleted file mode 100644 index b067aa732d10..000000000000 --- a/contrib/bc/benchmarks/bc/power.bc +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/bc -lq - diff --git a/contrib/bc/benchmarks/bc/strings.bc b/contrib/bc/benchmarks/bc/strings.bc deleted file mode 100644 index 13cf200cdb89..000000000000 --- a/contrib/bc/benchmarks/bc/strings.bc +++ /dev/null @@ -1,36 +0,0 @@ -#! /usr/bin/bc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. -# -# 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 HOLDER 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. -# - -max = 1000000 - -print "\qasotehnuasnotehustnaoheusntaoheustnaoheusntaoehunsatoheuastoehuaosnetuhaosetnuhaosentuahoesntuahoeuhstoeunhatoehusanotehusatnoheus\q\n" - -for (i = 0; i < max; ++i) { - print "\qabc", i, " = ", i, "\\n\q\n" -} diff --git a/contrib/bc/benchmarks/bc/subtract.bc b/contrib/bc/benchmarks/bc/subtract.bc deleted file mode 100644 index b88bd60e935c..000000000000 --- a/contrib/bc/benchmarks/bc/subtract.bc +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/bc -lq - -print "scale = 20\n" -print "x = 1234567890 / scale\n" -print "len = length(x) + 1 + scale\n" -print "len *= 2\n" - -scale = 20 -x = 1234567890 / scale -len = length(x) + 1 + scale -len *= 2 - -for (i = 0; i <= len; ++i) { - print "a[", i, "] = x * (10^", i, ")\n" -} - -for (i = 1; i <= 10000; ++i) { - for (j = 0; j < len; ++j) { - print "v = a[", i, "] - a[", j, "]\n" - } -} - diff --git a/contrib/bc/benchmarks/dc/modexp.dc b/contrib/bc/benchmarks/dc/modexp.dc deleted file mode 100644 index 48f304cb92da..000000000000 --- a/contrib/bc/benchmarks/dc/modexp.dc +++ /dev/null @@ -1,42 +0,0 @@ -#! /usr/bin/dc -# -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. -# -# 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 HOLDER 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. - -[ ]ss -[|]so -100sm 0si -[ - li1+si 0sj - [ - lj1+sj 0sk - [ - lk1+sk lin lsn ljn lsn lkn lsn lon 10P lk lm !scale)scale=l - t=irand(t)/t - scale=s - return t -} -define ifbrand(i,b,p){return irand(abs(i)$)+fbrand(b,p)} -``` - -This allows me to use `bc` as part of my `bash` prompt. - -## Code Style - -The code style for `bc` is...weird, and that comes from historical accident. - -In [History][23], I mentioned how I got my `bc` in [toybox][16]. Well, in order -to do that, my `bc` originally had toybox style. Eventually, I changed to using -tabs, and assuming they were 4 spaces wide, but other than that, I basically -kept the same style, with some exceptions that are more or less dependent on my -taste. - -The code style is as follows: - -* Tabs are 4 spaces. -* Tabs are used at the beginning of lines for indent. -* Spaces are used for alignment. -* Lines are limited to 80 characters, period. -* Pointer asterisk (`*`) goes with the variable (on the right), not the type, - unless it is for a pointer type returned from a function. -* The opening brace is put on the same line as the header for the function, - loop, or `if` statement. -* Unless the header is more than one line, in which case the opening brace is - put on its own line. -* If the opening brace is put on its own line, there is no blank line after it. -* If the opening brace is *not* put on its own line, there *is* a blank line - after it, *unless* the block is only one or two lines long. -* Code lines are grouped into what I call "paragraphs." Basically, lines that - seem like they should go together are grouped together. This one comes down - to judgment. -* Bodies of `if` statements, `else` statements, and loops that are one line - long are put on the same line as the statement, unless the header is more than - one line long, and/or, the header and body cannot fit into 80 characters with - a space inbetween them. -* If single-line bodies are on a separate line from their headers, and the - headers are only a single line, then no braces are used. -* However, braces are *always* used if they contain another `if` statement or - loop. -* Loops with empty bodies are ended with a semicolon. -* Expressions that return a boolean value are surrounded by paretheses. -* Macro backslashes are aligned as far to the left as possible. -* Binary operators have spaces on both sides. -* If a line with binary operators overflows 80 characters, a newline is inserted - *after* binary operators. -* Function modifiers and return types are on the same line as the function name. -* With one exception, `goto`'s are only used to jump to the end of a function - for cleanup. -* All structs, enums, and unions are `typedef`'ed. -* All constant data is in one file: [`src/data.c`][131], but the corresponding - `extern` declarations are in the appropriate header file. -* All local variables are declared at the beginning of the scope where they - appear. They may be initialized at that point, if it does not invoke UB or - otherwise cause bugs. -* All precondition `assert()`'s (see [Asserts][135]) come *after* local variable - declarations. -* Besides short `if` statements and loops, there should *never* be more than one - statement per line. - -### ClangFormat - -I attempted three times to use [ClangFormat][24] to impose a standard, -machine-useful style on `bc`. All three failed. Otherwise, the style in this -repo would be more consistent. - -## Repo Structure - -Functions are documented with Doxygen-style doc comments. Functions that appear -in headers are documented in the headers, while static functions are documented -where they are defined. - -### `bcl.sln` - -A Visual Studio solution file for [`bcl`][156]. This, along with -[`bcl.vcxproj`][63] and [`bcl.vcxproj.filters`][64] is what makes it possible to -build [`bcl`][156] on Windows. - -### `bcl.vcxproj` - -A Visual Studio project file for [`bcl`][156]. This, along with [`bcl.sln`][65] -and [`bcl.vcxproj.filters`][64] is what makes it possible to build [`bcl`][156] -on Windows. - -### `bcl.vcxproj.filters` - -A Visual Studio filters file for [`bcl`][156]. This, along with [`bcl.sln`][65] -and [`bcl.vcxproj`][63] is what makes it possible to build [`bcl`][156] on -Windows. - -### `bc.sln` - -A Visual Studio solution file for `bc`. This, along with [`bc.vcxproj`][66] -and [`bc.vcxproj.filters`][67] is what makes it possible to build `bc` on -Windows. - -### `bc.vcxproj` - -A Visual Studio project file for `bc`. This, along with [`bc.sln`][68] and -[`bc.vcxproj.filters`][67] is what makes it possible to build `bc` on Windows. - -### `bc.vcxproj.filters` - -A Visual Studio filters file for `bc`. This, along with [`bc.sln`][68] and -[`bc.vcxproj`][66] is what makes it possible to build `bc` on Windows. - -### `configure` - -A symlink to [`configure.sh`][69]. - -### `configure.sh` - -This is the script to configure `bc` and [`bcl`][156] for building. - -This `bc` has a custom build system. The reason for this is because of -[*portability*][136]. - -If `bc` used an outside build system, that build system would be an external -dependency. Thus, I had to write a build system for `bc` that used nothing but -C99 and POSIX utilities. - -One of those utilities is POSIX `sh`, which technically implements a -Turing-complete programming language. It's a terrible one, but it works. - *** 8168 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Mon Oct 4 08:06:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38DA167968A; Mon, 4 Oct 2021 08:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNCwk5RFRz3rXk; Mon, 4 Oct 2021 08:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8169115D29; Mon, 4 Oct 2021 08:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19486k3t054647; Mon, 4 Oct 2021 08:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19486kaW054646; Mon, 4 Oct 2021 08:06:46 GMT (envelope-from git) Date: Mon, 4 Oct 2021 08:06:46 GMT Message-Id: <202110040806.19486kaW054646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: f774652b0e83 - main - contrib/bc: temporarily disconnect the tests for 5.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f774652b0e837be415abd20935eae3466ea34a20 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 08:06:47 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=f774652b0e837be415abd20935eae3466ea34a20 commit f774652b0e837be415abd20935eae3466ea34a20 Author: Stefan Eßer AuthorDate: 2021-10-04 07:50:44 +0000 Commit: Stefan Eßer CommitDate: 2021-10-04 07:50:44 +0000 contrib/bc: temporarily disconnect the tests for 5.0.2 The tests that come with version 5.0.2 have been extended to cover the line editing functions. It has been found that these tests generate false negative results in FreeBSD, most likely due to an issue in the pexpect functionality used. These history tests are skipped on systems that do not have python and py-pexpect installed (and thus are unlikely to cause CI test failures), but in order to not cause irritating failures on systems were these packages are in fact installed, I temporarily disconnect them. I had planned to skip this version due to the issue with the history tests, but some committer has asked me to go ahead since the currently used version 5.0.0 contains a macro name that collides with a project he is working on. No MFC of this version is planned. A version 5.0.3 is expected to be released soon, and that version will allow to reconnect the tests and will be MFCed. --- usr.bin/gh-bc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/gh-bc/Makefile b/usr.bin/gh-bc/Makefile index e5f68b704d79..e6e2f45aca73 100644 --- a/usr.bin/gh-bc/Makefile +++ b/usr.bin/gh-bc/Makefile @@ -67,8 +67,8 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests +#HAS_TESTS= +#SUBDIR.${MK_TESTS}+= tests .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} From owner-dev-commits-src-main@freebsd.org Mon Oct 4 08:48:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A00767A0C9; Mon, 4 Oct 2021 08:48:10 +0000 (UTC) (envelope-from mpp302@gmail.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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNDrV0ys1z3tg5; Mon, 4 Oct 2021 08:48:10 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-wr1-f53.google.com with SMTP id u18so29421492wrg.5; Mon, 04 Oct 2021 01:48:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ACTCrNmOCq4OAUif+f58vHyqAoPit73czFSS2fbaBcc=; b=I4b9ujbH0LGxuPmlwORDPP2vmVTHzoGBtdeqWQHa3f7cds7Crl5faWhRyBQo69+n7O zJVrb0luvfXq1EFOoVWxW41rWVbmRRJEt004nJnADvAIGb49WTTaNyNuQ7x1Hu7RiMmS /eM28kGl52TnYV5NgcpnrtBGshRfY8AiX0U2xVbBk8ur56GPDrWqlgjzHzPBFQ/iOr3C EH5IG0o6Vho3vV5LOUTlMDdi+O89cdIQwBiL4ASE6p2wVoO7PsaoDDIHuw+VdI84xuTU JAaBc2mxefGuEnwyt3ybVrVJqkFsAKjo0VYgCvw+i3ZoWSiL38O84U6AN2lM6m8ORBjU BE7A== X-Gm-Message-State: AOAM5315ygwyVO/cQGew+hqOXKGiD6EN7H/EoljXh4lEMBEjnfHu8D8K 3gJ3dt6eOTi0YsJpy9b8eDAX4eFeJgs= X-Google-Smtp-Source: ABdhPJyfyH9adiSqNLXCbKbkcC6U4m1vBiHbda5xuUyeOgnNx4CDYgvqkhNDEq+0ZRwfxvAojpmsWg== X-Received: by 2002:adf:c6c5:: with SMTP id c5mr294799wrh.46.1633337283139; Mon, 04 Oct 2021 01:48:03 -0700 (PDT) Received: from [192.168.0.15] (ip5f5bd4ef.dynamic.kabel-deutschland.de. [95.91.212.239]) by smtp.gmail.com with ESMTPSA id 20sm16232569wme.46.2021.10.04.01.48.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 01:48:02 -0700 (PDT) To: Hans Petter Selasky , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Christos Margiolis References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. Message-ID: Date: Mon, 4 Oct 2021 10:48:03 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Rspamd-Queue-Id: 4HNDrV0ys1z3tg5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 08:48:10 -0000 Hi Hans, On 03/10/2021 21:08, Hans Petter Selasky wrote: > On 10/3/21 6:03 PM, Mateusz Piotrowski wrote: >> On 22/09/2021 20:03, Hans Petter Selasky wrote: >>> The branch main has been updated by hselasky: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D903873ce15600fc02a0ea4= 2cbf888cff232b411d >>> >>> commit 903873ce15600fc02a0ea42cbf888cff232b411d >>> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Hans Petter Selasky >>> AuthorDate: 2021-09-22 13:42:51 +0000 >>> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Hans Petter Selasky >>> CommitDate: 2021-09-22 17:43:56 +0000 >>> >>> =C2=A0=C2=A0=C2=A0=C2=A0 Implement and use new mixer(3) library for F= reeBSD. >>> =C2=A0=C2=A0=C2=A0=C2=A0 Wiki article: https://wiki.freebsd.org/Summe= rOfCode2021Projects/SoundMixerImprovements >>> =C2=A0=C2=A0=C2=A0=C2=A0 This project was part of Google Summer of Co= de 2021. >> >> This may be a bit late to discuss but the new mixer has a completely d= ifferent >> set of options and command-line arguments. In addition to that, >> the output of the command is different. >> >> Shouldn't we keep supporting the previous way of interacting with mixe= r? >> I know that people are scripting mixer and its output in production >> in order to control soundcards. Are there any good reasons to keep the= new >> mixer(8) as it is now while keeping the old name? Perhaps we could cha= nge >> the name of the new mixer to, e.g., newmixer. Users are going to have = to >> rewrite their scripts for mixer(8) anyway for 14.0. >> > > It depends what level of compatibility you need. > > If you have a script parsing mixer output, then it needs to be binary c= ompatible so to speak. That=20 > means some new features like "mute" won't work. Hmm, I agree that mute and volume controls in the new CLI interface are v= ery consistent. However, in=20 case of the old CLI interface, the mute functionality could also be added= without a problem (at=20 least by looking at the manual pages, the "mute" command could look like = this: "mixer mute vol"). My=20 point is that I feel that the CLI interface should be backwards-compatibl= e in this case. > > Would it help to make a port, like "oldmixer", under "audio" ? That's a good idea. I've committed the "old" mixer to the ports tree:=20 https://cgit.freebsd.org/ports/commit/?id=3De9a0efe4509b8dbdef0b4e4b5b94a= bf0aebd78a9. However, I feel that it is a solution to a problem that could have been a= voided. The mixer=20 improvements should have been introduced in a way that users do not have = to do anything to keep=20 their scripts working. At the moment, it does not really matter if a user= has to install an=20 additional port or patch their scripts. In the end, it's extra work and p= otential bugs. On the other hand, from what I understand so far, mixer(8) needed a redes= ign. Also, usually people=20 don't script mixer(8) too heavily so the changes in the interface are goi= ng to be only a minor=20 annoyance when FreeBSD 14.0 is released. An entry in the release notes an= d the availability of the=20 old mixer in the ports tree should be enough. Best, Mateusz Piotrowski From owner-dev-commits-src-main@freebsd.org Mon Oct 4 09:02:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F317B67A367; Mon, 4 Oct 2021 09:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNF9B68PCz3vXS; Mon, 4 Oct 2021 09:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B31DA1684A; Mon, 4 Oct 2021 09:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19492cn6034564; Mon, 4 Oct 2021 09:02:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19492cb5034563; Mon, 4 Oct 2021 09:02:38 GMT (envelope-from git) Date: Mon, 4 Oct 2021 09:02:38 GMT Message-Id: <202110040902.19492cb5034563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 8bc5971be1ec - main - UPDATING: Update notes about new mixer(8) utility. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bc5971be1ece76284b2cdb0addf051afc14044a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 09:02:39 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=8bc5971be1ece76284b2cdb0addf051afc14044a commit 8bc5971be1ece76284b2cdb0addf051afc14044a Author: Hans Petter Selasky AuthorDate: 2021-10-04 09:00:56 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-04 09:01:47 +0000 UPDATING: Update notes about new mixer(8) utility. Differential Revision: https://reviews.freebsd.org/D31636 Sponsored by: NVIDIA Networking --- UPDATING | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 34f2a1ee145b..2f432124233a 100644 --- a/UPDATING +++ b/UPDATING @@ -36,7 +36,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: 20210922: As of commit 903873ce1560, the mixer(8) utility has got a slightly new syntax. Please refer to the mixer(8) manual page for more - information. + information. The old mixer utility can be installed from ports: + audio/freebsd-13-mixer 20210911: As of commit 55089ef4f8bb, the global variable nfs_maxcopyrange has From owner-dev-commits-src-main@freebsd.org Mon Oct 4 09:13:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B56D567AC08; Mon, 4 Oct 2021 09:13:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::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) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNFPY3tsNz3vyc; Mon, 4 Oct 2021 09:13:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 40FA12600DF; Mon, 4 Oct 2021 11:13:19 +0200 (CEST) Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Mateusz Piotrowski <0mp@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Christos Margiolis References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> From: Hans Petter Selasky Message-ID: Date: Mon, 4 Oct 2021 11:13:07 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HNFPY3tsNz3vyc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 09:13:21 -0000 Hi Mateusz, On 10/4/21 10:48 AM, Mateusz Piotrowski wrote: > Hi Hans, > > On 03/10/2021 21:08, Hans Petter Selasky wrote: >> On 10/3/21 6:03 PM, Mateusz Piotrowski wrote: >>> On 22/09/2021 20:03, Hans Petter Selasky wrote: >>>> The branch main has been updated by hselasky: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=903873ce15600fc02a0ea42cbf888cff232b411d >>>> >>>> >>>> commit 903873ce15600fc02a0ea42cbf888cff232b411d >>>> Author:     Hans Petter Selasky >>>> AuthorDate: 2021-09-22 13:42:51 +0000 >>>> Commit:     Hans Petter Selasky >>>> CommitDate: 2021-09-22 17:43:56 +0000 >>>> >>>>      Implement and use new mixer(3) library for FreeBSD. >>>>      Wiki article: >>>> https://wiki.freebsd.org/SummerOfCode2021Projects/SoundMixerImprovements >>>> >>>>      This project was part of Google Summer of Code 2021. >>> >>> This may be a bit late to discuss but the new mixer has a completely >>> different >>> set of options and command-line arguments. In addition to that, >>> the output of the command is different. >>> >>> Shouldn't we keep supporting the previous way of interacting with mixer? >>> I know that people are scripting mixer and its output in production >>> in order to control soundcards. Are there any good reasons to keep >>> the new >>> mixer(8) as it is now while keeping the old name? Perhaps we could >>> change >>> the name of the new mixer to, e.g., newmixer. Users are going to have to >>> rewrite their scripts for mixer(8) anyway for 14.0. >>> >> >> It depends what level of compatibility you need. >> >> If you have a script parsing mixer output, then it needs to be binary >> compatible so to speak. That means some new features like "mute" won't >> work. > Hmm, I agree that mute and volume controls in the new CLI interface are > very consistent. However, in case of the old CLI interface, the mute > functionality could also be added without a problem (at least by looking > at the manual pages, the "mute" command could look like this: "mixer > mute vol"). My point is that I feel that the CLI interface should be > backwards-compatible in this case. >> >> Would it help to make a port, like "oldmixer", under "audio" ? > > That's a good idea. I've committed the "old" mixer to the ports tree: > https://cgit.freebsd.org/ports/commit/?id=e9a0efe4509b8dbdef0b4e4b5b94abf0aebd78a9. > > > However, I feel that it is a solution to a problem that could have been > avoided. The mixer improvements should have been introduced in a way > that users do not have to do anything to keep their scripts working. At > the moment, it does not really matter if a user has to install an > additional port or patch their scripts. In the end, it's extra work and > potential bugs. I agree we should avoid breakage. On the other hand only having one API to use is better for the long run. Look at USB for example. We support multiple different USB APIs. Plain file descriptor based ugen, USB FS IOCTLs, libusb v0.1, libusb v1.0 and BSD's libusb v2.0. It makes everyone happy at least :-) Similarly there has been new evdev APIs for X.org and Wayland, and having to choose among old and new APIs is confusing for the end-user. With regards to mixer(8) it looks like we now have a maintainer, Christos. Feel free to correct me if I'm wrong. > On the other hand, from what I understand so far, mixer(8) needed a > redesign. Also, usually people don't script mixer(8) too heavily so the > changes in the interface are going to be only a minor annoyance when > FreeBSD 14.0 is released. An entry in the release notes and the > availability of the old mixer in the ports tree should be enough. > Thanks for making that port. I've now updated the notes in UPDATING to mention it: https://cgit.freebsd.org/src/commit/?id=8bc5971be1ece76284b2cdb0addf051afc14044a --HPS From owner-dev-commits-src-main@freebsd.org Mon Oct 4 09:40:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D7C567B229; Mon, 4 Oct 2021 09:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNG181Vnnz4SLw; Mon, 4 Oct 2021 09:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1390916E76; Mon, 4 Oct 2021 09:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1949eiW8082652; Mon, 4 Oct 2021 09:40:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1949eiEa082651; Mon, 4 Oct 2021 09:40:44 GMT (envelope-from git) Date: Mon, 4 Oct 2021 09:40:44 GMT Message-Id: <202110040940.1949eiEa082651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 396851c20aeb - main - ncurses: split libtinfo from libncurses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 396851c20aebdfada7c108bef5695c6a372e75b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 09:40:44 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=396851c20aebdfada7c108bef5695c6a372e75b1 commit 396851c20aebdfada7c108bef5695c6a372e75b1 Author: Baptiste Daroussin AuthorDate: 2021-09-23 01:49:51 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-04 09:38:21 +0000 ncurses: split libtinfo from libncurses many external program expects libncurses to not be provided as a single library. Instead of fixing all ports, distribute ncurses the way upstream distributes it Turn libncursesw.so into a ldscript which will link automatically as needed to libtinfow so so this change is seamless at compile time. Differential Revision: https://reviews.freebsd.org/D32098 --- lib/ncurses/Makefile | 6 +- lib/ncurses/config.mk | 5 +- lib/ncurses/ncurses/Makefile | 1001 +----------------------- lib/ncurses/ncurses/libncursesw.ldscript | 1 + lib/ncurses/tinfo/Makefile | 1066 ++++++++++++++++++++++++++ lib/ncurses/tinfo/Makefile.depend | 18 + lib/ncurses/{ncurses => tinfo}/ncurses_cfg.h | 0 lib/ncurses/tinfo/pathnames.h | 36 + share/mk/bsd.libnames.mk | 2 +- share/mk/src.libnames.mk | 5 +- 10 files changed, 1151 insertions(+), 989 deletions(-) diff --git a/lib/ncurses/Makefile b/lib/ncurses/Makefile index be8697fbc609..da3791d01703 100644 --- a/lib/ncurses/Makefile +++ b/lib/ncurses/Makefile @@ -1,11 +1,11 @@ # $FreeBSD$ -SUBDIR= ncurses form menu panel +SUBDIR= tinfo ncurses form menu panel SUBDIR_PARALLEL= -.for subdir in ${SUBDIR:Nncurses*} -SUBDIR_DEPEND_${subdir}= ncurses +.for subdir in ${SUBDIR:Ntinfo*} +SUBDIR_DEPEND_${subdir}= tinfo .endfor .include diff --git a/lib/ncurses/config.mk b/lib/ncurses/config.mk index 0ca0e4547ba8..c322cbeaa681 100644 --- a/lib/ncurses/config.mk +++ b/lib/ncurses/config.mk @@ -11,14 +11,14 @@ CFLAGS+= -D_XOPEN_SOURCE_EXTENDED NCURSES_CFG_H= ${.CURDIR}/ncurses_cfg.h CFLAGS+= -I. -CFLAGS+= -I${.CURDIR:H}/ncurses +CFLAGS+= -I${.CURDIR:H}/tinfo # for ${NCURSES_CFG_H} CFLAGS+= -I${.CURDIR:H}/ncurses CFLAGS+= -I${NCURSES_DIR}/include CFLAGS+= -I${NCURSES_DIR}/ncurses -CFLAGS+= -I${.OBJDIR:H}/ncurses/ +CFLAGS+= -I${.OBJDIR:H}/tinfo/ CFLAGS+= -Wall @@ -28,6 +28,7 @@ CFLAGS+= -DHAVE_CONFIG_H # everyone needs this .PATH: ${NCURSES_DIR}/include +.PATH: ${.OBJDIR:H}/tinfo/ # tools and directories AWK?= awk diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 5a1fab7003a6..35b123a22292 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -12,85 +12,16 @@ SHLIB_MAJOR= 9 NO_LINT= -NCURSES_MAJOR!= egrep 'NCURSES_MAJOR[ ]*=' ${NCURSES_DIR}/dist.mk | sed -e 's%^[^0-9]*%%' -NCURSES_MINOR!= egrep 'NCURSES_MINOR[ ]*=' ${NCURSES_DIR}/dist.mk | sed -e 's%^[^0-9]*%%' -NCURSES_PATCH!= egrep 'NCURSES_PATCH[ ]*=' ${NCURSES_DIR}/dist.mk | sed -e 's%^[^0-9]*%%' - -# From autoconf (!) -NCURSES_CH_T= cchar_t -NCURSES_OK_WCHAR_T= 1 -NEED_WCHAR_H= 1 -NCURSES_EXT_COLORS= 1 -NCURSES_EXT_FUNCS= 1 -NCURSES_CONST= const -NCURSES_INLINE= inline -NCURSES_LIBUTF8= 0 -NCURSES_MBSTATE_T= 0 -NCURSES_MOUSE_VERSION= 2 -NCURSES_INTEROP_FUNCS= 1 -NCURSES_OPAQUE= 0 -NCURSES_OPAQUE= 0 -NCURSES_OPAQUE_FORM= 0 -NCURSES_OPAQUE_MENU= 0 -NCURSES_OPAQUE_PANEL= 0 -NCURSES_OSPEED= short -NCURSES_SBOOL= char -NCURSES_SIZE_T= short -NCURSES_TPARM_VARARGS= 1 -NCURSES_WCHAR_T= 0 -NCURSES_WINT_T= 0 -NCURSES_XNAMES= 1 -NCURSES_WCWIDTH_GRAPHICS= 1 -NCURSES_WATTR_MACROS= 1 -NCURSES_TPARM_ARG= intptr_t -NCURSES_SP_FUNCS= 1 -BROKEN_LINKER= 0 -BUILTIN_BOOL= 1 -ENABLE_LP64= 1 -ENABLE_OPAQUE= NCURSES_OPAQUE -ENABLE_REENTRANT= 0 -HAVE_TCGETATTR= 1 -HAVE_TERMIOS_H= 1 -HAVE_TERMIO_H= 0 -HAVE_VSSCANF= 1 -HAVE_STDINT_H= 1 -HEADER_STDBOOL= 1 -# XXX amd64 1L and int -ONEUL= 1U -TYPEOF_CHTYPE= uint32_t -TYPEOF_MMASK_T= uint32_t -TYPE_OF_BOOL= unsigned char -USE_BIG_STRINGS= 1 -USE_CXX_BOOL= defined(__cplusplus) - GENSRCS= \ - codes.c \ expanded.c \ - fallback.c \ - lib_gen.c \ - lib_keyname.c \ - names.c \ - unctrl.c + lib_gen.c -GENHDRS= \ - curses.h \ - hashsize.h \ - init_keytry.h \ - ncurses_def.h \ - nomacros.h \ - parametrized.h \ - term.h \ - termcap.h \ - unctrl.h - -SRCS= ${GENHDRS} ${GENSRCS} +SRCS= ${GENSRCS} .PATH: ${NCURSES_DIR}/ncurses/base SRCS+= \ - define_key.c \ - key_defined.c \ - keybound.c \ - keyok.c \ + new_pair.c \ + lib_dft_fgbg.c \ legacy_coding.c \ lib_addch.c \ lib_addstr.c \ @@ -106,12 +37,10 @@ SRCS+= \ lib_colorset.c \ lib_delch.c \ lib_delwin.c \ - lib_dft_fgbg.c \ lib_echo.c \ lib_endwin.c \ lib_erase.c \ lib_flash.c \ - lib_freeall.c \ lib_getch.c \ lib_getstr.c \ lib_hline.c \ @@ -132,6 +61,7 @@ SRCS+= \ lib_nl.c \ lib_overlay.c \ lib_pad.c \ + lib_print.c \ lib_printw.c \ lib_redrawln.c \ lib_refresh.c \ @@ -162,72 +92,29 @@ SRCS+= \ lib_wattron.c \ lib_winch.c \ lib_window.c \ - new_pair.c \ nc_panel.c \ resizeterm.c \ safe_sprintf.c \ - tries.c \ - version.c \ vsscanf.c \ - wresize.c + wresize.c \ + lib_freeall.c \ .PATH: ${NCURSES_DIR}/ncurses/tinfo SRCS+= \ - access.c \ - add_tries.c \ - alloc_entry.c \ - alloc_ttype.c \ - captoinfo.c \ - comp_captab.c \ - comp_error.c \ - comp_expand.c \ - comp_hash.c \ - comp_parse.c \ - comp_scan.c \ - comp_userdefs.c \ - db_iterator.c \ - doalloc.c \ - entries.c \ - free_ttype.c \ - getenv_num.c \ - hashed_db.c \ - home_terminfo.c \ - init_keytry.c \ - lib_acs.c \ - lib_baudrate.c \ - lib_cur_term.c \ - lib_data.c \ - lib_has_cap.c \ - lib_kernel.c \ - lib_longname.c \ - lib_napms.c \ - lib_options.c \ - lib_print.c \ - lib_raw.c \ - lib_setup.c \ - lib_termcap.c \ - lib_termname.c \ - lib_tgoto.c \ - lib_ti.c \ - lib_tparm.c \ - lib_tputs.c \ - lib_ttyflags.c \ - name_match.c \ - obsolete.c \ - parse_entry.c \ - read_entry.c \ - read_termcap.c \ - strings.c \ - trim_sgr0.c \ - write_entry.c + use_screen.c \ + use_window.c +.PATH: ${NCURSES_DIR}/ncurses/trace +SRCS+= \ + varargs.c + +# DONE .PATH: ${NCURSES_DIR}/ncurses/tty SRCS+= \ hardscroll.c \ hashmap.c \ lib_mvcur.c \ lib_tstp.c \ - lib_twait.c \ lib_vidattr.c \ tty_update.c @@ -254,893 +141,43 @@ SRCS+= \ lib_wacs.c \ lib_wunctrl.c -.PATH: ${NCURSES_DIR}/ncurses/trace -SRCS+= \ - lib_trace.c \ - visbuf.c - # Currently unused, for debugging libncurses itself. DBGSRCS= \ - lib_traceatr.c \ - lib_tracebits.c \ - lib_tracechr.c \ - lib_tracedmp.c \ - lib_tracemse.c \ - trace_buf.c \ - trace_tries.c \ - trace_xnames.c \ varargs.c -CLEANFILES= ${GENSRCS} ${GENHDRS} keys.list make_hash term.h.new \ - make_keys MKterm.h.awk comp_captab.c curses.head - -CFLAGS+= -DTERMIOS - -# Installed -HEADERS= curses.h term.h termcap.h unctrl.h -SRCHDRS= ncurses_dll.h -CLEANFILES+= ncurses_dll.h - -INCS= ${HEADERS} ${SRCHDRS} -INCSLINKS= curses.h ${INCLUDEDIR}/ncurses.h +CLEANFILES= ${GENSRCS} .if ${MK_INSTALLLIB} != "no" SYMLINKS+= libncursesw.a ${LIBDIR}/libcursesw.a -SYMLINKS+= libncursesw.a ${LIBDIR}/libtermcapw.a -SYMLINKS+= libncursesw.a ${LIBDIR}/libtermlibw.a -SYMLINKS+= libncursesw.a ${LIBDIR}/libtinfow.a # backward compat SYMLINKS+= libncursesw.a ${LIBDIR}/libncurses.a SYMLINKS+= libncursesw.a ${LIBDIR}/libcurses.a -SYMLINKS+= libncursesw.a ${LIBDIR}/libtermcap.a -SYMLINKS+= libncursesw.a ${LIBDIR}/libtermlib.a -SYMLINKS+= libncursesw.a ${LIBDIR}/libtinfo.a .endif .if !defined(NO_PIC) # no need for major at all, it's an ld-time redirection only SYMLINKS+= libncursesw.so ${LIBDIR}/libcursesw.so -SYMLINKS+= libncursesw.so ${LIBDIR}/libtermcapw.so -SYMLINKS+= libncursesw.so ${LIBDIR}/libtermlibw.so -SYMLINKS+= libncursesw.so ${LIBDIR}/libtinfow.so # backward compat SYMLINKS+= libncursesw.so ${LIBDIR}/libncurses.so SYMLINKS+= libncursesw.so ${LIBDIR}/libcurses.so -SYMLINKS+= libncursesw.so ${LIBDIR}/libtermcap.so -SYMLINKS+= libncursesw.so ${LIBDIR}/libtermlib.so -SYMLINKS+= libncursesw.so ${LIBDIR}/libtinfo.so .endif .if ${MK_PROFILE} != "no" SYMLINKS+= libncursesw_p.a ${LIBDIR}/libcursesw_p.a -SYMLINKS+= libncursesw_p.a ${LIBDIR}/libtermcapw_p.a -SYMLINKS+= libncursesw_p.a ${LIBDIR}/libtermlibw_p.a -SYMLINKS+= libncursesw_p.a ${LIBDIR}/libtinfow_p.a # backward compat SYMLINKS+= libncursesw_p.a ${LIBDIR}/libncurses_p.a SYMLINKS+= libncursesw_p.a ${LIBDIR}/libcurses_p.a -SYMLINKS+= libncursesw_p.a ${LIBDIR}/libtermcap_p.a -SYMLINKS+= libncursesw_p.a ${LIBDIR}/libtermlib_p.a -SYMLINKS+= libncursesw_p.a ${LIBDIR}/libtinfo_p.a .endif -DOCSDIR= ${SHAREDIR}/doc/ncurses -DOCS= ncurses-intro.html hackguide.html +LIBADD+= tinfow +SHLIB_LDSCRIPT= libncursesw.ldscript -.if ${MK_HTML} != "no" -.PATH: ${NCURSES_DIR}/doc/html -FILESGROUPS= DOCS -.endif - -# Generated source -.ORDER: names.c codes.c - -names.c: MKnames.awk - ${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKnames.awk bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > names.c - -codes.c: MKcodes.awk - ${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c +libncurses.ldscript: + @${ECHO} "INPUT(${SHLIB_NAME} AS NEEDED(-ltinfow))" >$@ lib_gen.c: MKlib_gen.sh curses.h ncurses_dll.h LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \ "${AWK}" generated < curses.h >$@ -lib_keyname.c: keys.list MKkeyname.awk - ${AWK} -f ${NCURSES_DIR}/ncurses/base/MKkeyname.awk bigstrings=${USE_BIG_STRINGS} keys.list > lib_keyname.c - -unctrl.c: MKunctrl.awk - echo | ${AWK} -f ${NCURSES_DIR}/ncurses/base/MKunctrl.awk bigstrings=${USE_BIG_STRINGS} > unctrl.c - -comp_captab.c: MKcaptab.sh MKcaptab.awk Caps Caps-ncurses make_hash - env PATH=${BTOOLSPATH:U.}:${PATH} sh ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.sh "${AWK}" \ - ${USE_BIG_STRINGS} ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.awk \ - ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > comp_captab.c - expanded.c: MKexpanded.sh sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c -fallback.c: MKfallback.sh - sh ${NCURSES_DIR}/ncurses/tinfo/MKfallback.sh "" "" "" > ${.TARGET}.tmp && \ - mv -f ${.TARGET}.tmp ${.TARGET} - -comp_userdefs.c: MKuserdefs.sh Caps Caps-ncurses make_hash - env PATH=${BTOOLSPATH:U.}:${PATH} sh ${NCURSES_DIR}/ncurses/tinfo/MKuserdefs.sh "${AWK}" \ - ${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > ${.TARGET} - -# Generated headers -nomacros.h: MKlib_gen.sh curses.h - LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CC:N${CCACHE_BIN}} -E ${CFLAGS}" \ - "${AWK}" generated < curses.h | fgrep undef > $@ - -init_keytry.h: keys.list make_keys - ${BTOOLSPATH:U.}/make_keys keys.list > init_keytry.h - -hashsize.h: MKhashsize.sh Caps Caps-ncurses - sh ${NCURSES_DIR}/include/MKhashsize.sh ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > $@ - -parametrized.h: MKparametrized.sh Caps Caps-ncurses - AWK=${AWK} sh ${NCURSES_DIR}/include/MKparametrized.sh \ - ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > $@ - -term.h: MKterm.h.awk edit_cfg.sh Caps Caps-ncurses - ${AWK} -f MKterm.h.awk ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses > $@.new - sh ${NCURSES_DIR}/include/edit_cfg.sh ${NCURSES_CFG_H} $@.new - mv -f $@.new $@ - -curses.h: curses.head MKkey_defs.sh Caps Caps-ncurses - cat curses.head > $@.new - AWK=${AWK} _POSIX2_VERSION=199209 sh ${NCURSES_DIR}/include/MKkey_defs.sh \ - ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses >> $@.new - cat ${NCURSES_DIR}/include/curses.wide >> $@.new - cat ${NCURSES_DIR}/include/curses.tail >> $@.new - mv -f $@.new $@ - -# Generated intermediate files -keys.list: MKkeys_list.sh Caps Caps-ncurses - AWK=${AWK} sh ${NCURSES_DIR}/ncurses/tinfo/MKkeys_list.sh \ - ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/include/Caps-ncurses | LC_ALL=C sort > keys.list - -# Build tools -DEPENDOBJS+= make_hash make_keys -build-tools: make_hash make_keys - -make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c - -make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} - ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} -DMAIN_PROGRAM \ - ${NCURSES_DIR}/ncurses/tinfo/make_hash.c - -# ./configure generated -MKterm.h.awk: MKterm.h.awk.in - sed <${NCURSES_DIR}/include/MKterm.h.awk.in >$@ \ - -e "/@BROKEN_LINKER@/s%%${BROKEN_LINKER}%" \ - -e "s%@NCURSES_USE_DATABASE@%1%g" \ - -e "s%@NCURSES_USE_TERMCAP@%1%g" \ - -e "/@NCURSES_MAJOR@/s%%${NCURSES_MAJOR}%" \ - -e "/@NCURSES_MINOR@/s%%${NCURSES_MINOR}%" \ - -e "/@NCURSES_CONST@/s%%${NCURSES_CONST}%" \ - -e "/@NCURSES_TPARM_VARARGS@/s%%${NCURSES_TPARM_VARARGS}%" \ - -e "/@NCURSES_SBOOL@/s%%${NCURSES_SBOOL}%" \ - -e "/@NCURSES_XNAMES@/s%%${NCURSES_XNAMES}%" \ - -e "/@NCURSES_EXT_COLORS@/s%%${NCURSES_EXT_COLORS}%" \ - -e "/@HAVE_TERMIOS_H@/s%%${HAVE_TERMIOS_H}%" \ - -e "/@HAVE_TERMIO_H@/s%%${HAVE_TERMIO_H}%" \ - -e "/@HAVE_TCGETATTR@/s%%${HAVE_TCGETATTR}%" \ - -e "s%@cf_cv_enable_reentrant@%${ENABLE_REENTRANT}%g" \ - -e "s%@NCURSES_SP_FUNCS@%1%" \ - -e "s%@NCURSES_PATCH@%${NCURSES_PATCH}%" - -termcap.h: termcap.h.in - sed <${NCURSES_DIR}/include/termcap.h.in >$@ \ - -e "/@NCURSES_MAJOR@/s%%${NCURSES_MAJOR}%" \ - -e "/@NCURSES_MINOR@/s%%${NCURSES_MINOR}%" \ - -e "/@NCURSES_CONST@/s%%${NCURSES_CONST}%" \ - -e "/@NCURSES_OSPEED@/s%%${NCURSES_OSPEED}%" - -ncurses_dll.h: ncurses_dll.h.in - sed <${NCURSES_DIR}/include/ncurses_dll.h.in >$@ \ - -e "s%@NCURSES_WRAP_PREFIX@%_nc_%g" - -curses.head: curses.h.in - sed <${NCURSES_DIR}/include/curses.h.in >$@ \ - -e "/@BROKEN_LINKER@/s%%${BROKEN_LINKER}%" \ - -e "/@HAVE_VSSCANF@/s%%${HAVE_VSSCANF}%" \ - -e "/@HAVE_STDINT_H@/s%%${HAVE_STDINT_H}%" \ - -e "/@NCURSES_CH_T@/s%%${NCURSES_CH_T}%" \ - -e "/@NCURSES_CONST@/s%%${NCURSES_CONST}%" \ - -e "/@NCURSES_EXT_COLORS@/s%%${NCURSES_EXT_COLORS}%" \ - -e "/@NCURSES_EXT_FUNCS@/s%%${NCURSES_EXT_FUNCS}%" \ - -e "/@NCURSES_INLINE@/s%%${NCURSES_INLINE}%" \ - -e "/@NCURSES_LIBUTF8@/s%%${NCURSES_LIBUTF8}%" \ - -e "/@NCURSES_MAJOR@/s%%${NCURSES_MAJOR}%" \ - -e "/@NCURSES_MBSTATE_T@/s%%${NCURSES_MBSTATE_T}%" \ - -e "/@NCURSES_MINOR@/s%%${NCURSES_MINOR}%" \ - -e "/@NCURSES_MOUSE_VERSION@/s%%${NCURSES_MOUSE_VERSION}%" \ - -e "/@NCURSES_OK_WCHAR_T@/s%%${NCURSES_OK_WCHAR_T}%" \ - -e "/@NCURSES_OPAQUE@/s%%${NCURSES_OPAQUE}%" \ - -e "/@NCURSES_OPAQUE_FORM@/s%%${NCURSES_OPAQUE_FORM}%" \ - -e "/@NCURSES_OPAQUE_MENU@/s%%${NCURSES_OPAQUE_MENU}%" \ - -e "/@NCURSES_OPAQUE_PANEL@/s%%${NCURSES_OPAQUE_PANEL}%" \ - -e "/@NCURSES_PATCH@/s%%${NCURSES_PATCH}%" \ - -e "/@NCURSES_SIZE_T@/s%%${NCURSES_SIZE_T}%" \ - -e "/@NCURSES_TPARM_VARARGS@/s%%${NCURSES_TPARM_VARARGS}%" \ - -e "/@NCURSES_WATTR_MACROS@/s%%${NCURSES_WATTR_MACROS}%"\ - -e "/@NCURSES_WCHAR_T@/s%%${NCURSES_WCHAR_T}%" \ - -e "/@NCURSES_WCHAR_T@/s%%${NCURSES_WCHAR_T}%" \ - -e "/@NCURSES_WCWIDTH_GRAPHICS@/s%%${NCURSES_WCWIDTH_GRAPHICS}%g" \ - -e "/@NCURSES_WINT_T@/s%%${NCURSES_WINT_T}%" \ - -e "/@NCURSES_INTEROP_FUNCS@/s%%${NCURSES_INTEROP_FUNCS}%g" \ - -e "/@NCURSES_TPARM_ARG@/s%%${NCURSES_TPARM_ARG}%g" \ - -e "/@NCURSES_SP_FUNCS@/s%%${NCURSES_SP_FUNCS}%g" \ - -e "/@NEED_WCHAR_H@/s%%${NEED_WCHAR_H}%" \ - -e "/@USE_CXX_BOOL@/s%%${USE_CXX_BOOL}%" \ - -e "/@GENERATED_EXT_FUNCS@/s%%generated%g" \ - -e "s%@NCURSES_CCHARW_MAX@%5%g" \ - -e "s%@cf_cv_1UL@%${ONEUL}%g" \ - -e "s%@cf_cv_builtin_bool@%${BUILTIN_BOOL}%g" \ - -e "s%@cf_cv_enable_lp64@%${ENABLE_LP64}%g" \ - -e "s%@cf_cv_enable_opaque@%${ENABLE_OPAQUE}%g" \ - -e "s%@cf_cv_enable_reentrant@%${ENABLE_REENTRANT}%g" \ - -e "s%@cf_cv_header_stdbool_h@%${HEADER_STDBOOL}%g" \ - -e "s%@cf_cv_type_of_bool@%${TYPE_OF_BOOL}%g" \ - -e "s%@cf_cv_typeof_chtype@%${TYPEOF_CHTYPE}%g" \ - -e "s%@cf_cv_typeof_mmask_t@%${TYPEOF_MMASK_T}%g" \ - -e "s/ _WCHAR_T/ __wchar_t/g" \ - -e "s/ _WINT_T/ __wint_t/g" - -unctrl.h: unctrl.h.in - sed <${NCURSES_DIR}/include/$@.in >$@ \ - -e "s%@NCURSES_SP_FUNCS@%${NCURSES_SP_FUNCS}%g" \ - -e "/@NCURSES_MAJOR@/s%%${NCURSES_MAJOR}%" \ - -e "/@NCURSES_MINOR@/s%%${NCURSES_MINOR}%" - -# MAN page gunk -terminfo.5: MKterminfo.sh terminfo.head Caps - sh ${NCURSES_DIR}/man/MKterminfo.sh ${NCURSES_DIR}/man/terminfo.head \ - ${NCURSES_DIR}/include/Caps ${NCURSES_DIR}/man/terminfo.tail >$@ - -CLEANFILES+= terminfo.5 - -.PATH: ${NCURSES_DIR}/man -MAN= \ - curs_addch.3 \ - curs_addchstr.3 \ - curs_addstr.3 \ - curs_attr.3 \ - curs_beep.3 \ - curs_bkgd.3 \ - curs_bkgrnd.3 \ - curs_border.3 \ - curs_border_set.3 \ - curs_clear.3 \ - curs_color.3 \ - curs_delch.3 \ - curs_deleteln.3 \ - curs_extend.3 \ - curs_getcchar.3 \ - curs_getch.3 \ - curs_getstr.3 \ - curs_getyx.3 \ - curs_inch.3 \ - curs_inchstr.3 \ - curs_initscr.3 \ - curs_inopts.3 \ - curs_insch.3 \ - curs_insstr.3 \ - curs_instr.3 \ - curs_inwstr.3 \ - curs_kernel.3 \ - curs_legacy.3 \ - curs_memleaks.3 \ - curs_mouse.3 \ - curs_move.3 \ - curs_opaque.3 \ - curs_outopts.3 \ - curs_overlay.3 \ - curs_pad.3 \ - curs_print.3 \ - curs_refresh.3 \ - curs_scr_dump.3 \ - curs_scroll.3 \ - curs_slk.3 \ - curs_sp_funcs.3 \ - curs_termattrs.3 \ - curs_termcap.3 \ - curs_terminfo.3 \ - curs_threads.3 \ - curs_touch.3 \ - curs_trace.3 \ - curs_util.3 \ - curs_variables.3 \ - curs_window.3 \ - default_colors.3 \ - define_key.3 \ - key_defined.3 \ - keybound.3 \ - keyok.3 \ - legacy_coding.3 \ - ncurses.3 \ - new_pair.3 \ - resizeterm.3 \ - term_variables.3 \ - wresize.3 - -MAN+= \ - curs_add_wch.3 \ - curs_add_wchstr.3 \ - curs_addwstr.3 \ - curs_get_wch.3 \ - curs_get_wstr.3 \ - curs_in_wch.3 \ - curs_in_wchstr.3 \ - curs_ins_wch.3 \ - curs_ins_wstr.3 \ - curs_printw.3 \ - curs_scanw.3 - -MAN+= term.5 terminfo.5 scr_dump.5 user_caps.5 -MAN+= term.7 - -CLEANFILES+= ${MAN:M*.3} - -MLINKS= ncurses.3 curses.3 \ - curs_addch.3 addch.3 \ - curs_addch.3 echochar.3 \ - curs_addch.3 mvaddch.3 \ - curs_addch.3 mvwaddch.3 \ - curs_addch.3 waddch.3 \ - curs_addch.3 wechochar.3 \ - curs_addchstr.3 addchnstr.3 \ - curs_addchstr.3 addchstr.3 \ - curs_addchstr.3 mvaddchnstr.3 \ - curs_addchstr.3 mvaddchstr.3 \ - curs_addchstr.3 mvwaddchnstr.3 \ - curs_addchstr.3 mvwaddchstr.3 \ - curs_addchstr.3 waddchnstr.3 \ - curs_addchstr.3 waddchstr.3 \ - curs_addstr.3 addnstr.3 \ - curs_addstr.3 addstr.3 \ - curs_addstr.3 mvaddnstr.3 \ - curs_addstr.3 mvaddstr.3 \ - curs_addstr.3 mvwaddnstr.3 \ - curs_addstr.3 mvwaddstr.3 \ - curs_addstr.3 waddnstr.3 \ - curs_addstr.3 waddstr.3 \ - curs_attr.3 PAIR_NUMBER.3 \ - curs_attr.3 attr_get.3 \ - curs_attr.3 attr_off.3 \ - curs_attr.3 attr_on.3 \ - curs_attr.3 attr_set.3 \ - curs_attr.3 attroff.3 \ - curs_attr.3 attron.3 \ - curs_attr.3 attrset.3 \ - curs_attr.3 chgat.3 \ - curs_attr.3 color_set.3 \ - curs_attr.3 mvchgat.3 \ - curs_attr.3 mvwchgat.3 \ - curs_attr.3 standend.3 \ - curs_attr.3 standout.3 \ - curs_attr.3 wattr_get.3 \ - curs_attr.3 wattr_off.3 \ - curs_attr.3 wattr_on.3 \ - curs_attr.3 wattr_set.3 \ - curs_attr.3 wattroff.3 \ - curs_attr.3 wattron.3 \ - curs_attr.3 wattrset.3 \ - curs_attr.3 wchgat.3 \ - curs_attr.3 wcolor_set.3 \ - curs_attr.3 wstandend.3 \ - curs_attr.3 wstandout.3 \ - curs_beep.3 beep.3 \ - curs_beep.3 flash.3 \ - curs_bkgd.3 bkgd.3 \ - curs_bkgd.3 bkgdset.3 \ - curs_bkgd.3 getbkgd.3 \ - curs_bkgd.3 wbkgd.3 \ - curs_bkgd.3 wbkgdset.3 \ - curs_bkgrnd.3 bkgrnd.3 \ - curs_bkgrnd.3 bkgrndset.3 \ - curs_bkgrnd.3 getbkgrnd.3 \ - curs_bkgrnd.3 wbkgrnd.3 \ - curs_bkgrnd.3 wbkgrndset.3 \ - curs_bkgrnd.3 wgetbkgrnd.3 \ - curs_border.3 border.3 \ - curs_border.3 box.3 \ - curs_border.3 hline.3 \ - curs_border.3 mvhline.3 \ - curs_border.3 mvvline.3 \ - curs_border.3 mvwhline.3 \ - curs_border.3 mvwvline.3 \ - curs_border.3 vline.3 \ - curs_border.3 wborder.3 \ - curs_border.3 whline.3 \ - curs_border.3 wvline.3 \ - curs_border_set.3 border_set.3 \ - curs_border_set.3 box_set.3 \ - curs_border_set.3 hline_set.3 \ - curs_border_set.3 mvhline_set.3 \ - curs_border_set.3 mvvline_set.3 \ - curs_border_set.3 mvwhline_set.3 \ - curs_border_set.3 mvwvline_set.3 \ - curs_border_set.3 vline_set.3 \ - curs_border_set.3 wborder_set.3 \ - curs_border_set.3 whline_set.3 \ - curs_border_set.3 wvline_set.3 \ - curs_clear.3 clear.3 \ - curs_clear.3 clrtobot.3 \ - curs_clear.3 clrtoeol.3 \ - curs_clear.3 erase.3 \ - curs_clear.3 wclear.3 \ - curs_clear.3 wclrtobot.3 \ - curs_clear.3 wclrtoeol.3 \ - curs_clear.3 werase.3 \ - curs_color.3 COLOR_PAIR.3 \ - curs_color.3 can_change_color.3 \ - curs_color.3 color_content.3 \ - curs_color.3 has_colors.3 \ - curs_color.3 init_color.3 \ - curs_color.3 init_pair.3 \ - curs_color.3 pair_content.3 \ - curs_color.3 start_color.3 \ - curs_delch.3 delch.3 \ - curs_delch.3 mvdelch.3 \ - curs_delch.3 mvwdelch.3 \ - curs_delch.3 wdelch.3 \ - curs_deleteln.3 deleteln.3 \ - curs_deleteln.3 insdelln.3 \ - curs_deleteln.3 insertln.3 \ - curs_deleteln.3 wdeleteln.3 \ - curs_deleteln.3 winsdelln.3 \ - curs_deleteln.3 winsertln.3 \ - curs_extend.3 curses_version.3 \ - curs_extend.3 use_extended_names.3 \ - curs_getcchar.3 getcchar.3 \ - curs_getcchar.3 setcchar.3 \ - curs_getch.3 getch.3 \ - curs_getch.3 has_key.3 \ - curs_getch.3 mvgetch.3 \ - curs_getch.3 mvwgetch.3 \ - curs_getch.3 ungetch.3 \ - curs_getch.3 wgetch.3 \ - curs_getstr.3 getnstr.3 \ - curs_getstr.3 getstr.3 \ - curs_getstr.3 mvgetnstr.3 \ - curs_getstr.3 mvgetstr.3 \ - curs_getstr.3 mvwgetnstr.3 \ - curs_getstr.3 mvwgetstr.3 \ - curs_getstr.3 wgetnstr.3 \ - curs_getstr.3 wgetstr.3 \ - curs_getyx.3 getbegyx.3 \ - curs_getyx.3 getmaxyx.3 \ - curs_getyx.3 getparyx.3 \ - curs_getyx.3 getyx.3 \ - curs_inch.3 inch.3 \ - curs_inch.3 mvinch.3 \ - curs_inch.3 mvwinch.3 \ - curs_inch.3 winch.3 \ - curs_inchstr.3 inchnstr.3 \ - curs_inchstr.3 inchstr.3 \ - curs_inchstr.3 mvinchnstr.3 \ - curs_inchstr.3 mvinchstr.3 \ - curs_inchstr.3 mvwinchnstr.3 \ - curs_inchstr.3 mvwinchstr.3 \ - curs_inchstr.3 winchnstr.3 \ - curs_inchstr.3 winchstr.3 \ - curs_initscr.3 delscreen.3 \ - curs_initscr.3 endwin.3 \ - curs_initscr.3 initscr.3 \ - curs_initscr.3 isendwin.3 \ - curs_initscr.3 newterm.3 \ - curs_initscr.3 set_term.3 \ - curs_inopts.3 cbreak.3 \ - curs_inopts.3 echo.3 \ - curs_inopts.3 halfdelay.3 \ - curs_inopts.3 intrflush.3 \ - curs_inopts.3 keypad.3 \ - curs_inopts.3 meta.3 \ - curs_inopts.3 nocbreak.3 \ - curs_inopts.3 nodelay.3 \ - curs_inopts.3 noecho.3 \ - curs_inopts.3 noqiflush.3 \ - curs_inopts.3 noraw.3 \ - curs_inopts.3 notimeout.3 \ - curs_inopts.3 qiflush.3 \ - curs_inopts.3 raw.3 \ - curs_inopts.3 timeout.3 \ - curs_inopts.3 typeahead.3 \ - curs_inopts.3 wtimeout.3 \ - curs_insch.3 insch.3 \ - curs_insch.3 mvinsch.3 \ - curs_insch.3 mvwinsch.3 \ - curs_insch.3 winsch.3 \ - curs_insstr.3 insnstr.3 \ - curs_insstr.3 insstr.3 \ - curs_insstr.3 mvinsnstr.3 \ - curs_insstr.3 mvinsstr.3 \ - curs_insstr.3 mvwinsnstr.3 \ - curs_insstr.3 mvwinsstr.3 \ - curs_insstr.3 winsnstr.3 \ - curs_insstr.3 winsstr.3 \ - curs_instr.3 innstr.3 \ - curs_instr.3 instr.3 \ - curs_instr.3 mvinnstr.3 \ - curs_instr.3 mvinstr.3 \ - curs_instr.3 mvwinnstr.3 \ - curs_instr.3 mvwinstr.3 \ - curs_instr.3 winnstr.3 \ - curs_instr.3 winstr.3 \ - curs_kernel.3 curs_set.3 \ - curs_kernel.3 def_prog_mode.3 \ - curs_kernel.3 def_shell_mode.3 \ - curs_kernel.3 getsyx.3 \ - curs_kernel.3 napms.3 \ - curs_kernel.3 reset_prog_mode.3 \ - curs_kernel.3 reset_shell_mode.3 \ - curs_kernel.3 resetty.3 \ - curs_kernel.3 ripoffline.3 \ - curs_kernel.3 savetty.3 \ - curs_kernel.3 setsyx.3 \ - curs_legacy.3 getbegx.3 \ - curs_legacy.3 getbegy.3 \ - curs_legacy.3 getcurx.3 \ - curs_legacy.3 getcury.3 \ - curs_legacy.3 getmaxx.3 \ - curs_legacy.3 getmaxy.3 \ - curs_legacy.3 getparx.3 \ - curs_legacy.3 getpary.3 \ - curs_memleaks.3 _nc_free_and_exit.3 \ - curs_memleaks.3 _nc_freeall.3 \ - curs_mouse.3 getmouse.3 \ - curs_mouse.3 mouse_trafo.3 \ - curs_mouse.3 mouseinterval.3 \ - curs_mouse.3 mousemask.3 \ - curs_mouse.3 ungetmouse.3 \ - curs_mouse.3 wenclose.3 \ - curs_mouse.3 wmouse_trafo.3 \ - curs_move.3 move.3 \ - curs_move.3 wmove.3 \ - curs_opaque.3 is_cleared.3 \ - curs_opaque.3 is_idcok.3 \ - curs_opaque.3 is_idlok.3 \ - curs_opaque.3 is_immedok.3 \ - curs_opaque.3 is_keypad.3 \ - curs_opaque.3 is_leaveok.3 \ - curs_opaque.3 is_nodelay.3 \ - curs_opaque.3 is_notimeout.3 \ - curs_opaque.3 is_scrollok.3 \ - curs_opaque.3 is_syncok.3 \ - curs_opaque.3 is_timeout.3 \ - curs_opaque.3 wgetparent.3 \ - curs_opaque.3 wgetscrreg.3 \ - curs_outopts.3 clearok.3 \ - curs_outopts.3 idcok.3 \ - curs_outopts.3 idlok.3 \ - curs_outopts.3 immedok.3 \ - curs_outopts.3 leaveok.3 \ - curs_outopts.3 nl.3 \ - curs_outopts.3 nonl.3 \ - curs_outopts.3 scrollok.3 \ - curs_outopts.3 setscrreg.3 \ - curs_outopts.3 wsetscrreg.3 \ - curs_overlay.3 copywin.3 \ - curs_overlay.3 overlay.3 \ - curs_overlay.3 overwrite.3 \ - curs_pad.3 newpad.3 \ - curs_pad.3 pecho_wchar.3 \ - curs_pad.3 pechochar.3 \ - curs_pad.3 pnoutrefresh.3 \ - curs_pad.3 prefresh.3 \ - curs_pad.3 subpad.3 \ - curs_print.3 mcprint.3 \ - curs_refresh.3 doupdate.3 \ - curs_refresh.3 redrawwin.3 \ - curs_refresh.3 refresh.3 \ - curs_refresh.3 wnoutrefresh.3 \ - curs_refresh.3 wredrawln.3 \ - curs_refresh.3 wrefresh.3 \ - curs_scr_dump.3 scr_dump.3 \ - curs_scr_dump.3 scr_init.3 \ - curs_scr_dump.3 scr_restore.3 \ - curs_scr_dump.3 scr_set.3 \ - curs_scroll.3 scrl.3 \ - curs_scroll.3 scroll.3 \ - curs_scroll.3 wscrl.3 \ - curs_slk.3 slk_attr.3 \ - curs_slk.3 slk_attr_off.3 \ - curs_slk.3 slk_attr_on.3 \ - curs_slk.3 slk_attr_set.3 \ - curs_slk.3 slk_attroff.3 \ - curs_slk.3 slk_attron.3 \ - curs_slk.3 slk_attrset.3 \ - curs_slk.3 slk_clear.3 \ - curs_slk.3 slk_color.3 \ - curs_slk.3 slk_init.3 \ - curs_slk.3 slk_label.3 \ - curs_slk.3 slk_noutrefresh.3 \ - curs_slk.3 slk_refresh.3 \ - curs_slk.3 slk_restore.3 \ - curs_slk.3 slk_set.3 \ - curs_slk.3 slk_touch.3 \ - curs_sp_funcs.3 sp_funcs.3 \ - curs_sp_funcs.3 assume_default_colors_sp.3 \ - curs_sp_funcs.3 baudrate_sp.3 \ - curs_sp_funcs.3 beep_sp.3 \ - curs_sp_funcs.3 can_change_color_sp.3 \ - curs_sp_funcs.3 cbreak_sp.3 \ - curs_sp_funcs.3 ceiling_panel.3 \ - curs_sp_funcs.3 color_content_sp.3 \ - curs_sp_funcs.3 curs_set_sp.3 \ - curs_sp_funcs.3 def_prog_mode_sp.3 \ - curs_sp_funcs.3 def_shell_mode_sp.3 \ - curs_sp_funcs.3 define_key_sp.3 \ - curs_sp_funcs.3 del_curterm_sp.3 \ - curs_sp_funcs.3 delay_output_sp.3 \ - curs_sp_funcs.3 doupdate_sp.3 \ - curs_sp_funcs.3 echo_sp.3 \ - curs_sp_funcs.3 endwin_sp.3 \ - curs_sp_funcs.3 erasechar_sp.3 \ - curs_sp_funcs.3 filter_sp.3 \ - curs_sp_funcs.3 flash_sp.3 \ - curs_sp_funcs.3 flushinp_sp.3 \ - curs_sp_funcs.3 get_escdelay_sp.3 \ - curs_sp_funcs.3 getmouse_sp.3 \ - curs_sp_funcs.3 getwin_sp.3 \ - curs_sp_funcs.3 ground_panel.3 \ - curs_sp_funcs.3 halfdelay_sp.3 \ - curs_sp_funcs.3 has_colors_sp.3 \ - curs_sp_funcs.3 has_ic_sp.3 \ - curs_sp_funcs.3 has_il_sp.3 \ - curs_sp_funcs.3 has_key_sp.3 \ - curs_sp_funcs.3 has_mouse_sp.3 \ - curs_sp_funcs.3 init_color_sp.3 \ - curs_sp_funcs.3 init_pair_sp.3 \ - curs_sp_funcs.3 intrflush_sp.3 \ - curs_sp_funcs.3 is_term_resized_sp.3 \ - curs_sp_funcs.3 isendwin_sp.3 \ - curs_sp_funcs.3 key_defined_sp.3 \ - curs_sp_funcs.3 keybound_sp.3 \ - curs_sp_funcs.3 keyname_sp.3 \ - curs_sp_funcs.3 keyok_sp.3 \ - curs_sp_funcs.3 killchar_sp.3 \ - curs_sp_funcs.3 mcprint_sp.3 \ - curs_sp_funcs.3 mouseinterval_sp.3 \ - curs_sp_funcs.3 mousemask_sp.3 \ - curs_sp_funcs.3 mvcur_sp.3 \ - curs_sp_funcs.3 napms_sp.3 \ - curs_sp_funcs.3 new_form_sp.3 \ - curs_sp_funcs.3 new_menu_sp.3 \ - curs_sp_funcs.3 new_prescr.3 \ - curs_sp_funcs.3 newpad_sp.3 \ - curs_sp_funcs.3 newterm_sp.3 \ - curs_sp_funcs.3 newwin_sp.3 \ - curs_sp_funcs.3 nl_sp.3 \ - curs_sp_funcs.3 nocbreak_sp.3 \ - curs_sp_funcs.3 noecho_sp.3 \ - curs_sp_funcs.3 nofilter_sp.3 \ - curs_sp_funcs.3 nonl_sp.3 \ - curs_sp_funcs.3 noqiflush_sp.3 \ - curs_sp_funcs.3 noraw_sp.3 \ - curs_sp_funcs.3 pair_content_sp.3 \ - curs_sp_funcs.3 putp_sp.3 \ - curs_sp_funcs.3 qiflush_sp.3 \ - curs_sp_funcs.3 raw_sp.3 \ - curs_sp_funcs.3 reset_prog_mode_sp.3 \ - curs_sp_funcs.3 reset_shell_mode_sp.3 \ - curs_sp_funcs.3 resetty_sp.3 \ - curs_sp_funcs.3 resize_term_sp.3 \ - curs_sp_funcs.3 resizeterm_sp.3 \ - curs_sp_funcs.3 restartterm_sp.3 \ - curs_sp_funcs.3 ripoffline_sp.3 \ - curs_sp_funcs.3 savetty_sp.3 \ - curs_sp_funcs.3 scr_init_sp.3 \ - curs_sp_funcs.3 scr_restore_sp.3 \ - curs_sp_funcs.3 scr_set_sp.3 \ - curs_sp_funcs.3 set_curterm_sp.3 \ - curs_sp_funcs.3 set_escdelay_sp.3 \ - curs_sp_funcs.3 set_tabsize_sp.3 \ - curs_sp_funcs.3 slk_attr_set_sp.3 \ - curs_sp_funcs.3 slk_attr_sp.3 \ - curs_sp_funcs.3 slk_attroff_sp.3 \ - curs_sp_funcs.3 slk_attron_sp.3 \ - curs_sp_funcs.3 slk_attrset_sp.3 \ - curs_sp_funcs.3 slk_clear_sp.3 \ - curs_sp_funcs.3 slk_color_sp.3 \ - curs_sp_funcs.3 slk_init_sp.3 \ - curs_sp_funcs.3 slk_label_sp.3 \ - curs_sp_funcs.3 slk_noutrefresh_sp.3 \ - curs_sp_funcs.3 slk_refresh_sp.3 \ - curs_sp_funcs.3 slk_restore_sp.3 \ - curs_sp_funcs.3 slk_set_sp.3 \ - curs_sp_funcs.3 slk_touch_sp.3 \ - curs_sp_funcs.3 start_color_sp.3 \ - curs_sp_funcs.3 term_attrs_sp.3 \ - curs_sp_funcs.3 termattrs_sp.3 \ *** 1389 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Mon Oct 4 09:40:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B82F67B430; Mon, 4 Oct 2021 09:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNG192XnCz4SG0; Mon, 4 Oct 2021 09:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 385BA16EEC; Mon, 4 Oct 2021 09:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1949ejna082676; Mon, 4 Oct 2021 09:40:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1949ejjk082675; Mon, 4 Oct 2021 09:40:45 GMT (envelope-from git) Date: Mon, 4 Oct 2021 09:40:45 GMT Message-Id: <202110040940.1949ejjk082675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: cbc83e378a7e - main - ncurses: chase dependency changes in the source tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbc83e378a7ee8f8aea9811906a2786a8f3bdeb3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 09:40:45 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=cbc83e378a7ee8f8aea9811906a2786a8f3bdeb3 commit cbc83e378a7ee8f8aea9811906a2786a8f3bdeb3 Author: Baptiste Daroussin AuthorDate: 2021-09-23 01:52:46 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-04 09:38:24 +0000 ncurses: chase dependency changes in the source tree Differential Revision: https://reviews.freebsd.org/D32098 --- Makefile.inc1 | 5 +++-- gnu/lib/libdialog/Makefile | 2 +- gnu/usr.bin/dialog/Makefile | 2 +- lib/libdpv/Makefile | 2 +- lib/libedit/Makefile | 2 +- libexec/telnetd/Makefile | 2 +- sbin/ipf/ipfstat/Makefile | 2 +- share/mk/src.libnames.mk | 6 +++--- tools/tools/ath/athratestats/Makefile | 2 +- tools/tools/net80211/stumbler/Makefile | 2 +- usr.bin/clang/lld/Makefile | 2 +- usr.bin/clang/lldb-server/Makefile | 1 + usr.bin/clang/lldb/Makefile | 3 ++- usr.bin/clang/llvm.prog.mk | 2 +- usr.bin/ee/Makefile | 2 +- usr.bin/grdc/Makefile | 2 +- usr.bin/less/Makefile | 2 +- usr.bin/msgs/Makefile | 2 +- usr.bin/ncal/Makefile | 2 +- usr.bin/ncurses/Makefile | 6 +++--- usr.bin/systat/Makefile | 2 +- usr.bin/tabs/Makefile | 2 +- usr.bin/talk/Makefile | 2 +- usr.bin/telnet/Makefile | 2 +- usr.bin/top/Makefile | 2 +- usr.bin/ul/Makefile | 2 +- usr.bin/vi/Makefile | 2 +- usr.sbin/gstat/Makefile | 2 +- usr.sbin/pmc/Makefile | 2 +- usr.sbin/pmcstat/Makefile | 2 +- usr.sbin/tzsetup/Makefile | 2 +- usr.sbin/watch/Makefile | 2 +- 32 files changed, 39 insertions(+), 36 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index ff5911edc384..6dcfa6a17d3d 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2576,7 +2576,7 @@ _bt_clean= ${CLEANDIR} bin/sh \ ${LOCAL_TOOL_DIRS} \ ${_jevents} \ - lib/ncurses/ncurses \ + lib/ncurses/tinfo \ ${_rescue} \ ${_share} \ usr.bin/awk \ @@ -2933,6 +2933,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ lib/libzstd \ ${_lib_casper} \ + lib/ncurses/tinfo \ lib/ncurses/ncurses \ lib/libopie lib/libpam/libpam lib/libthr \ ${_lib_libradius} lib/libsbuf lib/libtacplus \ @@ -2954,7 +2955,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ .if ${MK_DIALOG} != "no" _prebuild_libs+= gnu/lib/libdialog -gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncurses__L +gnu/lib/libdialog__L: lib/msun__L lib/ncurses/tinfo__L lib/ncurses/ncurses__L .endif .if ${MK_GOOGLETEST} != "no" diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile index b97e4df9373a..6de2460c62a5 100644 --- a/gnu/lib/libdialog/Makefile +++ b/gnu/lib/libdialog/Makefile @@ -13,7 +13,7 @@ SRCS= argv.c arrows.c buildlist.c buttons.c calendar.c checklist.c \ INCS= dialog.h dlg_colors.h dlg_config.h dlg_keys.h MAN= dialog.3 -LIBADD= ncursesw m +LIBADD= tinfow ncursesw m CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED .PATH: ${DIALOG} diff --git a/gnu/usr.bin/dialog/Makefile b/gnu/usr.bin/dialog/Makefile index 71496f774830..bb50dc46cea8 100644 --- a/gnu/usr.bin/dialog/Makefile +++ b/gnu/usr.bin/dialog/Makefile @@ -3,7 +3,7 @@ DIALOG= ${SRCTOP}/contrib/dialog PROG= dialog -LIBADD= dialog ncursesw m +LIBADD= dialog tinfow ncursesw m CFLAGS+= -I${.CURDIR} -I${DIALOG} .PATH: ${DIALOG} diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile index be28debc70bc..5b432602ff7b 100644 --- a/lib/libdpv/Makefile +++ b/lib/libdpv/Makefile @@ -7,7 +7,7 @@ INCS= dpv.h MAN= dpv.3 MLINKS= dpv.3 dpv_free.3 -LIBADD= dialog figpar util ncursesw +LIBADD= dialog figpar util tinfow ncursesw SRCS= dialog_util.c dialogrc.c dprompt.c dpv.c status.c util.c diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index e549ac15c000..28014feafab7 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -13,7 +13,7 @@ SHLIBDIR?= /lib WARNS?= 3 LIB= edit -LIBADD= ncursesw +LIBADD= tinfow SRCS= chared.c chartype.c common.c el.c eln.c emacs.c filecomplete.c \ hist.c history.c historyn.c keymacro.c literal.c map.c \ diff --git a/libexec/telnetd/Makefile b/libexec/telnetd/Makefile index 15dc0af01f0b..09136d360a71 100644 --- a/libexec/telnetd/Makefile +++ b/libexec/telnetd/Makefile @@ -29,7 +29,7 @@ CFLAGS+= -DINET6 CFLAGS+= -I${TELNETDIR} CFLAGS+= -I${TELNETDIR}/telnet -LIBADD= telnet util ncursesw +LIBADD= telnet util tinfow .if ${MK_OPENSSL} != "no" SRCS+= authenc.c diff --git a/sbin/ipf/ipfstat/Makefile b/sbin/ipf/ipfstat/Makefile index 4714f2c0394e..80c2e89a2c88 100644 --- a/sbin/ipf/ipfstat/Makefile +++ b/sbin/ipf/ipfstat/Makefile @@ -6,6 +6,6 @@ PACKAGE= ipf PROG= ipfstat SRCS= ipfstat.c MAN= ipfstat.8 -LIBADD+= ncursesw +LIBADD+= tinfow ncursesw .include diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 77f32c8cecb1..e014e12cb3c9 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -274,7 +274,7 @@ _DP_ssh= crypto crypt z .if ${MK_LDNS} != "no" _DP_ssh+= ldns .endif -_DP_edit= ncursesw +_DP_edit= tinfow .if ${MK_OPENSSL} != "no" _DP_bsnmp= crypto .endif @@ -324,8 +324,8 @@ _DP_fetch= md .endif _DP_execinfo= elf _DP_dwarf= elf -_DP_dpv= dialog figpar util ncursesw -_DP_dialog= ncursesw m +_DP_dpv= dialog figpar util tinfow ncursesw +_DP_dialog= tinfow ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c _DP_gtest= pthread regex diff --git a/tools/tools/ath/athratestats/Makefile b/tools/tools/ath/athratestats/Makefile index ccf04ebd8da0..c924370a31e7 100644 --- a/tools/tools/ath/athratestats/Makefile +++ b/tools/tools/ath/athratestats/Makefile @@ -7,7 +7,7 @@ PROG= athratestats SRCS= main.c opt_ah.h ah_osdep.h -LIBADD+= ncursesw +LIBADD+= tinfow ncursesw CLEANFILES+= opt_ah.h ah_osdep.h diff --git a/tools/tools/net80211/stumbler/Makefile b/tools/tools/net80211/stumbler/Makefile index e840be7446ce..614fc6064cb8 100644 --- a/tools/tools/net80211/stumbler/Makefile +++ b/tools/tools/net80211/stumbler/Makefile @@ -2,7 +2,7 @@ PROG= stumbler BINDIR= /usr/local/bin -LIBADD= pcap ncursesw +LIBADD= pcap tinfow ncursesw CFLAGS=-g MAN= diff --git a/usr.bin/clang/lld/Makefile b/usr.bin/clang/lld/Makefile index 8e95ccc07f04..7e6743133835 100644 --- a/usr.bin/clang/lld/Makefile +++ b/usr.bin/clang/lld/Makefile @@ -104,7 +104,7 @@ CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} .if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) LIBADD+= execinfo -LIBADD+= ncursesw +LIBADD+= tinfow .endif LIBADD+= pthread LIBADD+= z diff --git a/usr.bin/clang/lldb-server/Makefile b/usr.bin/clang/lldb-server/Makefile index 28e0c4ce7260..56aa4e565ffb 100644 --- a/usr.bin/clang/lldb-server/Makefile +++ b/usr.bin/clang/lldb-server/Makefile @@ -41,6 +41,7 @@ TGHDRS+= ${INCFILE} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} +LIBADD+= tinfow LIBADD+= edit LIBADD+= execinfo LIBADD+= lua diff --git a/usr.bin/clang/lldb/Makefile b/usr.bin/clang/lldb/Makefile index c309559b06e7..8a2c247688aa 100644 --- a/usr.bin/clang/lldb/Makefile +++ b/usr.bin/clang/lldb/Makefile @@ -34,12 +34,13 @@ TGHDRS+= ${INCFILE} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} +LIBADD= tinfow LIBADD+= edit LIBADD+= execinfo LIBADD+= lua LIBADD+= lzma LIBADD+= ncursesw -LIBADD+= panel +LIBADD+= panelw LIBADD+= pthread LIBADD+= z diff --git a/usr.bin/clang/llvm.prog.mk b/usr.bin/clang/llvm.prog.mk index 56698c4138d3..3a708805d3ea 100644 --- a/usr.bin/clang/llvm.prog.mk +++ b/usr.bin/clang/llvm.prog.mk @@ -24,7 +24,7 @@ PACKAGE= clang .if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) LIBADD+= execinfo -LIBADD+= ncursesw +LIBADD+= tinfow .endif LIBADD+= pthread diff --git a/usr.bin/ee/Makefile b/usr.bin/ee/Makefile index c30a510a510c..d18c58191222 100644 --- a/usr.bin/ee/Makefile +++ b/usr.bin/ee/Makefile @@ -9,7 +9,7 @@ PACKAGE=ee PROG= ee LINKS= ${BINDIR}/ee ${BINDIR}/ree ${BINDIR}/ee ${BINDIR}/edit MLINKS= ee.1 ree.1 ee.1 edit.1 -LIBADD= ncursesw +LIBADD= tinfow ncursesw WARNS?= 2 diff --git a/usr.bin/grdc/Makefile b/usr.bin/grdc/Makefile index d12277df8466..4ea181508b45 100644 --- a/usr.bin/grdc/Makefile +++ b/usr.bin/grdc/Makefile @@ -2,6 +2,6 @@ PROG= grdc MAN= grdc.6 -LIBADD= ncursesw +LIBADD= tinfow ncursesw .include diff --git a/usr.bin/less/Makefile b/usr.bin/less/Makefile index 08c5249598f9..630750c3e117 100644 --- a/usr.bin/less/Makefile +++ b/usr.bin/less/Makefile @@ -9,7 +9,7 @@ SRCS= main.c screen.c brac.c ch.c charset.c cmdbuf.c command.c cvt.c \ signal.c tags.c ttyin.c version.c xbuf.c SCRIPTS=lesspipe.sh zless.sh SCRIPTSNAME_lesspipe.sh=lesspipe.sh -LIBADD= ncursesw +LIBADD= tinfow LINKS= ${BINDIR}/less ${BINDIR}/more \ ${BINDIR}/zless ${BINDIR}/bzless \ ${BINDIR}/zless ${BINDIR}/xzless \ diff --git a/usr.bin/msgs/Makefile b/usr.bin/msgs/Makefile index 3af95c31ea0d..7dbf9ff149be 100644 --- a/usr.bin/msgs/Makefile +++ b/usr.bin/msgs/Makefile @@ -3,6 +3,6 @@ PROG= msgs -LIBADD= ncursesw +LIBADD= tinfow .include diff --git a/usr.bin/ncal/Makefile b/usr.bin/ncal/Makefile index 8cfd9b1c62e0..e6bcf4232b8a 100644 --- a/usr.bin/ncal/Makefile +++ b/usr.bin/ncal/Makefile @@ -4,7 +4,7 @@ PROG= ncal -LIBADD= calendar ncursesw +LIBADD= calendar tinfow LINKS= ${BINDIR}/ncal ${BINDIR}/cal MLINKS= ncal.1 cal.1 diff --git a/usr.bin/ncurses/Makefile b/usr.bin/ncurses/Makefile index cd8344aa1a97..33e8794aa0e5 100644 --- a/usr.bin/ncurses/Makefile +++ b/usr.bin/ncurses/Makefile @@ -15,10 +15,10 @@ SRCS.clear= clear.c clear_cmd.c tty_settings.c SRCS.tset= tset.c tty_settings.c transform.c reset_cmd.c CFLAGS+= -I${NCURSES_DIR}/progs \ -I${NCURSES_DIR}/include \ - -I${SRCTOP}/lib/ncurses/ncurses \ - -I${OBJTOP}/lib/ncurses/ncurses \ + -I${SRCTOP}/lib/ncurses/tinfo \ + -I${OBJTOP}/lib/ncurses/tinfo \ -I${.CURDIR} -LIBADD= ncursesw +LIBADD= tinfow CLEANFILES= termsort.c termsort.c: MKtermsort.sh diff --git a/usr.bin/systat/Makefile b/usr.bin/systat/Makefile index ca3f7ed72ce4..01cd36877101 100644 --- a/usr.bin/systat/Makefile +++ b/usr.bin/systat/Makefile @@ -16,6 +16,6 @@ CFLAGS+= -DINET6 WARNS?= 1 -LIBADD= ncursesw m devstat kvm util +LIBADD= tinfow ncursesw m devstat kvm util .include diff --git a/usr.bin/tabs/Makefile b/usr.bin/tabs/Makefile index f8c085bfbe80..a67780a2a365 100644 --- a/usr.bin/tabs/Makefile +++ b/usr.bin/tabs/Makefile @@ -2,6 +2,6 @@ PROG= tabs -LIBADD= ncursesw +LIBADD= tinfow .include diff --git a/usr.bin/talk/Makefile b/usr.bin/talk/Makefile index f595be8839c4..ba5692c4196b 100644 --- a/usr.bin/talk/Makefile +++ b/usr.bin/talk/Makefile @@ -5,6 +5,6 @@ PROG= talk SRCS= ctl.c ctl_transact.c display.c get_addrs.c get_iface.c get_names.c \ init_disp.c invite.c io.c look_up.c msgs.c talk.c -LIBADD= ncursesw +LIBADD= tinfow ncursesw .include diff --git a/usr.bin/telnet/Makefile b/usr.bin/telnet/Makefile index 33c8b9cba193..91b88f592b66 100644 --- a/usr.bin/telnet/Makefile +++ b/usr.bin/telnet/Makefile @@ -21,7 +21,7 @@ CFLAGS+= -DINET6 WARNS?= 2 -LIBADD= telnet ncursesw +LIBADD= telnet tinfow CFLAGS+= -DIPSEC LIBADD+= ipsec diff --git a/usr.bin/top/Makefile b/usr.bin/top/Makefile index d11b91273b50..c4a3aca3dd62 100644 --- a/usr.bin/top/Makefile +++ b/usr.bin/top/Makefile @@ -7,5 +7,5 @@ SRCS= commands.c display.c machine.c screen.c top.c \ username.c utils.c MAN= top.1 -LIBADD= ncursesw m kvm jail util sbuf +LIBADD= tinfow m kvm jail util sbuf .include diff --git a/usr.bin/ul/Makefile b/usr.bin/ul/Makefile index 817f07ba14cb..9418dee7529d 100644 --- a/usr.bin/ul/Makefile +++ b/usr.bin/ul/Makefile @@ -3,6 +3,6 @@ PROG= ul -LIBADD= ncursesw +LIBADD= tinfow .include diff --git a/usr.bin/vi/Makefile b/usr.bin/vi/Makefile index 5769a34c6d2e..4449982f118c 100644 --- a/usr.bin/vi/Makefile +++ b/usr.bin/vi/Makefile @@ -35,7 +35,7 @@ MLINKS+=vi.1 nex.1 vi.1 nview.1 vi.1 nvi.1 CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRCDIR}/regex \ -I${.CURDIR}/ex -LIBADD= util ncursesw +LIBADD= util tinfow ncursesw .if ${MK_ICONV} == "yes" && !defined(RESCUE) CFLAGS+= -DUSE_ICONV -DICONV_TRADITIONAL diff --git a/usr.sbin/gstat/Makefile b/usr.sbin/gstat/Makefile index 1c71f2285622..fcf90fa3b130 100644 --- a/usr.sbin/gstat/Makefile +++ b/usr.sbin/gstat/Makefile @@ -2,6 +2,6 @@ PROG= gstat MAN= gstat.8 -LIBADD= devstat geom edit ncursesw +LIBADD= devstat geom edit tinfow ncursesw .include diff --git a/usr.sbin/pmc/Makefile b/usr.sbin/pmc/Makefile index b67641de9f62..8f026f131a8b 100644 --- a/usr.sbin/pmc/Makefile +++ b/usr.sbin/pmc/Makefile @@ -14,7 +14,7 @@ CFLAGS+= -I${SRCTOP}/lib/libpmcstat # Does not link when built position-independent. MK_PIE=no -LIBADD= kvm pmc m ncursesw pmcstat elf +LIBADD= pmc m pmcstat elf SRCS= pmc.c pmc_util.c cmd_pmc_stat.c \ cmd_pmc_list.c cmd_pmc_filter.cc \ diff --git a/usr.sbin/pmcstat/Makefile b/usr.sbin/pmcstat/Makefile index fa3c8948a7f9..5d938677306c 100644 --- a/usr.sbin/pmcstat/Makefile +++ b/usr.sbin/pmcstat/Makefile @@ -6,7 +6,7 @@ PROG_CXX= pmcstat MAN= pmcstat.8 CFLAGS+= -I${SRCTOP}/lib/libpmcstat -LIBADD= kvm pmc m ncursesw pmcstat elf +LIBADD= kvm pmc m tinfow ncursesw pmcstat elf SRCS= pmcstat.c pmcstat.h pmcstat_log.c \ pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c \ diff --git a/usr.sbin/tzsetup/Makefile b/usr.sbin/tzsetup/Makefile index e3d7526838a1..7274b7680ca9 100644 --- a/usr.sbin/tzsetup/Makefile +++ b/usr.sbin/tzsetup/Makefile @@ -10,7 +10,7 @@ CFLAGS+= -I. .if ${MK_DIALOG} != no && !defined(BOOTSTRAPPING) WARNS?= 3 CFLAGS+= -I${SRCTOP}/contrib/dialog -DHAVE_DIALOG -LIBADD= dialog ncursesw +LIBADD= dialog tinfow .endif .include diff --git a/usr.sbin/watch/Makefile b/usr.sbin/watch/Makefile index 981aec0a4749..215ff61e9004 100644 --- a/usr.sbin/watch/Makefile +++ b/usr.sbin/watch/Makefile @@ -5,6 +5,6 @@ MAN= watch.8 WARNS?= 2 -LIBADD= ncursesw +LIBADD= tinfow .include From owner-dev-commits-src-main@freebsd.org Mon Oct 4 09:40:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8D8667B395; Mon, 4 Oct 2021 09:40: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 4HNG1B3rFRz4S9Z; Mon, 4 Oct 2021 09:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EFB217096; Mon, 4 Oct 2021 09:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1949ekmL082700; Mon, 4 Oct 2021 09:40:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1949ekFK082699; Mon, 4 Oct 2021 09:40:46 GMT (envelope-from git) Date: Mon, 4 Oct 2021 09:40:46 GMT Message-Id: <202110040940.1949ekFK082699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 19deec3b30ca - main - bsdinstall: reduce overlinking MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19deec3b30ca6add3ef3f7414e163c72d8f5b966 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 09:40:46 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=19deec3b30ca6add3ef3f7414e163c72d8f5b966 commit 19deec3b30ca6add3ef3f7414e163c72d8f5b966 Author: Baptiste Daroussin AuthorDate: 2021-09-23 02:08:08 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-04 09:38:27 +0000 bsdinstall: reduce overlinking both distextract and distfetch does not directly use ncurses, or figpart, drop their direct link to those libs --- usr.sbin/bsdinstall/distextract/Makefile | 2 +- usr.sbin/bsdinstall/distfetch/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsdinstall/distextract/Makefile b/usr.sbin/bsdinstall/distextract/Makefile index 908a60c6594a..2b7180e28ea0 100644 --- a/usr.sbin/bsdinstall/distextract/Makefile +++ b/usr.sbin/bsdinstall/distextract/Makefile @@ -2,7 +2,7 @@ BINDIR= ${LIBEXECDIR}/bsdinstall PROG= distextract -LIBADD= archive dpv figpar ncursesw dialog m +LIBADD= archive dpv dialog m MAN= diff --git a/usr.sbin/bsdinstall/distfetch/Makefile b/usr.sbin/bsdinstall/distfetch/Makefile index 044b83a8a1a0..70ecb381d485 100644 --- a/usr.sbin/bsdinstall/distfetch/Makefile +++ b/usr.sbin/bsdinstall/distfetch/Makefile @@ -2,7 +2,7 @@ BINDIR= ${LIBEXECDIR}/bsdinstall PROG= distfetch -LIBADD= fetch ncursesw dialog m +LIBADD= fetch dialog m MAN= From owner-dev-commits-src-main@freebsd.org Mon Oct 4 09:40:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89B6C67B23C; Mon, 4 Oct 2021 09:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNG1C6hH3z4SJW; Mon, 4 Oct 2021 09:40:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D4AF16EEE; Mon, 4 Oct 2021 09:40:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1949elUJ082728; Mon, 4 Oct 2021 09:40:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1949elkn082727; Mon, 4 Oct 2021 09:40:47 GMT (envelope-from git) Date: Mon, 4 Oct 2021 09:40:47 GMT Message-Id: <202110040940.1949elkn082727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 16f1ee11e657 - main - ncurses: document in UPDATING and bump _FreeBSD_version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16f1ee11e6574d7f8d8a9dc6ebc9be3036ff9fd0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 09:40:48 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=16f1ee11e6574d7f8d8a9dc6ebc9be3036ff9fd0 commit 16f1ee11e6574d7f8d8a9dc6ebc9be3036ff9fd0 Author: Baptiste Daroussin AuthorDate: 2021-10-04 09:36:47 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-04 09:38:29 +0000 ncurses: document in UPDATING and bump _FreeBSD_version --- UPDATING | 6 ++++++ sys/sys/param.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 2f432124233a..6184d2df8a8d 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20211004: + Ncurses distribution has been split between libtinfow and libncurses + with libncurses.so becoming a linker (ld) script to seamlessly link + to libtinfow as needed. Bump _FreeBSD_version to 1400035 to reflect + this change. + 20210923: As of commit 8160a0f62be6, the dummynet module no longer depends on the ipfw module. Dummynet can now be used by pf as well as ipfw. As such diff --git a/sys/sys/param.h b/sys/sys/param.h index 234111e5d53c..899ae1793b28 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400034 +#define __FreeBSD_version 1400035 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Mon Oct 4 10:17:40 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACF7E67BE81; Mon, 4 Oct 2021 10:17:40 +0000 (UTC) (envelope-from christos@margiolis.net) Received: from christos (mail.margiolis.net [95.179.159.8]) by mx1.freebsd.org (Postfix) with ESMTP id 4HNGqm13zbz4Vm6; Mon, 4 Oct 2021 10:17:39 +0000 (UTC) (envelope-from christos@margiolis.net) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=5mx4KMfqDpM2 KFSb+snvPE5bzdEvPjzcPZPC9a8bWMw=; h=in-reply-to:references:subject:cc: to:from:date; d=margiolis.net; b=DsUg9hmFm/H5A18EhMIuUw3OBcU2AE4XsxSM5 wyoHbFhbgFRYBH0tkjQq7ItueLBoheWB79JuTQcKE4irOwrlLWP/nHSDfoKkYSmCyPGpJh aT91jum7hry8iXxU6NFtCKdlRnyqAuvpJ4dry/fgIJ1s+g02sBES/e0veUWxr6VM= Received: from pleb (athedsl-4393259.home.otenet.gr [79.130.121.27]) by christos (OpenSMTPD) with ESMTPSA id 4b0ffeff (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 4 Oct 2021 10:17:31 +0000 (UTC) Date: Mon, 4 Oct 2021 13:17:26 +0300 From: Christos Margiolis To: Mateusz Piotrowski <0mp@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Hans Petter Selasky Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. Message-ID: <20211004101726.wraje5ol5vwbhjcv@pleb> References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4HNGqm13zbz4Vm6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 10:17:40 -0000 On Mon, Oct 04, 2021 at 10:48:03AM +0200, Mateusz Piotrowski wrote: > Hmm, I agree that mute and volume controls in the new CLI interface are very > consistent. However, in case of the old CLI interface, the mute > functionality could also be added without a problem (at least by looking at > the manual pages, the "mute" command could look like this: "mixer mute > vol"). My point is that I feel that the CLI interface should be > backwards-compatible in this case. I think the new interface is more readable and extensible than the old one, and, as you mentioned, mixer(8) did need an upgrade, so it might be better to have it changed from now on and keep the old version as a port, than to keep working on an -- in my opinion -- obsolete interface and code. > > Would it help to make a port, like "oldmixer", under "audio" ? > > That's a good idea. I've committed the "old" mixer to the ports tree: https://cgit.freebsd.org/ports/commit/?id=e9a0efe4509b8dbdef0b4e4b5b94abf0aebd78a9. Yeap, that's a good idea indeed. -- Christos From owner-dev-commits-src-main@freebsd.org Mon Oct 4 10:32:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4168B67C1EE; Mon, 4 Oct 2021 10:32: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 4HNH951HfYz4X4V; Mon, 4 Oct 2021 10:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CC0A17B2B; Mon, 4 Oct 2021 10:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194AWeQI054080; Mon, 4 Oct 2021 10:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194AWe3o054079; Mon, 4 Oct 2021 10:32:40 GMT (envelope-from git) Date: Mon, 4 Oct 2021 10:32:40 GMT Message-Id: <202110041032.194AWe3o054079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 27803b54db20 - main - ncurses: fix path where to find curses.h at bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27803b54db209aad2037d5e300c4494b2bfb5193 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 10:32:41 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=27803b54db209aad2037d5e300c4494b2bfb5193 commit 27803b54db209aad2037d5e300c4494b2bfb5193 Author: Baptiste Daroussin AuthorDate: 2021-10-04 10:31:23 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-04 10:31:23 +0000 ncurses: fix path where to find curses.h at bootstrap after the split, curses.h is now generated by tinfo Makefile, but still used for a file generated in ncurses lib. Adjust the path to make sure curses.h is always found --- lib/ncurses/ncurses/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 35b123a22292..d2ba1007b54a 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -173,9 +173,9 @@ SHLIB_LDSCRIPT= libncursesw.ldscript libncurses.ldscript: @${ECHO} "INPUT(${SHLIB_NAME} AS NEEDED(-ltinfow))" >$@ -lib_gen.c: MKlib_gen.sh curses.h ncurses_dll.h +lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h ncurses_dll.h LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \ - "${AWK}" generated < curses.h >$@ + "${AWK}" generated < ${.OBJDIR:H}/tinfo/curses.h >$@ expanded.c: MKexpanded.sh sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c From owner-dev-commits-src-main@freebsd.org Mon Oct 4 11:16:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7521D67C867; Mon, 4 Oct 2021 11:16:36 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNJ7m2dBBz4b22; Mon, 4 Oct 2021 11:16:36 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id g10so4150978edj.1; Mon, 04 Oct 2021 04:16:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=mful3i2lc4t14gSWcl36M0VHHhkirJVI3Z461vmjXv0=; b=CI5zfwPtKbTtI8fo2vUkcdxaqlmV08dq7/MJ95tjNBXmZFQ8MHSWMY7wcStT8cxmlE Yx+pyHxUqf1dDAAGL19QX4CRzJxibvJdxQIHTMQlWPIrVZIGF1ZnW3h7zrxSf8TafuSg Xs395qJOBXfv+zZLDaniQsO1cVFi6Zo93XY7sMJo24fRGFAkjvHOuF77Hh0H5CvO3MI2 IOL04T9HdSejhxknV471xwLNlbHotZMPfZsnLMAQrtC2YEclRTYOMYlnTHPFTEKKUEOd 94pYL90LMD3BCZlCCxtzs8IyzkyzKJ97Or59czvO4nQTasvIUOWSMeFAl5wzomQ+Y8sC /oyQ== X-Gm-Message-State: AOAM532NH98CnOQOJeEqdUf3U3nbuiXJrfNv8GLUe+X2FkhFENtG4e/C ayrGWNPRuyTkf3dDgmKuH6gpXT2wOb0= X-Google-Smtp-Source: ABdhPJwXvmU40mhpJ740lFFP7oQtL96BkgYXKrLTGzafYA5VpNj5rBNrtbOa0O85y6N3ON18CI46Ig== X-Received: by 2002:a17:906:d04d:: with SMTP id bo13mr16365636ejb.351.1633346195263; Mon, 04 Oct 2021 04:16:35 -0700 (PDT) Received: from [192.168.0.15] (ip5f5bd4ef.dynamic.kabel-deutschland.de. [95.91.212.239]) by smtp.gmail.com with ESMTPSA id jl12sm6200710ejc.120.2021.10.04.04.16.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 04:16:34 -0700 (PDT) Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Hans Petter Selasky , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Christos Margiolis References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: <817b2388-b599-9f8a-98c2-1f2410c88105@FreeBSD.org> Date: Mon, 4 Oct 2021 13:16:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4HNJ7m2dBBz4b22 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 11:16:36 -0000 On 04/10/2021 11:13, Hans Petter Selasky wrote: > Thanks for making that port. I've now updated the notes in UPDATING to mention it: > > https://cgit.freebsd.org/src/commit/?id=8bc5971be1ece76284b2cdb0addf051afc14044a Thanks! From owner-dev-commits-src-main@freebsd.org Mon Oct 4 12:16:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D674467D91C; Mon, 4 Oct 2021 12:16: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 4HNKTM5jYMz4gwX; Mon, 4 Oct 2021 12:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0B5118F53; Mon, 4 Oct 2021 12:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194CGtLn088019; Mon, 4 Oct 2021 12:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194CGtn3088018; Mon, 4 Oct 2021 12:16:55 GMT (envelope-from git) Date: Mon, 4 Oct 2021 12:16:55 GMT Message-Id: <202110041216.194CGtn3088018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: cc46927f8a2b - main - ncurses: fix libcompat (lib32 for example) building MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc46927f8a2be7d6a6ed7adc76237f258a5a7e22 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 12:16:55 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=cc46927f8a2be7d6a6ed7adc76237f258a5a7e22 commit cc46927f8a2be7d6a6ed7adc76237f258a5a7e22 Author: Baptiste Daroussin AuthorDate: 2021-10-04 12:16:32 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-04 12:16:32 +0000 ncurses: fix libcompat (lib32 for example) building --- Makefile.libcompat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.libcompat b/Makefile.libcompat index b376ebaa65f4..eb2b12b6c7d2 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -45,7 +45,7 @@ _LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib _LC_INCDIRS= \ include \ - lib/ncurses/ncurses \ + lib/ncurses/tinfo \ ${_LC_LIBDIRS.yes} .if ${MK_FILE} != "no" @@ -94,7 +94,7 @@ build${libcompat}: .PHONY DIRPRFX=${_dir}/ ${_t} .endfor .endfor -.for _dir in lib/ncurses/ncurses ${_libmagic} ${_jevents} +.for _dir in lib/ncurses/tinfo ${_libmagic} ${_jevents} .for _t in ${_obj} build-tools ${_+_}cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ From owner-dev-commits-src-main@freebsd.org Mon Oct 4 12:21:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5E9E67D940; Mon, 4 Oct 2021 12:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNKZv5m51z4hVr; Mon, 4 Oct 2021 12:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A65F518F63; Mon, 4 Oct 2021 12:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194CLh5v000729; Mon, 4 Oct 2021 12:21:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194CLhR9000728; Mon, 4 Oct 2021 12:21:43 GMT (envelope-from git) Date: Mon, 4 Oct 2021 12:21:43 GMT Message-Id: <202110041221.194CLhR9000728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 507a22be3850 - main - Add the missing license to gic_if.m MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 507a22be3850da1f2afc753abcf3372659249c31 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 12:21:43 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=507a22be3850da1f2afc753abcf3372659249c31 commit 507a22be3850da1f2afc753abcf3372659249c31 Author: Andrew Turner AuthorDate: 2021-10-04 10:22:19 +0000 Commit: Andrew Turner CommitDate: 2021-10-04 12:21:21 +0000 Add the missing license to gic_if.m Sponsored by: The FreeBSD Foundation --- sys/arm/arm/gic_if.m | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sys/arm/arm/gic_if.m b/sys/arm/arm/gic_if.m index b9bef7db1a80..ba722c3b1250 100644 --- a/sys/arm/arm/gic_if.m +++ b/sys/arm/arm/gic_if.m @@ -1,3 +1,33 @@ +#- +# Copyright (c) 2021 The FreeBSD Foundation +# +# This software was developed by Andrew Turner under +# sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + INTERFACE gic; From nobody Mon Oct 4 16:28:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 140928D0AAF; Mon, 4 Oct 2021 16:28: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 4HNR3k01Xdz3MQT; Mon, 4 Oct 2021 16:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4D301C5C0; Mon, 4 Oct 2021 16:28:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194GSXPu022957; Mon, 4 Oct 2021 16:28:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194GSXPQ022956; Mon, 4 Oct 2021 16:28:33 GMT (envelope-from git) Date: Mon, 4 Oct 2021 16:28:33 GMT Message-Id: <202110041628.194GSXPQ022956@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: 105fd928b0b5 - main - libctf: Improve check for duplicate SOU definitions in ctf_add_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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 105fd928b0b5b35ab529e5f6914788dc49582901 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=105fd928b0b5b35ab529e5f6914788dc49582901 commit 105fd928b0b5b35ab529e5f6914788dc49582901 Author: Mark Johnston AuthorDate: 2021-10-04 16:28:22 +0000 Commit: Mark Johnston CommitDate: 2021-10-04 16:28:22 +0000 libctf: Improve check for duplicate SOU definitions in ctf_add_type() When copying a struct or union from one CTF container to another, ctf_add_type() checks whether it matches an existing type in the destination container. It does so by looking for a type with the same name and kind as the new type, and if one exists, it iterates over all members of the source type and checks whether a member with matching name and offset exists in the matched destination type. This can produce false positives, for example because member types are not compared, but this is not expected to arise in practice. If the match fails, ctf_add_type() returns an error. The procedure used for member comparison breaks down in the face of anonymous struct and union members. ctf_member_iter() visits each member in the source definition and looks up the corresponding member in the desination definition by name using ctf_member_info(), but this function will descend into anonymous members and thus fail to match. Fix the problem by introducing a custom comparison routine which does not assume member names are unique. This should also be faster for types with many members; in the previous scheme, membcmp() would perform a linear scan of the desination type's members to perform a lookup by name. The new routine steps through the members of both types in a single loop. PR: 258763 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- cddl/contrib/opensolaris/common/ctf/ctf_create.c | 100 +++++++++++++++++------ 1 file changed, 73 insertions(+), 27 deletions(-) diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_create.c b/cddl/contrib/opensolaris/common/ctf/ctf_create.c index ae4cc7f31176..3a080e71baa0 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_create.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_create.c @@ -1196,17 +1196,6 @@ enumadd(const char *name, int value, void *arg) name, value) == CTF_ERR); } -/*ARGSUSED*/ -static int -membcmp(const char *name, ctf_id_t type, ulong_t offset, void *arg) -{ - ctf_bundle_t *ctb = arg; - ctf_membinfo_t ctm; - - return (ctf_member_info(ctb->ctb_file, ctb->ctb_type, - name, &ctm) == CTF_ERR || ctm.ctm_offset != offset); -} - static int membadd(const char *name, ctf_id_t type, ulong_t offset, void *arg) { @@ -1240,6 +1229,71 @@ membadd(const char *name, ctf_id_t type, ulong_t offset, void *arg) return (0); } +static long +soucmp(ctf_file_t *src_fp, ctf_id_t src_type, ctf_file_t *dst_fp, + ctf_id_t dst_type) +{ + const struct ctf_type *src_tp, *dst_tp; + const char *src_name, *dst_name; + ssize_t src_sz, dst_sz, src_inc, dst_inc; + uint_t kind, n; + + if ((src_type = ctf_type_resolve(src_fp, src_type)) == CTF_ERR) + return (CTF_ERR); + if ((dst_type = ctf_type_resolve(dst_fp, dst_type)) == CTF_ERR) + return (CTF_ERR); + + if ((src_tp = ctf_lookup_by_id(&src_fp, src_type)) == NULL) + return (CTF_ERR); + if ((dst_tp = ctf_lookup_by_id(&dst_fp, dst_type)) == NULL) + return (CTF_ERR); + + if ((kind = LCTF_INFO_KIND(src_fp, src_tp->ctt_info)) != + LCTF_INFO_KIND(dst_fp, dst_tp->ctt_info)) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + if (kind != CTF_K_STRUCT && kind != CTF_K_UNION) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + if ((n = LCTF_INFO_VLEN(src_fp, src_tp->ctt_info)) != + LCTF_INFO_VLEN(dst_fp, dst_tp->ctt_info)) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + + (void) ctf_get_ctt_size(src_fp, src_tp, &src_sz, &src_inc); + (void) ctf_get_ctt_size(dst_fp, dst_tp, &dst_sz, &dst_inc); + if (src_sz != dst_sz || src_inc != dst_inc) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + + if (src_sz < CTF_LSTRUCT_THRESH) { + const ctf_member_t *src_mp, *dst_mp; + + src_mp = (const ctf_member_t *)((uintptr_t)src_tp + src_inc); + dst_mp = (const ctf_member_t *)((uintptr_t)dst_tp + dst_inc); + for (; n != 0; n--, src_mp++, dst_mp++) { + if (src_mp->ctm_offset != dst_mp->ctm_offset) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + src_name = ctf_strptr(src_fp, src_mp->ctm_name); + dst_name = ctf_strptr(dst_fp, dst_mp->ctm_name); + if (strcmp(src_name, dst_name) != 0) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } + } else { + const ctf_lmember_t *src_mp, *dst_mp; + + src_mp = (const ctf_lmember_t *)((uintptr_t)src_tp + src_inc); + dst_mp = (const ctf_lmember_t *)((uintptr_t)dst_tp + dst_inc); + for (; n != 0; n--, src_mp++, dst_mp++) { + if (src_mp->ctlm_offsethi != dst_mp->ctlm_offsethi || + src_mp->ctlm_offsetlo != dst_mp->ctlm_offsetlo) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + src_name = ctf_strptr(src_fp, src_mp->ctlm_name); + dst_name = ctf_strptr(dst_fp, dst_mp->ctlm_name); + if (strcmp(src_name, dst_name) != 0) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + } + } + + return (0); +} + /* * The ctf_add_type routine is used to copy a type from a source CTF container * to a dynamic destination container. This routine operates recursively by @@ -1460,23 +1514,15 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type) ctf_dmdef_t *dmd; int errs = 0; - /* - * Technically to match a struct or union we need to check both - * ways (src members vs. dst, dst members vs. src) but we make - * this more optimal by only checking src vs. dst and comparing - * the total size of the structure (which we must do anyway) - * which covers the possibility of dst members not in src. - * This optimization can be defeated for unions, but is so - * pathological as to render it irrelevant for our purposes. - */ if (dst_type != CTF_ERR && dst_kind != CTF_K_FORWARD) { - if (ctf_type_size(src_fp, src_type) != - ctf_type_size(dst_fp, dst_type)) - return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); - - if (ctf_member_iter(src_fp, src_type, membcmp, &dst)) - return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); - + /* + * Compare the sizes and fields of the two types. + * The field comparisons only check the names and + * offsets, so this is not perfect but is good enough + * for scenarios that we care about. + */ + if (soucmp(src_fp, src_type, dst_fp, dst_type) != 0) + return (CTF_ERR); /* errno is set for us */ break; } From nobody Mon Oct 4 16:28:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 84E3E8D07F8; Mon, 4 Oct 2021 16:28: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 4HNR3l245Wz3MLQ; Mon, 4 Oct 2021 16:28:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 244571C738; Mon, 4 Oct 2021 16:28:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194GSYnE022981; Mon, 4 Oct 2021 16:28:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194GSYE3022980; Mon, 4 Oct 2021 16:28:34 GMT (envelope-from git) Date: Mon, 4 Oct 2021 16:28:34 GMT Message-Id: <202110041628.194GSYE3022980@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: 69f7649b7148 - main - gmultipath tests: Re-enable the failloop test in CI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69f7649b7148f9e1e331da8f4a9748c55a2b6ce3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=69f7649b7148f9e1e331da8f4a9748c55a2b6ce3 commit 69f7649b7148f9e1e331da8f4a9748c55a2b6ce3 Author: Mark Johnston AuthorDate: 2021-10-04 16:24:29 +0000 Commit: Mark Johnston CommitDate: 2021-10-04 16:28:27 +0000 gmultipath tests: Re-enable the failloop test in CI PR: 258763 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- tests/sys/geom/class/multipath/failloop.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/sys/geom/class/multipath/failloop.sh b/tests/sys/geom/class/multipath/failloop.sh index 48006d6b10da..0f0202bb8b01 100755 --- a/tests/sys/geom/class/multipath/failloop.sh +++ b/tests/sys/geom/class/multipath/failloop.sh @@ -36,10 +36,6 @@ failloop_head() } failloop_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/258763" - fi - sysctl -n kern.geom.notaste > kern.geom.notaste.txt load_gnop load_gmultipath From nobody Mon Oct 4 16:52:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 43AF08D507D; Mon, 4 Oct 2021 16:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNRbV1GgTz3RHq; Mon, 4 Oct 2021 16:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 014BF1C9F8; Mon, 4 Oct 2021 16:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194Gqbfo061655; Mon, 4 Oct 2021 16:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194Gqb7T061654; Mon, 4 Oct 2021 16:52:37 GMT (envelope-from git) Date: Mon, 4 Oct 2021 16:52:37 GMT Message-Id: <202110041652.194Gqb7T061654@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: d6dffbae9662 - main - lastcomm/sa: Remove sparc64 tests, they aren't needed. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: d6dffbae96621a6fbc804c5f31dff6648e0a122c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d6dffbae96621a6fbc804c5f31dff6648e0a122c commit d6dffbae96621a6fbc804c5f31dff6648e0a122c Author: Warner Losh AuthorDate: 2021-10-04 16:38:37 +0000 Commit: Warner Losh CommitDate: 2021-10-04 16:51:15 +0000 lastcomm/sa: Remove sparc64 tests, they aren't needed. These tests will run only on a sparc64 system, and so never run anymore. Sponsored by: Netflix --- usr.bin/lastcomm/tests/Makefile | 6 +---- usr.bin/lastcomm/tests/v1-sparc64-acct.in | Bin 1568 -> 0 bytes usr.bin/lastcomm/tests/v1-sparc64.out | 28 ----------------------- usr.bin/lastcomm/tests/v2-sparc64-acct.in | Bin 2592 -> 0 bytes usr.bin/lastcomm/tests/v2-sparc64.out | 36 ------------------------------ usr.sbin/sa/tests/Makefile | 10 +-------- usr.sbin/sa/tests/v1-sparc64-sav.in | Bin 16384 -> 0 bytes usr.sbin/sa/tests/v1-sparc64-sav.out | 5 ----- usr.sbin/sa/tests/v1-sparc64-u.out | 28 ----------------------- usr.sbin/sa/tests/v1-sparc64-usr.in | Bin 16384 -> 0 bytes usr.sbin/sa/tests/v1-sparc64-usr.out | 1 - usr.sbin/sa/tests/v2-sparc64-sav.in | Bin 16384 -> 0 bytes usr.sbin/sa/tests/v2-sparc64-u.out | 36 ------------------------------ usr.sbin/sa/tests/v2-sparc64-usr.in | Bin 16384 -> 0 bytes 14 files changed, 2 insertions(+), 148 deletions(-) diff --git a/usr.bin/lastcomm/tests/Makefile b/usr.bin/lastcomm/tests/Makefile index 9a38743c903b..db6aec3b69fa 100644 --- a/usr.bin/lastcomm/tests/Makefile +++ b/usr.bin/lastcomm/tests/Makefile @@ -3,19 +3,15 @@ PACKAGE= tests TAP_TESTS_SH= legacy_test -TEST_METADATA.legacy_test+= allowed_architectures="amd64 i386 sparc64" +TEST_METADATA.legacy_test+= allowed_architectures="amd64 i386" ${PACKAGE}FILES+= v1-amd64-acct.in ${PACKAGE}FILES+= v1-amd64.out ${PACKAGE}FILES+= v1-i386-acct.in ${PACKAGE}FILES+= v1-i386.out -${PACKAGE}FILES+= v1-sparc64-acct.in -${PACKAGE}FILES+= v1-sparc64.out ${PACKAGE}FILES+= v2-amd64-acct.in ${PACKAGE}FILES+= v2-amd64.out ${PACKAGE}FILES+= v2-i386-acct.in ${PACKAGE}FILES+= v2-i386.out -${PACKAGE}FILES+= v2-sparc64-acct.in -${PACKAGE}FILES+= v2-sparc64.out .include diff --git a/usr.bin/lastcomm/tests/v1-sparc64-acct.in b/usr.bin/lastcomm/tests/v1-sparc64-acct.in deleted file mode 100644 index 00f05b423fc5..000000000000 Binary files a/usr.bin/lastcomm/tests/v1-sparc64-acct.in and /dev/null differ diff --git a/usr.bin/lastcomm/tests/v1-sparc64.out b/usr.bin/lastcomm/tests/v1-sparc64.out deleted file mode 100644 index d33ae719fb53..000000000000 --- a/usr.bin/lastcomm/tests/v1-sparc64.out +++ /dev/null @@ -1,28 +0,0 @@ -core -FDX root 0.000 secs 0.000 us 0.000 sy 0.031 es Wed May 16 12:16 -core -DX root 0.031 secs 0.000 us 0.031 sy 0.047 es Wed May 16 12:16 -cc - root 0.016 secs 0.000 us 0.016 sy 0.859 es Wed May 16 12:16 -ld - root 0.094 secs 0.047 us 0.047 sy 0.266 es Wed May 16 12:16 -as - root 0.016 secs 0.000 us 0.016 sy 0.094 es Wed May 16 12:16 -cc1 - root 0.094 secs 0.047 us 0.047 sy 0.375 es Wed May 16 12:16 -time - root 0.016 secs 0.000 us 0.016 sy 0.047 es Wed May 16 12:16 -1234567890123456 - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 12:16 -ln - root 0.016 secs 0.000 us 0.016 sy 0.016 es Wed May 16 12:16 -time - root 0.016 secs 0.000 us 0.016 sy 0.047 es Wed May 16 12:16 -1234567890123456 - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 12:16 -ln - root 0.016 secs 0.000 us 0.016 sy 0.016 es Wed May 16 12:16 -time - root 0.016 secs 0.000 us 0.016 sy 0.047 es Wed May 16 12:16 -123456789012345 - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 12:16 -ln - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 12:16 -time - root 0.016 secs 0.000 us 0.016 sy 1.703 es Wed May 16 12:16 -diff - root 1.641 secs 1.344 us 0.297 sy 1.672 es Wed May 16 12:16 -time - root 0.016 secs 0.000 us 0.016 sy 0.625 es Wed May 16 12:16 -dd - root 0.562 secs 0.000 us 0.562 sy 0.594 es Wed May 16 12:16 -time - root 0.016 secs 0.000 us 0.016 sy 3.047 es Wed May 16 12:16 -sleep - root 0.000 secs 0.000 us 0.000 sy 3.016 es Wed May 16 12:16 -time - root 0.016 secs 0.000 us 0.016 sy 17.219 es Wed May 16 12:16 -find - root 5.516 secs 0.562 us 4.953 sy 17.188 es Wed May 16 12:16 -time - root 0.016 secs 0.000 us 0.016 sy 30.031 es Wed May 16 12:15 -egrep - root 29.750 secs 29.688 us 0.062 sy 30.000 es Wed May 16 12:15 -time - root 0.016 secs 0.000 us 0.016 sy 1.688 es Wed May 16 12:15 -awk - root 1.609 secs 1.594 us 0.016 sy 1.641 es Wed May 16 12:15 -accton - root 0.016 secs 0.000 us 0.016 sy 0.031 es Wed May 16 12:15 diff --git a/usr.bin/lastcomm/tests/v2-sparc64-acct.in b/usr.bin/lastcomm/tests/v2-sparc64-acct.in deleted file mode 100644 index 26df19e8b5e6..000000000000 Binary files a/usr.bin/lastcomm/tests/v2-sparc64-acct.in and /dev/null differ diff --git a/usr.bin/lastcomm/tests/v2-sparc64.out b/usr.bin/lastcomm/tests/v2-sparc64.out deleted file mode 100644 index f693e8efd9ff..000000000000 --- a/usr.bin/lastcomm/tests/v2-sparc64.out +++ /dev/null @@ -1,36 +0,0 @@ -core -FDX root 0.010 secs 0.000 us 0.010 sy 0.042 es Sat May 19 09:17 -core -DX root 0.037 secs 0.001 us 0.036 sy 0.055 es Sat May 19 09:17 -cc - root 0.033 secs 0.002 us 0.031 sy 1.012 es Sat May 19 09:17 -ld - root 0.186 secs 0.115 us 0.071 sy 0.361 es Sat May 19 09:17 -as - root 0.030 secs 0.005 us 0.025 sy 0.126 es Sat May 19 09:17 -cc1 - root 0.105 secs 0.048 us 0.057 sy 0.417 es Sat May 19 09:17 -time - root 0.029 secs 0.001 us 0.028 sy 0.047 es Sat May 19 09:17 -1234567890123456 - root 0.017 secs 0.003 us 0.014 sy 0.019 es Sat May 19 09:17 -ln - root 0.019 secs 0.003 us 0.016 sy 0.020 es Sat May 19 09:17 -time - root 0.029 secs 0.003 us 0.025 sy 0.047 es Sat May 19 09:17 -1234567890123456 - root 0.017 secs 0.002 us 0.015 sy 0.019 es Sat May 19 09:17 -ln - root 0.019 secs 0.004 us 0.015 sy 0.020 es Sat May 19 09:17 -time - root 0.029 secs 0.004 us 0.025 sy 0.053 es Sat May 19 09:17 -123456789012345 - root 0.018 secs 0.001 us 0.016 sy 0.025 es Sat May 19 09:17 -ln - root 0.020 secs 0.001 us 0.019 sy 0.020 es Sat May 19 09:17 -time - root 0.029 secs 0.003 us 0.026 sy 1.702 es Sat May 19 09:17 -diff - root 1.636 secs 1.337 us 0.299 sy 1.674 es Sat May 19 09:17 -time - root 0.027 secs 0.002 us 0.026 sy 0.634 es Sat May 19 09:17 -dd - root 0.588 secs 0.017 us 0.571 sy 0.605 es Sat May 19 09:17 -time - root 0.028 secs 0.001 us 0.027 sy 3.049 es Sat May 19 09:17 -sleep - root 0.018 secs 0.002 us 0.016 sy 3.021 es Sat May 19 09:17 -time - root 0.029 secs 0.002 us 0.027 sy 17.970 es Sat May 19 09:17 -find - root 5.703 secs 0.555 us 5.148 sy 17.942 es Sat May 19 09:17 -time - root 0.029 secs 0.005 us 0.024 sy 27.162 es Sat May 19 09:16 -egrep - root 26.715 secs 26.632 us 0.082 sy 27.133 es Sat May 19 09:16 -logger - root 0.023 secs 0.005 us 0.018 sy 60.808 es Sat May 19 09:15 -sh -F root 0.008 secs 0.000 us 0.008 sy 60.815 es Sat May 19 09:15 -fsck - root 0.055 secs 0.008 us 0.047 sy 60.806 es Sat May 19 09:15 -fsck_ufs - root 0.028 secs 0.005 us 0.022 sy 0.140 es Sat May 19 09:16 -fsck_ufs - root 0.028 secs 0.006 us 0.022 sy 0.123 es Sat May 19 09:16 -fsck_ufs - root 0.028 secs 0.004 us 0.024 sy 0.058 es Sat May 19 09:16 -fsck_ufs - root 0.032 secs 0.004 us 0.028 sy 0.326 es Sat May 19 09:16 -sleep - root 0.019 secs 0.001 us 0.018 sy 60.085 es Sat May 19 09:15 -time - root 0.029 secs 0.005 us 0.025 sy 1.701 es Sat May 19 09:16 -awk - root 1.644 secs 1.617 us 0.028 sy 1.657 es Sat May 19 09:16 -accton - root 0.019 secs 0.003 us 0.016 sy 0.027 es Sat May 19 09:16 diff --git a/usr.sbin/sa/tests/Makefile b/usr.sbin/sa/tests/Makefile index 06fcd38a2769..ed2318417842 100644 --- a/usr.sbin/sa/tests/Makefile +++ b/usr.sbin/sa/tests/Makefile @@ -3,7 +3,7 @@ PACKAGE= tests TAP_TESTS_SH= legacy_test -TEST_METADATA.legacy_test+= allowed_architectures="amd64 i386 sparc64" +TEST_METADATA.legacy_test+= allowed_architectures="amd64 i386" ${PACKAGE}FILES+= v1-amd64-sav.in ${PACKAGE}FILES+= v1-amd64-sav.out @@ -15,19 +15,11 @@ ${PACKAGE}FILES+= v1-i386-sav.out ${PACKAGE}FILES+= v1-i386-u.out ${PACKAGE}FILES+= v1-i386-usr.in ${PACKAGE}FILES+= v1-i386-usr.out -${PACKAGE}FILES+= v1-sparc64-sav.in -${PACKAGE}FILES+= v1-sparc64-sav.out -${PACKAGE}FILES+= v1-sparc64-u.out -${PACKAGE}FILES+= v1-sparc64-usr.in -${PACKAGE}FILES+= v1-sparc64-usr.out ${PACKAGE}FILES+= v2-amd64-sav.in ${PACKAGE}FILES+= v2-amd64-u.out ${PACKAGE}FILES+= v2-amd64-usr.in ${PACKAGE}FILES+= v2-i386-sav.in ${PACKAGE}FILES+= v2-i386-u.out ${PACKAGE}FILES+= v2-i386-usr.in -${PACKAGE}FILES+= v2-sparc64-sav.in -${PACKAGE}FILES+= v2-sparc64-u.out -${PACKAGE}FILES+= v2-sparc64-usr.in .include diff --git a/usr.sbin/sa/tests/v1-sparc64-sav.in b/usr.sbin/sa/tests/v1-sparc64-sav.in deleted file mode 100644 index d6911cf946bd..000000000000 Binary files a/usr.sbin/sa/tests/v1-sparc64-sav.in and /dev/null differ diff --git a/usr.sbin/sa/tests/v1-sparc64-sav.out b/usr.sbin/sa/tests/v1-sparc64-sav.out deleted file mode 100644 index 1905420793e4..000000000000 --- a/usr.sbin/sa/tests/v1-sparc64-sav.out +++ /dev/null @@ -1,5 +0,0 @@ - 28 1.839re 0.66cp 161avio 252k - 14 0.930re 0.66cp 322avio 197k ***other - 9 0.908re 0.00cp 0avio 10190k time - 3 0.001re 0.00cp 0avio 16256k ln - 2 0.001re 0.00cp 0avio 27900k 1234567890123456 diff --git a/usr.sbin/sa/tests/v1-sparc64-u.out b/usr.sbin/sa/tests/v1-sparc64-u.out deleted file mode 100644 index d0ecb51b9de7..000000000000 --- a/usr.sbin/sa/tests/v1-sparc64-u.out +++ /dev/null @@ -1,28 +0,0 @@ - 0 0.016 cpu 162k mem 0 io accton - 0 1.609 cpu 273k mem 0 io awk - 0 0.016 cpu 174k mem 0 io time - 0 29.750 cpu 233k mem 26 io egrep - 0 0.016 cpu 161k mem 0 io time - 0 5.516 cpu 184k mem 4437 io find - 0 0.016 cpu 156k mem 0 io time - 0 0.000 cpu 136k mem 0 io sleep - 0 0.016 cpu 152k mem 0 io time - 0 0.562 cpu 161k mem 16 io dd - 0 0.016 cpu 156k mem 0 io time - 0 1.641 cpu 193k mem 0 io diff - 0 0.016 cpu 156k mem 0 io time - 0 0.000 cpu 169k mem 0 io ln - 0 0.000 cpu 144k mem 0 io 123456789012345 - 0 0.016 cpu 166k mem 0 io time - 0 0.016 cpu 170k mem 0 io ln - 0 0.000 cpu 144k mem 0 io 1234567890123456 - 0 0.016 cpu 156k mem 0 io time - 0 0.016 cpu 169k mem 0 io ln - 0 0.000 cpu 135k mem 0 io 1234567890123456 - 0 0.016 cpu 156k mem 0 io time - 0 0.094 cpu 3462k mem 2 io cc1 - 0 0.016 cpu 1047k mem 1 io as - 0 0.094 cpu 1118k mem 10 io ld - 0 0.016 cpu 361k mem 5 io cc - 0 0.031 cpu 165k mem 7 io core - 0 0.000 cpu 112k mem 4 io core* diff --git a/usr.sbin/sa/tests/v1-sparc64-usr.in b/usr.sbin/sa/tests/v1-sparc64-usr.in deleted file mode 100644 index 08d795b90dd4..000000000000 Binary files a/usr.sbin/sa/tests/v1-sparc64-usr.in and /dev/null differ diff --git a/usr.sbin/sa/tests/v1-sparc64-usr.out b/usr.sbin/sa/tests/v1-sparc64-usr.out deleted file mode 100644 index cab001f1b531..000000000000 --- a/usr.sbin/sa/tests/v1-sparc64-usr.out +++ /dev/null @@ -1 +0,0 @@ -root 28 0.66cpu 4508tio 9971k*sec diff --git a/usr.sbin/sa/tests/v2-sparc64-sav.in b/usr.sbin/sa/tests/v2-sparc64-sav.in deleted file mode 100644 index b6d836a59e06..000000000000 Binary files a/usr.sbin/sa/tests/v2-sparc64-sav.in and /dev/null differ diff --git a/usr.sbin/sa/tests/v2-sparc64-u.out b/usr.sbin/sa/tests/v2-sparc64-u.out deleted file mode 100644 index 9339238ef449..000000000000 --- a/usr.sbin/sa/tests/v2-sparc64-u.out +++ /dev/null @@ -1,36 +0,0 @@ - 0 0.019 cpu 163k mem 0 io accton - 0 1.644 cpu 272k mem 0 io awk - 0 0.029 cpu 175k mem 0 io time - 0 0.019 cpu 163k mem 0 io sleep - 0 0.032 cpu 214k mem 35 io fsck_ufs - 0 0.028 cpu 213k mem 10 io fsck_ufs - 0 0.028 cpu 189k mem 8 io fsck_ufs - 0 0.028 cpu 196k mem 7 io fsck_ufs - 0 0.055 cpu 168k mem 0 io fsck - 0 0.008 cpu 204k mem 0 io sh* - 0 0.023 cpu 179k mem 0 io logger - 0 26.715 cpu 233k mem 25 io egrep - 0 0.029 cpu 162k mem 0 io time - 0 5.703 cpu 184k mem 4444 io find - 0 0.029 cpu 166k mem 0 io time - 0 0.018 cpu 136k mem 0 io sleep - 0 0.028 cpu 157k mem 0 io time - 0 0.588 cpu 160k mem 16 io dd - 0 0.027 cpu 162k mem 0 io time - 0 1.636 cpu 193k mem 0 io diff - 0 0.029 cpu 172k mem 0 io time - 0 0.020 cpu 170k mem 0 io ln - 0 0.018 cpu 135k mem 0 io 123456789012345 - 0 0.029 cpu 167k mem 0 io time - 0 0.019 cpu 163k mem 0 io ln - 0 0.017 cpu 135k mem 0 io 1234567890123456 - 0 0.029 cpu 157k mem 0 io time - 0 0.019 cpu 163k mem 0 io ln - 0 0.017 cpu 135k mem 0 io 1234567890123456 - 0 0.029 cpu 162k mem 0 io time - 0 0.105 cpu 3358k mem 2 io cc1 - 0 0.030 cpu 996k mem 1 io as - 0 0.186 cpu 1114k mem 11 io ld - 0 0.033 cpu 386k mem 6 io cc - 0 0.037 cpu 158k mem 12 io core - 0 0.010 cpu 129k mem 7 io core* diff --git a/usr.sbin/sa/tests/v2-sparc64-usr.in b/usr.sbin/sa/tests/v2-sparc64-usr.in deleted file mode 100644 index 01a1bdc04333..000000000000 Binary files a/usr.sbin/sa/tests/v2-sparc64-usr.in and /dev/null differ From nobody Mon Oct 4 17:46:59 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BF19D10FD17E; Mon, 4 Oct 2021 17:46: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 4HNSpC4FXRz3pgZ; Mon, 4 Oct 2021 17:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6449C1D07B; Mon, 4 Oct 2021 17:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194Hkxrt029860; Mon, 4 Oct 2021 17:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194Hkxrn029859; Mon, 4 Oct 2021 17:46:59 GMT (envelope-from git) Date: Mon, 4 Oct 2021 17:46:59 GMT Message-Id: <202110041746.194Hkxrn029859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: David Bright Subject: git: d18c9a919795 - main - RPCBIND: skip ipv6 link local when request is not from link local address List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d18c9a91979543adc182c7b28819691b64fda388 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=d18c9a91979543adc182c7b28819691b64fda388 commit d18c9a91979543adc182c7b28819691b64fda388 Author: David Bright AuthorDate: 2021-10-04 15:43:41 +0000 Commit: David Bright CommitDate: 2021-10-04 17:45:26 +0000 RPCBIND: skip ipv6 link local when request is not from link local address RPCINFO on macOS behaves different compared to other linux clients and doesn't provide request address in rpcb structure of the RPCBPROC_GETADDRLIST call which doesn't seem to be forbidden. In this case RPCBIND uses RPC call's source address and picks a closest corresponding local address. If there are no addresses in the same subnet as the source address, return of RPCBIND may vary depending on the order of addresses returned in getifaddrs. If a link local precedes global address it may be returned even if the request comes from neither a link local nor from link local in a different scope, which will prevent services like nfs from working in tpc6 scenario on macOS clients. Issue can be seen only on FreeBSD rpcbind port due to changes in workflow of addrmerge call. Submitted by: Dmitry Ovsyannikov (Dmitry.Ovsyannikov@dell.com) Reviewers: dab Differential Revision: https://reviews.freebsd.org/D31491 Sponsored by: Dell EMC MFC to: stable/12, stable/13 MFC after: 1 week --- usr.sbin/rpcbind/tests/addrmerge_test.c | 34 +++++++++++++++++++++++++++++++++ usr.sbin/rpcbind/util.c | 12 +++++++----- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/usr.sbin/rpcbind/tests/addrmerge_test.c b/usr.sbin/rpcbind/tests/addrmerge_test.c index e1600f1a4837..a29dc30fdde8 100644 --- a/usr.sbin/rpcbind/tests/addrmerge_test.c +++ b/usr.sbin/rpcbind/tests/addrmerge_test.c @@ -257,6 +257,22 @@ mock_tun0(void) IFF_UP | IFF_RUNNING | IFF_POINTOPOINT | IFF_MULTICAST, 0, false); } +static void +mock_mlxen0(void) +{ + mock_ifaddr4("mlxen0", "192.0.3.1", "255.255.255.128", "192.0.3.127", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + false); + /* Setting link local address before ipv6 address*/ + mock_ifaddr6("mlxen0", "fe80::4", "ffff:ffff:ffff:ffff::", + "fe80::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 3, false); + mock_ifaddr6("mlxen0", "2001:db8::7", "ffff:ffff:ffff:ffff::", + "2001:db8::ffff:ffff:ffff:ffff", + IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_SIMPLEX | IFF_MULTICAST, + 0, false); +} /* Stub rpcbind functions */ int @@ -835,6 +851,23 @@ ATF_TC_BODY(addrmerge_recvdstaddr6_rev, tc) ATF_CHECK_STREQ("2001:db8::2.3.46", maddr); free(maddr); } + +ATF_TC_WITHOUT_HEAD(addrmerge_ipv6_other_subnet); +ATF_TC_BODY(addrmerge_ipv6_other_subnet, tc) +{ + char *maddr; + + /* getifaddrs will return link local before normal ipv6 */ + mock_lo0(); + mock_mlxen0(); + + maddr = do_addrmerge6("2001:db8:1::1.3.46"); + + /* We must return the closest ipv6 address*/ + ATF_REQUIRE(maddr != NULL); + ATF_CHECK_STREQ("2001:db8::7.3.46", maddr); + free(maddr); +} #endif /* INET6 */ @@ -864,6 +897,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, addrmerge_ipv6_linklocal_rev); ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr6); ATF_TP_ADD_TC(tp, addrmerge_recvdstaddr6_rev); + ATF_TP_ADD_TC(tp, addrmerge_ipv6_other_subnet); #endif return (atf_no_error()); diff --git a/usr.sbin/rpcbind/util.c b/usr.sbin/rpcbind/util.c index 455578b657fb..e497e9227690 100644 --- a/usr.sbin/rpcbind/util.c +++ b/usr.sbin/rpcbind/util.c @@ -229,17 +229,19 @@ addrmerge(struct netbuf *caller, const char *serv_uaddr, const char *clnt_uaddr, * a link-local address then use the scope id to see * which one. */ - if (IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(ifsa)) && - IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(caller_sa)) && - IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(hint_sa))) { - if (SA2SIN6(ifsa)->sin6_scope_id == - SA2SIN6(caller_sa)->sin6_scope_id) { + if (IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(ifsa))) { + if (IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(caller_sa)) && + IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(hint_sa)) && + (SA2SIN6(ifsa)->sin6_scope_id == + SA2SIN6(caller_sa)->sin6_scope_id)) { const int goodness = 3; if (bestif_goodness < goodness) { bestif = ifap; bestif_goodness = goodness; } + } else { + continue; } } } From nobody Mon Oct 4 20:15:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 69E6F12D7EC1; Mon, 4 Oct 2021 20:15: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 4HNX552Dh4z4fCy; Mon, 4 Oct 2021 20:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C7931F4E3; Mon, 4 Oct 2021 20:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194KF5ir032048; Mon, 4 Oct 2021 20:15:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194KF5ld032047; Mon, 4 Oct 2021 20:15:05 GMT (envelope-from git) Date: Mon, 4 Oct 2021 20:15:05 GMT Message-Id: <202110042015.194KF5ld032047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: d6c323eda215 - main - Remove files that were checked in with wrong .gitattributes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6c323eda215d05091f56d02a8274eb50c244a6f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=d6c323eda215d05091f56d02a8274eb50c244a6f commit d6c323eda215d05091f56d02a8274eb50c244a6f Author: Stefan Eßer AuthorDate: 2021-07-28 13:31:57 +0000 Commit: Stefan Eßer CommitDate: 2021-10-04 20:10:32 +0000 Remove files that were checked in with wrong .gitattributes These files will be added back in updated form, but are only relevant for the Windows platform, anyway. --- contrib/bc/bc.vcxproj | 278 ----------------------------------------- contrib/bc/bc.vcxproj.filters | 182 --------------------------- contrib/bc/bcl.vcxproj | 161 ------------------------ contrib/bc/bcl.vcxproj.filters | 96 -------------- 4 files changed, 717 deletions(-) diff --git a/contrib/bc/bc.vcxproj b/contrib/bc/bc.vcxproj deleted file mode 100644 index 8d4f34a2a0e6..000000000000 --- a/contrib/bc/bc.vcxproj +++ /dev/null @@ -1,278 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {D5086CFE-052C-4742-B005-E05DB983BBA2} - Win32Proj - - - - Application - true - v142 - - - Application - false - v142 - - - Application - true - v142 - - - Application - false - v142 - - - - - - - - - - - - - - - - - - - - - Building strgen - CL /Fo:$(Configuration)\$(Platform)\$(ProjectName)\ /Fe:$(Configuration)\$(Platform)\$(ProjectName)\strgen.exe gen\strgen.c - gen\strgen.c - $(Configuration)\$(Platform)\$(ProjectName)\strgen.exe - - - Generating $(Configuration)\$(Platform)\$(ProjectName)/lib.c - START $(Configuration)\$(Platform)\$(ProjectName)/strgen gen\lib.bc $(Configuration)\$(Platform)\$(ProjectName)/lib.c bc_lib bc_lib_name BC_ENABLED 1 - $(Configuration)\$(Platform)\$(ProjectName)\strgen.exe;gen\lib.bc - $(Configuration)\$(Platform)\$(ProjectName)\lib.c - - - Generating $(Configuration)\$(Platform)\$(ProjectName)/lib2.c - START $(Configuration)\$(Platform)\$(ProjectName)/strgen gen\lib2.bc $(Configuration)\$(Platform)\$(ProjectName)/lib2.c bc_lib2 bc_lib2_name BC_ENABLED 1 - $(Configuration)\$(Platform)\$(ProjectName)\strgen.exe;gen\lib2.bc - $(Configuration)\$(Platform)\$(ProjectName)\lib2.c - - - Generating $(Configuration)\$(Platform)\$(ProjectName)/bc_help.c - START $(Configuration)\$(Platform)\$(ProjectName)/strgen gen\bc_help.txt $(Configuration)\$(Platform)\$(ProjectName)\bc_help.c bc_help "" BC_ENABLED - $(Configuration)\$(Platform)\$(ProjectName)\strgen.exe;gen\bc_help.txt - $(Configuration)\$(Platform)\$(ProjectName)\bc_help.c - - - Generating $(Configuration)\$(Platform)\$(ProjectName)/dc_help.c - START $(Configuration)\$(Platform)\$(ProjectName)/strgen gen\dc_help.txt $(Configuration)\$(Platform)\$(ProjectName)\dc_help.c dc_help "" DC_ENABLED - $(Configuration)\$(Platform)\$(ProjectName)\strgen.exe;gen\dc_help.txt - $(Configuration)\$(Platform)\$(ProjectName)\dc_help.c - - - - ClCompile - - - - true - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - - - false - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - - - false - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=1;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=N;BC_DEFAULT_BANNER=1;BC_DEFAULT_SIGINT_RESET=0;DC_DEFAULT_SIGINT_RESET=0;BC_DEFAULT_TTY_MODE=1;DC_DEFAULT_TTY_MODE=1;BC_DEFAULT_PROMPT=1;DC_DEFAULT_PROMPT=1 - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - false - /W3 %(AdditionalOptions) - - - MachineX86 - DebugFastLink - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=1;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=N;BC_DEFAULT_BANNER=1;BC_DEFAULT_SIGINT_RESET=0;DC_DEFAULT_SIGINT_RESET=0;BC_DEFAULT_TTY_MODE=1;DC_DEFAULT_TTY_MODE=1;BC_DEFAULT_PROMPT=1;DC_DEFAULT_PROMPT=1 - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - false - /W3 %(AdditionalOptions) - - - MachineX86 - false - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - true - true - - - copy /b "$(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=1;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=N;BC_DEFAULT_BANNER=1;BC_DEFAULT_SIGINT_RESET=0;DC_DEFAULT_SIGINT_RESET=0;BC_DEFAULT_TTY_MODE=1;DC_DEFAULT_TTY_MODE=1;BC_DEFAULT_PROMPT=1;DC_DEFAULT_PROMPT=1 - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - false - /W3 %(AdditionalOptions) - - - MachineX64 - true - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=1;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=N;BC_DEFAULT_BANNER=1;BC_DEFAULT_SIGINT_RESET=0;DC_DEFAULT_SIGINT_RESET=0;BC_DEFAULT_TTY_MODE=1;DC_DEFAULT_TTY_MODE=1;BC_DEFAULT_PROMPT=1;DC_DEFAULT_PROMPT=1 - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - false - /W3 %(AdditionalOptions) - Default - - - MachineX64 - DebugFastLink - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/contrib/bc/bc.vcxproj.filters b/contrib/bc/bc.vcxproj.filters deleted file mode 100644 index 141ecb808d08..000000000000 --- a/contrib/bc/bc.vcxproj.filters +++ /dev/null @@ -1,182 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - - - - - - - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/contrib/bc/bcl.vcxproj b/contrib/bc/bcl.vcxproj deleted file mode 100644 index c1031045e34a..000000000000 --- a/contrib/bc/bcl.vcxproj +++ /dev/null @@ -1,161 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {D2CC3DCF-7919-4DEF-839D-E9B897EC3E8E} - Win32Proj - 10.0 - - - - StaticLibrary - true - v142 - - - StaticLibrary - false - v142 - - - StaticLibrary - true - v142 - - - StaticLibrary - false - v142 - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(Platform)\$(ProjectName)\ - - - - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - $(SolutionDir)\include - - - MachineX86 - true - Windows - - - - - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 - MultiThreadedDLL - Level3 - ProgramDatabase - $(SolutionDir)\include - - - MachineX86 - true - Windows - true - true - - - - - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 - $(SolutionDir)\include - - - - - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 - $(SolutionDir)\include - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/contrib/bc/bcl.vcxproj.filters b/contrib/bc/bcl.vcxproj.filters deleted file mode 100644 index f75e0331cc88..000000000000 --- a/contrib/bc/bcl.vcxproj.filters +++ /dev/null @@ -1,96 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file From nobody Mon Oct 4 20:15:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8A67B12D7F46; Mon, 4 Oct 2021 20:15: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 4HNX56309sz4f07; Mon, 4 Oct 2021 20:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47CA81F454; Mon, 4 Oct 2021 20:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194KF6Ee032076; Mon, 4 Oct 2021 20:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194KF6pt032075; Mon, 4 Oct 2021 20:15:06 GMT (envelope-from git) Date: Mon, 4 Oct 2021 20:15:06 GMT Message-Id: <202110042015.194KF6pt032075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: ded0d3d486eb - main - Add back Windows only VCXProj files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ded0d3d486eba766f613070de0ed12029a9a3816 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=ded0d3d486eba766f613070de0ed12029a9a3816 commit ded0d3d486eba766f613070de0ed12029a9a3816 Author: Stefan Eßer AuthorDate: 2021-07-28 13:35:16 +0000 Commit: Stefan Eßer CommitDate: 2021-10-04 20:10:52 +0000 Add back Windows only VCXProj files --- bc.vcxproj | 278 ++++++++++++++++++++++++++++++++++++++++++++++++++++ bc.vcxproj.filters | 182 ++++++++++++++++++++++++++++++++++ bcl.vcxproj | 161 ++++++++++++++++++++++++++++++ bcl.vcxproj.filters | 96 ++++++++++++++++++ 4 files changed, 717 insertions(+) diff --git a/bc.vcxproj b/bc.vcxproj new file mode 100644 index 000000000000..2dbbd558618f --- /dev/null +++ b/bc.vcxproj @@ -0,0 +1,278 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {D5086CFE-052C-4742-B005-E05DB983BBA2} + Win32Proj + + + + Application + true + v142 + + + Application + false + v142 + + + Application + true + v142 + + + Application + false + v142 + + + + + + + + + + + + + + + + + + + + + Building strgen + CL /Fo:$(Configuration)\$(ProjectName)\ /Fe:$(Configuration)\$(ProjectName)\strgen.exe gen\strgen.c + gen\strgen.c + $(Configuration)\$(ProjectName)\strgen.exe + + + Generating $(Configuration)\$(ProjectName)/lib.c + START $(Configuration)\$(ProjectName)/strgen gen\lib.bc $(Configuration)\$(ProjectName)/lib.c bc_lib bc_lib_name BC_ENABLED 1 + $(Configuration)\$(ProjectName)\strgen.exe;gen\lib.bc + $(Configuration)\$(ProjectName)\lib.c + + + Generating $(Configuration)\$(ProjectName)/lib2.c + START $(Configuration)\$(ProjectName)/strgen gen\lib2.bc $(Configuration)\$(ProjectName)/lib2.c bc_lib2 bc_lib2_name BC_ENABLED 1 + $(Configuration)\$(ProjectName)\strgen.exe;gen\lib2.bc + $(Configuration)\$(ProjectName)\lib2.c + + + Generating $(Configuration)\$(ProjectName)/bc_help.c + START $(Configuration)\$(ProjectName)/strgen gen\bc_help.txt $(Configuration)\$(ProjectName)\bc_help.c bc_help "" BC_ENABLED + $(Configuration)\$(ProjectName)\strgen.exe;gen\bc_help.txt + $(Configuration)\$(ProjectName)\bc_help.c + + + Generating $(Configuration)\$(ProjectName)/dc_help.c + START $(Configuration)\$(ProjectName)/strgen gen\dc_help.txt $(Configuration)\$(ProjectName)\dc_help.c dc_help "" DC_ENABLED + $(Configuration)\$(ProjectName)\strgen.exe;gen\dc_help.txt + $(Configuration)\$(ProjectName)\dc_help.c + + + + ClCompile + + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + false + /W3 %(AdditionalOptions) + + + MachineX86 + true + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + MaxSpeed + false + /W3 %(AdditionalOptions) + + + MachineX86 + false + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + true + true + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + false + /W3 %(AdditionalOptions) + + + MachineX64 + true + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + MaxSpeed + false + /W3 %(AdditionalOptions) + Default + + + MachineX64 + false + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bc.vcxproj.filters b/bc.vcxproj.filters new file mode 100644 index 000000000000..141ecb808d08 --- /dev/null +++ b/bc.vcxproj.filters @@ -0,0 +1,182 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + + + + + + + + + + + Resource Files + + + Resource Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/bcl.vcxproj b/bcl.vcxproj new file mode 100644 index 000000000000..3b79c8b9ef64 --- /dev/null +++ b/bcl.vcxproj @@ -0,0 +1,161 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {D2CC3DCF-7919-4DEF-839D-E9B897EC3E8E} + Win32Proj + 10.0 + + + + StaticLibrary + true + v142 + + + StaticLibrary + false + v142 + + + StaticLibrary + true + v142 + + + StaticLibrary + false + v142 + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + $(SolutionDir)\include + + + MachineX86 + true + Windows + + + + + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 + MultiThreadedDLL + Level3 + ProgramDatabase + $(SolutionDir)\include + + + MachineX86 + true + Windows + true + true + + + + + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 + $(SolutionDir)\include + + + + + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 + $(SolutionDir)\include + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bcl.vcxproj.filters b/bcl.vcxproj.filters new file mode 100644 index 000000000000..f75e0331cc88 --- /dev/null +++ b/bcl.vcxproj.filters @@ -0,0 +1,96 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file From nobody Mon Oct 4 20:15:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D458F10F80BD; Mon, 4 Oct 2021 20:15: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 4HNX574kLMz4f7L; Mon, 4 Oct 2021 20:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D7B31F5D6; Mon, 4 Oct 2021 20:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194KF7s0032104; Mon, 4 Oct 2021 20:15:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194KF7Rf032103; Mon, 4 Oct 2021 20:15:07 GMT (envelope-from git) Date: Mon, 4 Oct 2021 20:15:07 GMT Message-Id: <202110042015.194KF7Rf032103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: b8d895faf47a - main - contrib/bc: re-enable tests after the import of version 5.1.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: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8d895faf47afb8f3b31055e2ec2db8d0df5db23 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=b8d895faf47afb8f3b31055e2ec2db8d0df5db23 commit b8d895faf47afb8f3b31055e2ec2db8d0df5db23 Author: Stefan Eßer AuthorDate: 2021-10-04 19:43:52 +0000 Commit: Stefan Eßer CommitDate: 2021-10-04 20:14:27 +0000 contrib/bc: re-enable tests after the import of version 5.1.0 The tests have been fixed to not write any data outside of the temporary work directory provided by the test framework. MFC after: 3 days --- usr.bin/gh-bc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/gh-bc/Makefile b/usr.bin/gh-bc/Makefile index e6e2f45aca73..e5f68b704d79 100644 --- a/usr.bin/gh-bc/Makefile +++ b/usr.bin/gh-bc/Makefile @@ -67,8 +67,8 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif -#HAS_TESTS= -#SUBDIR.${MK_TESTS}+= tests +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} From nobody Mon Oct 4 20:26:43 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B9C4910FA297; Mon, 4 Oct 2021 20:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNXLW4tncz4glV; Mon, 4 Oct 2021 20:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8831F1F93E; Mon, 4 Oct 2021 20:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194KQhaZ045329; Mon, 4 Oct 2021 20:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194KQhPQ045328; Mon, 4 Oct 2021 20:26:43 GMT (envelope-from git) Date: Mon, 4 Oct 2021 20:26:43 GMT Message-Id: <202110042026.194KQhPQ045328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: d43fa8ef534a - main - contrib/bc: merge version 5.1.0 from vendor branch List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d43fa8ef534ac87a16843d45264f56cf11e0fcbc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=d43fa8ef534ac87a16843d45264f56cf11e0fcbc commit d43fa8ef534ac87a16843d45264f56cf11e0fcbc Merge: b8d895faf47a 5d58a5157172 Author: Stefan Eßer AuthorDate: 2021-10-04 20:25:24 +0000 Commit: Stefan Eßer CommitDate: 2021-10-04 20:25:24 +0000 contrib/bc: merge version 5.1.0 from vendor branch This version adds options and functions that allow to print numbers in the open interval (-1 .. 1) with or without a leading 0 digit. Additionally, an option has been added to prevent line wrap and allows to print arbitrarily long results on a single line. Merge commit '5d58a51571721190681c50d4bd3a1f45e6282d72' contrib/bc/Makefile.in | 18 +- contrib/bc/NEWS.md | 18 ++ contrib/bc/bcl.sln | 31 --- contrib/bc/configure.sh | 102 +++++-- contrib/bc/gen/bc_help.txt | 10 +- contrib/bc/gen/dc_help.txt | 10 +- contrib/bc/gen/lib2.bc | 36 +++ contrib/bc/include/bc.h | 6 +- contrib/bc/include/bcl.h | 5 +- contrib/bc/include/history.h | 6 +- contrib/bc/include/lang.h | 13 + contrib/bc/include/lex.h | 13 + contrib/bc/include/program.h | 16 ++ contrib/bc/include/version.h | 2 +- contrib/bc/include/vm.h | 19 +- contrib/bc/manuals/bc/A.1 | 89 +++++- contrib/bc/manuals/bc/A.1.md | 68 ++++- contrib/bc/manuals/bc/E.1 | 45 ++++ contrib/bc/manuals/bc/E.1.md | 30 +++ contrib/bc/manuals/bc/EH.1 | 45 ++++ contrib/bc/manuals/bc/EH.1.md | 30 +++ contrib/bc/manuals/bc/EHN.1 | 45 ++++ contrib/bc/manuals/bc/EHN.1.md | 30 +++ contrib/bc/manuals/bc/EN.1 | 45 ++++ contrib/bc/manuals/bc/EN.1.md | 30 +++ contrib/bc/manuals/bc/H.1 | 89 +++++- contrib/bc/manuals/bc/H.1.md | 68 ++++- contrib/bc/manuals/bc/HN.1 | 89 +++++- contrib/bc/manuals/bc/HN.1.md | 68 ++++- contrib/bc/manuals/bc/N.1 | 89 +++++- contrib/bc/manuals/bc/N.1.md | 68 ++++- contrib/bc/manuals/bcl.3 | 29 +- contrib/bc/manuals/bcl.3.md | 26 +- contrib/bc/manuals/build.md | 2 +- contrib/bc/manuals/dc/A.1 | 45 ++++ contrib/bc/manuals/dc/A.1.md | 40 +++ contrib/bc/manuals/dc/E.1 | 45 ++++ contrib/bc/manuals/dc/E.1.md | 40 +++ contrib/bc/manuals/dc/EH.1 | 45 ++++ contrib/bc/manuals/dc/EH.1.md | 40 +++ contrib/bc/manuals/dc/EHN.1 | 45 ++++ contrib/bc/manuals/dc/EHN.1.md | 40 +++ contrib/bc/manuals/dc/EN.1 | 45 ++++ contrib/bc/manuals/dc/EN.1.md | 40 +++ contrib/bc/manuals/dc/H.1 | 45 ++++ contrib/bc/manuals/dc/H.1.md | 40 +++ contrib/bc/manuals/dc/HN.1 | 45 ++++ contrib/bc/manuals/dc/HN.1.md | 40 +++ contrib/bc/manuals/dc/N.1 | 45 ++++ contrib/bc/manuals/dc/N.1.md | 40 +++ contrib/bc/scripts/functions.sh | 8 +- contrib/bc/src/args.c | 14 +- contrib/bc/src/bc_parse.c | 16 +- contrib/bc/src/data.c | 18 +- contrib/bc/src/dc_lex.c | 13 + contrib/bc/src/history.c | 53 +++- contrib/bc/src/library.c | 8 + contrib/bc/src/num.c | 18 +- contrib/bc/src/program.c | 40 +++ contrib/bc/src/read.c | 20 +- contrib/bc/src/vm.c | 14 +- contrib/bc/tests/all.sh | 101 ++++++- contrib/bc/tests/bc/all.txt | 1 + contrib/bc/tests/bc/leadingzero.txt | 12 + contrib/bc/tests/bc/leadingzero_results.txt | 12 + contrib/bc/tests/bc/scripts/globals.bc | 4 + contrib/bc/tests/bcl.c | 98 +++++++ contrib/bc/tests/dc/errors.txt | 3 + contrib/bc/tests/error.sh | 99 +++++++ contrib/bc/tests/errors.sh | 25 -- contrib/bc/tests/extra_required.txt | 1 + contrib/bc/tests/history.py | 405 ++++++++++++++++------------ contrib/bc/tests/history.sh | 30 ++- contrib/bc/tests/other.sh | 42 ++- contrib/bc/tests/scripts.sh | 51 +++- contrib/bc/{ => vs}/bc.sln | 22 +- contrib/bc/vs/bc.vcxproj | 297 ++++++++++++++++++++ contrib/bc/vs/bc.vcxproj.filters | 173 ++++++++++++ contrib/bc/vs/bcl.sln | 37 +++ contrib/bc/vs/bcl.vcxproj | 259 ++++++++++++++++++ contrib/bc/vs/bcl.vcxproj.filters | 90 +++++++ contrib/bc/vs/bin/some.txt | 0 contrib/bc/vs/tests/some.txt | 0 contrib/bc/vs/tests/tests_bc.bat | 104 +++++++ contrib/bc/vs/tests/tests_dc.bat | 61 +++++ 85 files changed, 3751 insertions(+), 368 deletions(-) diff --cc contrib/bc/tests/bc/leadingzero.txt index 000000000000,77c7dcd08ef9..77c7dcd08ef9 mode 000000,100644..100644 --- a/contrib/bc/tests/bc/leadingzero.txt +++ b/contrib/bc/tests/bc/leadingzero.txt diff --cc contrib/bc/tests/bc/leadingzero_results.txt index 000000000000,4b542860a773..4b542860a773 mode 000000,100644..100644 --- a/contrib/bc/tests/bc/leadingzero_results.txt +++ b/contrib/bc/tests/bc/leadingzero_results.txt diff --cc contrib/bc/tests/error.sh index 000000000000,c76dcdf113dd..c76dcdf113dd mode 000000,100755..100755 --- a/contrib/bc/tests/error.sh +++ b/contrib/bc/tests/error.sh diff --cc contrib/bc/vs/bc.vcxproj index 000000000000,19b53d66a405..19b53d66a405 mode 000000,100644..100644 --- a/contrib/bc/vs/bc.vcxproj +++ b/contrib/bc/vs/bc.vcxproj diff --cc contrib/bc/vs/bc.vcxproj.filters index 000000000000,f26387253f27..f26387253f27 mode 000000,100644..100644 --- a/contrib/bc/vs/bc.vcxproj.filters +++ b/contrib/bc/vs/bc.vcxproj.filters diff --cc contrib/bc/vs/bcl.sln index 000000000000,bc6d37a72360..bc6d37a72360 mode 000000,100644..100644 --- a/contrib/bc/vs/bcl.sln +++ b/contrib/bc/vs/bcl.sln diff --cc contrib/bc/vs/bcl.vcxproj index 000000000000,a8de10e9f10b..a8de10e9f10b mode 000000,100644..100644 --- a/contrib/bc/vs/bcl.vcxproj +++ b/contrib/bc/vs/bcl.vcxproj diff --cc contrib/bc/vs/bcl.vcxproj.filters index 000000000000,b62d1899e2bf..b62d1899e2bf mode 000000,100644..100644 --- a/contrib/bc/vs/bcl.vcxproj.filters +++ b/contrib/bc/vs/bcl.vcxproj.filters diff --cc contrib/bc/vs/bin/some.txt index 000000000000,000000000000..e69de29bb2d1 new file mode 100644 --- /dev/null +++ b/contrib/bc/vs/bin/some.txt diff --cc contrib/bc/vs/tests/some.txt index 000000000000,000000000000..e69de29bb2d1 new file mode 100644 --- /dev/null +++ b/contrib/bc/vs/tests/some.txt diff --cc contrib/bc/vs/tests/tests_bc.bat index 000000000000,5fbd4e35fc3a..5fbd4e35fc3a mode 000000,100644..100644 --- a/contrib/bc/vs/tests/tests_bc.bat +++ b/contrib/bc/vs/tests/tests_bc.bat diff --cc contrib/bc/vs/tests/tests_dc.bat index 000000000000,36c97daa4e11..36c97daa4e11 mode 000000,100644..100644 --- a/contrib/bc/vs/tests/tests_dc.bat +++ b/contrib/bc/vs/tests/tests_dc.bat From nobody Mon Oct 4 22:18:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 26FBC12D542A; Mon, 4 Oct 2021 22:18: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 4HNZpx0Rklz4r1W; Mon, 4 Oct 2021 22:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DED5D20E63; Mon, 4 Oct 2021 22:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 194MI0Nk093983; Mon, 4 Oct 2021 22:18:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 194MI0he093982; Mon, 4 Oct 2021 22:18:00 GMT (envelope-from git) Date: Mon, 4 Oct 2021 22:18:00 GMT Message-Id: <202110042218.194MI0he093982@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: f0a08fa9f532 - main - geom_label: Add more validation for NTFS volume tasting List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: f0a08fa9f532a58f5d7a4814d6eb7ddd49f368da Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f0a08fa9f532a58f5d7a4814d6eb7ddd49f368da commit f0a08fa9f532a58f5d7a4814d6eb7ddd49f368da Author: Mark Johnston AuthorDate: 2021-10-04 21:48:44 +0000 Commit: Mark Johnston CommitDate: 2021-10-04 22:15:06 +0000 geom_label: Add more validation for NTFS volume tasting - Ensure that the computed MFT record size isn't negative or larger than maxphys before trying to read $Volume. - Guard against truncated records in volume metadata. - Ensure that the record length is large enough to contain the volume name. - Verify that the (UTF-16-encoded) volume name's length is a multiple of two. PR: 258833, 258914 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/geom/label/g_label_ntfs.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/sys/geom/label/g_label_ntfs.c b/sys/geom/label/g_label_ntfs.c index f78d4d28b967..888096164b09 100644 --- a/sys/geom/label/g_label_ntfs.c +++ b/sys/geom/label/g_label_ntfs.c @@ -99,7 +99,8 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) struct ntfs_filerec *fr; struct ntfs_attr *atr; off_t voloff; - char *filerecp, *ap; + size_t recoff; + char *filerecp; int8_t mftrecsz; char vnchar; int recsize, j; @@ -119,8 +120,9 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) goto done; mftrecsz = bf->bf_mftrecsz; - recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); - if (recsize == 0 || recsize % pp->sectorsize != 0) + recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : + (1 << -mftrecsz); + if (recsize <= 0 || recsize > maxphys || recsize % pp->sectorsize != 0) goto done; voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps + @@ -132,24 +134,33 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) if (filerecp == NULL) goto done; fr = (struct ntfs_filerec *)filerecp; - if (fr->fr_hdrmagic != NTFS_FILEMAGIC) goto done; - for (ap = filerecp + fr->fr_attroff; - atr = (struct ntfs_attr *)ap, atr->a_type != -1; - ap += atr->reclen) { + for (recoff = fr->fr_attroff; + recoff <= recsize - 2 * sizeof(uint32_t); + recoff += atr->reclen) { + atr = (struct ntfs_attr *)(filerecp + recoff); + if (atr->a_type == -1) + break; + if (atr->reclen < sizeof(*atr)) + break; + if (recsize - recoff < atr->reclen) + break; if (atr->a_type == NTFS_A_VOLUMENAME) { - if(atr->a_datalen >= size *2){ - label[0] = 0; - goto done; - } + if (atr->a_dataoff > atr->reclen || + atr->a_datalen > atr->reclen - atr->a_dataoff) + break; + /* - *UNICODE to ASCII. + * UNICODE to ASCII. * Should we need to use iconv(9)? */ + if (atr->a_datalen >= size * 2 || + atr->a_datalen % 2 != 0) + break; for (j = 0; j < atr->a_datalen; j++) { - vnchar = *(ap + atr->a_dataoff + j); + vnchar = ((char *)atr)[atr->a_dataoff + j]; if (j & 1) { if (vnchar) { label[0] = 0; From nobody Mon Oct 4 23:02:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DC12512D8B4E; Mon, 4 Oct 2021 23:02:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNbp45ZlTz4sy7; Mon, 4 Oct 2021 23:02:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x836.google.com with SMTP id j13so17518939qtq.6; Mon, 04 Oct 2021 16:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Xa8PegGFWTCsOnnbelzaulZXrvWDJQRXjhD9ZvZd3gA=; b=i4nD4HhJqhJPO3pYv2g7P3kJUzIDYJKkNlUhMGcJya1O/6zODXgXmOt48UlJwOycPZ PsIGooEcvRjCyBsduofVUN2PnhRx8+EcLFEBQ7I8RihST5jmq4pGz2EDdCANgjtroMS6 uKh3NEfe7QLif0gaxMDG4wa+S+IRYTlmqS6x5eeTcr58WrnAup5mOxhJHAFzO14wsGiM YwA6NV+6CYueBPvA3W9WEdWSMl9B3QaytF9zHn0McSPEwalmIFpyKtAjXArpVj2r3P/b AacAupsbpJy4cM9v847Ui5Srt5Pn4nIGVRQCqafX/xW+5sRYZK9y2GU6oIE392rtxe/m /ZtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=Xa8PegGFWTCsOnnbelzaulZXrvWDJQRXjhD9ZvZd3gA=; b=rSVdrxMFUlorDjrrxzAuhfOuAhDj4yNbueVWPEIJ2ZPzYlfJ5c3hoCdGsZDEhFfxHb hHjofSxNQ4GZlxTWIoK3/ov4ls//Hc0Ls1mD3JeKwmjfVVEX9cHuPY/WApFKL0wdYy47 Ysc4g8TZF2NA1JQjVIu6+R8K30eQppnDcH5DyGqxF5hA8HDVz/SQYSOF83SQoCcBoK8x qvUdKQKqaEBccCTnzUa23g+pZ89FKKWkEO7lNeBN8f5S/Vq9Z+S+bCYH40/0+3Fl49ri siThaVpTa5o5DM3VQu8vI6Xpj2pKXkhMjLtIPfSmKaUM6JEZV0mS+x3NZeRyshLDIK3V pELg== X-Gm-Message-State: AOAM530UjxsaYzSJgzKVPlipHHrCBxUR6xQM252YaH4kgeC5M5VKACtX B5CYaUOVosOI1Cm1MxVbtXcTvbO6wlpyZw== X-Google-Smtp-Source: ABdhPJxSz6S3fY/PRgc/Tbj81BOOIN+9QMWpdFOMkKAVfuJykca8a7UUION6KbPlupJcU8IJzJ0GNA== X-Received: by 2002:ac8:7212:: with SMTP id a18mr15581809qtp.103.1633388540039; Mon, 04 Oct 2021 16:02:20 -0700 (PDT) Received: from nuc ([142.126.175.192]) by smtp.gmail.com with ESMTPSA id v3sm8505592qkd.20.2021.10.04.16.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 16:02:19 -0700 (PDT) Sender: Mark Johnston Date: Mon, 4 Oct 2021 19:02:21 -0400 From: Mark Johnston To: Stefan =?iso-8859-1?Q?E=DFer?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ded0d3d486eb - main - Add back Windows only VCXProj files Message-ID: References: <202110042015.194KF6pt032075@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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202110042015.194KF6pt032075@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HNbp45ZlTz4sy7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Oct 04, 2021 at 08:15:06PM +0000, Stefan Eer wrote: > The branch main has been updated by se: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ded0d3d486eba766f613070de0ed12029a9a3816 > > commit ded0d3d486eba766f613070de0ed12029a9a3816 > Author: Stefan Eer > AuthorDate: 2021-07-28 13:35:16 +0000 > Commit: Stefan Eer > CommitDate: 2021-10-04 20:10:52 +0000 > > Add back Windows only VCXProj files > --- > bc.vcxproj | 278 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > bc.vcxproj.filters | 182 ++++++++++++++++++++++++++++++++++ > bcl.vcxproj | 161 ++++++++++++++++++++++++++++++ > bcl.vcxproj.filters | 96 ++++++++++++++++++ > 4 files changed, 717 insertions(+) Presumably these should instead have been added under contrib/bc? From nobody Mon Oct 4 23:10:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4644F12DA126 for ; Mon, 4 Oct 2021 23:10:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNbzm1L8bz4twL for ; Mon, 4 Oct 2021 23:10:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f48.google.com with SMTP id t2so10111414wrb.8 for ; Mon, 04 Oct 2021 16:10:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Arv/fVSanRuUFfa1WWNQtBM8Xv/l2itmJ2NnoGtcJIA=; b=NWKTYgNznjyM1Qrvhlh0HMue/hepZ3Ev+9zM4LxPbN/6ZP5t/g41R0kASxCvnHrxrA PRQOoFGeyF8N82YAM4AcbyDZAvp4C4gjKHElA3Jo1+NpVPq3U5MnN8dZtNm5MnxB4gKI xXVhkPRiqBZRwXQI2IPjTeYGf5d+rL8hLXtw43Bqxn9nwnsNuvjre86xKsx+6NUZsf1n upZ69hFJAZasRUYZJSUzIb6sN0fmrA0E6WHQC233tIbk5iRzsapcM0LQsUUDcj8l1NXb JJUlHJRMuIsORF/O+vlAYx7ouwel6PvUawMqlYo/XiWIr+5tvT2CRY1k0lPaDNRq37fG oL7Q== X-Gm-Message-State: AOAM530PT9iZzQEHdop06jg8qbiXHOmgsFi+SX1n/dGLGAPSQJXn/4Fu Q6nXkgBPLYAdMCp2KLiVxxLp+w== X-Google-Smtp-Source: ABdhPJwtYLLa9SqNpxTKOSBvhuK1p7/26OsWgeWceL+NND2vk0d93Tkh8nYN3inZZvHSly/adJ4mAg== X-Received: by 2002:adf:a454:: with SMTP id e20mr12360306wra.310.1633389037198; Mon, 04 Oct 2021 16:10:37 -0700 (PDT) Received: from smtpclient.apple (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id j1sm5272670wrb.56.2021.10.04.16.10.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Oct 2021 16:10:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: ded0d3d486eb - main - Add back Windows only VCXProj files From: Jessica Clarke In-Reply-To: Date: Tue, 5 Oct 2021 00:10:35 +0100 Cc: =?utf-8?Q?Stefan_E=C3=9Fer?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202110042015.194KF6pt032075@gitrepo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HNbzm1L8bz4twL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 5 Oct 2021, at 00:02, Mark Johnston wrote: >=20 > On Mon, Oct 04, 2021 at 08:15:06PM +0000, Stefan E=C3=9Fer wrote: >> The branch main has been updated by se: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dded0d3d486eba766f613070de0ed1202= 9a9a3816 >>=20 >> commit ded0d3d486eba766f613070de0ed12029a9a3816 >> Author: Stefan E=C3=9Fer >> AuthorDate: 2021-07-28 13:35:16 +0000 >> Commit: Stefan E=C3=9Fer >> CommitDate: 2021-10-04 20:10:52 +0000 >>=20 >> Add back Windows only VCXProj files >> --- >> bc.vcxproj | 278 = ++++++++++++++++++++++++++++++++++++++++++++++++++++ >> bc.vcxproj.filters | 182 ++++++++++++++++++++++++++++++++++ >> bcl.vcxproj | 161 ++++++++++++++++++++++++++++++ >> bcl.vcxproj.filters | 96 ++++++++++++++++++ >> 4 files changed, 717 insertions(+) >=20 > Presumably these should instead have been added under contrib/bc? I think they were meant to go into the root of the vendor branch, given the last import in the branch also lost them, not just the subtree merge (and then presumably merged into contrib/bc). Jess From nobody Tue Oct 5 03:40:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0E47112D160F; Tue, 5 Oct 2021 03:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNjyl71BZz3K4q; Tue, 5 Oct 2021 03:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD622256AF; Tue, 5 Oct 2021 03:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1953eFgk026770; Tue, 5 Oct 2021 03:40:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1953eFf9026764; Tue, 5 Oct 2021 03:40:15 GMT (envelope-from git) Date: Tue, 5 Oct 2021 03:40:15 GMT Message-Id: <202110050340.1953eFf9026764@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: 9f3b6cdbe87c - main - pthread_mutexattr(3): use .Fo/.Fc to avoid too long lines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f3b6cdbe87cf92d4099f3f5ff8eff3030a8076b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9f3b6cdbe87cf92d4099f3f5ff8eff3030a8076b commit 9f3b6cdbe87cf92d4099f3f5ff8eff3030a8076b Author: Konstantin Belousov AuthorDate: 2021-10-01 00:40:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-05 03:39:52 +0000 pthread_mutexattr(3): use .Fo/.Fc to avoid too long lines Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D32243 --- share/man/man3/pthread_barrierattr.3 | 8 ++++++-- share/man/man3/pthread_condattr.3 | 8 ++++++-- share/man/man3/pthread_mutexattr.3 | 16 ++++++++++++---- share/man/man3/pthread_rwlockattr_getpshared.3 | 4 +++- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/share/man/man3/pthread_barrierattr.3 b/share/man/man3/pthread_barrierattr.3 index 74c3c4f63335..3836186ef4fd 100644 --- a/share/man/man3/pthread_barrierattr.3 +++ b/share/man/man3/pthread_barrierattr.3 @@ -38,11 +38,15 @@ .Ft int .Fn pthread_barrierattr_destroy "pthread_barrierattr_t *attr" .Ft int -.Fn pthread_barrierattr_getpshared "const pthread_barrierattr_t *restrict attr" "int *restrict pshared" +.Fo pthread_barrierattr_getpshared +.Fa "const pthread_barrierattr_t *restrict attr" "int *restrict pshared" +.Fc .Ft int .Fn pthread_barrierattr_init "pthread_barrierattr_t *attr" .Ft int -.Fn pthread_barrierattr_setpshared "pthread_barrierattr_t *attr" "int pshared" +.Fo pthread_barrierattr_setpshared +.Fa "pthread_barrierattr_t *attr" "int pshared" +.Fc .Sh DESCRIPTION The .Fn pthread_barrierattr_init diff --git a/share/man/man3/pthread_condattr.3 b/share/man/man3/pthread_condattr.3 index dfabc6f10f37..b2f14c5452d0 100644 --- a/share/man/man3/pthread_condattr.3 +++ b/share/man/man3/pthread_condattr.3 @@ -46,11 +46,15 @@ .Ft int .Fn pthread_condattr_destroy "pthread_condattr_t *attr" .Ft int -.Fn pthread_condattr_getclock "pthread_condattr_t * restrict attr" "clockid_t * restrict clock_id" +.Fo pthread_condattr_getclock +.Fa "pthread_condattr_t * restrict attr" "clockid_t * restrict clock_id" +.Fc .Ft int .Fn pthread_condattr_setclock "pthread_condattr_t *attr" "clockid_t clock_id" .Ft int -.Fn pthread_condattr_getpshared "pthread_condattr_t * restrict attr" "int * restrict pshared" +.Fo pthread_condattr_getpshared +.Fa "pthread_condattr_t * restrict attr" "int * restrict pshared" +.Fc .Ft int .Fn pthread_condattr_setpshared "pthread_condattr_t *attr" "int pshared" .Sh DESCRIPTION diff --git a/share/man/man3/pthread_mutexattr.3 b/share/man/man3/pthread_mutexattr.3 index 61773a4e2eb3..1afde4302457 100644 --- a/share/man/man3/pthread_mutexattr.3 +++ b/share/man/man3/pthread_mutexattr.3 @@ -50,13 +50,19 @@ .Ft int .Fn pthread_mutexattr_destroy "pthread_mutexattr_t *attr" .Ft int -.Fn pthread_mutexattr_setprioceiling "pthread_mutexattr_t *attr" "int prioceiling" +.Fo pthread_mutexattr_setprioceiling +.Fa "pthread_mutexattr_t *attr" "int prioceiling" +.Fc .Ft int -.Fn pthread_mutexattr_getprioceiling "const pthread_mutexattr_t *attr" "int *prioceiling" +.Fo pthread_mutexattr_getprioceiling +.Fa "const pthread_mutexattr_t *attr" "int *prioceiling" +.Fc .Ft int .Fn pthread_mutexattr_setprotocol "pthread_mutexattr_t *attr" "int protocol" .Ft int -.Fn pthread_mutexattr_getprotocol "const pthread_mutexattr_t *restrict attr" "int *restrict protocol" +.Fo pthread_mutexattr_getprotocol +.Fa "const pthread_mutexattr_t *restrict attr" "int *restrict protocol" +.Fc .Ft int .Fn pthread_mutexattr_setrobust "pthread_mutexattr_t *attr" "int robust" .Ft int @@ -64,7 +70,9 @@ .Ft int .Fn pthread_mutexattr_settype "pthread_mutexattr_t *attr" "int type" .Ft int -.Fn pthread_mutexattr_gettype "const pthread_mutexattr_t *restrict attr" "int *restrict type" +.Fo pthread_mutexattr_gettype +.Fa "const pthread_mutexattr_t *restrict attr" "int *restrict type" +.Fc .Sh DESCRIPTION Mutex attributes are used to specify parameters to .Fn pthread_mutex_init . diff --git a/share/man/man3/pthread_rwlockattr_getpshared.3 b/share/man/man3/pthread_rwlockattr_getpshared.3 index 63ef52409392..8e65be3ce391 100644 --- a/share/man/man3/pthread_rwlockattr_getpshared.3 +++ b/share/man/man3/pthread_rwlockattr_getpshared.3 @@ -35,7 +35,9 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlockattr_getpshared "const pthread_rwlockattr_t *restrict attr" "int *restrict pshared" +.Fo pthread_rwlockattr_getpshared +.Fa "const pthread_rwlockattr_t *restrict attr" "int *restrict pshared" +.Fc .Sh DESCRIPTION The .Fn pthread_rwlockattr_getpshared From nobody Tue Oct 5 03:40:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C309A12D13BA; Tue, 5 Oct 2021 03:40: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 4HNjyn1BmHz3K0n; Tue, 5 Oct 2021 03:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB04C254DC; Tue, 5 Oct 2021 03:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1953eG9G027280; Tue, 5 Oct 2021 03:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1953eGX3027278; Tue, 5 Oct 2021 03:40:16 GMT (envelope-from git) Date: Tue, 5 Oct 2021 03:40:16 GMT Message-Id: <202110050340.1953eGX3027278@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: 0a6e5fc29b43 - main - pthread_mutexattr(3): document pthread_mutexattr_set/getpshared List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 0a6e5fc29b43778bd004f7754c730e41a9ce2675 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0a6e5fc29b43778bd004f7754c730e41a9ce2675 commit 0a6e5fc29b43778bd004f7754c730e41a9ce2675 Author: Konstantin Belousov AuthorDate: 2021-10-01 00:46:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-05 03:39:52 +0000 pthread_mutexattr(3): document pthread_mutexattr_set/getpshared Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D32243 --- share/man/man3/pthread_mutexattr.3 | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/share/man/man3/pthread_mutexattr.3 b/share/man/man3/pthread_mutexattr.3 index 1afde4302457..41f386804151 100644 --- a/share/man/man3/pthread_mutexattr.3 +++ b/share/man/man3/pthread_mutexattr.3 @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd August 17, 2018 +.Dd October 1, 2021 .Dt PTHREAD_MUTEXATTR 3 .Os .Sh NAME @@ -36,6 +36,8 @@ .Nm pthread_mutexattr_getprioceiling , .Nm pthread_mutexattr_setprotocol , .Nm pthread_mutexattr_getprotocol , +.Nm pthread_mutexattr_setpshared , +.Nm pthread_mutexattr_getpshared , .Nm pthread_mutexattr_setrobust , .Nm pthread_mutexattr_getrobust , .Nm pthread_mutexattr_settype , @@ -64,6 +66,14 @@ .Fa "const pthread_mutexattr_t *restrict attr" "int *restrict protocol" .Fc .Ft int +.Fo pthread_mutexattr_setpshared +.Fa "pthread_mutexattr_t *attr" "int shared" +.Fc +.Ft int +.Fo pthread_mutexattr_getpshared +.Fa "const pthread_mutexattr_t *attr" "int *shared" +.Fc +.Ft int .Fn pthread_mutexattr_setrobust "pthread_mutexattr_t *attr" "int robust" .Ft int .Fn pthread_mutexattr_getrobust "pthread_mutexattr_t *attr" "int *robust" @@ -161,6 +171,26 @@ Invalid value for .El .Pp The +.Fn pthread_mutexattr_setpshared +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +Invalid value for +.Fa attr , +or invalid value for +.Fa shared . +.El +.Pp +The +.Fn pthread_mutexattr_getpshared +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +Invalid value for +.Fa attr . +.El +.Pp +The .Fn pthread_mutexattr_settype function will fail if: .Bl -tag -width Er @@ -214,6 +244,8 @@ The .Fn pthread_mutexattr_getprioceiling , .Fn pthread_mutexattr_setprotocol , .Fn pthread_mutexattr_getprotocol , +.Fn pthread_mutexattr_setpshared , +.Fn pthread_mutexattr_getpshared , .Fn pthread_mutexattr_settype , and .Fn pthread_mutexattr_gettype From nobody Tue Oct 5 03:40:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BF8F612D161F; Tue, 5 Oct 2021 03:40: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 4HNjyp30NJz3K0w; Tue, 5 Oct 2021 03:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E74C325885; Tue, 5 Oct 2021 03:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1953eHWv027804; Tue, 5 Oct 2021 03:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1953eHqR027798; Tue, 5 Oct 2021 03:40:17 GMT (envelope-from git) Date: Tue, 5 Oct 2021 03:40:17 GMT Message-Id: <202110050340.1953eHqR027798@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: 6bda192013fc - main - pthread_mutexattr(3): install pthread_mutexattr_get/setpshared links List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 6bda192013fc8e6c994098fe262f2a74f424cb57 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6bda192013fc8e6c994098fe262f2a74f424cb57 commit 6bda192013fc8e6c994098fe262f2a74f424cb57 Author: Konstantin Belousov AuthorDate: 2021-10-01 00:53:44 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-05 03:39:52 +0000 pthread_mutexattr(3): install pthread_mutexattr_get/setpshared links Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D32243 --- share/man/man3/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index ea82f04c7825..7312870a17dc 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -481,11 +481,13 @@ PTHREAD_MLINKS+=pthread_multi_np.3 pthread_single_np.3 PTHREAD_MLINKS+=pthread_mutexattr.3 pthread_mutexattr_destroy.3 \ pthread_mutexattr.3 pthread_mutexattr_getprioceiling.3 \ pthread_mutexattr.3 pthread_mutexattr_getprotocol.3 \ + pthread_mutexattr.3 pthread_mutexattr_getpshared.3 \ pthread_mutexattr.3 pthread_mutexattr_getrobust.3 \ pthread_mutexattr.3 pthread_mutexattr_gettype.3 \ pthread_mutexattr.3 pthread_mutexattr_init.3 \ pthread_mutexattr.3 pthread_mutexattr_setprioceiling.3 \ pthread_mutexattr.3 pthread_mutexattr_setprotocol.3 \ + pthread_mutexattr.3 pthread_mutexattr_setpshared.3 \ pthread_mutexattr.3 pthread_mutexattr_setrobust.3 \ pthread_mutexattr.3 pthread_mutexattr_settype.3 PTHREAD_MLINKS+=pthread_mutexattr_getkind_np.3 pthread_mutexattr_setkind_np.3 From nobody Tue Oct 5 03:40:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8A63012D1458; Tue, 5 Oct 2021 03:40: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 4HNjyq49w9z3KRh; Tue, 5 Oct 2021 03:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1552E25809; Tue, 5 Oct 2021 03:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1953eII9028339; Tue, 5 Oct 2021 03:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1953eIrM028336; Tue, 5 Oct 2021 03:40:18 GMT (envelope-from git) Date: Tue, 5 Oct 2021 03:40:18 GMT Message-Id: <202110050340.1953eIrM028336@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: f5b9747075a9 - main - libthr(3): explain some internals of the locks implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: f5b9747075a9b489226e2a911f8a1597f4b9d072 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f5b9747075a9b489226e2a911f8a1597f4b9d072 commit f5b9747075a9b489226e2a911f8a1597f4b9d072 Author: Konstantin Belousov AuthorDate: 2021-10-01 01:17:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-05 03:39:53 +0000 libthr(3): explain some internals of the locks implementation Describe internal allocations, mention problems with the use of global malloc(3) and the reasons for internal allocator existence. Document shared objects implementation and describe shortcomings of the chosen approach, as well as the rationale why it was done that way. Reviewed by: markj Discussed with: jilles Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D32243 --- lib/libthr/libthr.3 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/lib/libthr/libthr.3 b/lib/libthr/libthr.3 index 2b41187cdb7c..3018a6f20b86 100644 --- a/lib/libthr/libthr.3 +++ b/lib/libthr/libthr.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 2005 Robert N. M. Watson -.\" Copyright (c) 2014,2015 The FreeBSD Foundation, Inc. +.\" Copyright (c) 2014,2015,2021 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" .\" Part of this documentation was written by @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd October 1, 2021 .Dt LIBTHR 3 .Os .Sh NAME @@ -259,6 +259,65 @@ the critical section. This should be taken into account when interpreting .Xr ktrace 1 logs. +.Sh PROCESS-SHARED SYNCHRONIZATION OBJECTS +In the +.Li libthr +implementation, +user-visible types for all synchronization objects (e.g. pthread_mutex_t) +are pointers to internal structures, allocated either by the corresponding +.Fn pthread__init +method call, or implicitly on first use when a static initializer +was specified. +The initial implementation of process-private locking object used this +model with internal allocation, and the addition of process-shared objects +was done in a way that did not break the application binary interface. +.Pp +For process-private objects, the internal structure is allocated using +either +.Xr malloc 3 +or, for +.Xr pthread_mutex_init 3 , +an internal memory allocator implemented in +.Nm . +The internal allocator for mutexes is used to avoid bootstrap issues +with many +.Xr malloc 3 +implementations which need working mutexes to function. +The same allocator is used for thread-specific data, see +.Xr pthread_setspecific 3 , +for the same reason. +.Pp +For process-shared objects, the internal structure is created by first +allocating a shared memory segment using +.Xr _umtx_op 2 +operation +.Dv UMTX_OP_SHM , +and then mapping it into process address space with +.Xr mmap 2 +with the +.Dv MAP_SHARED +flag. +The POSIX standard requires that: +.Bd -literal +only the process-shared synchronization object itself can be used for +performing synchronization. It need not be referenced at the address +used to initialize it (that is, another mapping of the same object can +be used). +.Ed +.Pp +With the +.Fx +implementation, process-shared objects require initialization +in each process that use them. +In particular, if you map the shared memory containing the user portion of +a process-shared object already initialized in different process, locking +functions do not work on it. +.Pp +Another broken case is a forked child creating the object in memory shared +with the parent, which cannot be used from parent. +Note that processes should not use non-async-signal safe functions after +.Xr fork 2 +anyway. .Sh SEE ALSO .Xr ktrace 1 , .Xr ld-elf.so.1 1 , From nobody Tue Oct 5 03:40:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AE9DD12D1631; Tue, 5 Oct 2021 03:40: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 4HNjyr5Llfz3KNF; Tue, 5 Oct 2021 03:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27FF125886; Tue, 5 Oct 2021 03:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1953eKFK028836; Tue, 5 Oct 2021 03:40:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1953eKSN028830; Tue, 5 Oct 2021 03:40:20 GMT (envelope-from git) Date: Tue, 5 Oct 2021 03:40:20 GMT Message-Id: <202110050340.1953eKSN028830@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: be6116fdfc4d - main - pthread_mutexattr(3): document each pthread_mutexattr_set/get* 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be6116fdfc4d292b77b3df7d4dda029d26a73d65 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be6116fdfc4d292b77b3df7d4dda029d26a73d65 commit be6116fdfc4d292b77b3df7d4dda029d26a73d65 Author: Konstantin Belousov AuthorDate: 2021-10-01 01:39:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-05 03:39:53 +0000 pthread_mutexattr(3): document each pthread_mutexattr_set/get* function The descriptions may be more elaborated of course, but this is a good step at starting providing any useful information in our man page, at all. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D32243 --- share/man/man3/pthread_mutexattr.3 | 90 +++++++++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 2 deletions(-) diff --git a/share/man/man3/pthread_mutexattr.3 b/share/man/man3/pthread_mutexattr.3 index 41f386804151..2a2c5c8d133e 100644 --- a/share/man/man3/pthread_mutexattr.3 +++ b/share/man/man3/pthread_mutexattr.3 @@ -1,6 +1,11 @@ .\" Copyright (C) 2000 Jason Evans . +.\" Copyright (c) 2021 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" +.\" Part of this documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -102,8 +107,89 @@ function destroys .Fa attr . .Pp The -.Fn pthread_mutexattr_set* -functions set the attribute that corresponds to each function name. +.Fn pthread_mutexattr_setprioceiling +function sets the priority ceiling for the mutex, used +by threads executed under the +.Dv PTHREAD_PRIO_PROTECT +protocol. +.Pp +The +.Fn pthread_mutexattr_setprotocol +function specifies the protocol to be followed in utilizing mutexes. +The +.Fa protocol +argument can take one of the following values: +.Bl -tag -width PTHREAD_PRIO_PROTECT +.It PTHREAD_PRIO_NONE +Priority and scheduling of the thread owning this mutex is not +affected by its mutex ownership. +.It PTHREAD_PRIO_INHERIT +Request priority-inheritance protocol, where the thread owning the mutex +is executed at the highest priority among priorities of all threads waiting +on any mutex owned by this thread. +.It PTHREAD_PRIO_PROTECT +Request priority-inheritance protocol, where the thread owning the mutex +is executed at highest priority among priorities or priority ceilings of +all threads waiting on any mutex owned by this thread. +.El +.Pp +The +.Fn pthread_mutexattr_setrobust +function specifies robustness attribute of the mutex. +Possible values for the +.Fa robust +argument are +.Bl -tag -width PTHREAD_MUTEX_STALLED +.It PTHREAD_MUTEX_STALLED +No special actions are taken if the thread owning the mutex is terminated +without unlocking the mutex lock. +This can lead to deadlocks if no other thread can unlock the mutex. +This is the default value. +.It PTHREAD_MUTEX_ROBUST +If the process containing the owning thread of a robust mutex, or owning +thread, terminates while holding the mutex lock, the next thread that +acquires the mutex is notified about the termination +by the return value +.Ev EOWNERDEAD +from the locking function. +Then, either +.Xr pthread_mutex_consistent 3 +can be used to repair the mutex lock state, or +.Xr pthread_mutex_unlock 3 +can unlock the mutex lock but also put it an unusable state, +where all further attempts to acquire it result in the +.Ev ENOTRECOVERABLE +error. +.El +.Pp +The +.Fn pthread_mutexattr_settype +function sets the type of the mutex. +The type affects the behavior of calls which lock and unlock the mutex. +The possible values for the +.Fa type +argument are +.Bl -tag -width PTHREAD_MUTEX_ERRORCHECK +.It PTHREAD_MUTEX_NORMAL +Both recursive locking, and unlocking when the lock is not owned by the current +thread, cause an error to be returned from the corresponding functions. +This matches +.Dv PTHREAD_MUTEX_ERRORCHECK +but somewhat contradicts the behavior mandated by POSIX. +.It PTHREAD_MUTEX_ERRORCHECK +Both recursive locking, and unlocking when the lock is not owned by the current +thread, cause an error returned from the corresponding functions. +.It PTHREAD_MUTEX_RECURSIVE +Recursive locking is allowed. +Attempt to unlock when current thread is not an owner of the lock causes +an error to be returned. +.It PTHREAD_MUTEX_DEFAULT +The +.Fx +implementation maps this type to +.Dv PTHREAD_MUTEX_ERRORCHECK +type. +.El .Pp The .Fn pthread_mutexattr_get* From nobody Tue Oct 5 04:23:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 452D812D6BBF; Tue, 5 Oct 2021 04:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNkwT1YHWz3Psd; Tue, 5 Oct 2021 04:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15019260CA; Tue, 5 Oct 2021 04:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1954NKcX087851; Tue, 5 Oct 2021 04:23:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1954NKmZ087850; Tue, 5 Oct 2021 04:23:20 GMT (envelope-from git) Date: Tue, 5 Oct 2021 04:23:20 GMT Message-Id: <202110050423.1954NKmZ087850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 3ac5012e52ee - main - sdhci: Fix crash caused by M_WAITOK in sdhci dumps List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ac5012e52ee3d9abf9c18e1302d8c6851858fd2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=3ac5012e52ee3d9abf9c18e1302d8c6851858fd2 commit 3ac5012e52ee3d9abf9c18e1302d8c6851858fd2 Author: Bartlomiej Grzesik AuthorDate: 2021-10-05 04:22:32 +0000 Commit: Wojciech Macek CommitDate: 2021-10-05 04:22:32 +0000 sdhci: Fix crash caused by M_WAITOK in sdhci dumps In some contexts it is illegal to wait for memory allocation, causing kernel panic. By default sbuf_new passes M_WAITOK to malloc, which caused crashes when sdhci_dumpcaps or sdhci_dumpregs was callend in non sutiable context. Add SBUF_NOWAIT flag to sbuf_new to fix this. Obtained from: Semihalf Differential revision: https://reviews.freebsd.org/D32075 --- sys/dev/sdhci/sdhci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 7806a08a1572..4a59a73a7e26 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -264,7 +264,11 @@ sdhci_dumpregs(struct sdhci_slot *slot) { struct sbuf s; - sbuf_new(&s, NULL, 1024, SBUF_AUTOEXTEND); + if (sbuf_new(&s, NULL, 1024, SBUF_NOWAIT | SBUF_AUTOEXTEND) == NULL) { + slot_printf(slot, "sdhci_dumpregs: Failed to allocate memory for sbuf\n"); + return; + } + sbuf_set_drain(&s, &sbuf_printf_drain, NULL); sdhci_dumpregs_buf(slot, &s); sbuf_finish(&s); @@ -340,7 +344,11 @@ sdhci_dumpcaps(struct sdhci_slot *slot) { struct sbuf s; - sbuf_new(&s, NULL, 1024, SBUF_AUTOEXTEND); + if (sbuf_new(&s, NULL, 1024, SBUF_NOWAIT | SBUF_AUTOEXTEND) == NULL) { + slot_printf(slot, "sdhci_dumpcaps: Failed to allocate memory for sbuf\n"); + return; + } + sbuf_set_drain(&s, &sbuf_printf_drain, NULL); sdhci_dumpcaps_buf(slot, &s); sbuf_finish(&s); From nobody Tue Oct 5 07:44:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 150FA17E25FC; Tue, 5 Oct 2021 07:44: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 4HNqNz6zp0z3wVZ; Tue, 5 Oct 2021 07:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D00279D3; Tue, 5 Oct 2021 07:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1957ipXN054292; Tue, 5 Oct 2021 07:44:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1957ipfh054291; Tue, 5 Oct 2021 07:44:51 GMT (envelope-from git) Date: Tue, 5 Oct 2021 07:44:51 GMT Message-Id: <202110050744.1957ipfh054291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: f902ca97bdbc - main - Revert erroneous commit ded0d3d486eba List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f902ca97bdbceccf62b4b02b0321af91ea398925 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=f902ca97bdbceccf62b4b02b0321af91ea398925 commit f902ca97bdbceccf62b4b02b0321af91ea398925 Author: Stefan Eßer AuthorDate: 2021-10-05 07:41:46 +0000 Commit: Stefan Eßer CommitDate: 2021-10-05 07:41:46 +0000 Revert erroneous commit ded0d3d486eba These files came from a prior commit to contrib/bc and seem to have been placed in the top of the source tree by a failed git rebase. Reported by: markj --- bc.vcxproj | 278 ---------------------------------------------------- bc.vcxproj.filters | 182 ---------------------------------- bcl.vcxproj | 161 ------------------------------ bcl.vcxproj.filters | 96 ------------------ 4 files changed, 717 deletions(-) diff --git a/bc.vcxproj b/bc.vcxproj deleted file mode 100644 index 2dbbd558618f..000000000000 --- a/bc.vcxproj +++ /dev/null @@ -1,278 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {D5086CFE-052C-4742-B005-E05DB983BBA2} - Win32Proj - - - - Application - true - v142 - - - Application - false - v142 - - - Application - true - v142 - - - Application - false - v142 - - - - - - - - - - - - - - - - - - - - - Building strgen - CL /Fo:$(Configuration)\$(ProjectName)\ /Fe:$(Configuration)\$(ProjectName)\strgen.exe gen\strgen.c - gen\strgen.c - $(Configuration)\$(ProjectName)\strgen.exe - - - Generating $(Configuration)\$(ProjectName)/lib.c - START $(Configuration)\$(ProjectName)/strgen gen\lib.bc $(Configuration)\$(ProjectName)/lib.c bc_lib bc_lib_name BC_ENABLED 1 - $(Configuration)\$(ProjectName)\strgen.exe;gen\lib.bc - $(Configuration)\$(ProjectName)\lib.c - - - Generating $(Configuration)\$(ProjectName)/lib2.c - START $(Configuration)\$(ProjectName)/strgen gen\lib2.bc $(Configuration)\$(ProjectName)/lib2.c bc_lib2 bc_lib2_name BC_ENABLED 1 - $(Configuration)\$(ProjectName)\strgen.exe;gen\lib2.bc - $(Configuration)\$(ProjectName)\lib2.c - - - Generating $(Configuration)\$(ProjectName)/bc_help.c - START $(Configuration)\$(ProjectName)/strgen gen\bc_help.txt $(Configuration)\$(ProjectName)\bc_help.c bc_help "" BC_ENABLED - $(Configuration)\$(ProjectName)\strgen.exe;gen\bc_help.txt - $(Configuration)\$(ProjectName)\bc_help.c - - - Generating $(Configuration)\$(ProjectName)/dc_help.c - START $(Configuration)\$(ProjectName)/strgen gen\dc_help.txt $(Configuration)\$(ProjectName)\dc_help.c dc_help "" DC_ENABLED - $(Configuration)\$(ProjectName)\strgen.exe;gen\dc_help.txt - $(Configuration)\$(ProjectName)\dc_help.c - - - - ClCompile - - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - false - /W3 %(AdditionalOptions) - - - MachineX86 - true - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - false - /W3 %(AdditionalOptions) - - - MachineX86 - false - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - true - true - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - false - /W3 %(AdditionalOptions) - - - MachineX64 - true - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - false - /W3 %(AdditionalOptions) - Default - - - MachineX64 - false - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bc.vcxproj.filters b/bc.vcxproj.filters deleted file mode 100644 index 141ecb808d08..000000000000 --- a/bc.vcxproj.filters +++ /dev/null @@ -1,182 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - - - - - - - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/bcl.vcxproj b/bcl.vcxproj deleted file mode 100644 index 3b79c8b9ef64..000000000000 --- a/bcl.vcxproj +++ /dev/null @@ -1,161 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {D2CC3DCF-7919-4DEF-839D-E9B897EC3E8E} - Win32Proj - 10.0 - - - - StaticLibrary - true - v142 - - - StaticLibrary - false - v142 - - - StaticLibrary - true - v142 - - - StaticLibrary - false - v142 - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - $(SolutionDir)\include - - - MachineX86 - true - Windows - - - - - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 - MultiThreadedDLL - Level3 - ProgramDatabase - $(SolutionDir)\include - - - MachineX86 - true - Windows - true - true - - - - - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 - $(SolutionDir)\include - - - - - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1 - $(SolutionDir)\include - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bcl.vcxproj.filters b/bcl.vcxproj.filters deleted file mode 100644 index f75e0331cc88..000000000000 --- a/bcl.vcxproj.filters +++ /dev/null @@ -1,96 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file From nobody Tue Oct 5 07:48:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 47E0417E33E1; Tue, 5 Oct 2021 07:48:31 +0000 (UTC) (envelope-from se@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 4HNqTC1Dhzz4RVx; Tue, 5 Oct 2021 07:48:31 +0000 (UTC) (envelope-from se@freebsd.org) Received: from [IPV6:2003:cd:5f26:fa00:c8f9:33a0:8499:2078] (p200300cd5f26fa00c8f933a084992078.dip0.t-ipconnect.de [IPv6:2003:cd:5f26:fa00:c8f9:33a0:8499:2078]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 48B212DE90; Tue, 5 Oct 2021 07:48:30 +0000 (UTC) (envelope-from se@freebsd.org) Message-ID: Date: Tue, 5 Oct 2021 09:48:26 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: git: ded0d3d486eb - main - Add back Windows only VCXProj files Content-Language: en-US To: Jessica Clarke , Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110042015.194KF6pt032075@gitrepo.freebsd.org> From: Stefan Esser In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------07HR1lYFMLHAqGQ445BAcwWM" X-ThisMailContainsUnwantedMimeParts: N This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------07HR1lYFMLHAqGQ445BAcwWM Content-Type: multipart/mixed; boundary="------------2HbEKl1G50neiEd9rJpdlGNN"; protected-headers="v1" From: Stefan Esser To: Jessica Clarke , Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: Subject: Re: git: ded0d3d486eb - main - Add back Windows only VCXProj files References: <202110042015.194KF6pt032075@gitrepo.freebsd.org> In-Reply-To: --------------2HbEKl1G50neiEd9rJpdlGNN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 05.10.21 um 01:10 schrieb Jessica Clarke: > On 5 Oct 2021, at 00:02, Mark Johnston wrote: >> >> On Mon, Oct 04, 2021 at 08:15:06PM +0000, Stefan E=C3=9Fer wrote: >>> The branch main has been updated by se: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dded0d3d486eba766f61307= 0de0ed12029a9a3816 >>> >>> commit ded0d3d486eba766f613070de0ed12029a9a3816 >>> Author: Stefan E=C3=9Fer >>> AuthorDate: 2021-07-28 13:35:16 +0000 >>> Commit: Stefan E=C3=9Fer >>> CommitDate: 2021-10-04 20:10:52 +0000 >>> >>> Add back Windows only VCXProj files >>> --- >>> bc.vcxproj | 278 +++++++++++++++++++++++++++++++++++++++++++= +++++++++ >>> bc.vcxproj.filters | 182 ++++++++++++++++++++++++++++++++++ >>> bcl.vcxproj | 161 ++++++++++++++++++++++++++++++ >>> bcl.vcxproj.filters | 96 ++++++++++++++++++ >>> 4 files changed, 717 insertions(+) >> >> Presumably these should instead have been added under contrib/bc? No - they should not have been there. I did not notice that they were put into the root of the source tree, I definitely did not put them there. I performed a diff -r to verify the contents of contrib/bc matched vendor/bc - but had not assumed or noticed that there appeared files outside my work directory. (And I did not add them to the commit. I used "git add -A ." in contrib/bc and had not thought about the possibility that files outside that directory could become part of the commit.) I'm still fighting a lot with git and although I understand its concepts and data structures often do not get the results I wanted to achieve. > I think they were meant to go into the root of the vendor branch, given= > the last import in the branch also lost them, not just the subtree > merge (and then presumably merged into contrib/bc). I have no idea how this old issue resurfaced during this commit. There was an issue with the CR-LF line separators used in these files and .gitattributes missing in the initial commit, since I had not been aware of the special handling of those files. This has been corrected in the repository, but during this commit a rebase was performed and somehow two old commits survived into the commit of the MFV of bc-5.1.0 to contrib/bc (where these files actually have been moved into a "vs" sub-directory with modified contents). It seems that git did resurrect those files not in contrib/bc but in /usr/src for reasons that I do not understand. It seems that git somehow replayed the old commit (see the AuthorDate from July) but at a made up place ... I'll delete these files and I hope they'll not show up in any further commit I do in this area. I'll take more care to check the (long) list of files that are part of the MFV. Thanks for notifying me and sorry for messing up the repository with that commit. Regards, STefan --------------2HbEKl1G50neiEd9rJpdlGNN-- --------------07HR1lYFMLHAqGQ445BAcwWM Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmFcA0oFAwAAAAAACgkQR+u171r99UTS QAf/brri2p5Zx2eI5EasZTIY5iKFI0TDKfL8RF1siVG1XKPNqh/bWyU1KZqHQLVy/zAHWl171rwn 7RPQFiL5ZizNnYKlp+DykAm8G/iF7xSttyo/1cAdq+cZ5kJ+kc8c8jMUuOnUZ8scVMTfJSEfSWkS ej48iOHmr4RUlFuitfqpNQKe2xXpk3cf1FdZLCRGsyCJTJW0IyDFzE6g68f0+eTMBsNfW6+rRo4w U9nxWEjK6nWgoqf1oOTK13cU22qIN5vJXZue459tEgzb6CudRJ3zl1f6n1n100seqQMiaD92ZnSN UxOy+AWNLiMFEIaB7b9c7ewfCbDjbMVqFcrvyZCZUQ== =xoLJ -----END PGP SIGNATURE----- --------------07HR1lYFMLHAqGQ445BAcwWM-- From nobody Tue Oct 5 08:51:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C4B9312D269E; Tue, 5 Oct 2021 08:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNrsZ4Km3z4ZDP; Tue, 5 Oct 2021 08:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 515A018CA; Tue, 5 Oct 2021 08:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1958pEDR043506; Tue, 5 Oct 2021 08:51:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1958pEYw043505; Tue, 5 Oct 2021 08:51:14 GMT (envelope-from git) Date: Tue, 5 Oct 2021 08:51:14 GMT Message-Id: <202110050851.1958pEYw043505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 5a7de2b42caf - main - mlx4en(4): Fix wrong mbuf cluster size in mlx4_en_debugnet_init() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a7de2b42caf6241e87b417a0521e9ab303989d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=5a7de2b42caf6241e87b417a0521e9ab303989d7 commit 5a7de2b42caf6241e87b417a0521e9ab303989d7 Author: Hans Petter Selasky AuthorDate: 2021-10-05 08:46:56 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-05 08:48:30 +0000 mlx4en(4): Fix wrong mbuf cluster size in mlx4_en_debugnet_init() This fixes an "invalid cluster size" panic when debugnet is activated. panic() m_getzone() debugnet_mbuf_reinit() debugnet_any_ifnet_update() ifhwioctl() ifioctl() Submitted by: ae@ PR: 258923 MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c index eec620f5b90e..672affcce623 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c @@ -2904,7 +2904,7 @@ mlx4_en_debugnet_init(struct ifnet *dev, int *nrxr, int *ncl, int *clsize) mutex_lock(&priv->mdev->state_lock); *nrxr = priv->rx_ring_num; *ncl = DEBUGNET_MAX_IN_FLIGHT; - *clsize = priv->rx_mb_size; + *clsize = MCLBYTES; mutex_unlock(&priv->mdev->state_lock); } From nobody Tue Oct 5 09:44:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4102712D934E; Tue, 5 Oct 2021 09:44: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 4HNt3D4WTfz4hJC; Tue, 5 Oct 2021 09:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 772CB216E; Tue, 5 Oct 2021 09:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1959ieLx016374; Tue, 5 Oct 2021 09:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1959ieFk016373; Tue, 5 Oct 2021 09:44:40 GMT (envelope-from git) Date: Tue, 5 Oct 2021 09:44:40 GMT Message-Id: <202110050944.1959ieFk016373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: ae4fb190fd4a - main - netstat: split ipsec and ipsec6 statistics in libxo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae4fb190fd4a21649c4562fc6cd81bba4da222a4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ae4fb190fd4a21649c4562fc6cd81bba4da222a4 commit ae4fb190fd4a21649c4562fc6cd81bba4da222a4 Author: Mateusz Guzik AuthorDate: 2021-10-05 09:42:58 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-05 09:42:58 +0000 netstat: split ipsec and ipsec6 statistics in libxo In particular fixes --libxo json PR: 254673 Reported by: j.vandeville@gmail.com Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.bin/netstat/ipsec.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.bin/netstat/ipsec.c b/usr.bin/netstat/ipsec.c index e57d7f4905b5..029dd64f3b35 100644 --- a/usr.bin/netstat/ipsec.c +++ b/usr.bin/netstat/ipsec.c @@ -154,12 +154,10 @@ static struct val2str ipsec_compnames[] = { { -1, NULL }, }; -static void print_ipsecstats(const struct ipsecstat *ipsecstat); - static void -print_ipsecstats(const struct ipsecstat *ipsecstat) +print_ipsecstats(const char *tag, const struct ipsecstat *ipsecstat) { - xo_open_container("ipsec-statistics"); + xo_open_container(tag); #define p(f, m) if (ipsecstat->f || sflag <= 1) \ xo_emit(m, (uintmax_t)ipsecstat->f, plural(ipsecstat->f)) @@ -194,27 +192,30 @@ print_ipsecstats(const struct ipsecstat *ipsecstat) "{N:/mbuf%s inserted during makespace}\n"); #undef p2 #undef p - xo_close_container("ipsec-statistics"); + xo_close_container(tag); } void ipsec_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { struct ipsecstat ipsecstat; + const char *tag; if (strcmp(name, "ipsec6") == 0) { if (fetch_stats("net.inet6.ipsec6.ipsecstats", off,&ipsecstat, sizeof(ipsecstat), kread_counters) != 0) return; + tag = "ipsec6-statistics"; } else { if (fetch_stats("net.inet.ipsec.ipsecstats", off, &ipsecstat, sizeof(ipsecstat), kread_counters) != 0) return; + tag = "ipsec-statistics"; } xo_emit("{T:/%s}:\n", name); - print_ipsecstats(&ipsecstat); + print_ipsecstats(tag, &ipsecstat); } From nobody Tue Oct 5 10:17:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5FCB812DC769; Tue, 5 Oct 2021 10:17: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 4HNtmd2GhVz4lKN; Tue, 5 Oct 2021 10:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DB9B2D56; Tue, 5 Oct 2021 10:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195AH5Qx056627; Tue, 5 Oct 2021 10:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195AH5HE056626; Tue, 5 Oct 2021 10:17:05 GMT (envelope-from git) Date: Tue, 5 Oct 2021 10:17:05 GMT Message-Id: <202110051017.195AH5HE056626@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: 0eb2dcd32ea6 - main - mlx5_en: fix use of CALLOUT_DIRECT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 0eb2dcd32ea6fb59661d709872e02ea6b3e7b9e2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0eb2dcd32ea6fb59661d709872e02ea6b3e7b9e2 commit 0eb2dcd32ea6fb59661d709872e02ea6b3e7b9e2 Author: Konstantin Belousov AuthorDate: 2021-09-08 15:37:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-05 10:07:36 +0000 mlx5_en: fix use of CALLOUT_DIRECT Reported by: markj Reviewed by: hselasky Sponsored by: NVIDIA Networking MFC after: 1 week --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 9d8854528d4a..bf8c3c52a343 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1126,10 +1126,10 @@ mlx5e_reset_calibration_callout(struct mlx5e_priv *priv) if (priv->clbr_done == 0) mlx5e_calibration_callout(priv); else - callout_reset_curcpu(&priv->tstmp_clbr, (priv->clbr_done < + callout_reset_sbt_curcpu(&priv->tstmp_clbr, (priv->clbr_done < mlx5e_calibration_duration ? mlx5e_fast_calibration : - mlx5e_normal_calibration) * hz, mlx5e_calibration_callout, - priv); + mlx5e_normal_calibration) * SBT_1S, 0, + mlx5e_calibration_callout, priv, C_DIRECT_EXEC); } static uint64_t @@ -4614,7 +4614,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) OID_AUTO, "rx_clbr_done", CTLFLAG_RD, &priv->clbr_done, 0, "RX timestamps calibration state"); - callout_init(&priv->tstmp_clbr, CALLOUT_DIRECT); + callout_init(&priv->tstmp_clbr, 1); mlx5e_reset_calibration_callout(priv); pa.pa_version = PFIL_VERSION; From nobody Tue Oct 5 12:17:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7192B17E744D; Tue, 5 Oct 2021 12:17: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 4HNxRM2jSyz4vs3; Tue, 5 Oct 2021 12:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D6704720; Tue, 5 Oct 2021 12:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195CHJ55016686; Tue, 5 Oct 2021 12:17:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195CHJ4s016685; Tue, 5 Oct 2021 12:17:19 GMT (envelope-from git) Date: Tue, 5 Oct 2021 12:17:19 GMT Message-Id: <202110051217.195CHJ4s016685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: cee9a741b261 - main - cesa: remove unused CESA_SESSIONS macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cee9a741b261aaced00c1e9e2de3f0fa283f27af Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=cee9a741b261aaced00c1e9e2de3f0fa283f27af commit cee9a741b261aaced00c1e9e2de3f0fa283f27af Author: Mateusz Guzik AuthorDate: 2021-10-05 12:12:03 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-05 12:17:10 +0000 cesa: remove unused CESA_SESSIONS macro Unused since 1b0909d51a8aa8b5 ("OpenCrypto: Convert sessions to opaque handles instead of integers") Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/cesa/cesa.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/cesa/cesa.h b/sys/dev/cesa/cesa.h index 449f4ecce5b2..9387c87e9615 100644 --- a/sys/dev/cesa/cesa.h +++ b/sys/dev/cesa/cesa.h @@ -31,9 +31,6 @@ #ifndef _DEV_CESA_H_ #define _DEV_CESA_H_ -/* Maximum number of allocated sessions */ -#define CESA_SESSIONS 64 - /* Maximum number of queued requests */ #define CESA_REQUESTS 256 From nobody Tue Oct 5 13:08:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 89BD317EB86C; Tue, 5 Oct 2021 13:08: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 4HNyZK3XTdz3F5P; Tue, 5 Oct 2021 13:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59DAE4F45; Tue, 5 Oct 2021 13:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195D8PWC083223; Tue, 5 Oct 2021 13:08:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195D8PwP083222; Tue, 5 Oct 2021 13:08:25 GMT (envelope-from git) Date: Tue, 5 Oct 2021 13:08:25 GMT Message-Id: <202110051308.195D8PwP083222@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: b3b15d9256cb - main - cam: Add doxygen for cam_sim_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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3b15d9256cbba94d509d1c8b1c5b2379f03fd26 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b3b15d9256cbba94d509d1c8b1c5b2379f03fd26 commit b3b15d9256cbba94d509d1c8b1c5b2379f03fd26 Author: Warner Losh AuthorDate: 2021-10-05 13:07:17 +0000 Commit: Warner Losh CommitDate: 2021-10-05 13:07:47 +0000 cam: Add doxygen for cam_sim_free Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D32303 --- sys/cam/cam_sim.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/cam/cam_sim.c b/sys/cam/cam_sim.c index e7a7348d0c44..abf65965fc8e 100644 --- a/sys/cam/cam_sim.c +++ b/sys/cam/cam_sim.c @@ -127,6 +127,19 @@ cam_sim_alloc(sim_action_func sim_action, sim_poll_func sim_poll, return (sim); } +/** + * @brief frees up the sim + * + * Frees up the CAM @c sim and optionally the devq. If a mutex is associated + * with the sim, it must be locked on entry. It will remain locked on + * return. + * + * This function will wait for all outstanding reference to the sim to clear + * before returning. + * + * @param sim The sim to free + * @param free_devq Free the devq associated with the sim at creation. + */ void cam_sim_free(struct cam_sim *sim, int free_devq) { From nobody Tue Oct 5 18:47:42 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0130617EB994; Tue, 5 Oct 2021 18:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP65q2mLzz4gxs; Tue, 5 Oct 2021 18:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1020C11D39; Tue, 5 Oct 2021 18:47:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195Ilg3s034231; Tue, 5 Oct 2021 18:47:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195IlgUf034230; Tue, 5 Oct 2021 18:47:42 GMT (envelope-from git) Date: Tue, 5 Oct 2021 18:47:42 GMT Message-Id: <202110051847.195IlgUf034230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 7835b2cb4a1a - main - sbuf(9): Microoptimize sbuf_put_byte() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7835b2cb4a1ae57f403739a2f1076ec7188f18c9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7835b2cb4a1ae57f403739a2f1076ec7188f18c9 commit 7835b2cb4a1ae57f403739a2f1076ec7188f18c9 Author: Alexander Motin AuthorDate: 2021-10-05 18:42:47 +0000 Commit: Alexander Motin CommitDate: 2021-10-05 18:47:38 +0000 sbuf(9): Microoptimize sbuf_put_byte() This function is actively used by sbuf_vprintf(), so this simple inlining in half reduces time of kern.geom.confxml generation. MFC after: 2 weeks Sponsored by: iXsystem, Inc. --- sys/kern/subr_sbuf.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index b7f135e81206..6c533f36c82e 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -480,7 +480,26 @@ static void sbuf_put_byte(struct sbuf *s, char c) { - sbuf_put_bytes(s, &c, 1); + assert_sbuf_integrity(s); + assert_sbuf_state(s, 0); + + if (__predict_false(s->s_error != 0)) + return; + if (__predict_false(SBUF_FREESPACE(s) <= 0)) { + /* + * If there is a drain, use it, otherwise extend the + * buffer. + */ + if (s->s_drain_func != NULL) + (void)sbuf_drain(s); + else if (sbuf_extend(s, 1) < 0) + s->s_error = ENOMEM; + if (s->s_error != 0) + return; + } + s->s_buf[s->s_len++] = c; + if (SBUF_ISSECTION(s)) + s->s_sect_len++; } /* @@ -623,7 +642,7 @@ static void sbuf_putc_func(int c, void *arg) { - if (c != '\0') + if (__predict_true(c != '\0')) sbuf_put_byte(arg, c); } From nobody Tue Oct 5 19:04:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5CC1117EE3E3; Tue, 5 Oct 2021 19:04: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 4HP6Sl28KCz4l8F; Tue, 5 Oct 2021 19:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B233121D3; Tue, 5 Oct 2021 19:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195J47P4062168; Tue, 5 Oct 2021 19:04:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195J479l062167; Tue, 5 Oct 2021 19:04:07 GMT (envelope-from git) Date: Tue, 5 Oct 2021 19:04:07 GMT Message-Id: <202110051904.195J479l062167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 8f9be1eed11c - main - cam(4): Improve XPT_DEV_MATCH List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f9be1eed11c27c66386c3d72cd6c6aef597fa0d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=8f9be1eed11c27c66386c3d72cd6c6aef597fa0d commit 8f9be1eed11c27c66386c3d72cd6c6aef597fa0d Author: Alexander Motin AuthorDate: 2021-10-05 18:54:03 +0000 Commit: Alexander Motin CommitDate: 2021-10-05 18:54:03 +0000 cam(4): Improve XPT_DEV_MATCH Remove *_MATCH_NONE enums, making no sense and so never used. Make *_MATCH_ANY enums 0 (no any match flags set), previously used by *_MATCH_NONE. Bump CAM_VERSION to 0x1a reflecting those changes and add compat shims. When traversing through buses and devices do not descend if we can already see that requested pattern does not match the bus or device. It allows to save significant amount of time on system with thousands of disks when doing limited searches. Reviewed by: imp MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D32304 --- sys/cam/cam_ccb.h | 11 +++----- sys/cam/cam_compat.c | 50 ++++++++++++++++++++++++++++++++-- sys/cam/cam_compat.h | 7 +++++ sys/cam/cam_xpt.c | 76 +++++++++++++--------------------------------------- 4 files changed, 78 insertions(+), 66 deletions(-) diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 5b5e24904996..1ae310d399b7 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -422,13 +422,12 @@ struct ccb_getdevlist { }; typedef enum { - PERIPH_MATCH_NONE = 0x000, + PERIPH_MATCH_ANY = 0x000, PERIPH_MATCH_PATH = 0x001, PERIPH_MATCH_TARGET = 0x002, PERIPH_MATCH_LUN = 0x004, PERIPH_MATCH_NAME = 0x008, PERIPH_MATCH_UNIT = 0x010, - PERIPH_MATCH_ANY = 0x01f } periph_pattern_flags; struct periph_match_pattern { @@ -441,13 +440,12 @@ struct periph_match_pattern { }; typedef enum { - DEV_MATCH_NONE = 0x000, + DEV_MATCH_ANY = 0x000, DEV_MATCH_PATH = 0x001, DEV_MATCH_TARGET = 0x002, DEV_MATCH_LUN = 0x004, DEV_MATCH_INQUIRY = 0x008, DEV_MATCH_DEVID = 0x010, - DEV_MATCH_ANY = 0x00f } dev_pattern_flags; struct device_id_match_pattern { @@ -467,12 +465,11 @@ struct device_match_pattern { }; typedef enum { - BUS_MATCH_NONE = 0x000, + BUS_MATCH_ANY = 0x000, BUS_MATCH_PATH = 0x001, BUS_MATCH_NAME = 0x002, BUS_MATCH_UNIT = 0x004, BUS_MATCH_BUS_ID = 0x008, - BUS_MATCH_ANY = 0x00f } bus_pattern_flags; struct bus_match_pattern { @@ -594,7 +591,7 @@ struct ccb_dev_match { /* * Definitions for the path inquiry CCB fields. */ -#define CAM_VERSION 0x19 /* Hex value for current version */ +#define CAM_VERSION 0x1a /* Hex value for current version */ typedef enum { PI_MDP_ABLE = 0x80, /* Supports MDP message */ diff --git a/sys/cam/cam_compat.c b/sys/cam/cam_compat.c index 4c89072fa389..6893402a3d9c 100644 --- a/sys/cam/cam_compat.c +++ b/sys/cam/cam_compat.c @@ -58,6 +58,8 @@ static int cam_compat_handle_0x17(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td, d_ioctl_t *cbfnp); static int cam_compat_handle_0x18(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td, d_ioctl_t *cbfnp); +static int cam_compat_handle_0x19(struct cdev *dev, u_long cmd, caddr_t addr, + int flag, struct thread *td, d_ioctl_t *cbfnp); static int cam_compat_translate_dev_match_0x18(union ccb *ccb); int @@ -108,6 +110,22 @@ cam_compat_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, cmd = CAMGETPASSTHRU; error = cam_compat_handle_0x18(dev, cmd, addr, flag, td, cbfnp); break; + case CAMIOCOMMAND_0x19: + cmd = CAMIOCOMMAND; + error = cam_compat_handle_0x19(dev, cmd, addr, flag, td, cbfnp); + break; + case CAMGETPASSTHRU_0x19: + cmd = CAMGETPASSTHRU; + error = cam_compat_handle_0x19(dev, cmd, addr, flag, td, cbfnp); + break; + case CAMIOQUEUE_0x19: + cmd = CAMIOQUEUE; + error = cam_compat_handle_0x19(dev, cmd, addr, flag, td, cbfnp); + break; + case CAMIOGET_0x19: + cmd = CAMIOGET; + error = cam_compat_handle_0x19(dev, cmd, addr, flag, td, cbfnp); + break; default: error = ENOTTY; } @@ -170,7 +188,7 @@ cam_compat_handle_0x17(struct cdev *dev, u_long cmd, caddr_t addr, int flag, bcopy(ccbb17, ccbb, CAM_0X17_DATA_LEN); } - error = (cbfnp)(dev, cmd, (caddr_t)ccb, flag, td); + error = cam_compat_handle_0x19(dev, cmd, (caddr_t)ccb, flag, td, cbfnp); hdr17->pinfo = hdr->pinfo; hdr17->xpt_links = hdr->xpt_links; @@ -310,7 +328,7 @@ cam_compat_handle_0x18(struct cdev *dev, u_long cmd, caddr_t addr, int flag, bcopy(ccbb18, ccbb, CAM_0X18_DATA_LEN); } - error = (cbfnp)(dev, cmd, (caddr_t)ccb, flag, td); + error = cam_compat_handle_0x19(dev, cmd, (caddr_t)ccb, flag, td, cbfnp); hdr18->pinfo = hdr->pinfo; hdr18->xpt_links = hdr->xpt_links; @@ -420,3 +438,31 @@ cam_compat_translate_dev_match_0x18(union ccb *ccb) return (0); } + +static int +cam_compat_handle_0x19(struct cdev *dev, u_long cmd, caddr_t addr, int flag, + struct thread *td, d_ioctl_t *cbfnp) +{ + union ccb *ccb = (union ccb *)addr; + struct cam_periph_map_info mapinfo; + + if (cmd == CAMIOCOMMAND && ccb->ccb_h.func_code == XPT_DEV_MATCH) { + bzero(&mapinfo, sizeof(mapinfo)); + cam_periph_mapmem(ccb, &mapinfo, maxphys); + for (int i = 0; i < ccb->cdm.num_patterns; i++) { + struct dev_match_pattern *p = &ccb->cdm.patterns[i]; + + if (p->type == DEV_MATCH_BUS && + p->pattern.bus_pattern.flags == 0x00f) + p->pattern.bus_pattern.flags = BUS_MATCH_ANY; + if (p->type == DEV_MATCH_DEVICE && + p->pattern.device_pattern.flags == 0x00f) + p->pattern.device_pattern.flags = DEV_MATCH_ANY; + if (p->type == DEV_MATCH_PERIPH && + p->pattern.periph_pattern.flags == 0x01f) + p->pattern.periph_pattern.flags = PERIPH_MATCH_ANY; + } + cam_periph_unmapmem(ccb, &mapinfo); + } + return ((cbfnp)(dev, cmd, addr, flag, td)); +} diff --git a/sys/cam/cam_compat.h b/sys/cam/cam_compat.h index dd728d86839e..9a1996d230ce 100644 --- a/sys/cam/cam_compat.h +++ b/sys/cam/cam_compat.h @@ -220,5 +220,12 @@ struct dev_match_result_0x18 { #define CAMIOCOMMAND_0x18 _IOC(IOC_INOUT, CAM_VERSION_0x18, 2, CAM_0X18_LEN) #define CAMGETPASSTHRU_0x18 _IOC(IOC_INOUT, CAM_VERSION_0x18, 3, CAM_0X18_LEN) +/* Version 0x19 compatibility */ +#define CAM_VERSION_0x19 0x19 +#define CAMIOCOMMAND_0x19 _IOWR(CAM_VERSION_0x19, 2, union ccb) +#define CAMGETPASSTHRU_0x19 _IOWR(CAM_VERSION_0x19, 3, union ccb) +#define CAMIOQUEUE_0x19 _IO(CAM_VERSION_0x19, 4) +#define CAMIOGET_0x19 _IO(CAM_VERSION_0x19, 5) + #endif #endif diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index e228f0967f0e..d9ecabefe044 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -1386,6 +1386,8 @@ xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, for (i = 0; i < num_patterns; i++) { struct bus_match_pattern *cur_pattern; + struct device_match_pattern *dp = &patterns[i].pattern.device_pattern; + struct periph_match_pattern *pp = &patterns[i].pattern.periph_pattern; /* * If the pattern in question isn't for a bus node, we @@ -1394,6 +1396,14 @@ xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, * tree, since the user wants to match against lower-level * EDT elements. */ + if (patterns[i].type == DEV_MATCH_DEVICE && + (dp->flags & DEV_MATCH_PATH) != 0 && + dp->path_id != bus->path_id) + continue; + if (patterns[i].type == DEV_MATCH_PERIPH && + (pp->flags & PERIPH_MATCH_PATH) != 0 && + pp->path_id != bus->path_id) + continue; if (patterns[i].type != DEV_MATCH_BUS) { if ((retval & DM_RET_ACTION_MASK) == DM_RET_NONE) retval |= DM_RET_DESCEND; @@ -1402,28 +1412,6 @@ xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, cur_pattern = &patterns[i].pattern.bus_pattern; - /* - * If they want to match any bus node, we give them any - * device node. - */ - if (cur_pattern->flags == BUS_MATCH_ANY) { - /* set the copy flag */ - retval |= DM_RET_COPY; - - /* - * If we've already decided on an action, go ahead - * and return. - */ - if ((retval & DM_RET_ACTION_MASK) != DM_RET_NONE) - return(retval); - } - - /* - * Not sure why someone would do this... - */ - if (cur_pattern->flags == BUS_MATCH_NONE) - continue; - if (((cur_pattern->flags & BUS_MATCH_PATH) != 0) && (cur_pattern->path_id != bus->path_id)) continue; @@ -1499,11 +1487,20 @@ xptdevicematch(struct dev_match_pattern *patterns, u_int num_patterns, for (i = 0; i < num_patterns; i++) { struct device_match_pattern *cur_pattern; struct scsi_vpd_device_id *device_id_page; + struct periph_match_pattern *pp = &patterns[i].pattern.periph_pattern; /* * If the pattern in question isn't for a device node, we * aren't interested. */ + if (patterns[i].type == DEV_MATCH_PERIPH && + (pp->flags & PERIPH_MATCH_TARGET) != 0 && + pp->target_id != device->target->target_id) + continue; + if (patterns[i].type == DEV_MATCH_PERIPH && + (pp->flags & PERIPH_MATCH_LUN) != 0 && + pp->target_lun != device->lun_id) + continue; if (patterns[i].type != DEV_MATCH_DEVICE) { if ((patterns[i].type == DEV_MATCH_PERIPH) && ((retval & DM_RET_ACTION_MASK) == DM_RET_NONE)) @@ -1518,19 +1515,6 @@ xptdevicematch(struct dev_match_pattern *patterns, u_int num_patterns, == (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID)) return(DM_RET_ERROR); - /* - * If they want to match any device node, we give them any - * device node. - */ - if (cur_pattern->flags == DEV_MATCH_ANY) - goto copy_dev_node; - - /* - * Not sure why someone would do this... - */ - if (cur_pattern->flags == DEV_MATCH_NONE) - continue; - if (((cur_pattern->flags & DEV_MATCH_PATH) != 0) && (cur_pattern->path_id != device->target->bus->path_id)) continue; @@ -1560,7 +1544,6 @@ xptdevicematch(struct dev_match_pattern *patterns, u_int num_patterns, cur_pattern->data.devid_pat.id_len) != 0)) continue; -copy_dev_node: /* * If we get to this point, the user definitely wants * information on this device. So tell the caller to copy @@ -1635,27 +1618,6 @@ xptperiphmatch(struct dev_match_pattern *patterns, u_int num_patterns, cur_pattern = &patterns[i].pattern.periph_pattern; - /* - * If they want to match on anything, then we will do so. - */ - if (cur_pattern->flags == PERIPH_MATCH_ANY) { - /* set the copy flag */ - retval |= DM_RET_COPY; - - /* - * We've already set the return action to stop, - * since there are no nodes below peripherals in - * the tree. - */ - return(retval); - } - - /* - * Not sure why someone would do this... - */ - if (cur_pattern->flags == PERIPH_MATCH_NONE) - continue; - if (((cur_pattern->flags & PERIPH_MATCH_PATH) != 0) && (cur_pattern->path_id != periph->path->bus->path_id)) continue; From nobody Tue Oct 5 19:04:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 44E3F17EE173; Tue, 5 Oct 2021 19:04: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 4HP6Sm4nM9z4l6D; Tue, 5 Oct 2021 19:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CF94121D4; Tue, 5 Oct 2021 19:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195J48P1062192; Tue, 5 Oct 2021 19:04:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195J48iO062191; Tue, 5 Oct 2021 19:04:08 GMT (envelope-from git) Date: Tue, 5 Oct 2021 19:04:08 GMT Message-Id: <202110051904.195J48iO062191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 730ea72c706e - main - cam(4): Limit search for disks in SES enclosure by single bus List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 730ea72c706ef8e025616772cfd86fd89ed3d42e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=730ea72c706ef8e025616772cfd86fd89ed3d42e commit 730ea72c706ef8e025616772cfd86fd89ed3d42e Author: Alexander Motin AuthorDate: 2021-10-05 19:01:16 +0000 Commit: Alexander Motin CommitDate: 2021-10-05 19:01:16 +0000 cam(4): Limit search for disks in SES enclosure by single bus At least for SAS that we only support now disks are typically connected to the same bus as the enclosure. Limiting the search scope makes it much faster on systems with multiple buses and thousands of disks. Reviewed by: imp MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D32305 --- sys/cam/scsi/scsi_enc_ses.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index f4f1c4a23516..39d99fd23eb9 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -374,6 +374,10 @@ typedef struct ses_softc { ses_control_reqlist_t ses_pending_requests; } ses_softc_t; +static int ses_search_globally = 0; +SYSCTL_INT(_kern_cam_enc, OID_AUTO, search_globally, CTLFLAG_RWTUN, + &ses_search_globally, 0, "Search for disks on other buses"); + /** * \brief Reset a SES iterator to just before the first element * in the configuration. @@ -890,6 +894,10 @@ ses_path_iter_devid_callback(enc_softc_t *enc, enc_element_t *elem, + devid->length; memcpy(device_pattern->data.devid_pat.id, devid, device_pattern->data.devid_pat.id_len); + if (!ses_search_globally) { + device_pattern->flags |= DEV_MATCH_PATH; + device_pattern->path_id = xpt_path_path_id(enc->periph->path); + } memset(&cdm, 0, sizeof(cdm)); if (xpt_create_path(&cdm.ccb_h.path, /*periph*/NULL, From nobody Tue Oct 5 19:14:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3DE839F010A; Tue, 5 Oct 2021 19:14:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP6hp1DG5z4mrx; Tue, 5 Oct 2021 19:14:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f171.google.com with SMTP id w190so671527oif.5; Tue, 05 Oct 2021 12:14:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wKi+L1BNfZfv6c1tgHDHQ4wzU6rZvQgHb+lN31FoKU8=; b=b/fZcNauPpsJ7VzF7BXC35Xz8tRiHORPiVKaGaxid9F9sZbFic9DD56/nz73rA8zEy 4wfuBELApwpFBuHKup4l/aRmYULG7WZ/z5Js1jeEyw55ZAd/lVgOuicxRxbxvnetIiE1 zc2lResxSiumOjHi6sZkUsT0GDWz24StnNUwFj8knP6pmSl3zY2UF+NmG+qbDR7tkxbA 9CdZTJuANS7n41w4CIU5d/90JyZvKJSw3U24zKIbr8EE/2fQusK+ylc7AP99hITYQ2sa NfFPxZ85v6QICDG7mr/d0Nyoed+ju23yjWP59cZ/DxLrj7CvP0sGeDUKMuolTE7Z/h5o hkZg== X-Gm-Message-State: AOAM531WI9lYXGPxGNMMAk9dWXruioHBUgfXnc9UziT/s6cwzCLLtl2j 3co8sDWj2b6/Lh0aQdd0pwCAiGKznTSj54xri0A7F1Bl X-Google-Smtp-Source: ABdhPJwVghseK9Wpn6/qemrX/dVThzOrqR7PGaW9R/HlExfFeNuHO1XjIzdXtfmAIDhQ+VRmPQ6jRvX1+xI542KEheA= X-Received: by 2002:aca:1b09:: with SMTP id b9mr3972399oib.55.1633461267075; Tue, 05 Oct 2021 12:14:27 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110051904.195J48iO062191@gitrepo.freebsd.org> In-Reply-To: <202110051904.195J48iO062191@gitrepo.freebsd.org> From: Alan Somers Date: Tue, 5 Oct 2021 13:14:16 -0600 Message-ID: Subject: Re: git: 730ea72c706e - main - cam(4): Limit search for disks in SES enclosure by single bus To: Alexander Motin Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HP6hp1DG5z4mrx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 5, 2021 at 1:04 PM Alexander Motin wrote: > > The branch main has been updated by mav: > > URL: https://cgit.FreeBSD.org/src/commit/?id=730ea72c706ef8e025616772cfd86fd89ed3d42e > > commit 730ea72c706ef8e025616772cfd86fd89ed3d42e > Author: Alexander Motin > AuthorDate: 2021-10-05 19:01:16 +0000 > Commit: Alexander Motin > CommitDate: 2021-10-05 19:01:16 +0000 > > cam(4): Limit search for disks in SES enclosure by single bus > > At least for SAS that we only support now disks are typically > connected to the same bus as the enclosure. Limiting the search > scope makes it much faster on systems with multiple buses and > thousands of disks. > > Reviewed by: imp > MFC after: 2 weeks > Sponsored by: iXsystems, Inc. > Differential Revision: https://reviews.freebsd.org/D32305 > --- > sys/cam/scsi/scsi_enc_ses.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c Sounds juicy. Do you have any benchmarks? From nobody Tue Oct 5 19:41:55 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EA09F9F3C3D; Tue, 5 Oct 2021 19:41:58 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP7JQ63NNz4r4v; Tue, 5 Oct 2021 19:41:58 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qk1-x736.google.com with SMTP id 72so128594qkk.7; Tue, 05 Oct 2021 12:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WKMj1o76IXKbQG5vUYLB/+XdG85qh/hv+Q2dEK1yJUg=; b=ofuogPir++tjKblTCclIXHAMlm8sWfl6M+WbFzoqlVz5cNcK49mwcuC1NB8Qs0tbC7 bxSfXPostSUQrQaAj1IxBigWdVPnqtIiVRq4R/0UwCPAWhLEsUiCEpjop8aKdc5XD1wl LnxMRYECikinWobSKaX2/siwR+UU0a1WJxKoijNcjY+1A8uvQSL8poG++17/UmBegRIE fSJzDFPvqD/N1vTglNX7S0+YuasgVdqLL51UCvHdxk/KFjAVEuJxrrrGTyiJlU+FaOKW HjWUOleT8s39FZHb6og9+/3IW2lzXkJL46wujEVtYrp6f7+gNx2xw6FmvSzg0qsVKkhB +/mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WKMj1o76IXKbQG5vUYLB/+XdG85qh/hv+Q2dEK1yJUg=; b=2fKjisUr810KskAnJRXzBcpF6Y/FQ/AJNQriJPxEjh7nzlxqycrV5byGq6Cbid4ImN qhO86pq0dKyE6Px6s+BM3WRv4ms9ssXVedrNvKpXAtOU8ru+vAleyCqM735RQKnOxdMx fj3TuxlMUq/ET26qjgWdg9mx6YVfV1ktSsWdeUP8+BhWHncYArPPtW3q1WhcllsH8pGE Y9FLFGOGS09l++8IvAVPMbulfPc7RDnojpXrLp6MaSa9gdQUSbuej8eEqQnC71UW8Qtb /ljM5PdZ0xo/sFgo3NO9vt9gFwHh6GJVSigmM2nZYRYANl83lQKsi59/1GL4SbWmayfL idiA== X-Gm-Message-State: AOAM533Ag70gi/rxR5Aoq6hx4iWrF6r4uTC7irNqctIglqU7O5fcl+jB rEvK3s33HigX1UXv96KcbWZvYhLbFGA= X-Google-Smtp-Source: ABdhPJzp2beuFT1qRZvN0Uun2h5OUhJ1pNEDgIfScdgvtsuz9SVyCxiPVMsV2OWZuOLa4c/0sdweyA== X-Received: by 2002:a37:2d46:: with SMTP id t67mr16033818qkh.84.1633462917975; Tue, 05 Oct 2021 12:41:57 -0700 (PDT) Received: from mavoffice.ixsystems.com ([38.32.73.2]) by smtp.gmail.com with ESMTPSA id b18sm934725qtq.62.2021.10.05.12.41.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 12:41:56 -0700 (PDT) Sender: Alexander Motin Subject: Re: git: 730ea72c706e - main - cam(4): Limit search for disks in SES enclosure by single bus To: Alan Somers Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110051904.195J48iO062191@gitrepo.freebsd.org> From: Alexander Motin Message-ID: Date: Tue, 5 Oct 2021 15:41:55 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.13.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 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HP7JQ63NNz4r4v X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 05.10.2021 15:14, Alan Somers wrote: > On Tue, Oct 5, 2021 at 1:04 PM Alexander Motin wrote: >> >> The branch main has been updated by mav: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=730ea72c706ef8e025616772cfd86fd89ed3d42e >> >> commit 730ea72c706ef8e025616772cfd86fd89ed3d42e >> Author: Alexander Motin >> AuthorDate: 2021-10-05 19:01:16 +0000 >> Commit: Alexander Motin >> CommitDate: 2021-10-05 19:01:16 +0000 >> >> cam(4): Limit search for disks in SES enclosure by single bus >> >> At least for SAS that we only support now disks are typically >> connected to the same bus as the enclosure. Limiting the search >> scope makes it much faster on systems with multiple buses and >> thousands of disks. >> >> Reviewed by: imp >> MFC after: 2 weeks >> Sponsored by: iXsystems, Inc. >> Differential Revision: https://reviews.freebsd.org/D32305 >> --- >> sys/cam/scsi/scsi_enc_ses.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c > > > Sounds juicy. Do you have any benchmarks? I don't think we've benchmarked that system with payload yet, if that is what you mean, polishing usability. But I don't think there can be too much interesting, since big speeds don't require so many HDDs these days, but much smaller number of SSDs instead. This particular system is about capacity -- ~20PiB raw on 1248 disks in one ZFS pool. :) -- Alexander Motin From nobody Tue Oct 5 19:48:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 064329F5DF5; Tue, 5 Oct 2021 19:48:39 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP7S66SyFz4sFp; Tue, 5 Oct 2021 19:48:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f171.google.com with SMTP id a3so792010oid.6; Tue, 05 Oct 2021 12:48:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9dLaoF7wO7yb0F5ctYjRn2FuWRqUaXfiU3GRRWIA/Bc=; b=nOjXgOe+OO0g+u+phsRB+fn2gq8ZpAgFtuL4WF1eUU4BbVJW248avu3Ytl76VPmib4 ekAQok/9AT68Eem5YPSDRJ6S/U2BsRKnmWZIWnnegFfWLS1ClIoJZWeQ4+72tbV7gEKA bdsmpFUiPoprSM/dfEE5CHnAYYZnEiRCaJKPa8s8uEN71hyWmO1uimG/40Z3qFbHtIqI jvXhMVpj7nHDnzxT7kHTIGMhsG85JP1fsk36TonHIYW6JbYPNbk/1KXl9QbsJVvDSKdw SxbZNHmlOaNgbtnLZYoKLfLhLNv61fL4TseaZ+R+EnCuskSk7kZVi8hQ+rKObh/rUPrL EsXg== X-Gm-Message-State: AOAM531E7auDQScJ+iCeFKsWx0gItPOHaix+7GlVY/yI7k2slOvYTAA6 GsW3TxIBmg8FLDgiHQ2kHvxAWNuSADNDmA1Jqj8bz35h X-Google-Smtp-Source: ABdhPJzCpBIUYYUJJTsyJ4WfpfLwNQpQZMiESG5JOC1GD4evyEvUkwXuCF5f30HA/06cdWt0CxZRqFpBxcYN5uO7aIc= X-Received: by 2002:a54:4e94:: with SMTP id c20mr4012418oiy.57.1633463318145; Tue, 05 Oct 2021 12:48:38 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110051904.195J48iO062191@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Tue, 5 Oct 2021 13:48:27 -0600 Message-ID: Subject: Re: git: 730ea72c706e - main - cam(4): Limit search for disks in SES enclosure by single bus To: Alexander Motin Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HP7S66SyFz4sFp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 5, 2021 at 1:41 PM Alexander Motin wrote: > > On 05.10.2021 15:14, Alan Somers wrote: > > On Tue, Oct 5, 2021 at 1:04 PM Alexander Motin wrote: > >> > >> The branch main has been updated by mav: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=730ea72c706ef8e025616772cfd86fd89ed3d42e > >> > >> commit 730ea72c706ef8e025616772cfd86fd89ed3d42e > >> Author: Alexander Motin > >> AuthorDate: 2021-10-05 19:01:16 +0000 > >> Commit: Alexander Motin > >> CommitDate: 2021-10-05 19:01:16 +0000 > >> > >> cam(4): Limit search for disks in SES enclosure by single bus > >> > >> At least for SAS that we only support now disks are typically > >> connected to the same bus as the enclosure. Limiting the search > >> scope makes it much faster on systems with multiple buses and > >> thousands of disks. > >> > >> Reviewed by: imp > >> MFC after: 2 weeks > >> Sponsored by: iXsystems, Inc. > >> Differential Revision: https://reviews.freebsd.org/D32305 > >> --- > >> sys/cam/scsi/scsi_enc_ses.c | 8 ++++++++ > >> 1 file changed, 8 insertions(+) > >> > >> diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c > > > > > > Sounds juicy. Do you have any benchmarks? > > I don't think we've benchmarked that system with payload yet, if that is > what you mean, polishing usability. But I don't think there can be too > much interesting, since big speeds don't require so many HDDs these > days, but much smaller number of SSDs instead. This particular system > is about capacity -- ~20PiB raw on 1248 disks in one ZFS pool. :) > > -- > Alexander Motin 1248 disks? That's huge. But I'm not asking about throughput. Your commit message said "much faster". What operation is "much faster"? Enumerating disks at startup? That would be useful. -Alan From nobody Tue Oct 5 19:54:58 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 770149F6F09; Tue, 5 Oct 2021 19:55:00 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP7bS2ghYz4t9p; Tue, 5 Oct 2021 19:55:00 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qt1-x82f.google.com with SMTP id a13so243984qtw.10; Tue, 05 Oct 2021 12:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jWUvMJrec6y9v/FlMG7eOxxsUlORFgk9UScwaVnTwKo=; b=ci8rdLxCPrbdmip43AYthI9zKZsujxKJytS3/gUBhiqMG0TuLn/TvPYHpSCAY7G7LM zCGBgjuvupQ6SgTQ4SZ5dyo3ANMzS5YPpWy3Lke1wxb4gJvD4vBPFwedmu0XdIDzbM9K odmmg+s4jYbiMWf4ilrFxxZ/jge31uIAqFmtx4ViwOnXAmuW53IRC7LA7m8I/SEL4c2z 85K4artOwEu98oLmJUuYhvQ2I+avY95LyOkB5ZWtnS8+v6EdVwb4LU0Vw0GEfQSb3H3x 9g0UjshuNQqYJO7TgOMXwKgdDRG7CqfqAGJRByDlQ4jO3mjSyeTlO+I5wgy8kvnqzM+U Q/JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jWUvMJrec6y9v/FlMG7eOxxsUlORFgk9UScwaVnTwKo=; b=aTnzTvFgDztFF1h5PcAKUEPZvppYeID3MLqwSlxbxiKMNbYE6afXD9+xGgndwcyN3W oqbtkY+EJpextzdY6crsON+rWpgRf1pLDj+y0wVDP4PfbIoEIQGMBoCh5QyIhElG+2BX 93wOoI3aeMlYAf4ViEIzHIu2/8g/biFoYfnmfV93yL4jYSS3iIUq+C8DPuwsdWHEspD1 riULIFmtPcbY5wNxhdDSLVQUWTb0g+YBWfBNogR2KCz7Dkg6QECry+0qjxr1vKdQOLHo Q5KNfCQY9VIf/XgbjBlDk+rYdocdFVaaUop0lN9KQDPZJk4gOCfT5c8YopAT416teIoo LtEg== X-Gm-Message-State: AOAM531dRb+nzcggDLdHiIjejA7U+WB5C2GhO78vtaz2/EIK2y61Kr5v rLA1VZvWa8pG/o6Fdvj4yf5Fr4sjVyg= X-Google-Smtp-Source: ABdhPJyMpWkNkgz5aCtfgWoJjlr1NtUwLEmzlXu5MuWrHqPavTzmGqnNzT3DTWpZx5tL+1ItVCqdxg== X-Received: by 2002:ac8:c9:: with SMTP id d9mr8841641qtg.189.1633463699565; Tue, 05 Oct 2021 12:54:59 -0700 (PDT) Received: from mavoffice.ixsystems.com ([38.32.73.2]) by smtp.gmail.com with ESMTPSA id k10sm10213395qkk.124.2021.10.05.12.54.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 12:54:58 -0700 (PDT) Sender: Alexander Motin Subject: Re: git: 730ea72c706e - main - cam(4): Limit search for disks in SES enclosure by single bus To: Alan Somers Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110051904.195J48iO062191@gitrepo.freebsd.org> From: Alexander Motin Message-ID: <99fe068a-356c-7d58-8c70-6ecdf504ab25@FreeBSD.org> Date: Tue, 5 Oct 2021 15:54:58 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.13.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 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HP7bS2ghYz4t9p X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 05.10.2021 15:48, Alan Somers wrote: > On Tue, Oct 5, 2021 at 1:41 PM Alexander Motin wrote: >> >> On 05.10.2021 15:14, Alan Somers wrote: >>> On Tue, Oct 5, 2021 at 1:04 PM Alexander Motin wrote: >>>> >>>> The branch main has been updated by mav: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=730ea72c706ef8e025616772cfd86fd89ed3d42e >>>> >>>> commit 730ea72c706ef8e025616772cfd86fd89ed3d42e >>>> Author: Alexander Motin >>>> AuthorDate: 2021-10-05 19:01:16 +0000 >>>> Commit: Alexander Motin >>>> CommitDate: 2021-10-05 19:01:16 +0000 >>>> >>>> cam(4): Limit search for disks in SES enclosure by single bus >>>> >>>> At least for SAS that we only support now disks are typically >>>> connected to the same bus as the enclosure. Limiting the search >>>> scope makes it much faster on systems with multiple buses and >>>> thousands of disks. >>>> >>>> Reviewed by: imp >>>> MFC after: 2 weeks >>>> Sponsored by: iXsystems, Inc. >>>> Differential Revision: https://reviews.freebsd.org/D32305 >>>> --- >>>> sys/cam/scsi/scsi_enc_ses.c | 8 ++++++++ >>>> 1 file changed, 8 insertions(+) >>>> >>>> diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c >>> >>> >>> Sounds juicy. Do you have any benchmarks? >> >> I don't think we've benchmarked that system with payload yet, if that is >> what you mean, polishing usability. But I don't think there can be too >> much interesting, since big speeds don't require so many HDDs these >> days, but much smaller number of SSDs instead. This particular system >> is about capacity -- ~20PiB raw on 1248 disks in one ZFS pool. :) > > 1248 disks? That's huge. But I'm not asking about throughput. Your > commit message said "much faster". What operation is "much faster"? > Enumerating disks at startup? That would be useful. I don't think you notice the difference on startup, too many other things going on, but during idle it reduces periodic CPU load spikes by enc_daemon processes by several times, proportionally to the number of HBAs/buses. More annoyance than a real problem though. -- Alexander Motin From nobody Tue Oct 5 20:00:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AB5F512B92E2; Tue, 5 Oct 2021 20:01:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP7kc4Jtyz3Cbg; Tue, 5 Oct 2021 20:01:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id j11-20020a9d190b000000b00546fac94456so330515ota.6; Tue, 05 Oct 2021 13:01:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cxAckdlNsHic/jQpN1vA8gkWikty3hOcJFuf5S8euqI=; b=FMH476O1aPv3Lip3GZrcpL8bgplMeP84f7hQ8G9QUfn0FKUmff2KkmoV5G/jBe637o 4qxIwO2UXowyuTPIMpGk1vxbky8muP6vxauylkkURk3Y1m+glv4tZhT1ZXblMhbK+T9C Ga0O6V+MrmIXW8h2LWmyp3UoXORxvBrG12BChzuSOgZNDnewGJk1Gbo5lHAv6bwPfcoD xE7YicK2nXRmWhSQFdnLTcGwQqGWmmo1KslJTgDauJmtJi7ZYdepHcjzo/KmVJz1PpSY Q1D93g9b2My6iq3eksudvIazM1PDpw7o5VT1Yzl82aNvYolM6xhLzCD+Hlhz50HovYMs xEoA== X-Gm-Message-State: AOAM530suzyTzYnTIR3ha3e4tDtWmODyk4V48b9Hcffktr0b69XGgQJA FjBq7H6dYwVtpNMvAhC/DSfsPu23U6lpgJxVMdAoLSS3 X-Google-Smtp-Source: ABdhPJxRVL5XWHYlrfYP+HUd4uHJ3FETW50cvVVe+dRbOrq3jvPlERn0Qqfs8fHae9+EIlNZYCmq/RVwjn+VLLic4ko= X-Received: by 2002:a05:6830:44ab:: with SMTP id r43mr1133740otv.371.1633464065709; Tue, 05 Oct 2021 13:01:05 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110051904.195J48iO062191@gitrepo.freebsd.org> <99fe068a-356c-7d58-8c70-6ecdf504ab25@FreeBSD.org> In-Reply-To: <99fe068a-356c-7d58-8c70-6ecdf504ab25@FreeBSD.org> From: Alan Somers Date: Tue, 5 Oct 2021 14:00:54 -0600 Message-ID: Subject: Re: git: 730ea72c706e - main - cam(4): Limit search for disks in SES enclosure by single bus To: Alexander Motin Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HP7kc4Jtyz3Cbg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 5, 2021 at 1:55 PM Alexander Motin wrote: > > On 05.10.2021 15:48, Alan Somers wrote: > > On Tue, Oct 5, 2021 at 1:41 PM Alexander Motin wrote: > >> > >> On 05.10.2021 15:14, Alan Somers wrote: > >>> On Tue, Oct 5, 2021 at 1:04 PM Alexander Motin wrote: > >>>> > >>>> The branch main has been updated by mav: > >>>> > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=730ea72c706ef8e025616772cfd86fd89ed3d42e > >>>> > >>>> commit 730ea72c706ef8e025616772cfd86fd89ed3d42e > >>>> Author: Alexander Motin > >>>> AuthorDate: 2021-10-05 19:01:16 +0000 > >>>> Commit: Alexander Motin > >>>> CommitDate: 2021-10-05 19:01:16 +0000 > >>>> > >>>> cam(4): Limit search for disks in SES enclosure by single bus > >>>> > >>>> At least for SAS that we only support now disks are typically > >>>> connected to the same bus as the enclosure. Limiting the search > >>>> scope makes it much faster on systems with multiple buses and > >>>> thousands of disks. > >>>> > >>>> Reviewed by: imp > >>>> MFC after: 2 weeks > >>>> Sponsored by: iXsystems, Inc. > >>>> Differential Revision: https://reviews.freebsd.org/D32305 > >>>> --- > >>>> sys/cam/scsi/scsi_enc_ses.c | 8 ++++++++ > >>>> 1 file changed, 8 insertions(+) > >>>> > >>>> diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c > >>> > >>> > >>> Sounds juicy. Do you have any benchmarks? > >> > >> I don't think we've benchmarked that system with payload yet, if that is > >> what you mean, polishing usability. But I don't think there can be too > >> much interesting, since big speeds don't require so many HDDs these > >> days, but much smaller number of SSDs instead. This particular system > >> is about capacity -- ~20PiB raw on 1248 disks in one ZFS pool. :) > > > > 1248 disks? That's huge. But I'm not asking about throughput. Your > > commit message said "much faster". What operation is "much faster"? > > Enumerating disks at startup? That would be useful. > > I don't think you notice the difference on startup, too many other > things going on, but during idle it reduces periodic CPU load spikes by > enc_daemon processes by several times, proportionally to the number of > HBAs/buses. More annoyance than a real problem though. > > -- > Alexander Motin Yeah, I've noticed those occasional enc_daemon spikes. I was never sure what it was doing. Thanks for the fix! I'm looking forward to 13.1 a little bit more now. From nobody Tue Oct 5 21:17:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 586BC12D4BBB; Tue, 5 Oct 2021 21:17: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 4HP9Qs1vzVz3Q8N; Tue, 5 Oct 2021 21:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E08313DDB; Tue, 5 Oct 2021 21:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195LHfAA037008; Tue, 5 Oct 2021 21:17:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195LHf0c037006; Tue, 5 Oct 2021 21:17:41 GMT (envelope-from git) Date: Tue, 5 Oct 2021 21:17:41 GMT Message-Id: <202110052117.195LHf0c037006@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: 70ffa69e1bc7 - main - Remove obsolete amd(8) rc.conf configuration List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 70ffa69e1bc7d6acbe061315743b1407b7d722d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=70ffa69e1bc7d6acbe061315743b1407b7d722d8 commit 70ffa69e1bc7d6acbe061315743b1407b7d722d8 Author: Tom Hukins AuthorDate: 2021-10-05 14:34:52 +0000 Commit: Ed Maste CommitDate: 2021-10-05 21:16:58 +0000 Remove obsolete amd(8) rc.conf configuration The script that used these was removed in 13f7dbe822d5f along with amd itself. Fixes: 13f7dbe822d5 ("retire amd(8)") MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/548 --- libexec/rc/rc.conf | 4 ---- share/man/man5/rc.conf.5 | 36 +----------------------------------- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index b392dae9ae6c..6f4a3a1eb3f3 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -356,10 +356,6 @@ ftpd_program="/usr/libexec/ftpd" # Path to ftpd, if you want a different one. ftpd_flags="" # Additional flags to stand-alone ftpd. ### Network daemon (NFS): All need rpcbind_enable="YES" ### -amd_enable="NO" # Run amd service with $amd_flags (or NO). -amd_program="/usr/sbin/amd" # path to amd, if you want a different one. -amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map" -amd_map_program="NO" # Can be set to "ypcat -k amd.master" autofs_enable="NO" # Run autofs daemons. automount_flags="" # Flags to automount(8) (if autofs enabled). automountd_flags="" # Flags to automountd(8) (if autofs enabled). diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index b9d22a789c3a..6cff3f12954a 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2021 +.Dd October 5, 2021 .Dt RC.CONF 5 .Os .Sh NAME @@ -2352,39 +2352,6 @@ If is set to .Dq Li YES , these are the flags to pass to it. -.It Va amd_enable -.Pq Vt bool -If set to -.Dq Li YES , -run the -.Xr amd 8 -daemon at boot time. -.It Va amd_flags -.Pq Vt str -If -.Va amd_enable -is set to -.Dq Li YES , -these are the flags to pass to it. -See the -.Xr amd 8 -manpage for more information. -.It Va amd_map_program -.Pq Vt str -If set, -the specified program is run to get the list of -.Xr amd 8 -maps. -For example, if the -.Xr amd 8 -maps are stored in NIS, one can set this to -run -.Xr ypcat 1 -to get a list of -.Xr amd 8 -maps from the -.Pa amd.master -NIS map. .It Va update_motd .Pq Vt bool If set to @@ -4665,7 +4632,6 @@ it will be made permanently active. .Xr security 7 , .Xr tuning 7 , .Xr accton 8 , -.Xr amd 8 , .Xr apm 8 , .Xr bsdinstall 8 , .Xr bthidd 8 , From nobody Tue Oct 5 21:56:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F36A112DAEBB; Tue, 5 Oct 2021 21:56: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 4HPBHJ5swlz3mQn; Tue, 5 Oct 2021 21:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A692C14914; Tue, 5 Oct 2021 21:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195LuCks089333; Tue, 5 Oct 2021 21:56:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195LuChF089332; Tue, 5 Oct 2021 21:56:12 GMT (envelope-from git) Date: Tue, 5 Oct 2021 21:56:12 GMT Message-Id: <202110052156.195LuChF089332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 680d70b59e03 - main - sysdecode_enum.3: Fix a typo: SIGBTRAP -> SIGTRAP. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 680d70b59e0379ded0cc94e3772bc47be2163c7f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=680d70b59e0379ded0cc94e3772bc47be2163c7f commit 680d70b59e0379ded0cc94e3772bc47be2163c7f Author: John Baldwin AuthorDate: 2021-10-05 21:55:18 +0000 Commit: John Baldwin CommitDate: 2021-10-05 21:55:18 +0000 sysdecode_enum.3: Fix a typo: SIGBTRAP -> SIGTRAP. MFC after: 3 days Sponsored by: DARPA --- lib/libsysdecode/sysdecode_enum.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsysdecode/sysdecode_enum.3 b/lib/libsysdecode/sysdecode_enum.3 index 1db625f40ff0..722d82f27f29 100644 --- a/lib/libsysdecode/sysdecode_enum.3 +++ b/lib/libsysdecode/sysdecode_enum.3 @@ -225,7 +225,7 @@ object associated with an instance of signal: .It Fn sysdecode_sigfpe_code Ta Dv SIGFPE .It Fn sysdecode_sigill_code Ta Dv SIGILL .It Fn sysdecode_sigsegv_code Ta Dv SIGSEGV -.It Fn sysdecode_sigtrap_code Ta Dv SIGBTRAP +.It Fn sysdecode_sigtrap_code Ta Dv SIGTRAP .El .Pp Other functions decode the values described below: From nobody Wed Oct 6 00:27:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8DB6A12BA50D; Wed, 6 Oct 2021 00:27: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 4HPFfN3bR7z4VMk; Wed, 6 Oct 2021 00:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AF54167AD; Wed, 6 Oct 2021 00:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1960RulA089363; Wed, 6 Oct 2021 00:27:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1960Rucv089362; Wed, 6 Oct 2021 00:27:56 GMT (envelope-from git) Date: Wed, 6 Oct 2021 00:27:56 GMT Message-Id: <202110060027.1960Rucv089362@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: 7102ec5226e5 - main - unifdef.1: Fix typo on "input" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 7102ec5226e5eb410f817a90a54843410a32420d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7102ec5226e5eb410f817a90a54843410a32420d commit 7102ec5226e5eb410f817a90a54843410a32420d Author: Elyes HAOUAS AuthorDate: 2021-10-05 18:58:51 +0000 Commit: Ed Maste CommitDate: 2021-10-06 00:27:16 +0000 unifdef.1: Fix typo on "input" Pull request: https://github.com/freebsd/freebsd-src/pull/549 Signed-off-by: Elyes HAOUAS --- usr.bin/unifdef/unifdef.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/unifdef/unifdef.1 b/usr.bin/unifdef/unifdef.1 index 2bbefc0a2947..31a823268215 100644 --- a/usr.bin/unifdef/unifdef.1 +++ b/usr.bin/unifdef/unifdef.1 @@ -406,7 +406,7 @@ You must use the or .Fl M options if there are multiple input files. -You can specify inut from stdin or output to stdout with +You can specify input from stdin or output to stdout with .Ql - . .Pp The From nobody Wed Oct 6 02:54:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 53E9312D7662; Wed, 6 Oct 2021 02:54: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 4HPJvW1vtZz4gKT; Wed, 6 Oct 2021 02:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20B931852A; Wed, 6 Oct 2021 02:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1962sVZF087611; Wed, 6 Oct 2021 02:54:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1962sVbe087610; Wed, 6 Oct 2021 02:54:31 GMT (envelope-from git) Date: Wed, 6 Oct 2021 02:54:31 GMT Message-Id: <202110060254.1962sVbe087610@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: f8d3368b4346 - main - apic: initialize lapic_paddr statically List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: f8d3368b4346237deeaaaa91308ce78f8e2ea820 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f8d3368b4346237deeaaaa91308ce78f8e2ea820 commit f8d3368b4346237deeaaaa91308ce78f8e2ea820 Author: Konstantin Belousov AuthorDate: 2021-10-05 13:19:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-06 02:52:56 +0000 apic: initialize lapic_paddr statically The default value for LAPIC registers page physical address is usually right. Having this value available early makes pmap_force_invalidate_cache_range(), used on non-self-snoop machines, avoid flushing LAPIC range for early calls. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32318 --- sys/x86/x86/local_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 04de3ae47461..2cd2e0c23e11 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -195,7 +195,7 @@ static u_int32_t lapic_timer_divisors[] = { extern inthand_t IDTVEC(rsvd_pti), IDTVEC(rsvd); volatile char *lapic_map; -vm_paddr_t lapic_paddr; +vm_paddr_t lapic_paddr = DEFAULT_APIC_BASE; int x2apic_mode; int lapic_eoi_suppression; static int lapic_timer_tsc_deadline; From nobody Wed Oct 6 02:54:32 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A089912D799F; Wed, 6 Oct 2021 02:54: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 4HPJvX3xTRz4gY8; Wed, 6 Oct 2021 02:54:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EAB3185A2; Wed, 6 Oct 2021 02:54:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1962sWpK087635; Wed, 6 Oct 2021 02:54:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1962sWgn087634; Wed, 6 Oct 2021 02:54:32 GMT (envelope-from git) Date: Wed, 6 Oct 2021 02:54:32 GMT Message-Id: <202110060254.1962sWgn087634@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: 33c17670afdb - main - amd64: add pmap_page_set_memattr_noflush() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 33c17670afdb008097858d2fff8d4c4a47d68158 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=33c17670afdb008097858d2fff8d4c4a47d68158 commit 33c17670afdb008097858d2fff8d4c4a47d68158 Author: Konstantin Belousov AuthorDate: 2021-10-05 14:12:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-06 02:53:12 +0000 amd64: add pmap_page_set_memattr_noflush() Similar to pmap_page_set_memattr() by setting MD page cache attribute to the argument. Unlike pmap_page_set_memattr(), does not flush cache for the direct mapping of the page. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32318 --- sys/amd64/amd64/pmap.c | 17 +++++++++++++++++ sys/amd64/include/pmap.h | 1 + 2 files changed, 18 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index aae35c5d7e07..f1ddbe548c0f 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -9379,6 +9379,23 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) panic("memory attribute change on the direct map failed"); } +void +pmap_page_set_memattr_noflush(vm_page_t m, vm_memattr_t ma) +{ + int error; + + m->md.pat_mode = ma; + + if ((m->flags & PG_FICTITIOUS) != 0) + return; + PMAP_LOCK(kernel_pmap); + error = pmap_change_props_locked(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), + PAGE_SIZE, PROT_NONE, m->md.pat_mode, 0); + PMAP_UNLOCK(kernel_pmap); + if (error != 0) + panic("memory attribute change on the direct map failed"); +} + /* * Changes the specified virtual address range's memory type to that given by * the parameter "mode". The specified virtual address range must be diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index b65668b60023..bd6a8c006813 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -499,6 +499,7 @@ void *pmap_mapdev_pciecfg(vm_paddr_t pa, vm_size_t size); bool pmap_not_in_di(void); boolean_t pmap_page_is_mapped(vm_page_t m); void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); +void pmap_page_set_memattr_noflush(vm_page_t m, vm_memattr_t ma); void pmap_pinit_pml4(vm_page_t); void pmap_pinit_pml5(vm_page_t); bool pmap_ps_enabled(pmap_t pmap); From nobody Wed Oct 6 02:54:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EC51712D7968; Wed, 6 Oct 2021 02:54: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 4HPJvY4jFvz4gVq; Wed, 6 Oct 2021 02:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7099F188AB; Wed, 6 Oct 2021 02:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1962sXfh087661; Wed, 6 Oct 2021 02:54:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1962sXka087660; Wed, 6 Oct 2021 02:54:33 GMT (envelope-from git) Date: Wed, 6 Oct 2021 02:54:33 GMT Message-Id: <202110060254.1962sXka087660@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: ce21d4bff1bc - main - amd64 efirt: do not flush cache for runtime pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: ce21d4bff1bc7e562471eeab6fb012b35029bf50 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ce21d4bff1bc7e562471eeab6fb012b35029bf50 commit ce21d4bff1bc7e562471eeab6fb012b35029bf50 Author: Konstantin Belousov AuthorDate: 2021-10-05 14:14:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-06 02:53:20 +0000 amd64 efirt: do not flush cache for runtime pages We actually do not know is it safe or not to flush cache for random BAR/register page existing in the system. It is well-known that for instance LAPICs cannot tolerate cache flush. As report indicates, there are more such devices. This issue typically affects AMD machines which do not report self-snoop, causing real CLFLUSH invocation on the mapped pages. Intels do self-snoop, so this change should be nop for them, and unsafe devices, if any, are already ignored. Reported and tested by: manu Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32318 --- sys/amd64/amd64/efirt_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c index 6fb64816385e..6fffd113f868 100644 --- a/sys/amd64/amd64/efirt_machdep.c +++ b/sys/amd64/amd64/efirt_machdep.c @@ -254,7 +254,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) vm_page_init_page(m, va, -1); m->order = VM_NFREEORDER + 1; /* invalid */ m->pool = VM_NFREEPOOL + 1; /* invalid */ - pmap_page_set_memattr(m, mode); + pmap_page_set_memattr_noflush(m, mode); } } VM_OBJECT_WUNLOCK(obj_1t1_pt); From nobody Wed Oct 6 03:39:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B23F212DE4C7; Wed, 6 Oct 2021 03:39: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 4HPKvW4dl2z4nrH; Wed, 6 Oct 2021 03:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 800B3190AB; Wed, 6 Oct 2021 03:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1963dZbx043169; Wed, 6 Oct 2021 03:39:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1963dZn1043168; Wed, 6 Oct 2021 03:39:35 GMT (envelope-from git) Date: Wed, 6 Oct 2021 03:39:35 GMT Message-Id: <202110060339.1963dZn1043168@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: 8d3cd7767a2e - main - Fix mistakes in link(2) and shm_open(2) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d3cd7767a2ea1816c31e1dbe7957253e723e559 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8d3cd7767a2ea1816c31e1dbe7957253e723e559 commit 8d3cd7767a2ea1816c31e1dbe7957253e723e559 Author: Konstantin Belousov AuthorDate: 2021-10-06 03:38:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-06 03:38:26 +0000 Fix mistakes in link(2) and shm_open(2) PR: 258957 Submitted by: sigsys@gmail.com MFC after: 1 week --- lib/libc/sys/link.2 | 4 ++-- lib/libc/sys/shm_open.2 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2 index 37225f9571d0..ab686266cd21 100644 --- a/lib/libc/sys/link.2 +++ b/lib/libc/sys/link.2 @@ -126,9 +126,9 @@ flag in the manual page. .It Dv AT_EMPTY_PATH If the -.Fa path2 +.Fa name1 argument is an empty string, link the file referenced by the descriptor -.Fa fd2 . +.Fa fd1 . The operation requires that the calling process has the .Dv PRIV_VFS_FHOPEN privilege, effectively being executed with effective user diff --git a/lib/libc/sys/shm_open.2 b/lib/libc/sys/shm_open.2 index edf5440d44c4..4c03288b6bbe 100644 --- a/lib/libc/sys/shm_open.2 +++ b/lib/libc/sys/shm_open.2 @@ -369,7 +369,7 @@ does not begin with a slash character. .It Bq Er ENOENT .Dv O_CREAT -is specified and the named shared memory object does not exist. +is not specified and the named shared memory object does not exist. .It Bq Er EEXIST .Dv O_CREAT and From nobody Wed Oct 6 04:25:45 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4D0D717E450D; Wed, 6 Oct 2021 04:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPLwn1hdHz4tn8; Wed, 6 Oct 2021 04:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A2E119B2D; Wed, 6 Oct 2021 04:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1964Pj1Q009086; Wed, 6 Oct 2021 04:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1964PjAT009085; Wed, 6 Oct 2021 04:25:45 GMT (envelope-from git) Date: Wed, 6 Oct 2021 04:25:45 GMT Message-Id: <202110060425.1964PjAT009085@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: 7f4bb501768b - main - login: use sizeof(audit_cond) consistently, NFC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 7f4bb501768b9b3f856f91fbc8b9c80a2a4aaa04 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7f4bb501768b9b3f856f91fbc8b9c80a2a4aaa04 commit 7f4bb501768b9b3f856f91fbc8b9c80a2a4aaa04 Author: Kyle Evans AuthorDate: 2021-10-06 04:24:24 +0000 Commit: Kyle Evans CommitDate: 2021-10-06 04:25:29 +0000 login: use sizeof(audit_cond) consistently, NFC The other three instances were already converted to use audit_cond, this one was just changed from sizeof(long) -> sizeof(int). --- usr.bin/login/login_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/login/login_audit.c b/usr.bin/login/login_audit.c index a45adb7b9e71..91aa4336c659 100644 --- a/usr.bin/login/login_audit.c +++ b/usr.bin/login/login_audit.c @@ -180,7 +180,7 @@ audit_logout(void) int au_cond; /* If we are not auditing, don't cut an audit record; just return. */ - if (auditon(A_GETCOND, &au_cond, sizeof(int)) < 0) { + if (auditon(A_GETCOND, &au_cond, sizeof(au_cond)) < 0) { if (errno == ENOSYS) return; errx(1, "could not determine audit condition"); From nobody Wed Oct 6 14:05:32 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 67A6417E6F3E; Wed, 6 Oct 2021 14:05: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 4HPbnm2Sygz3hHj; Wed, 6 Oct 2021 14:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3569F2182B; Wed, 6 Oct 2021 14:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196E5WGi086671; Wed, 6 Oct 2021 14:05:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196E5Wlb086670; Wed, 6 Oct 2021 14:05:32 GMT (envelope-from git) Date: Wed, 6 Oct 2021 14:05:32 GMT Message-Id: <202110061405.196E5Wlb086670@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: b599982b65e3 - main - Move td_pflags2 TDP2_SIGWAIT to td_flags TDF_SIGWAIT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: b599982b65e36523a8aa828a9d504135144158db Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b599982b65e36523a8aa828a9d504135144158db commit b599982b65e36523a8aa828a9d504135144158db Author: Konstantin Belousov AuthorDate: 2021-10-03 01:52:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-06 14:05:22 +0000 Move td_pflags2 TDP2_SIGWAIT to td_flags TDF_SIGWAIT The flag should be accessible from non-current threads. Reviewed by: markj Tested by: trasz Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32252 --- sys/kern/kern_sig.c | 17 +++++++++++------ sys/sys/proc.h | 3 +-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 95eb8d5cc564..b20aea21333e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1278,8 +1278,11 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, saved_mask = td->td_sigmask; SIGSETNAND(td->td_sigmask, waitset); if ((p->p_sysent->sv_flags & SV_SIG_DISCIGN) != 0 || - !kern_sig_discard_ign) - td->td_pflags2 |= TDP2_SIGWAIT; + !kern_sig_discard_ign) { + thread_lock(td); + td->td_flags |= TDF_SIGWAIT; + thread_unlock(td); + } for (;;) { mtx_lock(&ps->ps_mtx); sig = cursig(td); @@ -1343,7 +1346,9 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, if (error == 0 && (p->p_ptevents & PTRACE_SYSCALL) != 0) traced = true; } - td->td_pflags2 &= ~TDP2_SIGWAIT; + thread_lock(td); + td->td_flags &= ~TDF_SIGWAIT; + thread_unlock(td); new_block = saved_mask; SIGSETNAND(new_block, td->td_sigmask); @@ -2951,7 +2956,7 @@ issignal(struct thread *td) */ if (SIGISMEMBER(ps->ps_sigignore, sig) && (p->p_flag & P_TRACED) == 0 && - (td->td_pflags2 & TDP2_SIGWAIT) == 0) { + (td->td_flags & TDF_SIGWAIT) == 0) { sigqueue_delete(&td->td_sigqueue, sig); sigqueue_delete(&p->p_sigqueue, sig); continue; @@ -3064,7 +3069,7 @@ issignal(struct thread *td) mtx_lock(&ps->ps_mtx); goto next; } else if ((prop & SIGPROP_IGNORE) != 0 && - (td->td_pflags2 & TDP2_SIGWAIT) == 0) { + (td->td_flags & TDF_SIGWAIT) == 0) { /* * Default action is to ignore; drop it if * not in kern_sigtimedwait(). @@ -3075,7 +3080,7 @@ issignal(struct thread *td) /*NOTREACHED*/ case (intptr_t)SIG_IGN: - if ((td->td_pflags2 & TDP2_SIGWAIT) == 0) + if ((td->td_flags & TDF_SIGWAIT) == 0) break; /* == ignore */ else return (sig); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 3d01aae2d06b..8fa9406bd378 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -446,7 +446,7 @@ do { \ #define TDF_TIMEOUT 0x00000010 /* Timing out during sleep. */ #define TDF_IDLETD 0x00000020 /* This is a per-CPU idle thread. */ #define TDF_CANSWAP 0x00000040 /* Thread can be swapped. */ -#define TDF_UNUSED80 0x00000080 /* unused. */ +#define TDF_SIGWAIT 0x00000080 /* Ignore ignored signals */ #define TDF_KTH_SUSP 0x00000100 /* kthread is suspended */ #define TDF_ALLPROCSUSP 0x00000200 /* suspended by SINGLE_ALLPROC */ #define TDF_BOUNDARY 0x00000400 /* Thread suspended at user boundary */ @@ -531,7 +531,6 @@ do { \ #define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ #define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */ #define TDP2_ACCT 0x00000004 /* Doing accounting */ -#define TDP2_SIGWAIT 0x00000008 /* Ignore ignored signals */ /* * Reasons that the current thread can not be run yet. From nobody Wed Oct 6 14:05:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A974A17E7022; Wed, 6 Oct 2021 14:05: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 4HPbnn3McKz3hYM; Wed, 6 Oct 2021 14:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52C65215A7; Wed, 6 Oct 2021 14:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196E5XXM086697; Wed, 6 Oct 2021 14:05:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196E5XTS086696; Wed, 6 Oct 2021 14:05:33 GMT (envelope-from git) Date: Wed, 6 Oct 2021 14:05:33 GMT Message-Id: <202110061405.196E5XTS086696@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: f17eb93d5540 - main - When sending ignored signal, arrange for zero return code from sleep List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: f17eb93d5540ec2bf422d96195820bba5021fa9c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f17eb93d5540ec2bf422d96195820bba5021fa9c commit f17eb93d5540ec2bf422d96195820bba5021fa9c Author: Konstantin Belousov AuthorDate: 2021-10-01 06:59:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-06 14:05:22 +0000 When sending ignored signal, arrange for zero return code from sleep Otherwise consumers get unexpected EINTR errors without seeing a properly discarded signal. Reported and tested by: trasz Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32252 --- sys/kern/kern_sig.c | 23 +++++++++++++---------- sys/kern/subr_sleepqueue.c | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b20aea21333e..59e16ca8e6c8 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2214,17 +2214,20 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) return (ret); } else { action = SIG_CATCH; + intrval = 0; } - } else if (SIGISMEMBER(td->td_sigmask, sig)) - action = SIG_HOLD; - else if (SIGISMEMBER(ps->ps_sigcatch, sig)) - action = SIG_CATCH; - else - action = SIG_DFL; - if (SIGISMEMBER(ps->ps_sigintr, sig)) - intrval = EINTR; - else - intrval = ERESTART; + } else { + if (SIGISMEMBER(td->td_sigmask, sig)) + action = SIG_HOLD; + else if (SIGISMEMBER(ps->ps_sigcatch, sig)) + action = SIG_CATCH; + else + action = SIG_DFL; + if (SIGISMEMBER(ps->ps_sigintr, sig)) + intrval = EINTR; + else + intrval = ERESTART; + } mtx_unlock(&ps->ps_mtx); if (prop & SIGPROP_CONT) diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 61efb1b9f377..8d61383f9737 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -1126,7 +1126,7 @@ sleepq_abort(struct thread *td, int intrval) THREAD_LOCK_ASSERT(td, MA_OWNED); MPASS(TD_ON_SLEEPQ(td)); MPASS(td->td_flags & TDF_SINTR); - MPASS(intrval == EINTR || intrval == ERESTART); + MPASS(intrval == 0 || intrval == EINTR || intrval == ERESTART); /* * If the TDF_TIMEOUT flag is set, just leave. A From nobody Wed Oct 6 14:05:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 491FE17E711A; Wed, 6 Oct 2021 14:05: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 4HPbnp5s5Xz3hRF; Wed, 6 Oct 2021 14:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BB172182C; Wed, 6 Oct 2021 14:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196E5YTU086726; Wed, 6 Oct 2021 14:05:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196E5YML086725; Wed, 6 Oct 2021 14:05:34 GMT (envelope-from git) Date: Wed, 6 Oct 2021 14:05:34 GMT Message-Id: <202110061405.196E5YML086725@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: 9b86d3e5de19 - main - When queuing ignored signal, only abort target thread' sleep if it is inside sigwait() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 9b86d3e5de1997ed8d3153d4530bcb981e6602b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9b86d3e5de1997ed8d3153d4530bcb981e6602b9 commit 9b86d3e5de1997ed8d3153d4530bcb981e6602b9 Author: Konstantin Belousov AuthorDate: 2021-10-03 02:03:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-06 14:05:22 +0000 When queuing ignored signal, only abort target thread' sleep if it is inside sigwait() Reported and tested by: trasz Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32252 --- sys/kern/kern_sig.c | 16 ++++++++++++++-- sys/kern/subr_sleepqueue.c | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 59e16ca8e6c8..b88556f2954d 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2156,6 +2156,18 @@ tdksignal(struct thread *td, int sig, ksiginfo_t *ksi) (void) tdsendsignal(td->td_proc, td, sig, ksi); } +static int +sig_sleepq_abort(struct thread *td, int intrval) +{ + THREAD_LOCK_ASSERT(td, MA_OWNED); + + if (intrval == 0 && (td->td_flags & TDF_SIGWAIT) == 0) { + thread_unlock(td); + return (0); + } + return (sleepq_abort(td, intrval)); +} + int tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) { @@ -2374,7 +2386,7 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) PROC_SLOCK(p); thread_lock(td); if (TD_CAN_ABORT(td)) - wakeup_swapper = sleepq_abort(td, intrval); + wakeup_swapper = sig_sleepq_abort(td, intrval); else thread_unlock(td); PROC_SUNLOCK(p); @@ -2505,7 +2517,7 @@ tdsigwakeup(struct thread *td, int sig, sig_t action, int intrval) if (td->td_priority > PUSER && !TD_IS_IDLETHREAD(td)) sched_prio(td, PUSER); - wakeup_swapper = sleepq_abort(td, intrval); + wakeup_swapper = sig_sleepq_abort(td, intrval); PROC_SUNLOCK(p); if (wakeup_swapper) kick_proc0(); diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 8d61383f9737..36832ef96ba4 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -1126,7 +1126,8 @@ sleepq_abort(struct thread *td, int intrval) THREAD_LOCK_ASSERT(td, MA_OWNED); MPASS(TD_ON_SLEEPQ(td)); MPASS(td->td_flags & TDF_SINTR); - MPASS(intrval == 0 || intrval == EINTR || intrval == ERESTART); + MPASS((intrval == 0 && (td->td_flags & TDF_SIGWAIT) != 0) || + intrval == EINTR || intrval == ERESTART); /* * If the TDF_TIMEOUT flag is set, just leave. A From nobody Wed Oct 6 14:16:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 85DC117E9916; Wed, 6 Oct 2021 14:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPc2d3MP2z3kKD; Wed, 6 Oct 2021 14:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 502D121749; Wed, 6 Oct 2021 14:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196EGfVd000538; Wed, 6 Oct 2021 14:16:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196EGfvP000537; Wed, 6 Oct 2021 14:16:41 GMT (envelope-from git) Date: Wed, 6 Oct 2021 14:16:41 GMT Message-Id: <202110061416.196EGfvP000537@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: da3278ded3b2 - main - ntp.conf.5: Fix typos List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: da3278ded3b2647d26da26788bab8363e502a144 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=da3278ded3b2647d26da26788bab8363e502a144 commit da3278ded3b2647d26da26788bab8363e502a144 Author: Elyes HAOUAS AuthorDate: 2021-10-06 05:38:06 +0000 Commit: Ed Maste CommitDate: 2021-10-06 14:16:04 +0000 ntp.conf.5: Fix typos "certian" --> "certain" "compatability" --> "compatibility" "noticable" --> "noticeable" "limite" --> "limit" "acutal" --> "actual" "ba" --> "be" MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/550 Signed-off-by: Elyes HAOUAS --- usr.sbin/ntp/doc/ntp.conf.5 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/ntp/doc/ntp.conf.5 b/usr.sbin/ntp/doc/ntp.conf.5 index 0f3d29341d17..3494a09c2bc7 100644 --- a/usr.sbin/ntp/doc/ntp.conf.5 +++ b/usr.sbin/ntp/doc/ntp.conf.5 @@ -843,7 +843,7 @@ The remaining files are necessary only for the Autokey protocol. .Pp Certificates imported from OpenSSL or public certificate -authorities have certian limitations. +authorities have certain limitations. The certificate should be in ASN.1 syntax, X.509 Version 3 format and encoded in PEM, which is the same format used by OpenSSL. @@ -1627,7 +1627,7 @@ one or more IPs or subnets via the third field of the .Pa ntp.keys file. This restriction is not enabled by default, -to maintain backward compatability. +to maintain backward compatibility. Expect .Cm noepeer to become the default in ntp\-4.4. @@ -2574,7 +2574,7 @@ While this is generally a feature as it allows for quick recovery if a server key has changed, a properly forged and appropriately delivered crypto\-NAK packet can be used in a DoS attack. -If you have active noticable problems with this type of DoS attack +If you have active noticeable problems with this type of DoS attack then you should consider disabling this option. You can check your @@ -2622,7 +2622,7 @@ While this is generally a feature as it allows for quick recovery if a server key has changed, a properly forged and appropriately delivered crypto\-NAK packet can be used in a DoS attack. -If you have active noticable problems with this type of DoS attack +If you have active noticeable problems with this type of DoS attack then you should consider disabling this option. You can check your @@ -2642,7 +2642,7 @@ While this is generally a feature as it allows for quick recovery, if this type of packet is carefully forged and sent during an appropriate window it can be used for a DoS attack. -If you have active noticable problems with this type of DoS attack +If you have active noticeable problems with this type of DoS attack then you should consider disabling this option. You can check your @@ -2848,7 +2848,7 @@ command line option. .Cm incalloc Ar count | Cm incmem Ar kilobytes .Oc .Xc -Controls size limite of the monitoring facility's Most Recently Used +Controls size limit of the monitoring facility's Most Recently Used (MRU) list of client addresses, which is also used by the rate control facility. @@ -2856,7 +2856,7 @@ rate control facility. .It Ic maxdepth Ar count .It Ic maxmem Ar kilobytes Equivalent upper limits on the size of the MRU list, in terms of entries or kilobytes. -The acutal limit will be up to +The actual limit will be up to .Cm incalloc entries or .Cm incmem @@ -2878,7 +2878,7 @@ The default is 600 entries. .It Cm maxage Ar seconds Once the MRU list has .Cm mindepth -entries and an additional client is to ba added to the list, +entries and an additional client is to be added to the list, if the oldest entry was updated more than .Cm maxage seconds ago, that entry is removed and its storage is reused. From nobody Wed Oct 6 18:50:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 56ADA12DB8B5; Wed, 6 Oct 2021 18:50:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPk6G1NSQz4b5T; Wed, 6 Oct 2021 18:50:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F3492522B; Wed, 6 Oct 2021 18:50:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196IoDVj066089; Wed, 6 Oct 2021 18:50:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196IoDF0066083; Wed, 6 Oct 2021 18:50:13 GMT (envelope-from git) Date: Wed, 6 Oct 2021 18:50:13 GMT Message-Id: <202110061850.196IoDF0066083@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: a76de17715ab - main - linuxkpi: Handle a NULL cache pointer in kmem_cache_destroy() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: a76de17715ab689b0b53a1012e22d8a08470b6e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a76de17715ab689b0b53a1012e22d8a08470b6e4 commit a76de17715ab689b0b53a1012e22d8a08470b6e4 Author: Mark Johnston AuthorDate: 2021-10-06 18:45:22 +0000 Commit: Mark Johnston CommitDate: 2021-10-06 18:49:39 +0000 linuxkpi: Handle a NULL cache pointer in kmem_cache_destroy() This is compatible with Linux, and some driver error paths depend on it. Reviewed by: bz, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32337 --- sys/compat/linuxkpi/common/src/linux_slab.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c index 5dbd87b66d1a..e062f0535fda 100644 --- a/sys/compat/linuxkpi/common/src/linux_slab.c +++ b/sys/compat/linuxkpi/common/src/linux_slab.c @@ -193,6 +193,9 @@ lkpi_kmem_cache_free(struct linux_kmem_cache *c, void *m) void linux_kmem_cache_destroy(struct linux_kmem_cache *c) { + if (c == NULL) + return; + if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) { /* make sure all free callbacks have been called */ rcu_barrier(); From nobody Wed Oct 6 20:07:59 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 70AEA17E7930; Wed, 6 Oct 2021 20: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 4HPlqz2ngfz4nWs; Wed, 6 Oct 2021 20:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4073C2647D; Wed, 6 Oct 2021 20:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196K7xdl069210; Wed, 6 Oct 2021 20:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196K7xG6069209; Wed, 6 Oct 2021 20:07:59 GMT (envelope-from git) Date: Wed, 6 Oct 2021 20:07:59 GMT Message-Id: <202110062007.196K7xG6069209@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: 5d94aaacb518 - main - fusefs: quiet some cache-related warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d94aaacb5180798b2f698e33937f068386004eb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=5d94aaacb5180798b2f698e33937f068386004eb commit 5d94aaacb5180798b2f698e33937f068386004eb Author: Alan Somers AuthorDate: 2021-10-03 16:59:04 +0000 Commit: Alan Somers CommitDate: 2021-10-06 20:07:33 +0000 fusefs: quiet some cache-related warnings If the FUSE server does something that would make our cache incoherent, we should print a warning to the user. However, we previously warned in some situations when we shouldn't, such as if the file's size changed on the server _after_ our own attribute cache had expired. This change suppresses the warning in cases like that. It also moves the warning logic to a single place within the code. PR: 256936 Reported by: Agata Tested by: Agata , jSML4ThWwBID69YC@protonmail.com MFC after: 2 weeks --- sys/fs/fuse/fuse_internal.c | 74 +++++++++++++++++++++++++++++++-------------- sys/fs/fuse/fuse_internal.h | 3 +- sys/fs/fuse/fuse_io.c | 4 +-- sys/fs/fuse/fuse_node.c | 19 ++++++++++-- sys/fs/fuse/fuse_node.h | 2 +- sys/fs/fuse/fuse_vfsops.c | 40 +----------------------- sys/fs/fuse/fuse_vnops.c | 41 ++----------------------- 7 files changed, 76 insertions(+), 107 deletions(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index c52f12d3a71a..ffa4a40095b2 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -255,7 +255,8 @@ fuse_internal_access(struct vnode *vp, */ void fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, - uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap) + uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap, + bool from_server) { struct mount *mp; struct fuse_vnode_data *fvdat; @@ -271,9 +272,54 @@ fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, fuse_validity_2_bintime(attr_valid, attr_valid_nsec, &fvdat->attr_cache_timeout); + if (vnode_isreg(vp) && + fvdat->cached_attrs.va_size != VNOVAL && + attr->size != fvdat->cached_attrs.va_size) + { + if ( data->cache_mode == FUSE_CACHE_WB && + fvdat->flag & FN_SIZECHANGE) + { + const char *msg; + + /* + * The server changed the file's size even though we're + * using writeback cacheing and and we have outstanding + * dirty writes! That's a server bug. + */ + if (fuse_libabi_geq(data, 7, 23)) { + msg = "writeback cache incoherent!." + "To prevent data corruption, disable " + "the writeback cache according to your " + "FUSE server's documentation."; + } else { + msg = "writeback cache incoherent!." + "To prevent data corruption, disable " + "the writeback cache by setting " + "vfs.fusefs.data_cache_mode to 0 or 1."; + } + fuse_warn(data, FSESS_WARN_WB_CACHE_INCOHERENT, msg); + } + if (fuse_vnode_attr_cache_valid(vp) && + data->cache_mode != FUSE_CACHE_UC) + { + /* + * The server changed the file's size even though we + * have it cached and our cache has not yet expired. + * That's a bug. + */ + fuse_warn(data, FSESS_WARN_CACHE_INCOHERENT, + "cache incoherent! " + "To prevent " + "data corruption, disable the data cache " + "by mounting with -o direct_io, or as " + "directed otherwise by your FUSE server's " + "documentation."); + } + } + /* Fix our buffers if the filesize changed without us knowing */ if (vnode_isreg(vp) && attr->size != fvdat->cached_attrs.va_size) { - (void)fuse_vnode_setsize(vp, attr->size); + (void)fuse_vnode_setsize(vp, attr->size, from_server); fvdat->cached_attrs.va_size = attr->size; } @@ -806,7 +852,7 @@ fuse_internal_newentry_core(struct vnode *dvp, fuse_vnode_clear_attr_cache(dvp); fuse_internal_cache_attrs(*vpp, &feo->attr, feo->attr_valid, - feo->attr_valid_nsec, NULL); + feo->attr_valid_nsec, NULL, true); return err; } @@ -912,26 +958,8 @@ fuse_internal_do_getattr(struct vnode *vp, struct vattr *vap, fao->attr.mtime = old_mtime.tv_sec; fao->attr.mtimensec = old_mtime.tv_nsec; } - if (vnode_isreg(vp) && - fvdat->cached_attrs.va_size != VNOVAL && - fao->attr.size != fvdat->cached_attrs.va_size) { - /* - * The server changed the file's size even though we had it - * cached! That's a server bug. - */ - struct mount *mp = vnode_mount(vp); - struct fuse_data *data = fuse_get_mpdata(mp); - - fuse_warn(data, FSESS_WARN_CACHE_INCOHERENT, - "cache incoherent! " - "To prevent data corruption, disable the data cache " - "by mounting with -o direct_io, or as directed " - "otherwise by your FUSE server's documentation."); - int iosize = fuse_iosize(vp); - v_inval_buf_range(vp, 0, INT64_MAX, iosize); - } fuse_internal_cache_attrs(vp, &fao->attr, fao->attr_valid, - fao->attr_valid_nsec, vap); + fao->attr_valid_nsec, vap, true); if (vtyp != vnode_vtype(vp)) { fuse_internal_vnode_disappear(vp); err = ENOENT; @@ -1231,7 +1259,7 @@ int fuse_internal_setattr(struct vnode *vp, struct vattr *vap, struct fuse_attr_out *fao = (struct fuse_attr_out*)fdi.answ; fuse_vnode_undirty_cached_timestamps(vp); fuse_internal_cache_attrs(vp, &fao->attr, fao->attr_valid, - fao->attr_valid_nsec, NULL); + fao->attr_valid_nsec, NULL, false); } out: diff --git a/sys/fs/fuse/fuse_internal.h b/sys/fs/fuse/fuse_internal.h index 20a10d7dfda0..e9fa3857227a 100644 --- a/sys/fs/fuse/fuse_internal.h +++ b/sys/fs/fuse/fuse_internal.h @@ -223,7 +223,8 @@ int fuse_internal_access(struct vnode *vp, accmode_t mode, /* attributes */ void fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, - uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap); + uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap, + bool from_server); /* fsync */ diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c index 47c7fb97e556..637c36424d3f 100644 --- a/sys/fs/fuse/fuse_io.c +++ b/sys/fs/fuse/fuse_io.c @@ -571,7 +571,7 @@ retry: as_written_offset = uio->uio_offset - diff; if (as_written_offset - diff > filesize) - fuse_vnode_setsize(vp, as_written_offset); + fuse_vnode_setsize(vp, as_written_offset, false); if (as_written_offset - diff >= filesize) fvdat->flag &= ~FN_SIZECHANGE; @@ -715,7 +715,7 @@ again: * Extend file _after_ locking buffer so we won't race * with other readers */ - err = fuse_vnode_setsize(vp, uio->uio_offset + n); + err = fuse_vnode_setsize(vp, uio->uio_offset + n, false); filesize = uio->uio_offset + n; fvdat->flag |= FN_SIZECHANGE; if (err) { diff --git a/sys/fs/fuse/fuse_node.c b/sys/fs/fuse/fuse_node.c index 6acd1df29361..c296a3b3c330 100644 --- a/sys/fs/fuse/fuse_node.c +++ b/sys/fs/fuse/fuse_node.c @@ -389,11 +389,14 @@ fuse_vnode_savesize(struct vnode *vp, struct ucred *cred, pid_t pid) } /* - * Adjust the vnode's size to a new value, such as that provided by - * FUSE_GETATTR. + * Adjust the vnode's size to a new value. + * + * If the new value came from the server, such as from a FUSE_GETATTR + * operation, set `from_server` true. But if it came from a local operation, + * such as write(2) or truncate(2), set `from_server` false. */ int -fuse_vnode_setsize(struct vnode *vp, off_t newsize) +fuse_vnode_setsize(struct vnode *vp, off_t newsize, bool from_server) { struct fuse_vnode_data *fvdat = VTOFUD(vp); struct vattr *attrs; @@ -434,6 +437,16 @@ fuse_vnode_setsize(struct vnode *vp, off_t newsize) MPASS(bp->b_flags & B_VMIO); vfs_bio_clrbuf(bp); bp->b_dirtyend = MIN(bp->b_dirtyend, newsize - lbn * iosize); + } else if (from_server && newsize > oldsize && oldsize != VNOVAL) { + /* + * The FUSE server changed the file size behind our back. We + * should invalidate the entire cache. + */ + daddr_t left_lbn, end_lbn; + + left_lbn = oldsize / iosize; + end_lbn = howmany(newsize, iosize); + v_inval_buf_range(vp, 0, end_lbn, iosize); } out: if (bp) diff --git a/sys/fs/fuse/fuse_node.h b/sys/fs/fuse/fuse_node.h index e5fb13d43bec..dcf5e4047778 100644 --- a/sys/fs/fuse/fuse_node.h +++ b/sys/fs/fuse/fuse_node.h @@ -201,7 +201,7 @@ void fuse_vnode_open(struct vnode *vp, int32_t fuse_open_flags, int fuse_vnode_savesize(struct vnode *vp, struct ucred *cred, pid_t pid); -int fuse_vnode_setsize(struct vnode *vp, off_t newsize); +int fuse_vnode_setsize(struct vnode *vp, off_t newsize, bool from_server); void fuse_vnode_undirty_cached_timestamps(struct vnode *vp); diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index b188996066d5..3d5e168bcde2 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -539,7 +539,6 @@ fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) struct fuse_entry_out *feo; struct fuse_vnode_data *fvdat; const char dot[] = "."; - off_t filesize; enum vtype vtyp; int error; @@ -576,47 +575,10 @@ fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) error = fuse_vnode_get(mp, feo, nodeid, NULL, vpp, NULL, vtyp); if (error) goto out; - filesize = feo->attr.size; - - /* - * In the case where we are looking up a FUSE node represented by an - * existing cached vnode, and the true size reported by FUSE_LOOKUP - * doesn't match the vnode's cached size, then any cached writes beyond - * the file's current size are lost. - * - * We can get here: - * * following attribute cache expiration, or - * * due a bug in the daemon, or - */ fvdat = VTOFUD(*vpp); - if (vnode_isreg(*vpp) && - filesize != fvdat->cached_attrs.va_size && - fvdat->flag & FN_SIZECHANGE) { - if (data->cache_mode == fuse_data_cache_mode) { - const char *msg; - - if (fuse_libabi_geq(data, 7, 23)) { - msg = "writeback cache incoherent!." - "To prevent data corruption, disable " - "the writeback cache according to your " - "FUSE server's documentation."; - } else { - msg = "writeback cache incoherent!." - "To prevent data corruption, disable " - "the writeback cache by setting " - "vfs.fusefs.data_cache_mode to 0 or 1."; - } - fuse_warn(data, FSESS_WARN_WB_CACHE_INCOHERENT, msg); - } else { - /* If we get here, it's likely a fusefs kernel bug */ - printf("%s: WB cache incoherent on %s!\n", __func__, - vnode_mount(*vpp)->mnt_stat.f_mntonname); - } - fvdat->flag &= ~FN_SIZECHANGE; - } fuse_internal_cache_attrs(*vpp, &feo->attr, feo->attr_valid, - feo->attr_valid_nsec, NULL); + feo->attr_valid_nsec, NULL, true); fuse_validity_2_bintime(feo->entry_valid, feo->entry_valid_nsec, &fvdat->entry_cache_timeout); out: diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 4c8c8c1d4461..dd8ff0fcc45a 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -895,7 +895,7 @@ fuse_vnop_create(struct vop_create_args *ap) } ASSERT_VOP_ELOCKED(*vpp, "fuse_vnop_create"); fuse_internal_cache_attrs(*vpp, &feo->attr, feo->attr_valid, - feo->attr_valid_nsec, NULL); + feo->attr_valid_nsec, NULL, true); fuse_filehandle_init(*vpp, FUFH_RDWR, NULL, td, cred, foo); fuse_vnode_open(*vpp, foo->open_flags, td); @@ -1151,7 +1151,7 @@ fuse_vnop_link(struct vop_link_args *ap) */ fuse_vnode_clear_attr_cache(tdvp); fuse_internal_cache_attrs(vp, &feo->attr, feo->attr_valid, - feo->attr_valid_nsec, NULL); + feo->attr_valid_nsec, NULL, true); } out: fdisp_destroy(&fdi); @@ -1360,52 +1360,17 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) *vpp = dvp; } else { struct fuse_vnode_data *fvdat; - struct vattr *vap; err = fuse_vnode_get(vnode_mount(dvp), feo, nid, dvp, &vp, cnp, vtyp); if (err) goto out; *vpp = vp; - - /* - * In the case where we are looking up a FUSE node - * represented by an existing cached vnode, and the - * true size reported by FUSE_LOOKUP doesn't match - * the vnode's cached size, then any cached writes - * beyond the file's current size are lost. - * - * We can get here: - * * following attribute cache expiration, or - * * due a bug in the daemon, or - */ fvdat = VTOFUD(vp); - if (vnode_isreg(vp) && - ((filesize != fvdat->cached_attrs.va_size && - fvdat->flag & FN_SIZECHANGE) || - ((vap = VTOVA(vp)) && - filesize != vap->va_size))) - { - fvdat->flag &= ~FN_SIZECHANGE; - /* - * The server changed the file's size even - * though we had it cached, or had dirty writes - * in the WB cache! - */ - fuse_warn(data, FSESS_WARN_CACHE_INCOHERENT, - "cache incoherent! " - "To prevent " - "data corruption, disable the data cache " - "by mounting with -o direct_io, or as " - "directed otherwise by your FUSE server's " - "documentation."); - int iosize = fuse_iosize(vp); - v_inval_buf_range(vp, 0, INT64_MAX, iosize); - } MPASS(feo != NULL); fuse_internal_cache_attrs(*vpp, &feo->attr, - feo->attr_valid, feo->attr_valid_nsec, NULL); + feo->attr_valid, feo->attr_valid_nsec, NULL, true); fuse_validity_2_bintime(feo->entry_valid, feo->entry_valid_nsec, &fvdat->entry_cache_timeout); From nobody Wed Oct 6 20:08:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B778D17E7AA7; Wed, 6 Oct 2021 20:08: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 4HPlr045SKz4nLQ; Wed, 6 Oct 2021 20:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62A27260F7; Wed, 6 Oct 2021 20:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196K80wG069240; Wed, 6 Oct 2021 20:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196K80Aq069239; Wed, 6 Oct 2021 20:08:00 GMT (envelope-from git) Date: Wed, 6 Oct 2021 20:08:00 GMT Message-Id: <202110062008.196K80Aq069239@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: 7430017b9978 - main - fusefs: fix a recurse-on-non-recursive lockmgr panic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 7430017b9978cae054ed99e5160f739e5ca021d5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=7430017b9978cae054ed99e5160f739e5ca021d5 commit 7430017b9978cae054ed99e5160f739e5ca021d5 Author: Alan Somers AuthorDate: 2021-10-02 18:17:36 +0000 Commit: Alan Somers CommitDate: 2021-10-06 20:07:33 +0000 fusefs: fix a recurse-on-non-recursive lockmgr panic fuse_vnop_bmap needs to know the file's size in order to calculate the optimum amount of readahead. If the file's size is unknown, it must ask the FUSE server. But if the file's data was previously cached and the server reports that its size has shrunk, fusefs must invalidate the cached data. That's not possible during VOP_BMAP because the buffer object is already locked. Fix the panic by not querying the FUSE server for the file's size during VOP_BMAP if we don't need it. That's also a a slight performance optimization. PR: 256937 Reported by: Agata Tested by: Agata MFC after: 2 weeks --- sys/fs/fuse/fuse_vnops.c | 20 ++++++++--- tests/sys/fs/fusefs/bmap.cc | 86 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 4 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index dd8ff0fcc45a..9aafbad990c5 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -516,8 +516,9 @@ fuse_vnop_bmap(struct vop_bmap_args *ap) struct fuse_bmap_in *fbi; struct fuse_bmap_out *fbo; struct fuse_data *data; + struct fuse_vnode_data *fvdat = VTOFUD(vp); uint64_t biosize; - off_t filesize; + off_t fsize; daddr_t lbn = ap->a_bn; daddr_t *pbn = ap->a_bnp; int *runp = ap->a_runp; @@ -550,10 +551,21 @@ fuse_vnop_bmap(struct vop_bmap_args *ap) */ if (runb != NULL) *runb = MIN(lbn, maxrun); - if (runp != NULL) { - error = fuse_vnode_size(vp, &filesize, td->td_ucred, td); + if (runp != NULL && maxrun == 0) + *runp = 0; + else if (runp != NULL) { + /* + * If the file's size is cached, use that value to calculate + * runp, even if the cache is expired. runp is only advisory, + * and the risk of getting it wrong is not worth the cost of + * another upcall. + */ + if (fvdat->cached_attrs.va_size != VNOVAL) + fsize = fvdat->cached_attrs.va_size; + else + error = fuse_vnode_size(vp, &fsize, td->td_ucred, td); if (error == 0) - *runp = MIN(MAX(0, filesize / (off_t)biosize - lbn - 1), + *runp = MIN(MAX(0, fsize / (off_t)biosize - lbn - 1), maxrun); else *runp = 0; diff --git a/tests/sys/fs/fusefs/bmap.cc b/tests/sys/fs/fusefs/bmap.cc index 3f392a4447f2..c635f4d7e46f 100644 --- a/tests/sys/fs/fusefs/bmap.cc +++ b/tests/sys/fs/fusefs/bmap.cc @@ -75,6 +75,8 @@ void expect_lookup(const char *relpath, uint64_t ino, off_t size) } }; +class BmapEof: public Bmap, public WithParamInterface {}; + /* * Test FUSE_BMAP * XXX The FUSE protocol does not include the runp and runb variables, so those @@ -165,3 +167,87 @@ TEST_F(Bmap, default_) leak(fd); } + +/* + * VOP_BMAP should not query the server for the file's size, even if its cached + * attributes have expired. + * Regression test for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256937 + */ +TEST_P(BmapEof, eof) +{ + /* + * Outline: + * 1) lookup the file, setting attr_valid=0 + * 2) Read more than one block, causing the kernel to issue VOP_BMAP to + * plan readahead. + * 3) Nothing should panic + * 4) Repeat the tests, truncating the file after different numbers of + * GETATTR operations. + */ + Sequence seq; + const off_t filesize = 2 * m_maxbcachebuf; + const ino_t ino = 42; + mode_t mode = S_IFREG | 0644; + void *contents, *buf; + int fd; + int ngetattrs; + + ngetattrs = GetParam(); + contents = calloc(1, filesize); + FuseTest::expect_lookup(RELPATH, ino, mode, filesize, 1, 0); + expect_open(ino, 0, 1); + // Depending on ngetattrs, FUSE_READ could be called with either + // filesize or filesize / 2 . + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_READ && + in.header.nodeid == ino && + in.body.read.offset == 0 && + ( in.body.read.size == filesize || + in.body.read.size == filesize / 2)); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([=](auto in, auto& out) { + size_t osize = in.body.read.size; + out.header.len = sizeof(struct fuse_out_header) + osize; + bzero(out.body.bytes, osize); + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(Between(ngetattrs - 1, ngetattrs)) + .InSequence(seq) + .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr_valid = 0; + out.body.attr.attr.ino = ino; + out.body.attr.attr.mode = S_IFREG | 0644; + out.body.attr.attr.size = filesize; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).InSequence(seq) + .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr_valid = 0; + out.body.attr.attr.ino = ino; + out.body.attr.attr.mode = S_IFREG | 0644; + out.body.attr.attr.size = filesize / 2; + }))); + + buf = calloc(1, filesize); + fd = open(FULLPATH, O_RDWR); + ASSERT_LE(0, fd) << strerror(errno); + read(fd, buf, filesize); +} + +INSTANTIATE_TEST_CASE_P(BE, BmapEof, + Values(1, 2, 3) +); From nobody Wed Oct 6 20:08:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6856E17E78DF; Wed, 6 Oct 2021 20:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPlr16jTlz4nNp; Wed, 6 Oct 2021 20:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FCDB26273; Wed, 6 Oct 2021 20:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196K81lh069265; Wed, 6 Oct 2021 20:08:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196K81B4069264; Wed, 6 Oct 2021 20:08:01 GMT (envelope-from git) Date: Wed, 6 Oct 2021 20:08:01 GMT Message-Id: <202110062008.196K81B4069264@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: 032a5bd55b3a - main - fusefs: Fix a bug during VOP_STRATEGY when the server changes file size List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 032a5bd55b3a003d3560435422a95f27f91685fe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=032a5bd55b3a003d3560435422a95f27f91685fe commit 032a5bd55b3a003d3560435422a95f27f91685fe Author: Alan Somers AuthorDate: 2021-10-03 17:51:14 +0000 Commit: Alan Somers CommitDate: 2021-10-06 20:07:33 +0000 fusefs: Fix a bug during VOP_STRATEGY when the server changes file size If the FUSE server tells the kernel that a file's size has changed, then the kernel must invalidate any portion of that file in cache. But the kernel can't do that during VOP_STRATEGY, because the file's buffers are already locked. Instead, proceed with the write. PR: 256937 Reported by: Agata Tested by: Agata MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D32332 --- sys/fs/fuse/fuse_io.c | 19 +++++++---- tests/sys/fs/fusefs/write.cc | 81 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 7 deletions(-) diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c index 637c36424d3f..f818fbd52869 100644 --- a/sys/fs/fuse/fuse_io.c +++ b/sys/fs/fuse/fuse_io.c @@ -1007,13 +1007,18 @@ fuse_io_strategy(struct vnode *vp, struct buf *bp) /* * Setup for actual write */ - error = fuse_vnode_size(vp, &filesize, cred, curthread); - if (error) { - bp->b_ioflags |= BIO_ERROR; - bp->b_error = error; - bufdone(bp); - return (error); - } + /* + * If the file's size is cached, use that value, even if the + * cache is expired. At this point we're already committed to + * writing something. If the FUSE server has changed the + * file's size behind our back, it's too late for us to do + * anything about it. In particular, we can't invalidate any + * part of the file's buffers because VOP_STRATEGY is called + * with them already locked. + */ + filesize = fvdat->cached_attrs.va_size; + /* filesize must've been cached by fuse_vnop_open. */ + KASSERT(filesize != VNOVAL, ("filesize should've been cached")); if ((off_t)bp->b_lblkno * biosize + bp->b_dirtyend > filesize) bp->b_dirtyend = filesize - diff --git a/tests/sys/fs/fusefs/write.cc b/tests/sys/fs/fusefs/write.cc index fadf4648d31c..db5bb3fe4441 100644 --- a/tests/sys/fs/fusefs/write.cc +++ b/tests/sys/fs/fusefs/write.cc @@ -208,6 +208,9 @@ virtual void SetUp() { } }; +class WriteEofDuringVnopStrategy: public Write, public WithParamInterface +{}; + void sigxfsz_handler(int __unused sig) { Write::s_sigxfsz = 1; } @@ -526,6 +529,84 @@ TEST_F(Write, eof_during_rmw) leak(fd); } +/* + * VOP_STRATEGY should not query the server for the file's size, even if its + * cached attributes have expired. + * Regression test for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256937 + */ +TEST_P(WriteEofDuringVnopStrategy, eof_during_vop_strategy) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + Sequence seq; + const off_t filesize = 2 * m_maxbcachebuf; + void *contents; + uint64_t ino = 42; + uint64_t attr_valid = 0; + uint64_t attr_valid_nsec = 0; + mode_t mode = S_IFREG | 0644; + int fd; + int ngetattrs; + + ngetattrs = GetParam(); + contents = calloc(1, filesize); + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillRepeatedly(Invoke( + ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.attr.mode = mode; + out.body.entry.nodeid = ino; + out.body.entry.attr.nlink = 1; + out.body.entry.attr.size = filesize; + out.body.entry.attr_valid = attr_valid; + out.body.entry.attr_valid_nsec = attr_valid_nsec; + }))); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(Between(ngetattrs - 1, ngetattrs)) + .InSequence(seq) + .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = ino; + out.body.attr.attr.mode = mode; + out.body.attr.attr_valid = attr_valid; + out.body.attr.attr_valid_nsec = attr_valid_nsec; + out.body.attr.attr.size = filesize; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).InSequence(seq) + .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = ino; + out.body.attr.attr.mode = mode; + out.body.attr.attr_valid = attr_valid; + out.body.attr.attr_valid_nsec = attr_valid_nsec; + out.body.attr.attr.size = filesize / 2; + }))); + expect_write(ino, 0, filesize / 2, filesize / 2, contents); + + fd = open(FULLPATH, O_RDWR); + ASSERT_LE(0, fd) << strerror(errno); + ASSERT_EQ(filesize / 2, write(fd, contents, filesize / 2)) + << strerror(errno); + +} + +INSTANTIATE_TEST_CASE_P(W, WriteEofDuringVnopStrategy, + Values(1, 2, 3) +); + /* * If the kernel cannot be sure which uid, gid, or pid was responsible for a * write, then it must set the FUSE_WRITE_CACHE bit From nobody Wed Oct 6 20:09:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6D83112B9B86; Wed, 6 Oct 2021 20:09: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 4HPltB0sCrz4qCg; Wed, 6 Oct 2021 20:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADE42264C4; Wed, 6 Oct 2021 20:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196K9rtP069528; Wed, 6 Oct 2021 20:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196K9rJY069527; Wed, 6 Oct 2021 20:09:53 GMT (envelope-from git) Date: Wed, 6 Oct 2021 20:09:53 GMT Message-Id: <202110062009.196K9rJY069527@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: 880b670c6fdb - main - malloc: Unmark KASAN redzones if the full allocation size was requested List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 880b670c6fdbd1268887869375771e0a74d2c8ac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=880b670c6fdbd1268887869375771e0a74d2c8ac commit 880b670c6fdbd1268887869375771e0a74d2c8ac Author: Mark Johnston AuthorDate: 2021-10-06 20:03:30 +0000 Commit: Mark Johnston CommitDate: 2021-10-06 20:09:41 +0000 malloc: Unmark KASAN redzones if the full allocation size was requested Consumers that want the full allocation size will typically access the full buffer, so mark the entire allocation as valid to avoid useless KASAN reports. Sponsored by: The FreeBSD Foundation --- sys/kern/kern_malloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index b1c5909db2a4..4ecdcdacce01 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1112,6 +1112,13 @@ malloc_usable_size(const void *addr) else size = malloc_large_size(slab); #endif + + /* + * Unmark the redzone to avoid reports from consumers who are + * (presumably) about to use the full allocation size. + */ + kasan_mark(addr, size, size, 0); + return (size); } From nobody Wed Oct 6 20:29:03 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B4FF612BC61A; Wed, 6 Oct 2021 20:29: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 4HPmJH4mMnz4smZ; Wed, 6 Oct 2021 20:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78BAA26829; Wed, 6 Oct 2021 20:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196KT3p1095990; Wed, 6 Oct 2021 20:29:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196KT3qj095989; Wed, 6 Oct 2021 20:29:03 GMT (envelope-from git) Date: Wed, 6 Oct 2021 20:29:03 GMT Message-Id: <202110062029.196KT3qj095989@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: f44a448709d3 - main - fusefs: fix intermittency in the dev_fuse_poll 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f44a448709d3b77508fd59ee28201ae1666387c2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f44a448709d3b77508fd59ee28201ae1666387c2 commit f44a448709d3b77508fd59ee28201ae1666387c2 Author: Alan Somers AuthorDate: 2021-09-25 16:16:20 +0000 Commit: Alan Somers CommitDate: 2021-10-06 20:28:48 +0000 fusefs: fix intermittency in the dev_fuse_poll test The DevFusePoll::access/select test would occasionally segfault. The cause was a file descriptor that was shared between two threads. The first thread would kill the second and close the file descriptor. But it was possible that the second would read the file descriptor before it shut down. That did not cause problems for kqueue, poll, or blocking operation, but it triggered segfaults in select's macros. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D32142 --- tests/sys/fs/fusefs/mockfs.cc | 10 +++++++--- tests/sys/fs/fusefs/mockfs.hh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index 4d0724b9c227..99f7ccc61273 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -870,6 +870,7 @@ void MockFS::read_request(mockfs_buf_in &in, ssize_t &res) { struct timeval timeout_tv; const int timeout_ms = 999; int timeout_int, nfds; + int fuse_fd; switch (m_pm) { case BLOCKING: @@ -906,19 +907,22 @@ void MockFS::read_request(mockfs_buf_in &in, ssize_t &res) { ASSERT_TRUE(fds[0].revents & POLLIN); break; case SELECT: + fuse_fd = m_fuse_fd; + if (fuse_fd < 0) + break; timeout_tv.tv_sec = 0; timeout_tv.tv_usec = timeout_ms * 1'000; - nfds = m_fuse_fd + 1; + nfds = fuse_fd + 1; while (nready == 0) { FD_ZERO(&readfds); - FD_SET(m_fuse_fd, &readfds); + FD_SET(fuse_fd, &readfds); nready = select(nfds, &readfds, NULL, NULL, &timeout_tv); if (m_quit) return; } ASSERT_LE(0, nready) << strerror(errno); - ASSERT_TRUE(FD_ISSET(m_fuse_fd, &readfds)); + ASSERT_TRUE(FD_ISSET(fuse_fd, &readfds)); break; default: FAIL() << "not yet implemented"; diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 24ca017dcdb1..600a4b4292c0 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -284,7 +284,7 @@ class MockFS { pthread_t m_daemon_id; /* file descriptor of /dev/fuse control device */ - int m_fuse_fd; + volatile int m_fuse_fd; /* The minor version of the kernel API that this mock daemon targets */ uint32_t m_kernel_minor_version; From nobody Wed Oct 6 20:37:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4A7B712BD6F5 for ; Wed, 6 Oct 2021 20:38:05 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPmVh3vFYz4tqR for ; Wed, 6 Oct 2021 20:38:04 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb33.google.com with SMTP id z5so8361604ybj.2 for ; Wed, 06 Oct 2021 13:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UTdRfNZvSy1T6YF7uD0/Q6OrIODwv2Y4Yq+LwDVxbDM=; b=Nze6d1jtdoSVtzh6iOhrpAWWv9o2WvzY6/3vRnPCPoZBduoL9Gmc5SADL5rjXIwePR fsn4wqdIV3BLBFesfykRFZVko3hybIBVkjt15AKTH9C2fjCnh/NAnd2w5m9rxbFrEyQi xrkx1uqoTiTrcbFpulzZL3ULwUGkZ+Ciun8rY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UTdRfNZvSy1T6YF7uD0/Q6OrIODwv2Y4Yq+LwDVxbDM=; b=m3KhR6pyy2KsMisqtgt45Ip409xaN+m7Fbk4bXp1/2KDOpjiogROjy5LY6tG+EdL6L 5R9Q1C9zq7lze7G3KMuiCz3Jd7843ilZHunNfkf2iqly1xpVtI9us2EJC+wRaWEXqfvU AarBE7pgMjMu4gJYprbhwGAejHUVM//ksYEqdU86dwGiAKmQaIhk3RT22Xo9Drpr1a2Q SlWodc9sSmLWReDpqT60siH8awJkDNgxqlFx7R6YqgI0REuy+C/GH2/SzGyFUXTskskc 3WG60FsqDPjolIc1eVBdbmasMPU8mdJ2RLS39QpLXh1/Agf1QUL5Ci8OZknPdXLJPSh/ iWsg== X-Gm-Message-State: AOAM532WjOyLTKc9/hI7itUTu9Y0i3dXdRtpsenQLVX+rk8Zk8zPGkQl 8E8YoJCtqJECeQoR8bnKJ1FuGAW4grCg4CX4Wbxwnw== X-Google-Smtp-Source: ABdhPJyks6RfTTtFhJ4XLkHAseCY+slb/NYC8CpjPjXNP6daTAFQZtJ/xyCU0tUWoSnzW9hf37BGBe6uenHLBX10NbY= X-Received: by 2002:a25:8690:: with SMTP id z16mr225120ybk.493.1633552683993; Wed, 06 Oct 2021 13:38:03 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> <20211004101726.wraje5ol5vwbhjcv@pleb> In-Reply-To: <20211004101726.wraje5ol5vwbhjcv@pleb> From: Kevin Bowling Date: Wed, 6 Oct 2021 13:37:51 -0700 Message-ID: Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Christos Margiolis Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers , "" , "dev-commits-src-main@FreeBSD.org" , Hans Petter Selasky Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HPmVh3vFYz4tqR X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none ("invalid DKIM record") header.d=kev009.com header.s=google header.b=Nze6d1jt; dmarc=none; spf=pass (mx1.freebsd.org: domain of kevin.bowling@kev009.com designates 2607:f8b0:4864:20::b33 as permitted sender) smtp.mailfrom=kevin.bowling@kev009.com X-Spamd-Result: default: False [-3.30 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[kev009.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[kev009.com:~]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b33:from]; R_DKIM_PERMFAIL(0.00)[kev009.com:s=google]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Oct 4, 2021 at 3:17 AM Christos Margiolis wrote: > > On Mon, Oct 04, 2021 at 10:48:03AM +0200, Mateusz Piotrowski wrote: > > Hmm, I agree that mute and volume controls in the new CLI interface are very > > consistent. However, in case of the old CLI interface, the mute > > functionality could also be added without a problem (at least by looking at > > the manual pages, the "mute" command could look like this: "mixer mute > > vol"). My point is that I feel that the CLI interface should be > > backwards-compatible in this case. > > I think the new interface is more readable and extensible than the old > one, and, as you mentioned, mixer(8) did need an upgrade, so it might be > better to have it changed from now on and keep the old version as a port, > than to keep working on an -- in my opinion -- obsolete interface and code. > > > > Would it help to make a port, like "oldmixer", under "audio" ? > > > > That's a good idea. I've committed the "old" mixer to the ports tree: https://cgit.freebsd.org/ports/commit/?id=e9a0efe4509b8dbdef0b4e4b5b94abf0aebd78a9. > > Yeap, that's a good idea indeed. I still get a bunch of spam from rc.d on boot and it doesn't seem to save my mixer settings on shutdown, is there some settings file I should blow away or is there a better way to handle upgrades? > -- > Christos > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" From nobody Wed Oct 6 20:43:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6E73C12BE716; Wed, 6 Oct 2021 20:43:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_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 4HPmcv1yq8z4vTk; Wed, 6 Oct 2021 20:43:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 682AF260182; Wed, 6 Oct 2021 22:43:25 +0200 (CEST) Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Kevin Bowling , Christos Margiolis Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers , dev-commits-src-all@freebsd.org, "dev-commits-src-main@FreeBSD.org" References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> <20211004101726.wraje5ol5vwbhjcv@pleb> From: Hans Petter Selasky Message-ID: Date: Wed, 6 Oct 2021 22:43:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.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 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HPmcv1yq8z4vTk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On 10/6/21 10:37 PM, Kevin Bowling wrote: > I still get a bunch of spam from rc.d on boot and it doesn't seem to > save my mixer settings on shutdown, is there some settings file I > should blow away or is there a better way to handle upgrades? Hi Kevin, Did you install the new /etc/rc.d/mixer script? Or do you see this diff: > diff -u /usr/src/libexec/rc/rc.d/mixer /etc/rc.d/mixer > --- /usr/src/libexec/rc/rc.d/mixer 2021-09-22 22:09:36.193543000 +0200 > +++ /etc/rc.d/mixer 2019-12-26 22:43:45.276389000 +0100 > @@ -58,7 +58,7 @@ > > dev="/dev/${1}" > if [ -r ${dev} ]; then > - /usr/sbin/mixer -f ${dev} -o > /var/db/${1}-state 2>/dev/null > + /usr/sbin/mixer -f ${dev} -s > /var/db/${1}-state 2>/dev/null > fi > } --HPS From nobody Wed Oct 6 20:52:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8C5D612BF98E; Wed, 6 Oct 2021 20:52:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPmqn37S3z3CHb; Wed, 6 Oct 2021 20:52:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C5EB26E3C; Wed, 6 Oct 2021 20:52:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196KqrHs034597; Wed, 6 Oct 2021 20:52:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196KqroQ034596; Wed, 6 Oct 2021 20:52:53 GMT (envelope-from git) Date: Wed, 6 Oct 2021 20:52:53 GMT Message-Id: <202110062052.196KqroQ034596@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: e7f8f3b95e1f - main - login.conf.5: Mark passwordtime as implemented List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7f8f3b95e1ff76765f1d2f4412b95f6ff5abe25 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e7f8f3b95e1ff76765f1d2f4412b95f6ff5abe25 commit e7f8f3b95e1ff76765f1d2f4412b95f6ff5abe25 Author: Felix Johnson AuthorDate: 2021-10-06 20:47:02 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-10-06 20:51:22 +0000 login.conf.5: Mark passwordtime as implemented login.conf.5 listed passwordtime in RESERVED CAPABILITIES, which is a section for capabilities not implemented in the base system. However, passwordtime has been implemented in the base for several years now. PR: 246099 Reported by: avg Reviewed by: 0mp MFC after: 3 days --- lib/libutil/login.conf.5 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index aafec9050b5c..7276863f53a9 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2020 +.Dd October 6, 2021 .Dt LOGIN.CONF 5 .Os .Sh NAME @@ -287,6 +287,9 @@ NIS clients using a NIS server should probably use "des". .It "passwd_prompt string The password prompt presented by" .Xr login 1 +.It "passwordtime time Used by" +.Xr passwd 1 +to set next password expiry date. .It "times.allow list List of time periods during which" logins are allowed. .It "times.deny list List of time periods during which logins are" @@ -427,9 +430,6 @@ password may be. .Xr passwd 1 will warn the user if an all lower case password is entered. .It "monthtime time Maximum login time per month." -.It "passwordtime time Used by" -.Xr passwd 1 -to set next password expiry date. .It "refreshtime time New time allowed on account refresh." .It "refreshperiod str How often account time is refreshed." .It "sessiontime time Maximum login time per session." From nobody Wed Oct 6 21:06:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 049AD12D1376; Wed, 6 Oct 2021 21:06: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 4HPn7N6T4Jz3DfY; Wed, 6 Oct 2021 21:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDFD426F5D; Wed, 6 Oct 2021 21:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196L6Op0049326; Wed, 6 Oct 2021 21:06:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196L6OTf049325; Wed, 6 Oct 2021 21:06:24 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:06:24 GMT Message-Id: <202110062106.196L6OTf049325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 28ccd780a96f - main - e1000: Function prototype cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28ccd780a96fe49364072955636829cff1589cfb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=28ccd780a96fe49364072955636829cff1589cfb commit 28ccd780a96fe49364072955636829cff1589cfb Author: Kevin Bowling AuthorDate: 2021-10-06 21:03:38 +0000 Commit: Kevin Bowling CommitDate: 2021-10-06 21:03:38 +0000 e1000: Function prototype cleanup Drop arguments of function prototypes since the file is mixed between listing arg names and not. No functional changes Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D32329 --- sys/dev/e1000/if_em.c | 98 +++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 34d7b8f5f87e..3153a44000c5 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -248,55 +248,55 @@ static pci_vendor_info_t igb_vendor_info_array[] = /********************************************************************* * Function prototypes *********************************************************************/ -static void *em_register(device_t dev); -static void *igb_register(device_t dev); -static int em_if_attach_pre(if_ctx_t ctx); -static int em_if_attach_post(if_ctx_t ctx); -static int em_if_detach(if_ctx_t ctx); -static int em_if_shutdown(if_ctx_t ctx); -static int em_if_suspend(if_ctx_t ctx); -static int em_if_resume(if_ctx_t ctx); - -static int em_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int ntxqs, int ntxqsets); -static int em_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nrxqs, int nrxqsets); -static void em_if_queues_free(if_ctx_t ctx); +static void *em_register(device_t); +static void *igb_register(device_t); +static int em_if_attach_pre(if_ctx_t); +static int em_if_attach_post(if_ctx_t); +static int em_if_detach(if_ctx_t); +static int em_if_shutdown(if_ctx_t); +static int em_if_suspend(if_ctx_t); +static int em_if_resume(if_ctx_t); + +static int em_if_tx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); +static int em_if_rx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); +static void em_if_queues_free(if_ctx_t); static uint64_t em_if_get_counter(if_ctx_t, ift_counter); -static void em_if_init(if_ctx_t ctx); -static void em_if_stop(if_ctx_t ctx); +static void em_if_init(if_ctx_t); +static void em_if_stop(if_ctx_t); static void em_if_media_status(if_ctx_t, struct ifmediareq *); -static int em_if_media_change(if_ctx_t ctx); -static int em_if_mtu_set(if_ctx_t ctx, uint32_t mtu); -static void em_if_timer(if_ctx_t ctx, uint16_t qid); -static void em_if_vlan_register(if_ctx_t ctx, u16 vtag); -static void em_if_vlan_unregister(if_ctx_t ctx, u16 vtag); -static void em_if_watchdog_reset(if_ctx_t ctx); -static bool em_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); - -static void em_identify_hardware(if_ctx_t ctx); -static int em_allocate_pci_resources(if_ctx_t ctx); -static void em_free_pci_resources(if_ctx_t ctx); -static void em_reset(if_ctx_t ctx); -static int em_setup_interface(if_ctx_t ctx); -static int em_setup_msix(if_ctx_t ctx); - -static void em_initialize_transmit_unit(if_ctx_t ctx); -static void em_initialize_receive_unit(if_ctx_t ctx); - -static void em_if_intr_enable(if_ctx_t ctx); -static void em_if_intr_disable(if_ctx_t ctx); -static void igb_if_intr_enable(if_ctx_t ctx); -static void igb_if_intr_disable(if_ctx_t ctx); -static int em_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); -static int em_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); -static int igb_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); -static int igb_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); -static void em_if_multi_set(if_ctx_t ctx); -static void em_if_update_admin_status(if_ctx_t ctx); -static void em_if_debug(if_ctx_t ctx); +static int em_if_media_change(if_ctx_t); +static int em_if_mtu_set(if_ctx_t, uint32_t); +static void em_if_timer(if_ctx_t, uint16_t); +static void em_if_vlan_register(if_ctx_t, u16); +static void em_if_vlan_unregister(if_ctx_t, u16); +static void em_if_watchdog_reset(if_ctx_t); +static bool em_if_needs_restart(if_ctx_t, enum iflib_restart_event); + +static void em_identify_hardware(if_ctx_t); +static int em_allocate_pci_resources(if_ctx_t); +static void em_free_pci_resources(if_ctx_t); +static void em_reset(if_ctx_t); +static int em_setup_interface(if_ctx_t); +static int em_setup_msix(if_ctx_t); + +static void em_initialize_transmit_unit(if_ctx_t); +static void em_initialize_receive_unit(if_ctx_t); + +static void em_if_intr_enable(if_ctx_t); +static void em_if_intr_disable(if_ctx_t); +static void igb_if_intr_enable(if_ctx_t); +static void igb_if_intr_disable(if_ctx_t); +static int em_if_rx_queue_intr_enable(if_ctx_t, uint16_t); +static int em_if_tx_queue_intr_enable(if_ctx_t, uint16_t); +static int igb_if_rx_queue_intr_enable(if_ctx_t, uint16_t); +static int igb_if_tx_queue_intr_enable(if_ctx_t, uint16_t); +static void em_if_multi_set(if_ctx_t); +static void em_if_update_admin_status(if_ctx_t); +static void em_if_debug(if_ctx_t); static void em_update_stats_counters(struct e1000_softc *); static void em_add_hw_stats(struct e1000_softc *); -static int em_if_set_promisc(if_ctx_t ctx, int flags); +static int em_if_set_promisc(if_ctx_t, int); static bool em_if_vlan_filter_capable(struct e1000_softc *); static bool em_if_vlan_filter_used(struct e1000_softc *); static void em_if_vlan_filter_enable(struct e1000_softc *); @@ -317,23 +317,23 @@ static void em_init_manageability(struct e1000_softc *); static void em_release_manageability(struct e1000_softc *); static void em_get_hw_control(struct e1000_softc *); static void em_release_hw_control(struct e1000_softc *); -static void em_get_wakeup(if_ctx_t ctx); -static void em_enable_wakeup(if_ctx_t ctx); +static void em_get_wakeup(if_ctx_t); +static void em_enable_wakeup(if_ctx_t); static int em_enable_phy_wakeup(struct e1000_softc *); static void em_disable_aspm(struct e1000_softc *); -int em_intr(void *arg); +int em_intr(void *); /* MSI-X handlers */ static int em_if_msix_intr_assign(if_ctx_t, int); static int em_msix_link(void *); -static void em_handle_link(void *context); +static void em_handle_link(void *); static void em_enable_vectors_82574(if_ctx_t); static int em_set_flowcntl(SYSCTL_HANDLER_ARGS); static int em_sysctl_eee(SYSCTL_HANDLER_ARGS); -static void em_if_led_func(if_ctx_t ctx, int onoff); +static void em_if_led_func(if_ctx_t, int); static int em_get_regs(SYSCTL_HANDLER_ARGS); From nobody Wed Oct 6 21:10:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2AD9F12D3971; Wed, 6 Oct 2021 21:10: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 4HPnCy0jBpz3HTn; Wed, 6 Oct 2021 21:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC21C26BD5; Wed, 6 Oct 2021 21:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LALEg058616; Wed, 6 Oct 2021 21:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LALEg058613; Wed, 6 Oct 2021 21:10:21 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:21 GMT Message-Id: <202110062110.196LALEg058613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b4e0a27c5be5 - main - cryptodev: Use 'csp' in the handlers for requests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4e0a27c5be5090a9db16dd0ad417543b1fb0c4a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b4e0a27c5be5090a9db16dd0ad417543b1fb0c4a commit b4e0a27c5be5090a9db16dd0ad417543b1fb0c4a Author: John Baldwin AuthorDate: 2021-10-06 21:08:46 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:46 +0000 cryptodev: Use 'csp' in the handlers for requests. - Retire cse->mode and use csp->csp_mode instead. - Use csp->csp_cipher_algorithm instead of the ivsize when checking for the fixup for the IV length for AES-XTS. Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32103 --- sys/opencrypto/cryptodev.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index 5d281f3157fa..9a4db6f453bc 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -3,13 +3,16 @@ /*- * Copyright (c) 2001 Theo de Raadt * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2014-2021 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by John-Mark Gurney * under sponsorship of the FreeBSD Foundation and * Rubicon Communications, LLC (Netgate). * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -265,7 +268,6 @@ struct csession { const struct enc_xform *txform; int hashsize; int ivsize; - int mode; void *key; void *mackey; @@ -614,7 +616,6 @@ cse_create(struct fcrypt *fcr, struct session2_op *sop) refcount_init(&cse->refs, 1); cse->key = key; cse->mackey = mackey; - cse->mode = csp.csp_mode; cse->cses = cses; cse->txform = txform; if (thash != NULL) @@ -743,6 +744,7 @@ cryptodev_cb(struct cryptop *crp) static int cryptodev_op(struct csession *cse, const struct crypt_op *cop) { + const struct crypto_session_params *csp; struct cryptop_data *cod = NULL; struct cryptop *crp = NULL; char *dst; @@ -792,7 +794,8 @@ cryptodev_op(struct csession *cse, const struct crypt_op *cop) if (cse->hashsize) crp->crp_digest_start = cop->len; - switch (cse->mode) { + csp = crypto_get_params(cse->cses); + switch (csp->csp_mode) { case CSP_MODE_COMPRESS: switch (cop->op) { case COP_ENCRYPT: @@ -958,6 +961,7 @@ bail: static int cryptodev_aead(struct csession *cse, struct crypt_aead *caead) { + const struct crypto_session_params *csp; struct cryptop_data *cod = NULL; struct cryptop *crp = NULL; char *dst; @@ -1020,7 +1024,8 @@ cryptodev_aead(struct csession *cse, struct crypt_aead *caead) else crp->crp_digest_start = crp->crp_payload_start + caead->len; - switch (cse->mode) { + csp = crypto_get_params(cse->cses); + switch (csp->csp_mode) { case CSP_MODE_AEAD: case CSP_MODE_ETA: switch (caead->op) { @@ -1058,9 +1063,9 @@ cryptodev_aead(struct csession *cse, struct crypt_aead *caead) * Permit a 16-byte IV for AES-XTS, but only use the * first 8 bytes as a block number. */ - if (cse->mode == CSP_MODE_ETA && - caead->ivlen == AES_BLOCK_LEN && - cse->ivsize == AES_XTS_IV_LEN) + if (csp->csp_mode == CSP_MODE_ETA && + csp->csp_cipher_alg == CRYPTO_AES_XTS && + caead->ivlen == AES_BLOCK_LEN) caead->ivlen = AES_XTS_IV_LEN; if (cse->ivsize == 0) { From nobody Wed Oct 6 21:10:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A271312D3BBE; Wed, 6 Oct 2021 21:10: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 4HPnCz2Fvxz3HHS; Wed, 6 Oct 2021 21:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EF7326EEA; Wed, 6 Oct 2021 21:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LANkJ058721; Wed, 6 Oct 2021 21:10:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAMcH058720; Wed, 6 Oct 2021 21:10:22 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:22 GMT Message-Id: <202110062110.196LAMcH058720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: cb128893b929 - main - ccp, ccr: Simplify drivers to assume an AES-GCM IV length of 12. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb128893b92994456107d6ca722fdf6e5028eacc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cb128893b92994456107d6ca722fdf6e5028eacc commit cb128893b92994456107d6ca722fdf6e5028eacc Author: John Baldwin AuthorDate: 2021-10-06 21:08:46 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:46 +0000 ccp, ccr: Simplify drivers to assume an AES-GCM IV length of 12. While here, use crypto_read_iv() in a few more places in ccr(4) that I missed previously. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32104 --- sys/crypto/ccp/ccp_hardware.c | 5 ++--- sys/dev/cxgbe/crypto/t4_crypto.c | 36 ++++++------------------------------ 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/sys/crypto/ccp/ccp_hardware.c b/sys/crypto/ccp/ccp_hardware.c index 5175343ffc90..2f184e3e770d 100644 --- a/sys/crypto/ccp/ccp_hardware.c +++ b/sys/crypto/ccp/ccp_hardware.c @@ -1356,10 +1356,9 @@ ccp_collect_iv(struct cryptop *crp, const struct crypto_session_params *csp, crypto_read_iv(crp, iv); /* - * If the input IV is 12 bytes, append an explicit counter of 1. + * Append an explicit counter of 1 for GCM. */ - if (csp->csp_cipher_alg == CRYPTO_AES_NIST_GCM_16 && - csp->csp_ivlen == 12) + if (csp->csp_cipher_alg == CRYPTO_AES_NIST_GCM_16) *(uint32_t *)&iv[12] = htobe32(1); if (csp->csp_cipher_alg == CRYPTO_AES_XTS && diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 3ce3e5c916db..490c984a9751 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -1136,26 +1136,7 @@ ccr_gcm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) else op_type = CHCR_DECRYPT_OP; - /* - * The IV handling for GCM in OCF is a bit more complicated in - * that IPSec provides a full 16-byte IV (including the - * counter), whereas the /dev/crypto interface sometimes - * provides a full 16-byte IV (if no IV is provided in the - * ioctl) and sometimes a 12-byte IV (if the IV was explicit). - * - * When provided a 12-byte IV, assume the IV is really 16 bytes - * with a counter in the last 4 bytes initialized to 1. - * - * While iv_len is checked below, the value is currently - * always set to 12 when creating a GCM session in this driver - * due to limitations in OCF (there is no way to know what the - * IV length of a given request will be). This means that the - * driver always assumes as 12-byte IV for now. - */ - if (s->blkcipher.iv_len == 12) - iv_len = AES_BLOCK_LEN; - else - iv_len = s->blkcipher.iv_len; + iv_len = AES_BLOCK_LEN; /* * GCM requests should always provide an explicit IV. @@ -1293,9 +1274,8 @@ ccr_gcm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr = wrtod(wr); memset(crwr, 0, wr_len); - memcpy(iv, crp->crp_iv, s->blkcipher.iv_len); - if (s->blkcipher.iv_len == 12) - *(uint32_t *)&iv[12] = htobe32(1); + crypto_read_iv(crp, iv); + *(uint32_t *)&iv[12] = htobe32(1); ccr_populate_wreq(sc, s, crwr, kctx_len, wr_len, imm_len, sgl_len, 0, crp); @@ -1448,15 +1428,11 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *crp) if (error) goto out; - /* - * This assumes a 12-byte IV from the crp. See longer comment - * above in ccr_gcm() for more details. - */ if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) { error = EINVAL; goto out; } - memcpy(iv, crp->crp_iv, 12); + crypto_read_iv(crp, iv); *(uint32_t *)&iv[12] = htobe32(1); axf->Reinit(auth_ctx, iv, sizeof(iv)); @@ -1770,7 +1746,7 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) */ memset(iv, 0, iv_len); iv[0] = (15 - AES_CCM_IV_LEN) - 1; - memcpy(iv + 1, crp->crp_iv, AES_CCM_IV_LEN); + crypto_read_iv(crp, iv + 1); ccr_populate_wreq(sc, s, crwr, kctx_len, wr_len, imm_len, sgl_len, 0, crp); @@ -1943,7 +1919,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) error = EINVAL; goto out; } - memcpy(iv, crp->crp_iv, AES_CCM_IV_LEN); + crypto_read_iv(crp, iv); auth_ctx->aes_cbc_mac_ctx.authDataLength = crp->crp_aad_length; auth_ctx->aes_cbc_mac_ctx.cryptDataLength = crp->crp_payload_length; From nobody Wed Oct 6 21:10:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4DEBF12D3D93; Wed, 6 Oct 2021 21:10: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 4HPnD04Rdgz3HMj; Wed, 6 Oct 2021 21:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51C8726F62; Wed, 6 Oct 2021 21:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAOkP058746; Wed, 6 Oct 2021 21:10:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAOV3058745; Wed, 6 Oct 2021 21:10:24 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:24 GMT Message-Id: <202110062110.196LAOV3058745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1833d6042c9a - main - crypto: Permit variable-sized IVs for ciphers with a reinit hook. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1833d6042c9a0116e8a1198256fd8fbc99cb11ad Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1833d6042c9a0116e8a1198256fd8fbc99cb11ad commit 1833d6042c9a0116e8a1198256fd8fbc99cb11ad Author: John Baldwin AuthorDate: 2021-10-06 21:08:46 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:46 +0000 crypto: Permit variable-sized IVs for ciphers with a reinit hook. Add a 'len' argument to the reinit hook in 'struct enc_xform' to permit support for AEAD ciphers such as AES-CCM and Chacha20-Poly1305 which support different nonce lengths. Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32105 --- sys/crypto/chacha20/chacha-sw.c | 5 +++-- sys/dev/cxgbe/crypto/t4_crypto.c | 10 +++++++--- sys/opencrypto/cryptosoft.c | 20 +++++++++++--------- sys/opencrypto/xform_aes_icm.c | 22 ++++++++++++++-------- sys/opencrypto/xform_aes_xts.c | 7 +++++-- sys/opencrypto/xform_chacha20_poly1305.c | 5 ++++- sys/opencrypto/xform_enc.h | 2 +- 7 files changed, 45 insertions(+), 26 deletions(-) diff --git a/sys/crypto/chacha20/chacha-sw.c b/sys/crypto/chacha20/chacha-sw.c index b1bf0a106bfd..8041a3fee8a5 100644 --- a/sys/crypto/chacha20/chacha-sw.c +++ b/sys/crypto/chacha20/chacha-sw.c @@ -18,9 +18,10 @@ chacha20_xform_setkey(void *ctx, const uint8_t *key, int len) } static void -chacha20_xform_reinit(void *ctx, const uint8_t *iv) +chacha20_xform_reinit(void *ctx, const uint8_t *iv, size_t ivlen) { - + KASSERT(ivlen == CHACHA_NONCELEN + CHACHA_CTRLEN, + ("%s: invalid IV length", __func__)); chacha_ivsetup(ctx, iv + 8, iv); } diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 490c984a9751..845bc3c29e38 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -1,8 +1,12 @@ /*- * Copyright (c) 2017 Chelsio Communications, Inc. + * Copyright (c) 2021 The FreeBSD Foundation * All rights reserved. * Written by: John Baldwin * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -1458,7 +1462,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *crp) } } - exf->reinit(kschedule, iv); + exf->reinit(kschedule, iv, sizeof(iv)); /* Do encryption with MAC */ for (i = 0; i < crp->crp_payload_length; i += sizeof(block)) { @@ -1935,7 +1939,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) if (error) goto out; - exf->reinit(kschedule, iv); + exf->reinit(kschedule, iv, sizeof(iv)); /* Do encryption/decryption with MAC */ for (i = 0; i < crp->crp_payload_length; i += sizeof(block)) { @@ -1970,7 +1974,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) error = 0; /* Tag matches, decrypt data. */ - exf->reinit(kschedule, iv); + exf->reinit(kschedule, iv, sizeof(iv)); for (i = 0; i < crp->crp_payload_length; i += sizeof(block)) { len = imin(crp->crp_payload_length - i, diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index ef927f117bcc..04a2b004799a 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -9,13 +9,16 @@ * supported the development of this code. * * Copyright (c) 2000, 2001 Angelos D. Keromytis - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2014-2021 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by John-Mark Gurney * under sponsorship of the FreeBSD Foundation and * Rubicon Communications, LLC (Netgate). * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. + * * Permission to use, copy, and modify this software with or without fee * is hereby granted, provided that this entire notice is included in * all source code copies of any software which is or includes a copy or @@ -106,7 +109,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop *crp) const struct enc_xform *exf; struct swcr_encdec *sw; size_t inlen, outlen; - int i, blks, ivlen, resid; + int i, blks, resid; struct crypto_buffer_cursor cc_in, cc_out; const unsigned char *inblk; unsigned char *outblk; @@ -117,7 +120,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop *crp) sw = &ses->swcr_encdec; exf = sw->sw_exf; - ivlen = exf->ivsize; + csp = crypto_get_params(crp->crp_session); if (exf->native_blocksize == 0) { /* Check for non-padded data */ @@ -133,7 +136,6 @@ swcr_encdec(struct swcr_session *ses, struct cryptop *crp) return (EINVAL); if (crp->crp_cipher_key != NULL) { - csp = crypto_get_params(crp->crp_session); error = exf->setkey(sw->sw_kschedule, crp->crp_cipher_key, csp->csp_cipher_klen); if (error) @@ -147,7 +149,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop *crp) * xforms that provide a reinit method perform all IV * handling themselves. */ - exf->reinit(sw->sw_kschedule, iv); + exf->reinit(sw->sw_kschedule, iv, csp->csp_ivlen); } ivp = iv; @@ -534,7 +536,7 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp) if (crp->crp_cipher_key != NULL) exf->setkey(swe->sw_kschedule, crp->crp_cipher_key, crypto_get_params(crp->crp_session)->csp_cipher_klen); - exf->reinit(swe->sw_kschedule, iv); + exf->reinit(swe->sw_kschedule, iv, ivlen); /* Do encryption with MAC */ crypto_cursor_init(&cc_in, &crp->crp_buf); @@ -753,7 +755,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) if (crp->crp_cipher_key != NULL) exf->setkey(swe->sw_kschedule, crp->crp_cipher_key, crypto_get_params(crp->crp_session)->csp_cipher_klen); - exf->reinit(swe->sw_kschedule, iv); + exf->reinit(swe->sw_kschedule, iv, ivlen); /* Do encryption/decryption with MAC */ crypto_cursor_init(&cc_in, &crp->crp_buf); @@ -824,7 +826,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) } /* tag matches, decrypt data */ - exf->reinit(swe->sw_kschedule, iv); + exf->reinit(swe->sw_kschedule, iv, ivlen); crypto_cursor_init(&cc_in, &crp->crp_buf); crypto_cursor_advance(&cc_in, crp->crp_payload_start); for (resid = crp->crp_payload_length; resid > blksz; @@ -915,7 +917,7 @@ swcr_chacha20_poly1305(struct swcr_session *ses, struct cryptop *crp) if (crp->crp_cipher_key != NULL) exf->setkey(swe->sw_kschedule, crp->crp_cipher_key, csp->csp_cipher_klen); - exf->reinit(swe->sw_kschedule, crp->crp_iv); + exf->reinit(swe->sw_kschedule, crp->crp_iv, csp->csp_ivlen); /* Do encryption with MAC */ crypto_cursor_init(&cc_in, &crp->crp_buf); diff --git a/sys/opencrypto/xform_aes_icm.c b/sys/opencrypto/xform_aes_icm.c index 618b812ceebf..860dceda5232 100644 --- a/sys/opencrypto/xform_aes_icm.c +++ b/sys/opencrypto/xform_aes_icm.c @@ -55,9 +55,9 @@ __FBSDID("$FreeBSD$"); static int aes_icm_setkey(void *, const uint8_t *, int); static void aes_icm_crypt(void *, const uint8_t *, uint8_t *); static void aes_icm_crypt_last(void *, const uint8_t *, uint8_t *, size_t); -static void aes_icm_reinit(void *, const uint8_t *); -static void aes_gcm_reinit(void *, const uint8_t *); -static void aes_ccm_reinit(void *, const uint8_t *); +static void aes_icm_reinit(void *, const uint8_t *, size_t); +static void aes_gcm_reinit(void *, const uint8_t *, size_t); +static void aes_ccm_reinit(void *, const uint8_t *, size_t); /* Encryption instances */ const struct enc_xform enc_xform_aes_icm = { @@ -114,20 +114,24 @@ const struct enc_xform enc_xform_ccm = { * Encryption wrapper routines. */ static void -aes_icm_reinit(void *key, const uint8_t *iv) +aes_icm_reinit(void *key, const uint8_t *iv, size_t ivlen) { struct aes_icm_ctx *ctx; ctx = key; - bcopy(iv, ctx->ac_block, AESICM_BLOCKSIZE); + KASSERT(ivlen <= sizeof(ctx->ac_block), + ("%s: ivlen too large", __func__)); + bcopy(iv, ctx->ac_block, ivlen); } static void -aes_gcm_reinit(void *key, const uint8_t *iv) +aes_gcm_reinit(void *key, const uint8_t *iv, size_t ivlen) { struct aes_icm_ctx *ctx; - aes_icm_reinit(key, iv); + KASSERT(ivlen == AES_GCM_IV_LEN, + ("%s: invalid IV length", __func__)); + aes_icm_reinit(key, iv, ivlen); ctx = key; /* GCM starts with 2 as counter 1 is used for final xor of tag. */ @@ -136,10 +140,12 @@ aes_gcm_reinit(void *key, const uint8_t *iv) } static void -aes_ccm_reinit(void *key, const uint8_t *iv) +aes_ccm_reinit(void *key, const uint8_t *iv, size_t ivlen) { struct aes_icm_ctx *ctx; + KASSERT(ivlen == AES_CCM_IV_LEN, + ("%s: invalid IV length", __func__)); ctx = key; /* CCM has flags, then the IV, then the counter, which starts at 1 */ diff --git a/sys/opencrypto/xform_aes_xts.c b/sys/opencrypto/xform_aes_xts.c index 457535621511..7a79d4685d21 100644 --- a/sys/opencrypto/xform_aes_xts.c +++ b/sys/opencrypto/xform_aes_xts.c @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static int aes_xts_setkey(void *, const uint8_t *, int); static void aes_xts_encrypt(void *, const uint8_t *, uint8_t *); static void aes_xts_decrypt(void *, const uint8_t *, uint8_t *); -static void aes_xts_reinit(void *, const uint8_t *); +static void aes_xts_reinit(void *, const uint8_t *, size_t); /* Encryption instances */ const struct enc_xform enc_xform_aes_xts = { @@ -77,12 +77,15 @@ const struct enc_xform enc_xform_aes_xts = { * Encryption wrapper routines. */ static void -aes_xts_reinit(void *key, const uint8_t *iv) +aes_xts_reinit(void *key, const uint8_t *iv, size_t ivlen) { struct aes_xts_ctx *ctx = key; uint64_t blocknum; u_int i; + KASSERT(ivlen == sizeof(blocknum), + ("%s: invalid IV length", __func__)); + /* * Prepare tweak as E_k2(IV). IV is specified as LE representation * of a 64-bit block number which we allow to be passed in directly. diff --git a/sys/opencrypto/xform_chacha20_poly1305.c b/sys/opencrypto/xform_chacha20_poly1305.c index 543c16bcc4e0..51ae11c923e7 100644 --- a/sys/opencrypto/xform_chacha20_poly1305.c +++ b/sys/opencrypto/xform_chacha20_poly1305.c @@ -50,10 +50,13 @@ chacha20_poly1305_setkey(void *vctx, const uint8_t *key, int len) } static void -chacha20_poly1305_reinit(void *vctx, const uint8_t *iv) +chacha20_poly1305_reinit(void *vctx, const uint8_t *iv, size_t ivlen) { struct chacha20_poly1305_cipher_ctx *ctx = vctx; + KASSERT(ivlen == sizeof(ctx->nonce), + ("%s: invalid nonce length", __func__)); + /* Block 0 is used for the poly1305 key. */ memcpy(ctx->nonce, iv, sizeof(ctx->nonce)); ctx->ic = 1; diff --git a/sys/opencrypto/xform_enc.h b/sys/opencrypto/xform_enc.h index 6f95b49986c5..baf423dd1079 100644 --- a/sys/opencrypto/xform_enc.h +++ b/sys/opencrypto/xform_enc.h @@ -62,7 +62,7 @@ struct enc_xform { void (*encrypt) (void *, const uint8_t *, uint8_t *); void (*decrypt) (void *, const uint8_t *, uint8_t *); int (*setkey) (void *, const uint8_t *, int len); - void (*reinit) (void *, const uint8_t *); + void (*reinit) (void *, const uint8_t *, size_t); /* * For stream ciphers, encrypt/decrypt the final partial block From nobody Wed Oct 6 21:10:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 89B9012D3AE4; Wed, 6 Oct 2021 21:10: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 4HPnD15vdnz3HRf; Wed, 6 Oct 2021 21:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59E1D26D4D; Wed, 6 Oct 2021 21:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAPWK058771; Wed, 6 Oct 2021 21:10:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAP8h058770; Wed, 6 Oct 2021 21:10:25 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:25 GMT Message-Id: <202110062110.196LAP8h058770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5ae5ed5b8fd2 - main - cryptosoft, ccr: Use crp_iv directly for AES-CCM and AES-GCM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ae5ed5b8fd2955378ab67ba127cad8c981678ab Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5ae5ed5b8fd2955378ab67ba127cad8c981678ab commit 5ae5ed5b8fd2955378ab67ba127cad8c981678ab Author: John Baldwin AuthorDate: 2021-10-06 21:08:46 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:46 +0000 cryptosoft, ccr: Use crp_iv directly for AES-CCM and AES-GCM. Rather than copying crp_iv to a local array on the stack that is then passed to xform reinit routines, pass crp_iv directly and remove the local copy. Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32106 --- sys/dev/cxgbe/crypto/t4_crypto.c | 17 +++++------------ sys/opencrypto/cryptosoft.c | 18 +++++------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 845bc3c29e38..30d168b60777 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -1391,7 +1391,6 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *crp) void *auth_ctx, *kschedule; char block[GMAC_BLOCK_LEN]; char digest[GMAC_DIGEST_LEN]; - char iv[AES_BLOCK_LEN]; int error, i, len; auth_ctx = NULL; @@ -1436,10 +1435,8 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *crp) error = EINVAL; goto out; } - crypto_read_iv(crp, iv); - *(uint32_t *)&iv[12] = htobe32(1); - axf->Reinit(auth_ctx, iv, sizeof(iv)); + axf->Reinit(auth_ctx, crp->crp_iv, AES_GCM_IV_LEN); /* MAC the AAD. */ if (crp->crp_aad != NULL) { @@ -1462,7 +1459,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *crp) } } - exf->reinit(kschedule, iv, sizeof(iv)); + exf->reinit(kschedule, crp->crp_iv, AES_GCM_IV_LEN); /* Do encryption with MAC */ for (i = 0; i < crp->crp_payload_length; i += sizeof(block)) { @@ -1522,7 +1519,6 @@ out: zfree(kschedule, M_CCR); zfree(auth_ctx, M_CCR); explicit_bzero(block, sizeof(block)); - explicit_bzero(iv, sizeof(iv)); explicit_bzero(digest, sizeof(digest)); crp->crp_etype = error; crypto_done(crp); @@ -1878,7 +1874,6 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) void *kschedule; char block[CCM_CBC_BLOCK_LEN]; char digest[AES_CBC_MAC_HASH_LEN]; - char iv[AES_CCM_IV_LEN]; int error, i, len; auth_ctx = NULL; @@ -1923,11 +1918,10 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) error = EINVAL; goto out; } - crypto_read_iv(crp, iv); auth_ctx->aes_cbc_mac_ctx.authDataLength = crp->crp_aad_length; auth_ctx->aes_cbc_mac_ctx.cryptDataLength = crp->crp_payload_length; - axf->Reinit(auth_ctx, iv, sizeof(iv)); + axf->Reinit(auth_ctx, crp->crp_iv, AES_CCM_IV_LEN); /* MAC the AAD. */ if (crp->crp_aad != NULL) @@ -1939,7 +1933,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) if (error) goto out; - exf->reinit(kschedule, iv, sizeof(iv)); + exf->reinit(kschedule, crp->crp_iv, AES_CCM_IV_LEN); /* Do encryption/decryption with MAC */ for (i = 0; i < crp->crp_payload_length; i += sizeof(block)) { @@ -1974,7 +1968,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) error = 0; /* Tag matches, decrypt data. */ - exf->reinit(kschedule, iv, sizeof(iv)); + exf->reinit(kschedule, crp->crp_iv, AES_CCM_IV_LEN); for (i = 0; i < crp->crp_payload_length; i += sizeof(block)) { len = imin(crp->crp_payload_length - i, @@ -1995,7 +1989,6 @@ out: zfree(kschedule, M_CCR); zfree(auth_ctx, M_CCR); explicit_bzero(block, sizeof(block)); - explicit_bzero(iv, sizeof(iv)); explicit_bzero(digest, sizeof(digest)); crp->crp_etype = error; crypto_done(crp); diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index 04a2b004799a..19092e56b004 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -463,7 +463,6 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp) uint32_t blkbuf[howmany(AES_BLOCK_LEN, sizeof(uint32_t))]; u_char *blk = (u_char *)blkbuf; u_char tag[GMAC_DIGEST_LEN]; - u_char iv[AES_BLOCK_LEN]; struct crypto_buffer_cursor cc_in, cc_out; const u_char *inblk; u_char *outblk; @@ -492,12 +491,10 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp) if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); - /* Initialize the IV */ ivlen = AES_GCM_IV_LEN; - bcopy(crp->crp_iv, iv, ivlen); /* Supply MAC with IV */ - axf->Reinit(&ctx, iv, ivlen); + axf->Reinit(&ctx, crp->crp_iv, ivlen); /* Supply MAC with AAD */ if (crp->crp_aad != NULL) { @@ -536,7 +533,7 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp) if (crp->crp_cipher_key != NULL) exf->setkey(swe->sw_kschedule, crp->crp_cipher_key, crypto_get_params(crp->crp_session)->csp_cipher_klen); - exf->reinit(swe->sw_kschedule, iv, ivlen); + exf->reinit(swe->sw_kschedule, crp->crp_iv, ivlen); /* Do encryption with MAC */ crypto_cursor_init(&cc_in, &crp->crp_buf); @@ -635,7 +632,6 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp) out: explicit_bzero(blkbuf, sizeof(blkbuf)); explicit_bzero(tag, sizeof(tag)); - explicit_bzero(iv, sizeof(iv)); return (error); } @@ -701,7 +697,6 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) uint32_t blkbuf[howmany(AES_BLOCK_LEN, sizeof(uint32_t))]; u_char *blk = (u_char *)blkbuf; u_char tag[AES_CBC_MAC_HASH_LEN]; - u_char iv[AES_BLOCK_LEN]; struct crypto_buffer_cursor cc_in, cc_out; const u_char *inblk; u_char *outblk; @@ -729,9 +724,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); - /* Initialize the IV */ ivlen = AES_CCM_IV_LEN; - bcopy(crp->crp_iv, iv, ivlen); /* * AES CCM-CBC-MAC needs to know the length of both the auth @@ -741,7 +734,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) ctx.aes_cbc_mac_ctx.cryptDataLength = crp->crp_payload_length; /* Supply MAC with IV */ - axf->Reinit(&ctx, iv, ivlen); + axf->Reinit(&ctx, crp->crp_iv, ivlen); /* Supply MAC with AAD */ if (crp->crp_aad != NULL) @@ -755,7 +748,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) if (crp->crp_cipher_key != NULL) exf->setkey(swe->sw_kschedule, crp->crp_cipher_key, crypto_get_params(crp->crp_session)->csp_cipher_klen); - exf->reinit(swe->sw_kschedule, iv, ivlen); + exf->reinit(swe->sw_kschedule, crp->crp_iv, ivlen); /* Do encryption/decryption with MAC */ crypto_cursor_init(&cc_in, &crp->crp_buf); @@ -826,7 +819,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) } /* tag matches, decrypt data */ - exf->reinit(swe->sw_kschedule, iv, ivlen); + exf->reinit(swe->sw_kschedule, crp->crp_iv, ivlen); crypto_cursor_init(&cc_in, &crp->crp_buf); crypto_cursor_advance(&cc_in, crp->crp_payload_start); for (resid = crp->crp_payload_length; resid > blksz; @@ -859,7 +852,6 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) out: explicit_bzero(blkbuf, sizeof(blkbuf)); explicit_bzero(tag, sizeof(tag)); - explicit_bzero(iv, sizeof(iv)); return (error); } From nobody Wed Oct 6 21:10:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5596112D3C61; Wed, 6 Oct 2021 21:10: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 4HPnD301WXz3HKh; Wed, 6 Oct 2021 21:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8537426F63; Wed, 6 Oct 2021 21:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAQ29058795; Wed, 6 Oct 2021 21:10:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAQbP058794; Wed, 6 Oct 2021 21:10:26 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:26 GMT Message-Id: <202110062110.196LAQbP058794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 16676123fc85 - main - cryptodev: Permit explicit IV/nonce and MAC/tag lengths. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16676123fc85233334983e0071cb446357abec8d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=16676123fc85233334983e0071cb446357abec8d commit 16676123fc85233334983e0071cb446357abec8d Author: John Baldwin AuthorDate: 2021-10-06 21:08:46 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:46 +0000 cryptodev: Permit explicit IV/nonce and MAC/tag lengths. Add 'ivlen' and 'maclen' fields to the structure used for CIOGSESSION2 to specify the explicit IV/nonce and MAC/tag lengths for crypto sessions. If these fields are zero, the default lengths are used. This permits selecting an alternate nonce length for AEAD ciphers such as AES-CCM which support multiple nonce leengths. It also supports truncated MACs as input to AEAD or ETA requests. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32107 --- share/man/man4/crypto.4 | 24 ++++++++++++++++++++---- sys/opencrypto/cryptodev.c | 29 +++++++++++++++++++++++++++-- sys/opencrypto/cryptodev.h | 9 +++++++-- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/share/man/man4/crypto.4 b/share/man/man4/crypto.4 index 56fd4f484c3b..5617bacd904a 100644 --- a/share/man/man4/crypto.4 +++ b/share/man/man4/crypto.4 @@ -1,13 +1,16 @@ .\" $NetBSD: crypto.4,v 1.24 2014/01/27 21:23:59 pgoyette Exp $ .\" .\" Copyright (c) 2008 The NetBSD Foundation, Inc. -.\" Copyright (c) 2014 The FreeBSD Foundation +.\" Copyright (c) 2014-2021 The FreeBSD Foundation .\" All rights reserved. .\" .\" Portions of this documentation were written by John-Mark Gurney .\" under sponsorship of the FreeBSD Foundation and .\" Rubicon Communications, LLC (Netgate). .\" +.\" Portions of this documentation were written by Ararat River +.\" Consulting, LLC under sponsorship of the FreeBSD Foundation. +.\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Coyote Point Systems, Inc. .\" @@ -60,7 +63,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 12, 2021 +.Dd October 6, 2021 .Dt CRYPTO 4 .Os .Sh NAME @@ -251,14 +254,27 @@ struct session2_op { uint32_t ses; /* returns: ses # */ int crid; /* driver id + flags (rw) */ - int pad[4]; /* for future expansion */ + int ivlen; /* length of nonce/IV */ + int maclen; /* length of MAC/tag */ + int pad[2]; /* for future expansion */ }; .Ed -This request is similar to CIOGSESSION except that +This request is similar to CIOGSESSION but adds additional fields. +.Pp .Fa sessp-\*[Gt]crid requests either a specific crypto device or a class of devices (software vs hardware). +.Pp +.Fa sessp-\*[Gt]ivlen +specifies the length of the IV or nonce supplied with each request. +If this field is set to zero, the default IV or nonce length is used. +.Pp +.Fa sessp-\*[Gt]maclen +specifies the length of the MAC or authentication tag supplied or computed by +each request. +If this field is set to zero, the full MAC is used. +.Pp The .Fa sessp-\*[Gt]pad field must be initialized to zero. diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index 9a4db6f453bc..6614c8f60676 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -103,7 +103,9 @@ struct session2_op32 { uint32_t mackey; uint32_t ses; int crid; - int pad[4]; + int ivlen; + int maclen; + int pad[2]; }; struct crypt_op32 { @@ -156,6 +158,8 @@ session2_op_from_32(const struct session2_op32 *from, struct session2_op *to) session_op_from_32((const struct session_op32 *)from, to); CP(*from, *to, crid); + CP(*from, *to, ivlen); + CP(*from, *to, maclen); } static void @@ -597,6 +601,25 @@ cse_create(struct fcrypt *fcr, struct session2_op *sop) csp.csp_ivlen = AES_CCM_IV_LEN; } + if (sop->ivlen != 0) { + if (csp.csp_ivlen == 0) { + CRYPTDEB("does not support an IV"); + error = EINVAL; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); + goto bail; + } + csp.csp_ivlen = sop->ivlen; + } + if (sop->maclen != 0) { + if (!(thash != NULL || csp.csp_mode == CSP_MODE_AEAD)) { + CRYPTDEB("does not support a MAC"); + error = EINVAL; + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); + goto bail; + } + csp.csp_auth_mlen = sop->maclen; + } + crid = sop->crid; error = checkforsoftware(&crid); if (error) { @@ -618,7 +641,9 @@ cse_create(struct fcrypt *fcr, struct session2_op *sop) cse->mackey = mackey; cse->cses = cses; cse->txform = txform; - if (thash != NULL) + if (sop->maclen != 0) + cse->hashsize = sop->maclen; + else if (thash != NULL) cse->hashsize = thash->hashsize; else if (csp.csp_cipher_alg == CRYPTO_AES_NIST_GCM_16) cse->hashsize = AES_GMAC_HASH_LEN; diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index 79dec8c44f51..b3c79a48f632 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -23,13 +23,16 @@ * PURPOSE. * * Copyright (c) 2001 Theo de Raadt - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2014-2021 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by John-Mark Gurney * under sponsorship of the FreeBSD Foundation and * Rubicon Communications, LLC (Netgate). * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -241,7 +244,9 @@ struct session2_op { uint32_t ses; /* returns: session # */ int crid; /* driver id + flags (rw) */ - int pad[4]; /* for future expansion */ + int ivlen; /* length of nonce/IV */ + int maclen; /* length of MAC/tag */ + int pad[2]; /* for future expansion */ }; struct crypt_op { From nobody Wed Oct 6 21:10:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8593F12D3F80; Wed, 6 Oct 2021 21:10: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 4HPnD411Tpz3HdK; Wed, 6 Oct 2021 21:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAB3326FD2; Wed, 6 Oct 2021 21:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LARbQ058819; Wed, 6 Oct 2021 21:10:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAR2a058818; Wed, 6 Oct 2021 21:10:27 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:27 GMT Message-Id: <202110062110.196LAR2a058818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 70dbebea1242 - main - cryptodev: Permit CIOCCRYPT for AEAD ciphers. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70dbebea124236184a66a30175ba307793971f00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=70dbebea124236184a66a30175ba307793971f00 commit 70dbebea124236184a66a30175ba307793971f00 Author: John Baldwin AuthorDate: 2021-10-06 21:08:47 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:47 +0000 cryptodev: Permit CIOCCRYPT for AEAD ciphers. A request without AAD for an AEAD cipher can be submitted via CIOCCRYPT rather than CIOCCRYPTAEAD. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32108 --- sys/opencrypto/cryptodev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index 6614c8f60676..3224ed3f900c 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -864,6 +864,13 @@ cryptodev_op(struct csession *cse, const struct crypt_op *cop) goto bail; } break; + case CSP_MODE_AEAD: + if (cse->ivsize != 0 && cop->iv == NULL) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); + error = EINVAL; + goto bail; + } + /* FALLTHROUGH */ case CSP_MODE_ETA: switch (cop->op) { case COP_ENCRYPT: From nobody Wed Oct 6 21:10:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B5F9912D3E20; Wed, 6 Oct 2021 21:10: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 4HPnD512YLz3HKw; Wed, 6 Oct 2021 21:10:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF2B72720A; Wed, 6 Oct 2021 21:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LASi6058856; Wed, 6 Oct 2021 21:10:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAS6j058855; Wed, 6 Oct 2021 21:10:28 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:28 GMT Message-Id: <202110062110.196LAS6j058855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: a0cbcbb7917b - main - cryptodev: Allow some CIOCCRYPT operations with an empty payload. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0cbcbb7917b0b8566ec0853425a73d7958ddbed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a0cbcbb7917b0b8566ec0853425a73d7958ddbed commit a0cbcbb7917b0b8566ec0853425a73d7958ddbed Author: John Baldwin AuthorDate: 2021-10-06 21:08:47 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:47 +0000 cryptodev: Allow some CIOCCRYPT operations with an empty payload. If an operation would generate a MAC output (e.g. for digest operation or for an AEAD or EtA operation), then an empty payload buffer is valid. Only reject requests with an empty buffer for "plain" cipher sessions. Some of the AES-CCM NIST KAT vectors use an empty payload. While here, don't advance crp_payload_start for requests that use an empty payload with an inline IV. (*) Reported by: syzbot+d4b94fbd9a44b032f428@syzkaller.appspotmail.com (*) Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32109 --- sys/opencrypto/cryptodev.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index 3224ed3f900c..9312945a9b8b 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -781,7 +781,7 @@ cryptodev_op(struct csession *cse, const struct crypt_op *cop) } if (cse->txform) { - if (cop->len == 0 || (cop->len % cse->txform->blocksize) != 0) { + if ((cop->len % cse->txform->blocksize) != 0) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } @@ -836,6 +836,12 @@ cryptodev_op(struct csession *cse, const struct crypt_op *cop) } break; case CSP_MODE_CIPHER: + if (cop->len == 0 || + (cop->iv == NULL && cop->len == cse->ivsize)) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); + error = EINVAL; + goto bail; + } switch (cop->op) { case COP_ENCRYPT: crp->crp_op = CRYPTO_OP_ENCRYPT; @@ -919,8 +925,9 @@ cryptodev_op(struct csession *cse, const struct crypt_op *cop) goto bail; } crp->crp_iv_start = 0; - crp->crp_payload_start += cse->ivsize; crp->crp_payload_length -= cse->ivsize; + if (crp->crp_payload_length != 0) + crp->crp_payload_start = cse->ivsize; dst += cse->ivsize; } From nobody Wed Oct 6 21:10:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7EB0A12D3FBD; Wed, 6 Oct 2021 21:10: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 4HPnD72t6rz3HNK; Wed, 6 Oct 2021 21:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF4D126D4E; Wed, 6 Oct 2021 21:10:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LATKx058970; Wed, 6 Oct 2021 21:10:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LATxZ058969; Wed, 6 Oct 2021 21:10:29 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:29 GMT Message-Id: <202110062110.196LATxZ058969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: bcb0fd6accc0 - main - cryptocheck: Support multiple IV sizes for AES-CCM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcb0fd6accc095295765b08b02f5f3b07ea62536 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bcb0fd6accc095295765b08b02f5f3b07ea62536 commit bcb0fd6accc095295765b08b02f5f3b07ea62536 Author: John Baldwin AuthorDate: 2021-10-06 21:08:47 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:47 +0000 cryptocheck: Support multiple IV sizes for AES-CCM. By default, the "normal" IV size (12) is used, but it can be overriden via -I. If -I is not specified and -z is specified, issue requests for all possible IV sizes. Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32110 --- tools/tools/crypto/cryptocheck.c | 236 ++++++++++++++++++++++++++------------- 1 file changed, 156 insertions(+), 80 deletions(-) diff --git a/tools/tools/crypto/cryptocheck.c b/tools/tools/crypto/cryptocheck.c index 502ea04cd661..63c6ce1f9d28 100644 --- a/tools/tools/crypto/cryptocheck.c +++ b/tools/tools/crypto/cryptocheck.c @@ -1,8 +1,12 @@ /*- * Copyright (c) 2017 Chelsio Communications, Inc. * All rights reserved. + * Copyright (c) 2021 The FreeBSD Foundation * Written by: John Baldwin * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -65,7 +69,8 @@ * operation once in software via OpenSSL and a second time via * OpenCrypto and compares the results. * - * cryptocheck [-vz] [-A aad length] [-a algorithm] [-d dev] [size ...] + * cryptocheck [-vz] [-A aad length] [-a algorithm] [-d dev] [-I IV length] + * [size ...] * * Options: * -v Verbose. @@ -153,6 +158,7 @@ static const struct alg { enum { T_HASH, T_HMAC, T_GMAC, T_DIGEST, T_CIPHER, T_ETA, T_AEAD } type; int key_len; int tag_len; + u_int iv_sizes[8]; const EVP_CIPHER *(*evp_cipher)(void); const EVP_MD *(*evp_md)(void); int pkey; @@ -208,34 +214,41 @@ static const struct alg { { .name = "chacha20", .cipher = CRYPTO_CHACHA20, .type = T_CIPHER, .evp_cipher = EVP_chacha20 }, { .name = "aes-gcm", .cipher = CRYPTO_AES_NIST_GCM_16, .type = T_AEAD, - .tag_len = AES_GMAC_HASH_LEN, .evp_cipher = EVP_aes_128_gcm }, + .tag_len = AES_GMAC_HASH_LEN, .iv_sizes = { AES_GCM_IV_LEN }, + .evp_cipher = EVP_aes_128_gcm }, { .name = "aes-gcm192", .cipher = CRYPTO_AES_NIST_GCM_16, .type = T_AEAD, .tag_len = AES_GMAC_HASH_LEN, - .evp_cipher = EVP_aes_192_gcm }, + .iv_sizes = { AES_GCM_IV_LEN }, .evp_cipher = EVP_aes_192_gcm }, { .name = "aes-gcm256", .cipher = CRYPTO_AES_NIST_GCM_16, .type = T_AEAD, .tag_len = AES_GMAC_HASH_LEN, - .evp_cipher = EVP_aes_256_gcm }, + .iv_sizes = { AES_GCM_IV_LEN }, .evp_cipher = EVP_aes_256_gcm }, { .name = "aes-ccm", .cipher = CRYPTO_AES_CCM_16, .type = T_AEAD, - .evp_cipher = EVP_aes_128_ccm, .tag_len = AES_CBC_MAC_HASH_LEN }, + .tag_len = AES_CBC_MAC_HASH_LEN, .iv_sizes = { 12, 7, 8, 9, 10, 11, 13 }, + .evp_cipher = EVP_aes_128_ccm }, { .name = "aes-ccm192", .cipher = CRYPTO_AES_CCM_16, .type = T_AEAD, - .evp_cipher = EVP_aes_192_ccm, .tag_len = AES_CBC_MAC_HASH_LEN }, + .tag_len = AES_CBC_MAC_HASH_LEN, .iv_sizes = { 12, 7, 8, 9, 10, 11, 13 }, + .evp_cipher = EVP_aes_192_ccm }, { .name = "aes-ccm256", .cipher = CRYPTO_AES_CCM_16, .type = T_AEAD, - .evp_cipher = EVP_aes_256_ccm, .tag_len = AES_CBC_MAC_HASH_LEN }, + .tag_len = AES_CBC_MAC_HASH_LEN, .iv_sizes = { 12, 7, 8, 9, 10, 11, 13 }, + .evp_cipher = EVP_aes_256_ccm }, { .name = "chacha20-poly1305", .cipher = CRYPTO_CHACHA20_POLY1305, .type = T_AEAD, .tag_len = POLY1305_HASH_LEN, + .iv_sizes = { CHACHA20_POLY1305_IV_LEN }, .evp_cipher = EVP_chacha20_poly1305 }, }; -static bool verbose; +static bool testall, verbose; static int requested_crid; static size_t aad_sizes[48], sizes[EALG_MAX_BLOCK_LEN * 2]; static u_int naad_sizes, nsizes; +static u_int iv_size; static void usage(void) { fprintf(stderr, - "usage: cryptocheck [-z] [-a algorithm] [-d dev] [size ...]\n"); + "usage: cryptocheck [-vz] [-A aad size] [-a algorithm]\n" + " [-d dev] [-I IV size] [size ...]\n"); exit(1); } @@ -1218,8 +1231,8 @@ out: static void openssl_aead_encrypt(const struct alg *alg, const EVP_CIPHER *cipher, - const char *key, const char *iv, const char *aad, size_t aad_len, - const char *input, char *output, size_t size, char *tag) + const char *key, const char *iv, size_t iv_len, const char *aad, + size_t aad_len, const char *input, char *output, size_t size, char *tag) { EVP_CIPHER_CTX *ctx; int outl, total; @@ -1228,7 +1241,13 @@ openssl_aead_encrypt(const struct alg *alg, const EVP_CIPHER *cipher, if (ctx == NULL) errx(1, "OpenSSL %s (%zu) ctx new failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); - if (EVP_EncryptInit_ex(ctx, cipher, NULL, (const u_char *)key, + if (EVP_EncryptInit_ex(ctx, cipher, NULL, NULL, NULL) != 1) + errx(1, "OpenSSL %s (%zu) ctx init failed: %s", alg->name, + size, ERR_error_string(ERR_get_error(), NULL)); + if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv_len, NULL) != 1) + errx(1, "OpenSSL %s (%zu) setting iv length failed: %s", alg->name, + size, ERR_error_string(ERR_get_error(), NULL)); + if (EVP_EncryptInit_ex(ctx, NULL, NULL, (const u_char *)key, (const u_char *)iv) != 1) errx(1, "OpenSSL %s (%zu) ctx init failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); @@ -1314,54 +1333,67 @@ openssl_ccm_encrypt(const struct alg *alg, const EVP_CIPHER *cipher, ctx = EVP_CIPHER_CTX_new(); if (ctx == NULL) - errx(1, "OpenSSL %s (%zu) ctx new failed: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, "OpenSSL %s/%zu (%zu, %zu) ctx new failed: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); if (EVP_EncryptInit_ex(ctx, cipher, NULL, NULL, NULL) != 1) - errx(1, "OpenSSL %s (%zu) ctx init failed: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, "OpenSSL %s/%zu (%zu, %zu) ctx init failed: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv_len, NULL) != 1) - errx(1, "OpenSSL %s (%zu) setting iv length failed: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, + "OpenSSL %s/%zu (%zu, %zu) setting iv length failed: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, AES_CBC_MAC_HASH_LEN, NULL) != 1) - errx(1, "OpenSSL %s (%zu) setting tag length failed: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, + "OpenSSL %s/%zu (%zu, %zu) setting tag length failed: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); if (EVP_EncryptInit_ex(ctx, NULL, NULL, (const u_char *)key, (const u_char *)iv) != 1) - errx(1, "OpenSSL %s (%zu) ctx init failed: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, "OpenSSL %s/%zu (%zu, %zu) ctx init failed: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); if (EVP_EncryptUpdate(ctx, NULL, &outl, NULL, size) != 1) - errx(1, "OpenSSL %s (%zu) unable to set data length: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, + "OpenSSL %s/%zu (%zu, %zu) unable to set data length: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); if (aad != NULL) { if (EVP_EncryptUpdate(ctx, NULL, &outl, (const u_char *)aad, aad_len) != 1) - errx(1, "OpenSSL %s (%zu) aad update failed: %s", - alg->name, size, + errx(1, + "OpenSSL %s/%zu (%zu, %zu) aad update failed: %s", + alg->name, iv_len, aad_len, size, ERR_error_string(ERR_get_error(), NULL)); } if (EVP_EncryptUpdate(ctx, (u_char *)output, &outl, (const u_char *)input, size) != 1) - errx(1, "OpenSSL %s (%zu) encrypt update failed: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, "OpenSSL %s/%zu (%zu, %zu) encrypt update failed: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); total = outl; if (EVP_EncryptFinal_ex(ctx, (u_char *)output + outl, &outl) != 1) - errx(1, "OpenSSL %s (%zu) encrypt final failed: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, "OpenSSL %s/%zu (%zu, %zu) encrypt final failed: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); total += outl; if ((size_t)total != size) - errx(1, "OpenSSL %s (%zu) encrypt size mismatch: %d", alg->name, - size, total); + errx(1, "OpenSSL %s/%zu (%zu, %zu) encrypt size mismatch: %d", + alg->name, iv_len, aad_len, size, total); if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, AES_CBC_MAC_HASH_LEN, tag) != 1) - errx(1, "OpenSSL %s (%zu) get tag failed: %s", alg->name, - size, ERR_error_string(ERR_get_error(), NULL)); + errx(1, "OpenSSL %s/%zu (%zu, %zu) get tag failed: %s", + alg->name, iv_len, aad_len, size, + ERR_error_string(ERR_get_error(), NULL)); EVP_CIPHER_CTX_free(ctx); } static bool ocf_init_aead_session(const struct alg *alg, const char *key, size_t key_len, - struct ocf_session *ses) + size_t iv_len, struct ocf_session *ses) { struct session2_op sop; @@ -1369,6 +1401,7 @@ ocf_init_aead_session(const struct alg *alg, const char *key, size_t key_len, sop.keylen = key_len; sop.key = key; sop.cipher = alg->cipher; + sop.ivlen = iv_len; return (ocf_init_session(&sop, "AEAD", alg->name, ses)); } @@ -1398,14 +1431,43 @@ ocf_aead(const struct ocf_session *ses, const char *iv, size_t iv_len, #define AEAD_MAX_TAG_LEN \ MAX(MAX(AES_GMAC_HASH_LEN, AES_CBC_MAC_HASH_LEN), POLY1305_HASH_LEN) +static size_t +max_ccm_buffer_length(size_t iv_len) +{ + const u_int L = 15 - iv_len; + + switch (L) { + case 2: + return (0xffff); + case 3: + return (0xffffff); +#ifdef __LP64__ + case 4: + return (0xffffffff); + case 5: + return (0xffffffffff); + case 6: + return (0xffffffffffff); + case 7: + return (0xffffffffffffff); + default: + return (0xffffffffffffffff); +#else + default: + return (0xffffffff); +#endif + } +} + static void -run_aead_test(const struct alg *alg, size_t aad_len, size_t size) +run_aead_test(const struct alg *alg, size_t aad_len, size_t size, + size_t iv_len) { struct ocf_session ses; const EVP_CIPHER *cipher; char *aad, *buffer, *cleartext, *ciphertext; char *iv, *key; - u_int iv_len, key_len; + u_int key_len; int error; char control_tag[AEAD_MAX_TAG_LEN], test_tag[AEAD_MAX_TAG_LEN]; @@ -1413,31 +1475,25 @@ run_aead_test(const struct alg *alg, size_t aad_len, size_t size) if (size % EVP_CIPHER_block_size(cipher) != 0) { if (verbose) printf( - "%s (%zu, %zu): invalid buffer size (block size %d)\n", - alg->name, aad_len, size, + "%s/%zu (%zu, %zu): invalid buffer size (block size %d)\n", + alg->name, iv_len, aad_len, size, EVP_CIPHER_block_size(cipher)); return; } - memset(control_tag, 0x3c, sizeof(control_tag)); - memset(test_tag, 0x3c, sizeof(test_tag)); - - key_len = EVP_CIPHER_key_length(cipher); - iv_len = EVP_CIPHER_iv_length(cipher); - - /* - * AES-CCM can have varying IV lengths; however, for the moment - * we only support AES_CCM_IV_LEN (12). So if the sizes are - * different, we'll fail. - */ if (EVP_CIPHER_mode(cipher) == EVP_CIPH_CCM_MODE && - iv_len != AES_CCM_IV_LEN) { + size > max_ccm_buffer_length(iv_len)) { if (verbose) - printf("OpenSSL CCM IV length (%d) != AES_CCM_IV_LEN", - iv_len); + printf("%s/%zu (%zu, %zu): invalid buffer size\n", + alg->name, iv_len, aad_len, size); return; } + memset(control_tag, 0x3c, sizeof(control_tag)); + memset(test_tag, 0x3c, sizeof(test_tag)); + + key_len = EVP_CIPHER_key_length(cipher); + key = alloc_buffer(key_len); iv = generate_iv(iv_len, alg); cleartext = alloc_buffer(size); @@ -1453,23 +1509,23 @@ run_aead_test(const struct alg *alg, size_t aad_len, size_t size) openssl_ccm_encrypt(alg, cipher, key, iv, iv_len, aad, aad_len, cleartext, ciphertext, size, control_tag); else - openssl_aead_encrypt(alg, cipher, key, iv, aad, aad_len, - cleartext, ciphertext, size, control_tag); + openssl_aead_encrypt(alg, cipher, key, iv, iv_len, aad, + aad_len, cleartext, ciphertext, size, control_tag); - if (!ocf_init_aead_session(alg, key, key_len, &ses)) + if (!ocf_init_aead_session(alg, key, key_len, iv_len, &ses)) goto out; /* OCF encrypt */ error = ocf_aead(&ses, iv, iv_len, aad, aad_len, cleartext, buffer, size, test_tag, COP_ENCRYPT); if (error != 0) { - warnc(error, "cryptodev %s (%zu, %zu) failed for device %s", - alg->name, aad_len, size, crfind(ses.crid)); + warnc(error, "cryptodev %s/%zu (%zu, %zu) failed for device %s", + alg->name, iv_len, aad_len, size, crfind(ses.crid)); goto out; } if (memcmp(ciphertext, buffer, size) != 0) { - printf("%s (%zu, %zu) encryption mismatch:\n", alg->name, - aad_len, size); + printf("%s/%zu (%zu, %zu) encryption mismatch:\n", alg->name, + iv_len, aad_len, size); printf("control:\n"); hexdump(ciphertext, size, NULL, 0); printf("test (cryptodev device %s):\n", crfind(ses.crid)); @@ -1477,8 +1533,8 @@ run_aead_test(const struct alg *alg, size_t aad_len, size_t size) goto out; } if (memcmp(control_tag, test_tag, sizeof(control_tag)) != 0) { - printf("%s (%zu, %zu) enc tag mismatch:\n", alg->name, aad_len, - size); + printf("%s/%zu (%zu, %zu) enc tag mismatch:\n", alg->name, + iv_len, aad_len, size); printf("control:\n"); hexdump(control_tag, sizeof(control_tag), NULL, 0); printf("test (cryptodev device %s):\n", crfind(ses.crid)); @@ -1490,13 +1546,13 @@ run_aead_test(const struct alg *alg, size_t aad_len, size_t size) error = ocf_aead(&ses, iv, iv_len, aad, aad_len, ciphertext, buffer, size, control_tag, COP_DECRYPT); if (error != 0) { - warnc(error, "cryptodev %s (%zu, %zu) failed for device %s", - alg->name, aad_len, size, crfind(ses.crid)); + warnc(error, "cryptodev %s/%zu (%zu, %zu) failed for device %s", + alg->name, iv_len, aad_len, size, crfind(ses.crid)); goto out; } if (memcmp(cleartext, buffer, size) != 0) { - printf("%s (%zu, %zu) decryption mismatch:\n", alg->name, - aad_len, size); + printf("%s/%zu (%zu, %zu) decryption mismatch:\n", alg->name, + iv_len, aad_len, size); printf("control:\n"); hexdump(cleartext, size, NULL, 0); printf("test (cryptodev device %s):\n", crfind(ses.crid)); @@ -1511,18 +1567,18 @@ run_aead_test(const struct alg *alg, size_t aad_len, size_t size) if (error != EBADMSG) { if (error != 0) warnc(error, - "cryptodev %s (%zu, %zu) corrupt tag failed for device %s", - alg->name, aad_len, size, crfind(ses.crid)); + "cryptodev %s/%zu (%zu, %zu) corrupt tag failed for device %s", + alg->name, iv_len, aad_len, size, crfind(ses.crid)); else warnx( - "cryptodev %s (%zu, %zu) corrupt tag didn't fail for device %s", - alg->name, aad_len, size, crfind(ses.crid)); + "cryptodev %s/%zu (%zu, %zu) corrupt tag didn't fail for device %s", + alg->name, iv_len, aad_len, size, crfind(ses.crid)); goto out; } if (verbose) - printf("%s (%zu, %zu) matched (cryptodev device %s)\n", - alg->name, aad_len, size, crfind(ses.crid)); + printf("%s/%zu (%zu, %zu) matched (cryptodev device %s)\n", + alg->name, iv_len, aad_len, size, crfind(ses.crid)); out: ocf_destroy_session(&ses); @@ -1535,7 +1591,7 @@ out: } static void -run_test(const struct alg *alg, size_t aad_len, size_t size) +run_test(const struct alg *alg, size_t aad_len, size_t size, size_t iv_len) { switch (alg->type) { @@ -1558,7 +1614,7 @@ run_test(const struct alg *alg, size_t aad_len, size_t size) run_eta_test(alg, aad_len, size); break; case T_AEAD: - run_aead_test(alg, aad_len, size); + run_aead_test(alg, aad_len, size, iv_len); break; } } @@ -1566,18 +1622,33 @@ run_test(const struct alg *alg, size_t aad_len, size_t size) static void run_test_sizes(const struct alg *alg) { - u_int i, j; + u_int i, j, k; switch (alg->type) { default: for (i = 0; i < nsizes; i++) - run_test(alg, 0, sizes[i]); + run_test(alg, 0, sizes[i], 0); break; case T_ETA: - case T_AEAD: for (i = 0; i < naad_sizes; i++) for (j = 0; j < nsizes; j++) - run_test(alg, aad_sizes[i], sizes[j]); + run_test(alg, aad_sizes[i], sizes[j], 0); + break; + case T_AEAD: + for (i = 0; i < naad_sizes; i++) { + for (j = 0; j < nsizes; j++) { + if (iv_size != 0) + run_test(alg, aad_sizes[i], sizes[j], + iv_size); + else if (testall) { + for (k = 0; alg->iv_sizes[k] != 0; k++) + run_test(alg, aad_sizes[i], + sizes[j], alg->iv_sizes[k]); + } else + run_test(alg, aad_sizes[i], sizes[j], + alg->iv_sizes[0]); + } + } break; } } @@ -1654,14 +1725,14 @@ main(int ac, char **av) char *cp; size_t base_size; u_int i; - bool testall; int ch; algname = NULL; requested_crid = CRYPTO_FLAG_HARDWARE; testall = false; verbose = false; - while ((ch = getopt(ac, av, "A:a:d:vz")) != -1) + iv_size = 0; + while ((ch = getopt(ac, av, "A:a:d:I:vz")) != -1) switch (ch) { case 'A': if (naad_sizes >= nitems(aad_sizes)) { @@ -1679,6 +1750,11 @@ main(int ac, char **av) case 'd': requested_crid = crlookup(optarg); break; + case 'I': + iv_size = strtol(optarg, &cp, 0); + if (*cp != '\0') + errx(1, "Bad IV size %s", optarg); + break; case 'v': verbose = true; break; From nobody Wed Oct 6 21:10:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9143D12D3DF8; Wed, 6 Oct 2021 21:10: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 4HPnD73mnSz3HdW; Wed, 6 Oct 2021 21:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02DF426FD3; Wed, 6 Oct 2021 21:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAU20059017; Wed, 6 Oct 2021 21:10:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAU9P059016; Wed, 6 Oct 2021 21:10:30 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:30 GMT Message-Id: <202110062110.196LAU9P059016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ae18720d2792 - main - crypto: Support multiple nonce lengths for AES-CCM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae18720d2792287c9ec658404f1a3173014d4979 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ae18720d2792287c9ec658404f1a3173014d4979 commit ae18720d2792287c9ec658404f1a3173014d4979 Author: John Baldwin AuthorDate: 2021-10-06 21:08:47 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:47 +0000 crypto: Support multiple nonce lengths for AES-CCM. Permit nonces of lengths 7 through 13 in the OCF framework and the cryptosoft driver. A helper function (ccm_max_payload_length) can be used in OCF drivers to reject CCM requests which are too large for the specified nonce length. Reviewed by: sef Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32111 --- share/man/man7/crypto.7 | 18 +++++++++----- sys/opencrypto/crypto.c | 56 ++++++++++++++++++++++++++++++++++++------ sys/opencrypto/cryptodev.h | 29 ++++++++++++++++++++++ sys/opencrypto/cryptosoft.c | 17 +++++++------ sys/opencrypto/xform_aes_icm.c | 7 +++--- 5 files changed, 102 insertions(+), 25 deletions(-) diff --git a/share/man/man7/crypto.7 b/share/man/man7/crypto.7 index 6e5bd83621aa..d75daa62adcb 100644 --- a/share/man/man7/crypto.7 +++ b/share/man/man7/crypto.7 @@ -1,9 +1,13 @@ -.\" Copyright (c) 2014 The FreeBSD Foundation +.\" Copyright (c) 2014-2021 The FreeBSD Foundation .\" All rights reserved. .\" -.\" This documentation was written by John-Mark Gurney under -.\" the sponsorship of the FreeBSD Foundation and +.\" Portions of this documentation were written by John-Mark Gurney +.\" under the sponsorship of the FreeBSD Foundation and .\" Rubicon Communications, LLC (Netgate). +.\" +.\" Portions of this documentation were written by Ararat River +.\" Consulting, LLC under sponsorship of the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -27,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2021 +.Dd October 6, 2021 .Dt CRYPTO 7 .Os .Sh NAME @@ -153,13 +157,15 @@ This nonce must be provided in via the .Dv CRYPTO_F_IV_SEPARATE flag. +Some AEAD algorithms support multiple nonce sizes. +The first size listed is the default nonce size. .Pp The following AEAD algorithms are supported: -.Bl -column "CRYPTO_AES_NIST_GCM_16" "Nonce" "16, 24, 32" "Tag" +.Bl -column "CRYPTO_AES_NIST_GCM_16" "12, 7-13" "16, 24, 32" "Tag" .It Sy Name Ta Sy Nonce Ta Sy Key Sizes Ta Sy Tag Ta Sy Description .It Dv CRYPTO_AES_NIST_GCM_16 Ta 12 Ta 16, 24, 32 Ta 16 Ta AES Galois/Counter Mode -.It Dv CRYPTO_AES_CCM_16 Ta 12 Ta 16, 24, 32 Ta 16 Ta +.It Dv CRYPTO_AES_CCM_16 Ta 12, 7-13 Ta 16, 24, 32 Ta 16 Ta AES Counter with CBC-MAC .It Dv CRYPTO_CHACHA20_POLY1305 Ta 12 Ta 32 Ta 16 Ta ChaCha20-Poly1305 diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index ef8422d5f32c..3a71e53129be 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -1,5 +1,9 @@ /*- * Copyright (c) 2002-2006 Sam Leffler. All rights reserved. + * Copyright (c) 2021 The FreeBSD Foundation + * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -713,6 +717,24 @@ alg_is_aead(int alg) return (alg_type(alg) == ALG_AEAD); } +static bool +ccm_tag_length_valid(int len) +{ + /* RFC 3610 */ + switch (len) { + case 4: + case 6: + case 8: + case 10: + case 12: + case 14: + case 16: + return (true); + default: + return (false); + } +} + #define SUPPORTED_SES (CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD | CSP_F_ESN) /* Various sanity checks on crypto session parameters. */ @@ -770,8 +792,21 @@ check_csp(const struct crypto_session_params *csp) return (false); /* IV is optional for digests (e.g. GMAC). */ - if (csp->csp_ivlen >= EALG_MAX_BLOCK_LEN) - return (false); + switch (csp->csp_auth_alg) { + case CRYPTO_AES_CCM_CBC_MAC: + if (csp->csp_ivlen < 7 || csp->csp_ivlen > 13) + return (false); + break; + case CRYPTO_AES_NIST_GMAC: + if (csp->csp_ivlen != AES_GCM_IV_LEN) + return (false); + break; + default: + if (csp->csp_ivlen != 0) + return (false); + break; + } + if (!alg_is_digest(csp->csp_auth_alg)) return (false); @@ -790,6 +825,10 @@ check_csp(const struct crypto_session_params *csp) axf = crypto_auth_hash(csp); if (axf == NULL || csp->csp_auth_mlen > axf->hashsize) return (false); + + if (csp->csp_auth_alg == CRYPTO_AES_CCM_CBC_MAC && + !ccm_tag_length_valid(csp->csp_auth_mlen)) + return (false); } break; case CSP_MODE_AEAD: @@ -803,13 +842,16 @@ check_csp(const struct crypto_session_params *csp) if (csp->csp_auth_alg != 0 || csp->csp_auth_klen != 0) return (false); - /* - * XXX: Would be nice to have a better way to get this - * value. - */ switch (csp->csp_cipher_alg) { - case CRYPTO_AES_NIST_GCM_16: case CRYPTO_AES_CCM_16: + if (csp->csp_auth_mlen != 0 && + !ccm_tag_length_valid(csp->csp_auth_mlen)) + return (false); + + if (csp->csp_ivlen < 7 || csp->csp_ivlen > 13) + return (false); + break; + case CRYPTO_AES_NIST_GCM_16: case CRYPTO_CHACHA20_POLY1305: if (csp->csp_auth_mlen > 16) return (false); diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index b3c79a48f632..6611a8925020 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -686,5 +686,34 @@ crypto_read_iv(struct cryptop *crp, void *iv) crypto_copydata(crp, crp->crp_iv_start, csp->csp_ivlen, iv); } +static __inline size_t +ccm_max_payload_length(const struct crypto_session_params *csp) +{ + /* RFC 3160 */ + const u_int L = 15 - csp->csp_ivlen; + + switch (L) { + case 2: + return (0xffff); + case 3: + return (0xffffff); +#ifdef __LP64__ + case 4: + return (0xffffffff); + case 5: + return (0xffffffffff); + case 6: + return (0xffffffffffff); + case 7: + return (0xffffffffffffff); + default: + return (0xffffffffffffffff); +#else + default: + return (0xffffffff); +#endif + } +} + #endif /* _KERNEL */ #endif /* _CRYPTO_CRYPTO_H_ */ diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index 19092e56b004..ae71f0d6c096 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -642,17 +642,19 @@ swcr_ccm_cbc_mac(struct swcr_session *ses, struct cryptop *crp) u_char tag[AES_CBC_MAC_HASH_LEN]; u_char iv[AES_BLOCK_LEN]; union authctx ctx; + const struct crypto_session_params *csp; struct swcr_auth *swa; const struct auth_hash *axf; int error, ivlen; + csp = crypto_get_params(crp->crp_session); swa = &ses->swcr_auth; axf = swa->sw_axf; bcopy(swa->sw_ictx, &ctx, axf->ctxsize); /* Initialize the IV */ - ivlen = AES_CCM_IV_LEN; + ivlen = csp->csp_ivlen; crypto_read_iv(crp, iv); /* @@ -694,6 +696,7 @@ swcr_ccm_cbc_mac(struct swcr_session *ses, struct cryptop *crp) static int swcr_ccm(struct swcr_session *ses, struct cryptop *crp) { + const struct crypto_session_params *csp; uint32_t blkbuf[howmany(AES_BLOCK_LEN, sizeof(uint32_t))]; u_char *blk = (u_char *)blkbuf; u_char tag[AES_CBC_MAC_HASH_LEN]; @@ -708,6 +711,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) size_t len; int blksz, error, ivlen, r, resid; + csp = crypto_get_params(crp->crp_session); swa = &ses->swcr_auth; axf = swa->sw_axf; @@ -721,10 +725,13 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) KASSERT(axf->blocksize == exf->native_blocksize, ("%s: blocksize mismatch", __func__)); + if (crp->crp_payload_length > ccm_max_payload_length(csp)) + return (EMSGSIZE); + if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); - ivlen = AES_CCM_IV_LEN; + ivlen = csp->csp_ivlen; /* * AES CCM-CBC-MAC needs to know the length of both the auth @@ -1130,7 +1137,6 @@ swcr_setup_cipher(struct swcr_session *ses, swe = &ses->swcr_encdec; txf = crypto_cipher(csp); - MPASS(txf->ivsize == csp->csp_ivlen); if (txf->ctxsize != 0) { swe->sw_kschedule = malloc(txf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); @@ -1282,9 +1288,6 @@ swcr_setup_ccm(struct swcr_session *ses, struct swcr_auth *swa; const struct auth_hash *axf; - if (csp->csp_ivlen != AES_CCM_IV_LEN) - return (EINVAL); - /* First, setup the auth side. */ swa = &ses->swcr_auth; switch (csp->csp_cipher_klen * 8) { @@ -1392,8 +1395,6 @@ swcr_auth_supported(const struct crypto_session_params *csp) } if (csp->csp_auth_key == NULL) return (false); - if (csp->csp_ivlen != AES_CCM_IV_LEN) - return (false); break; } return (true); diff --git a/sys/opencrypto/xform_aes_icm.c b/sys/opencrypto/xform_aes_icm.c index 860dceda5232..09880ee426b8 100644 --- a/sys/opencrypto/xform_aes_icm.c +++ b/sys/opencrypto/xform_aes_icm.c @@ -144,15 +144,14 @@ aes_ccm_reinit(void *key, const uint8_t *iv, size_t ivlen) { struct aes_icm_ctx *ctx; - KASSERT(ivlen == AES_CCM_IV_LEN, + KASSERT(ivlen >= 7 && ivlen <= 13, ("%s: invalid IV length", __func__)); ctx = key; /* CCM has flags, then the IV, then the counter, which starts at 1 */ bzero(ctx->ac_block, sizeof(ctx->ac_block)); - /* 3 bytes for length field; this gives a nonce of 12 bytes */ - ctx->ac_block[0] = (15 - AES_CCM_IV_LEN) - 1; - bcopy(iv, ctx->ac_block+1, AES_CCM_IV_LEN); + ctx->ac_block[0] = (15 - ivlen) - 1; + bcopy(iv, ctx->ac_block + 1, ivlen); ctx->ac_block[AESICM_BLOCKSIZE - 1] = 1; } From nobody Wed Oct 6 21:10:32 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A16DB12D3F59; Wed, 6 Oct 2021 21:10: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 4HPnD90g4dz3HbN; Wed, 6 Oct 2021 21:10:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25BC5271EC; Wed, 6 Oct 2021 21:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAW4Q059041; Wed, 6 Oct 2021 21:10:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAWkb059040; Wed, 6 Oct 2021 21:10:32 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:32 GMT Message-Id: <202110062110.196LAWkb059040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8e6af6adfc2c - main - aesni: Support multiple nonce lengths for AES-CCM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e6af6adfc2cc3d0ea89c20eaa5914e453c48b49 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8e6af6adfc2cc3d0ea89c20eaa5914e453c48b49 commit 8e6af6adfc2cc3d0ea89c20eaa5914e453c48b49 Author: John Baldwin AuthorDate: 2021-10-06 21:08:47 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:47 +0000 aesni: Support multiple nonce lengths for AES-CCM. Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32112 --- sys/crypto/aesni/aesni.c | 13 +++++++++---- sys/crypto/aesni/aesni_ccm.c | 32 ++++++++------------------------ 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c index 4debbae12c2b..67dcef123429 100644 --- a/sys/crypto/aesni/aesni.c +++ b/sys/crypto/aesni/aesni.c @@ -1,7 +1,7 @@ /*- * Copyright (c) 2005-2008 Pawel Jakub Dawidek * Copyright (c) 2010 Konstantin Belousov - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2014-2021 The FreeBSD Foundation * Copyright (c) 2017 Conrad Meyer * All rights reserved. * @@ -9,6 +9,9 @@ * under sponsorship of the FreeBSD Foundation and * Rubicon Communications, LLC (Netgate). * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -319,8 +322,7 @@ aesni_probesession(device_t dev, const struct crypto_session_params *csp) if (csp->csp_auth_mlen != 0 && csp->csp_auth_mlen != AES_CBC_MAC_HASH_LEN) return (EINVAL); - if (csp->csp_ivlen != AES_CCM_IV_LEN || - !sc->has_aes) + if (!sc->has_aes) return (EINVAL); break; default: @@ -639,9 +641,12 @@ aesni_cipher_process(struct aesni_session *ses, struct cryptop *crp) csp = crypto_get_params(crp->crp_session); switch (csp->csp_cipher_alg) { + case CRYPTO_AES_CCM_16: + if (crp->crp_payload_length > ccm_max_payload_length(csp)) + return (EMSGSIZE); + /* FALLTHROUGH */ case CRYPTO_AES_ICM: case CRYPTO_AES_NIST_GCM_16: - case CRYPTO_AES_CCM_16: if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); break; diff --git a/sys/crypto/aesni/aesni_ccm.c b/sys/crypto/aesni/aesni_ccm.c index fc01e92c697f..9e2fa317b2ed 100644 --- a/sys/crypto/aesni/aesni_ccm.c +++ b/sys/crypto/aesni/aesni_ccm.c @@ -1,11 +1,15 @@ /*- - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2014-2021 The FreeBSD Foundation * Copyright (c) 2018 iXsystems, Inc * All rights reserved. * - * This software was developed by John-Mark Gurney under - * the sponsorship of the FreeBSD Foundation and + * Portions of this software were developed by John-Mark Gurney + * under the sponsorship of the FreeBSD Foundation and * Rubicon Communications, LLC (Netgate). + * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -185,12 +189,7 @@ cbc_mac_start(const unsigned char *auth_data, size_t auth_len, * however, they're always truncated from 16 bytes, and the tag * length isn't passed in. (This could be fixed by changing the * code in aesni.c:aesni_cipher_crypt().) - * Similarly, although the nonce length is passed in, the - * OpenCrypto API that calls us doesn't have a way to set the nonce - * other than by having different crypto algorithm types. As a result, - * this is currently always called with nlen=12; this means that we - * also have a maximum message length of 16 megabytes. And similarly, - * since abytes is limited to a 32 bit value here, the AAD is + * Since abytes is limited to a 32 bit value here, the AAD is * limited to 4 gigabytes or less. */ void @@ -222,14 +221,6 @@ AES_CCM_encrypt(const unsigned char *in, unsigned char *out, */ L = sizeof(__m128i) - 1 - nlen; - /* - * Now, this shouldn't happen, but let's make sure that - * the data length isn't too big. - */ - KASSERT(nbytes <= ((1 << (8 * L)) - 1), - ("%s: nbytes is %u, but length field is %d bytes", - __FUNCTION__, nbytes, L)); - /* * Clear out the blocks */ @@ -399,13 +390,6 @@ AES_CCM_decrypt(const unsigned char *in, unsigned char *out, */ L = sizeof(__m128i) - 1 - nlen; - /* - * Now, this shouldn't happen, but let's make sure that - * the data length isn't too big. - */ - if (nbytes > ((1 << (8 * L)) - 1)) - panic("%s: nbytes is %u, but length field is %d bytes", - __FUNCTION__, nbytes, L); /* * Clear out the blocks */ From nobody Wed Oct 6 21:10:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 12C4412D3BC4; Wed, 6 Oct 2021 21:10: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 4HPnDC10sdz3Hds; Wed, 6 Oct 2021 21:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5424C271ED; Wed, 6 Oct 2021 21:10:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAX7d059065; Wed, 6 Oct 2021 21:10:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAXcO059064; Wed, 6 Oct 2021 21:10:33 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:33 GMT Message-Id: <202110062110.196LAXcO059064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d718c2d3c805 - main - aesni: Handle requests with an empty payload. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d718c2d3c805001db0b0ae0cc0c8a811b8a90a95 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d718c2d3c805001db0b0ae0cc0c8a811b8a90a95 commit d718c2d3c805001db0b0ae0cc0c8a811b8a90a95 Author: John Baldwin AuthorDate: 2021-10-06 21:08:47 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:47 +0000 aesni: Handle requests with an empty payload. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32113 --- sys/crypto/aesni/aesni.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c index 67dcef123429..7d4dbd2c1604 100644 --- a/sys/crypto/aesni/aesni.c +++ b/sys/crypto/aesni/aesni.c @@ -700,28 +700,36 @@ aesni_cipher_crypt(struct aesni_session *ses, struct cryptop *crp, int error; bool encflag, allocated, authallocated, outallocated, outcopy; - buf = aesni_cipher_alloc(crp, crp->crp_payload_start, - crp->crp_payload_length, &allocated); - if (buf == NULL) - return (ENOMEM); + if (crp->crp_payload_length == 0) { + buf = NULL; + allocated = false; + } else { + buf = aesni_cipher_alloc(crp, crp->crp_payload_start, + crp->crp_payload_length, &allocated); + if (buf == NULL) + return (ENOMEM); + } outallocated = false; authallocated = false; authbuf = NULL; if (csp->csp_cipher_alg == CRYPTO_AES_NIST_GCM_16 || csp->csp_cipher_alg == CRYPTO_AES_CCM_16) { - if (crp->crp_aad != NULL) + if (crp->crp_aad_length == 0) { + authbuf = NULL; + } else if (crp->crp_aad != NULL) { authbuf = crp->crp_aad; - else + } else { authbuf = aesni_cipher_alloc(crp, crp->crp_aad_start, crp->crp_aad_length, &authallocated); - if (authbuf == NULL) { - error = ENOMEM; - goto out; + if (authbuf == NULL) { + error = ENOMEM; + goto out; + } } } - if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + if (CRYPTO_HAS_OUTPUT_BUFFER(crp) && crp->crp_payload_length > 0) { outbuf = crypto_buffer_contiguous_subsegment(&crp->crp_obuf, crp->crp_payload_output_start, crp->crp_payload_length); if (outbuf == NULL) { From nobody Wed Oct 6 21:10:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0551612D40BD; Wed, 6 Oct 2021 21:10: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 4HPnDD08JWz3HbX; Wed, 6 Oct 2021 21:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BBC626BD6; Wed, 6 Oct 2021 21:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAYr1059096; Wed, 6 Oct 2021 21:10:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAY2c059095; Wed, 6 Oct 2021 21:10:34 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:34 GMT Message-Id: <202110062110.196LAY2c059095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c09c379c7aa7 - main - aesni: Permit AES-CCM requests with neither payload nor AAD. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c09c379c7aa7337680ff3cb73691ce12d627128b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c09c379c7aa7337680ff3cb73691ce12d627128b commit c09c379c7aa7337680ff3cb73691ce12d627128b Author: John Baldwin AuthorDate: 2021-10-06 21:08:47 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:47 +0000 aesni: Permit AES-CCM requests with neither payload nor AAD. Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32114 --- sys/crypto/aesni/aesni_ccm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/crypto/aesni/aesni_ccm.c b/sys/crypto/aesni/aesni_ccm.c index 9e2fa317b2ed..34b61a633907 100644 --- a/sys/crypto/aesni/aesni_ccm.c +++ b/sys/crypto/aesni/aesni_ccm.c @@ -205,9 +205,6 @@ AES_CCM_encrypt(const unsigned char *in, unsigned char *out, uint8_t *byte_ptr; __m128i s0, rolling_mac, s_x, staging_block; - if (nbytes == 0 && abytes == 0) - return; - /* NIST 800-38c section A.1 says n is [7, 13]. */ if (nlen < 7 || nlen > 13) panic("%s: bad nonce length %d", __FUNCTION__, nlen); @@ -377,8 +374,6 @@ AES_CCM_decrypt(const unsigned char *in, unsigned char *out, __m128i s0, rolling_mac, staging_block; uint8_t *byte_ptr; - if (nbytes == 0 && abytes == 0) - return (1); // No message means no decryption! if (nlen < 0 || nlen > 15) panic("%s: bad nonce length %d", __FUNCTION__, nlen); From nobody Wed Oct 6 21:10:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E1CB412D42DB; Wed, 6 Oct 2021 21:10: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 4HPnDJ3n88z3HYC; Wed, 6 Oct 2021 21:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D6FD26F65; Wed, 6 Oct 2021 21:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAahl059701; Wed, 6 Oct 2021 21:10:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAa37059688; Wed, 6 Oct 2021 21:10:36 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:36 GMT Message-Id: <202110062110.196LAa37059688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3e6a97b3a7bc - main - ccr: Support multiple nonce lengths for AES-CCM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e6a97b3a7bc80b1c12dd7b5208bfe99019c42b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3e6a97b3a7bc80b1c12dd7b5208bfe99019c42b4 commit 3e6a97b3a7bc80b1c12dd7b5208bfe99019c42b4 Author: John Baldwin AuthorDate: 2021-10-06 21:08:48 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:48 +0000 ccr: Support multiple nonce lengths for AES-CCM. Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32116 --- sys/dev/cxgbe/crypto/t4_crypto.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 30d168b60777..ca6cd332fa24 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -1528,17 +1528,18 @@ static void generate_ccm_b0(struct cryptop *crp, u_int hash_size_in_response, const char *iv, char *b0) { - u_int i, payload_len; + u_int i, payload_len, L; /* NB: L is already set in the first byte of the IV. */ memcpy(b0, iv, CCM_B0_SIZE); + L = iv[0] + 1; /* Set length of hash in bits 3 - 5. */ b0[0] |= (((hash_size_in_response - 2) / 2) << 3); /* Store the payload length as a big-endian value. */ payload_len = crp->crp_payload_length; - for (i = 0; i < iv[0]; i++) { + for (i = 0; i < L; i++) { b0[CCM_CBC_BLOCK_LEN - 1 - i] = payload_len; payload_len >>= 8; } @@ -1559,6 +1560,7 @@ static int ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) { char iv[CHCR_MAX_CRYPTO_IV_LEN]; + const struct crypto_session_params *csp; struct ulptx_idata *idata; struct chcr_wr *crwr; struct wrqe *wr; @@ -1571,6 +1573,8 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) int sgl_nsegs, sgl_len; int error; + csp = crypto_get_params(crp->crp_session); + if (s->blkcipher.key_len == 0) return (EINVAL); @@ -1581,6 +1585,10 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) if (crp->crp_payload_length == 0) return (EMSGSIZE); + /* The length has to fit within the length field in block 0. */ + if (crp->crp_payload_length > ccm_max_payload_length(csp)) + return (EMSGSIZE); + /* * CCM always includes block 0 in the AAD before AAD from the * request. @@ -1598,9 +1606,8 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) return (EINVAL); /* - * Always assume a 12 byte input nonce for now since that is - * what OCF always generates. The full IV in the work request - * is 16 bytes. + * The IV in the work request is 16 bytes and not just the + * nonce. */ iv_len = AES_BLOCK_LEN; @@ -1745,7 +1752,7 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) * the full IV with the counter set to 0. */ memset(iv, 0, iv_len); - iv[0] = (15 - AES_CCM_IV_LEN) - 1; + iv[0] = (15 - csp->csp_ivlen) - 1; crypto_read_iv(crp, iv + 1); ccr_populate_wreq(sc, s, crwr, kctx_len, wr_len, imm_len, sgl_len, 0, @@ -1868,6 +1875,7 @@ ccr_ccm_done(struct ccr_softc *sc, struct ccr_session *s, static void ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) { + const struct crypto_session_params *csp; const struct auth_hash *axf; const struct enc_xform *exf; union authctx *auth_ctx; @@ -1879,6 +1887,12 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) auth_ctx = NULL; kschedule = NULL; + csp = crypto_get_params(crp->crp_session); + if (crp->crp_payload_length > ccm_max_payload_length(csp)) { + error = EMSGSIZE; + goto out; + } + /* Initialize the MAC. */ switch (s->blkcipher.key_len) { case 16: @@ -1921,7 +1935,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) auth_ctx->aes_cbc_mac_ctx.authDataLength = crp->crp_aad_length; auth_ctx->aes_cbc_mac_ctx.cryptDataLength = crp->crp_payload_length; - axf->Reinit(auth_ctx, crp->crp_iv, AES_CCM_IV_LEN); + axf->Reinit(auth_ctx, crp->crp_iv, csp->csp_ivlen); /* MAC the AAD. */ if (crp->crp_aad != NULL) @@ -1933,7 +1947,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) if (error) goto out; - exf->reinit(kschedule, crp->crp_iv, AES_CCM_IV_LEN); + exf->reinit(kschedule, crp->crp_iv, csp->csp_ivlen); /* Do encryption/decryption with MAC */ for (i = 0; i < crp->crp_payload_length; i += sizeof(block)) { @@ -1968,7 +1982,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) error = 0; /* Tag matches, decrypt data. */ - exf->reinit(kschedule, crp->crp_iv, AES_CCM_IV_LEN); + exf->reinit(kschedule, crp->crp_iv, csp->csp_ivlen); for (i = 0; i < crp->crp_payload_length; i += sizeof(block)) { len = imin(crp->crp_payload_length - i, @@ -2445,8 +2459,6 @@ ccr_probesession(device_t dev, const struct crypto_session_params *csp) return (EINVAL); break; case CRYPTO_AES_CCM_16: - if (csp->csp_ivlen != AES_CCM_IV_LEN) - return (EINVAL); if (csp->csp_auth_mlen < 0 || csp->csp_auth_mlen > AES_CBC_MAC_HASH_LEN) return (EINVAL); From nobody Wed Oct 6 21:10:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E2E8712D42DC; Wed, 6 Oct 2021 21:10: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 4HPnDH3GBBz3HW7; Wed, 6 Oct 2021 21:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81AC226BD7; Wed, 6 Oct 2021 21:10:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAZ7w059120; Wed, 6 Oct 2021 21:10:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAZWT059119; Wed, 6 Oct 2021 21:10:35 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:35 GMT Message-Id: <202110062110.196LAZWT059119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 655eb762c310 - main - aesni: Support AES-CCM requests with a truncated tag. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 655eb762c31044a791e8c8c6355515e7c89c07ef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=655eb762c31044a791e8c8c6355515e7c89c07ef commit 655eb762c31044a791e8c8c6355515e7c89c07ef Author: John Baldwin AuthorDate: 2021-10-06 21:08:48 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:48 +0000 aesni: Support AES-CCM requests with a truncated tag. Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32115 --- sys/crypto/aesni/aesni.c | 18 +++++++++++------- sys/crypto/aesni/aesni.h | 8 ++++---- sys/crypto/aesni/aesni_ccm.c | 10 ++-------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c index 7d4dbd2c1604..de797abd1af5 100644 --- a/sys/crypto/aesni/aesni.c +++ b/sys/crypto/aesni/aesni.c @@ -319,9 +319,6 @@ aesni_probesession(device_t dev, const struct crypto_session_params *csp) CRYPTDEB("invalid CCM key length"); return (EINVAL); } - if (csp->csp_auth_mlen != 0 && - csp->csp_auth_mlen != AES_CBC_MAC_HASH_LEN) - return (EINVAL); if (!sc->has_aes) return (EINVAL); break; @@ -610,6 +607,11 @@ aesni_cipher_setup(struct aesni_session *ses, error = aesni_authprepare(ses, csp->csp_auth_klen); if (error != 0) return (error); + } else if (csp->csp_cipher_alg == CRYPTO_AES_CCM_16) { + if (csp->csp_auth_mlen == 0) + ses->mlen = AES_CBC_MAC_HASH_LEN; + else + ses->mlen = csp->csp_auth_mlen; } kt = is_fpu_kern_thread(0) || (csp->csp_cipher_alg == 0); @@ -809,15 +811,17 @@ aesni_cipher_crypt(struct aesni_session *ses, struct cryptop *crp, memset(tag, 0, sizeof(tag)); AES_CCM_encrypt(buf, outbuf, authbuf, iv, tag, crp->crp_payload_length, crp->crp_aad_length, - csp->csp_ivlen, ses->enc_schedule, ses->rounds); - crypto_copyback(crp, crp->crp_digest_start, sizeof(tag), + csp->csp_ivlen, ses->mlen, ses->enc_schedule, + ses->rounds); + crypto_copyback(crp, crp->crp_digest_start, ses->mlen, tag); } else { - crypto_copydata(crp, crp->crp_digest_start, sizeof(tag), + crypto_copydata(crp, crp->crp_digest_start, ses->mlen, tag); if (!AES_CCM_decrypt(buf, outbuf, authbuf, iv, tag, crp->crp_payload_length, crp->crp_aad_length, - csp->csp_ivlen, ses->enc_schedule, ses->rounds)) + csp->csp_ivlen, ses->mlen, ses->enc_schedule, + ses->rounds)) error = EBADMSG; } break; diff --git a/sys/crypto/aesni/aesni.h b/sys/crypto/aesni/aesni.h index 284bf6fba0fc..77ceec7b382a 100644 --- a/sys/crypto/aesni/aesni.h +++ b/sys/crypto/aesni/aesni.h @@ -112,12 +112,12 @@ int AES_GCM_decrypt(const unsigned char *in, unsigned char *out, /* CCM + CBC-MAC functions */ void AES_CCM_encrypt(const unsigned char *in, unsigned char *out, const unsigned char *addt, const unsigned char *ivec, - unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes, - const unsigned char *key, int nr); + unsigned char *tag, uint32_t nbytes, uint32_t abytes, int nlen, + int tag_length, const unsigned char *key, int nr); int AES_CCM_decrypt(const unsigned char *in, unsigned char *out, const unsigned char *addt, const unsigned char *ivec, - const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int ibytes, - const unsigned char *key, int nr); + const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int nlen, + int tag_length, const unsigned char *key, int nr); void aesni_cipher_setup_common(struct aesni_session *ses, const struct crypto_session_params *csp, const uint8_t *key, int keylen); diff --git a/sys/crypto/aesni/aesni_ccm.c b/sys/crypto/aesni/aesni_ccm.c index 34b61a633907..c7edaa0b9d5c 100644 --- a/sys/crypto/aesni/aesni_ccm.c +++ b/sys/crypto/aesni/aesni_ccm.c @@ -185,10 +185,6 @@ cbc_mac_start(const unsigned char *auth_data, size_t auth_len, * Implement AES CCM+CBC-MAC encryption and authentication. * * A couple of notes: - * The specification allows for a different number of tag lengths; - * however, they're always truncated from 16 bytes, and the tag - * length isn't passed in. (This could be fixed by changing the - * code in aesni.c:aesni_cipher_crypt().) * Since abytes is limited to a 32 bit value here, the AAD is * limited to 4 gigabytes or less. */ @@ -196,9 +192,8 @@ void AES_CCM_encrypt(const unsigned char *in, unsigned char *out, const unsigned char *addt, const unsigned char *nonce, unsigned char *tag, uint32_t nbytes, uint32_t abytes, int nlen, - const unsigned char *key, int nr) + int tag_length, const unsigned char *key, int nr) { - static const int tag_length = 16; /* 128 bits */ int L; int counter = 1; /* S0 has 0, S1 has 1 */ size_t copy_amt, total = 0; @@ -367,9 +362,8 @@ int AES_CCM_decrypt(const unsigned char *in, unsigned char *out, const unsigned char *addt, const unsigned char *nonce, const unsigned char *tag, uint32_t nbytes, uint32_t abytes, int nlen, - const unsigned char *key, int nr) + int tag_length, const unsigned char *key, int nr) { - static const int tag_length = 16; /* 128 bits */ int L; __m128i s0, rolling_mac, staging_block; uint8_t *byte_ptr; From nobody Wed Oct 6 21:10:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D5CC912D43DF; Wed, 6 Oct 2021 21:10: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 4HPnDL0Sz6z3HTW; Wed, 6 Oct 2021 21:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B24DB2720C; Wed, 6 Oct 2021 21:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAb2n061208; Wed, 6 Oct 2021 21:10:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAbFQ061197; Wed, 6 Oct 2021 21:10:37 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:37 GMT Message-Id: <202110062110.196LAbFQ061197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e148e407df5c - main - ccr: Support AES-CCM requests with truncated tags. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e148e407df5c8b1c83bcd44da9f4837d94431d02 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e148e407df5c8b1c83bcd44da9f4837d94431d02 commit e148e407df5c8b1c83bcd44da9f4837d94431d02 Author: John Baldwin AuthorDate: 2021-10-06 21:08:48 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:48 +0000 ccr: Support AES-CCM requests with truncated tags. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32117 --- sys/dev/cxgbe/crypto/t4_crypto.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index ca6cd332fa24..b7fa048543b7 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -1524,6 +1524,29 @@ out: crypto_done(crp); } +static int +ccr_ccm_hmac_ctrl(unsigned int authsize) +{ + switch (authsize) { + case 4: + return (SCMD_HMAC_CTRL_PL1); + case 6: + return (SCMD_HMAC_CTRL_PL2); + case 8: + return (SCMD_HMAC_CTRL_DIV2); + case 10: + return (SCMD_HMAC_CTRL_TRUNC_RFC4366); + case 12: + return (SCMD_HMAC_CTRL_IPSEC_96BIT); + case 14: + return (SCMD_HMAC_CTRL_PL3); + case 16: + return (SCMD_HMAC_CTRL_NO_TRUNC); + default: + __assert_unreachable(); + } +} + static void generate_ccm_b0(struct cryptop *crp, u_int hash_size_in_response, const char *iv, char *b0) @@ -1783,7 +1806,7 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) V_CPL_TX_SEC_PDU_AUTHINSERT(auth_insert)); /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ - hmac_ctrl = ccr_hmac_ctrl(AES_CBC_MAC_HASH_LEN, hash_size_in_response); + hmac_ctrl = ccr_ccm_hmac_ctrl(hash_size_in_response); crwr->sec_cpl.seqno_numivs = htobe32( V_SCMD_SEQ_NO_CTRL(0) | V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | @@ -2459,9 +2482,6 @@ ccr_probesession(device_t dev, const struct crypto_session_params *csp) return (EINVAL); break; case CRYPTO_AES_CCM_16: - if (csp->csp_auth_mlen < 0 || - csp->csp_auth_mlen > AES_CBC_MAC_HASH_LEN) - return (EINVAL); break; default: return (EINVAL); From nobody Wed Oct 6 21:10:38 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C82B112D43DD; Wed, 6 Oct 2021 21:10: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 4HPnDL12DZz3Hn9; Wed, 6 Oct 2021 21:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C832726D51; Wed, 6 Oct 2021 21:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAcSF061580; Wed, 6 Oct 2021 21:10:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAcCj061579; Wed, 6 Oct 2021 21:10:38 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:38 GMT Message-Id: <202110062110.196LAcCj061579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2ec2e4df094b - main - safexcel: Support multiple nonce lengths for AES-CCM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ec2e4df094ba632e5e74268a8818f71903a4537 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2ec2e4df094ba632e5e74268a8818f71903a4537 commit 2ec2e4df094ba632e5e74268a8818f71903a4537 Author: John Baldwin AuthorDate: 2021-10-06 21:08:48 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:48 +0000 safexcel: Support multiple nonce lengths for AES-CCM. Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32118 --- sys/dev/safexcel/safexcel.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 3940361561d0..042fac5fc2b8 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -2,6 +2,10 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2020, 2021 Rubicon Communications, LLC (Netgate) + * Copyright (c) 2021 The FreeBSD Foundation + * + * Portions of this software were developed by Ararat River + * Consulting, LLC under sponsorship of the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1689,12 +1693,14 @@ static void safexcel_instr_ccm(struct safexcel_request *req, struct safexcel_instr *instr, struct safexcel_cmd_descr *cdesc) { + const struct crypto_session_params *csp; struct cryptop *crp; struct safexcel_instr *start; uint8_t *a0, *b0, *alenp, L; int aalign, blen; crp = req->crp; + csp = crypto_get_params(crp->crp_session); start = instr; /* @@ -1703,17 +1709,17 @@ safexcel_instr_ccm(struct safexcel_request *req, struct safexcel_instr *instr, * descriptor, and B0 is inserted directly into the data stream using * instructions below. * - * OCF seems to assume a 12-byte IV, fixing L (the payload length size) - * at 3 bytes due to the layout of B0. This is fine since the driver - * has a maximum of 65535 bytes anyway. + * An explicit check for overflow of the length field is not + * needed since the maximum driver size of 65535 bytes fits in + * the smallest length field used for a 13-byte nonce. */ blen = AES_BLOCK_LEN; - L = 3; + L = 15 - csp->csp_ivlen; a0 = (uint8_t *)&cdesc->control_data.token[0]; memset(a0, 0, blen); a0[0] = L - 1; - memcpy(&a0[1], req->iv, AES_CCM_IV_LEN); + memcpy(&a0[1], req->iv, csp->csp_ivlen); /* * Insert B0 and the AAD length into the input stream. @@ -1731,7 +1737,7 @@ safexcel_instr_ccm(struct safexcel_request *req, struct safexcel_instr *instr, (L - 1) | /* payload length size */ ((CCM_CBC_MAX_DIGEST_LEN - 2) / 2) << 3 /* digest length */ | (crp->crp_aad_length > 0 ? 1 : 0) << 6 /* AAD present bit */; - memcpy(&b0[1], req->iv, AES_CCM_IV_LEN); + memcpy(&b0[1], req->iv, csp->csp_ivlen); b0[14] = crp->crp_payload_length >> 8; b0[15] = crp->crp_payload_length & 0xff; instr += blen / sizeof(*instr); @@ -2308,7 +2314,8 @@ safexcel_probesession(device_t dev, const struct crypto_session_params *csp) return (EINVAL); break; case CRYPTO_AES_CCM_16: - if (csp->csp_ivlen != AES_CCM_IV_LEN) + if (csp->csp_auth_mlen != 0 && + csp->csp_auth_mlen != AES_CBC_MAC_HASH_LEN) return (EINVAL); break; default: From nobody Wed Oct 6 21:10:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2706112D4442; Wed, 6 Oct 2021 21:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPnDL6lCdz3HnJ; Wed, 6 Oct 2021 21:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F156E26D53; Wed, 6 Oct 2021 21:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAdHv061606; Wed, 6 Oct 2021 21:10:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAdLe061605; Wed, 6 Oct 2021 21:10:39 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:39 GMT Message-Id: <202110062110.196LAdLe061605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 366ae4a000b1 - main - safexcel: Support truncated tags for AES-CCM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 366ae4a000b1483390ddbf28e3dc420ebac894a0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=366ae4a000b1483390ddbf28e3dc420ebac894a0 commit 366ae4a000b1483390ddbf28e3dc420ebac894a0 Author: John Baldwin AuthorDate: 2021-10-06 21:08:48 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:48 +0000 safexcel: Support truncated tags for AES-CCM. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32119 --- sys/dev/safexcel/safexcel.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 042fac5fc2b8..b844a167b078 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -1735,7 +1735,7 @@ safexcel_instr_ccm(struct safexcel_request *req, struct safexcel_instr *instr, memset(b0, 0, blen); b0[0] = (L - 1) | /* payload length size */ - ((CCM_CBC_MAX_DIGEST_LEN - 2) / 2) << 3 /* digest length */ | + ((req->sess->digestlen - 2) / 2) << 3 /* digest length */ | (crp->crp_aad_length > 0 ? 1 : 0) << 6 /* AAD present bit */; memcpy(&b0[1], req->iv, csp->csp_ivlen); b0[14] = crp->crp_payload_length >> 8; @@ -2314,9 +2314,6 @@ safexcel_probesession(device_t dev, const struct crypto_session_params *csp) return (EINVAL); break; case CRYPTO_AES_CCM_16: - if (csp->csp_auth_mlen != 0 && - csp->csp_auth_mlen != AES_CBC_MAC_HASH_LEN) - return (EINVAL); break; default: return (EINVAL); From nobody Wed Oct 6 21:10:42 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D57C812D44BB; Wed, 6 Oct 2021 21:10:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPnDM682Dz3Hkk; Wed, 6 Oct 2021 21:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B7AE26BD9; Wed, 6 Oct 2021 21:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAgDD062198; Wed, 6 Oct 2021 21:10:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAgSw062192; Wed, 6 Oct 2021 21:10:42 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:42 GMT Message-Id: <202110062110.196LAgSw062192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 668770dc7de2 - main - crypto: Test all of the AES-CCM KAT vectors. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 668770dc7de2ec8b5f5edf71e09b8a404120f6fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=668770dc7de2ec8b5f5edf71e09b8a404120f6fa commit 668770dc7de2ec8b5f5edf71e09b8a404120f6fa Author: John Baldwin AuthorDate: 2021-10-06 21:08:48 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:48 +0000 crypto: Test all of the AES-CCM KAT vectors. Previously, only test vectors which used the default nonce and tag sizes (12 and 16, respectively) were tested. This now tests all of the vectors. This exposed some additional issues around requests with an empty payload (which wasn't supported) and an empty AAD (which falls back to CIOCCRYPT instead of CIOCCRYPTAEAD). - Make use of the 'ivlen' and 'maclen' fields for CIOGSESSION2 to test AES-CCM vectors with non-default nonce and tag lengths. - Permit requests with an empty payload. - Permit an input MAC for requests without AAD. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32121 --- tests/sys/opencrypto/cryptodev.py | 54 +++++++++++++++++++++++++++----------- tests/sys/opencrypto/cryptotest.py | 41 ++++++++++++----------------- 2 files changed, 56 insertions(+), 39 deletions(-) diff --git a/tests/sys/opencrypto/cryptodev.py b/tests/sys/opencrypto/cryptodev.py index 83d14fc2b205..d97a731d37ba 100644 --- a/tests/sys/opencrypto/cryptodev.py +++ b/tests/sys/opencrypto/cryptodev.py @@ -79,10 +79,10 @@ class SessionOp2(dpkt.Packet): ('mackey', 'P', 0), ('ses', 'I', 0), ('crid', 'i', 0), + ('ivlen', 'i', 0), + ('maclen', 'i', 0), ('pad0', 'i', 0), ('pad1', 'i', 0), - ('pad2', 'i', 0), - ('pad3', 'i', 0), ) class CryptOp(dpkt.Packet): @@ -159,6 +159,11 @@ def array_tobytes(array_obj): return array_obj.tobytes() return array_obj.tostring() +def empty_bytes(): + if sys.version_info[0] >= 3: + return b'' + return "" + class Crypto: @staticmethod def findcrid(name): @@ -169,7 +174,8 @@ class Crypto: return _findop(crid, '')[1] def __init__(self, cipher=0, key=None, mac=0, mackey=None, - crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE, maclen=None): + crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE, maclen=None, + ivlen=None): self._ses = None self._maclen = maclen ses = SessionOp2() @@ -191,6 +197,10 @@ class Crypto: if not cipher and not mac: raise ValueError('one of cipher or mac MUST be specified.') ses.crid = crid + if ivlen: + ses.ivlen = ivlen + if maclen: + ses.maclen = maclen #print(ses) s = array.array('B', ses.pack_hdr()) #print(s) @@ -209,16 +219,23 @@ class Crypto: pass self._ses = None - def _doop(self, op, src, iv): + def _doop(self, op, src, iv, mac=None): cop = CryptOp() cop.ses = self._ses cop.op = op cop.flags = 0 - cop.len = len(src) - s = array.array('B', src) - cop.src = cop.dst = s.buffer_info()[0] + if src is not None: + cop.len = len(src) + s = array.array('B', src) + cop.src = cop.dst = s.buffer_info()[0] + if mac is not None: + assert len(mac) == self._maclen, \ + '%d != %d' % (len(tag), self._maclen) if self._maclen is not None: - m = array.array('B', [0] * self._maclen) + if mac is None: + m = array.array('B', [0] * self._maclen) + else: + m = array.array('B', mac) cop.mac = m.buffer_info()[0] ivbuf = array.array('B', str_to_ascii(iv)) cop.iv = ivbuf.buffer_info()[0] @@ -226,7 +243,10 @@ class Crypto: #print('cop:', cop) ioctl(_cryptodev, CIOCCRYPT, bytes(cop)) - s = array_tobytes(s) + if src is not None: + s = array_tobytes(s) + else: + s = empty_bytes() if self._maclen is not None: return s, array_tobytes(m) @@ -238,10 +258,11 @@ class Crypto: caead.op = op caead.flags = CRD_F_IV_EXPLICIT caead.flags = 0 - src = str_to_ascii(src) - caead.len = len(src) - s = array.array('B', src) - caead.src = caead.dst = s.buffer_info()[0] + if src is not None and len(src) != 0: + src = str_to_ascii(src) + caead.len = len(src) + s = array.array('B', src) + caead.src = caead.dst = s.buffer_info()[0] aad = str_to_ascii(aad) caead.aadlen = len(aad) saad = array.array('B', aad) @@ -266,7 +287,10 @@ class Crypto: ioctl(_cryptodev, CIOCCRYPTAEAD, bytes(caead)) - s = array_tobytes(s) + if src is not None: + s = array_tobytes(s) + else: + s = empty_bytes() return s, array_tobytes(tag) @@ -320,7 +344,7 @@ class Crypto: def decrypt(self, data, iv, aad=None, tag=None): if aad is None: - return self._doop(COP_DECRYPT, data, iv) + return self._doop(COP_DECRYPT, data, iv, mac=tag) else: return self._doaead(COP_DECRYPT, data, aad, iv, tag=tag) diff --git a/tests/sys/opencrypto/cryptotest.py b/tests/sys/opencrypto/cryptotest.py index 2ef423ac1505..74ce62cee33d 100644 --- a/tests/sys/opencrypto/cryptotest.py +++ b/tests/sys/opencrypto/cryptotest.py @@ -243,25 +243,26 @@ def GenTestCase(cname): def runCCMEncryptWithParser(self, parser): for data in next(parser): Nlen = int(data['Nlen']) - if Nlen != 12: - # OCF only supports 12 byte IVs - continue + Tlen = int(data['Tlen']) key = binascii.unhexlify(data['Key']) nonce = binascii.unhexlify(data['Nonce']) Alen = int(data['Alen']) + Plen = int(data['Plen']) if Alen != 0: aad = binascii.unhexlify(data['Adata']) else: aad = None - payload = binascii.unhexlify(data['Payload']) + if Plen != 0: + payload = binascii.unhexlify(data['Payload']) + else: + payload = None ct = binascii.unhexlify(data['CT']) try: c = Crypto(crid=crid, cipher=cryptodev.CRYPTO_AES_CCM_16, key=key, - mac=cryptodev.CRYPTO_AES_CCM_CBC_MAC, - mackey=key, maclen=16) + mackey=key, maclen=Tlen, ivlen=Nlen) r, tag = Crypto.encrypt(c, payload, nonce, aad) except EnvironmentError as e: @@ -280,36 +281,29 @@ def GenTestCase(cname): self.runCCMDecryptWithParser(parser) def runCCMDecryptWithParser(self, parser): - # XXX: Note that all of the current CCM - # decryption test vectors use IV and tag sizes - # that aren't supported by OCF none of the - # tests are actually ran. for data in next(parser): Nlen = int(data['Nlen']) - if Nlen != 12: - # OCF only supports 12 byte IVs - continue Tlen = int(data['Tlen']) - if Tlen != 16: - # OCF only supports 16 byte tags - continue key = binascii.unhexlify(data['Key']) nonce = binascii.unhexlify(data['Nonce']) Alen = int(data['Alen']) + Plen = int(data['Plen']) if Alen != 0: aad = binascii.unhexlify(data['Adata']) else: aad = None ct = binascii.unhexlify(data['CT']) - tag = ct[-16:] - ct = ct[:-16] + tag = ct[-Tlen:] + if Plen != 0: + payload = ct[:-Tlen] + else: + payload = None try: c = Crypto(crid=crid, cipher=cryptodev.CRYPTO_AES_CCM_16, key=key, - mac=cryptodev.CRYPTO_AES_CCM_CBC_MAC, - mackey=key, maclen=16) + mackey=key, maclen=Tlen, ivlen=Nlen) except EnvironmentError as e: if e.errno != errno.EOPNOTSUPP: raise @@ -319,12 +313,11 @@ def GenTestCase(cname): self.assertRaises(IOError, c.decrypt, payload, nonce, aad, tag) else: - r = Crypto.decrypt(c, payload, nonce, - aad, tag) + r, tag = Crypto.decrypt(c, payload, nonce, + aad, tag) payload = binascii.unhexlify(data['Payload']) - plen = int(data('Plen')) - payload = payload[:plen] + payload = payload[:Plen] self.assertEqual(r, payload, "Count " + data['Count'] + \ " Actual: " + repr(binascii.hexlify(r)) + \ From nobody Wed Oct 6 21:10:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D3AAC12D45A3; Wed, 6 Oct 2021 21:10:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPnDM64JMz3HqG; Wed, 6 Oct 2021 21:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B88326F66; Wed, 6 Oct 2021 21:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAfpu061634; Wed, 6 Oct 2021 21:10:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAeWL061633; Wed, 6 Oct 2021 21:10:40 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:40 GMT Message-Id: <202110062110.196LAeWL061633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4361c4eb6e36 - main - cryptosoft: Fix support for variable tag lengths in AES-CCM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4361c4eb6e3620e68d005c1671fdbf60b1fe83c6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4361c4eb6e3620e68d005c1671fdbf60b1fe83c6 commit 4361c4eb6e3620e68d005c1671fdbf60b1fe83c6 Author: John Baldwin AuthorDate: 2021-10-06 21:08:48 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:48 +0000 cryptosoft: Fix support for variable tag lengths in AES-CCM. The tag length is included as one of the values in the flags byte of block 0 passed to CBC_MAC, so merely copying the first N bytes is insufficient. To avoid adding more sideband data to the CBC MAC software context, pull the generation of block 0, the AAD length, and AAD padding out of cbc_mac.c and into cryptosoft.c. This matches how GCM/GMAC are handled where the length block is constructed in cryptosoft.c and passed as an input to the Update callback. As a result, the CBC MAC Update() routine is now much simpler and simply performs the XOR-and-encrypt step on each input block. While here, avoid a copy to the staging block in the Update routine when one or more full blocks are passed as input to the Update callback. Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32120 --- sys/dev/cxgbe/crypto/t4_crypto.c | 107 ++++++++++++++++++++------ sys/opencrypto/cbc_mac.c | 157 ++++++--------------------------------- sys/opencrypto/cbc_mac.h | 6 +- sys/opencrypto/cryptosoft.c | 124 +++++++++++++++++++++++-------- 4 files changed, 205 insertions(+), 189 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index b7fa048543b7..fae77423aaa5 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -1893,8 +1893,60 @@ ccr_ccm_done(struct ccr_softc *sc, struct ccr_session *s, /* * Handle a CCM request that is not supported by the crypto engine by - * performing the operation in software. Derived from swcr_authenc(). + * performing the operation in software. Derived from swcr_ccm(). */ +static void +build_ccm_b0(const char *nonce, u_int nonce_length, u_int aad_length, + u_int data_length, u_int tag_length, uint8_t *b0) +{ + uint8_t *bp; + uint8_t flags, L; + + KASSERT(nonce_length >= 7 && nonce_length <= 13, + ("nonce_length must be between 7 and 13 bytes")); + + /* + * Need to determine the L field value. This is the number of + * bytes needed to specify the length of the message; the length + * is whatever is left in the 16 bytes after specifying flags and + * the nonce. + */ + L = 15 - nonce_length; + + flags = ((aad_length > 0) << 6) + + (((tag_length - 2) / 2) << 3) + + L - 1; + + /* + * Now we need to set up the first block, which has flags, nonce, + * and the message length. + */ + b0[0] = flags; + memcpy(b0 + 1, nonce, nonce_length); + bp = b0 + 1 + nonce_length; + + /* Need to copy L' [aka L-1] bytes of data_length */ + for (uint8_t *dst = b0 + CCM_CBC_BLOCK_LEN - 1; dst >= bp; dst--) { + *dst = data_length; + data_length >>= 8; + } +} + +/* NB: OCF only supports AAD lengths < 2^32. */ +static int +build_ccm_aad_length(u_int aad_length, uint8_t *blk) +{ + if (aad_length < ((1 << 16) - (1 << 8))) { + be16enc(blk, aad_length); + return (sizeof(uint16_t)); + } else { + blk[0] = 0xff; + blk[1] = 0xfe; + be32enc(blk + 2, aad_length); + return (2 + sizeof(uint32_t)); + } +} + static void ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) { @@ -1904,11 +1956,13 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) union authctx *auth_ctx; void *kschedule; char block[CCM_CBC_BLOCK_LEN]; - char digest[AES_CBC_MAC_HASH_LEN]; + char tag[AES_CBC_MAC_HASH_LEN]; + u_int taglen; int error, i, len; auth_ctx = NULL; kschedule = NULL; + taglen = s->ccm_mac.hash_len; csp = crypto_get_params(crp->crp_session); if (crp->crp_payload_length > ccm_max_payload_length(csp)) { @@ -1956,19 +2010,32 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) goto out; } - auth_ctx->aes_cbc_mac_ctx.authDataLength = crp->crp_aad_length; - auth_ctx->aes_cbc_mac_ctx.cryptDataLength = crp->crp_payload_length; axf->Reinit(auth_ctx, crp->crp_iv, csp->csp_ivlen); + /* Supply MAC with b0. */ + build_ccm_b0(crp->crp_iv, csp->csp_ivlen, crp->crp_aad_length, + crp->crp_payload_length, taglen, block); + axf->Update(auth_ctx, block, CCM_CBC_BLOCK_LEN); + /* MAC the AAD. */ - if (crp->crp_aad != NULL) - error = axf->Update(auth_ctx, crp->crp_aad, - crp->crp_aad_length); - else - error = crypto_apply(crp, crp->crp_aad_start, - crp->crp_aad_length, axf->Update, auth_ctx); - if (error) - goto out; + if (crp->crp_aad_length != 0) { + len = build_ccm_aad_length(crp->crp_aad_length, block); + axf->Update(auth_ctx, block, len); + if (crp->crp_aad != NULL) + axf->Update(auth_ctx, crp->crp_aad, + crp->crp_aad_length); + else + crypto_apply(crp, crp->crp_aad_start, + crp->crp_aad_length, axf->Update, auth_ctx); + + /* Pad the AAD (including length field) to a full block. */ + len = (len + crp->crp_aad_length) % CCM_CBC_BLOCK_LEN; + if (len != 0) { + len = CCM_CBC_BLOCK_LEN - len; + memset(block, 0, CCM_CBC_BLOCK_LEN); + axf->Update(auth_ctx, block, len); + } + } exf->reinit(kschedule, crp->crp_iv, csp->csp_ivlen); @@ -1989,19 +2056,17 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) } /* Finalize MAC. */ - axf->Final(digest, auth_ctx); + axf->Final(tag, auth_ctx); /* Inject or validate tag. */ if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - crypto_copyback(crp, crp->crp_digest_start, sizeof(digest), - digest); + crypto_copyback(crp, crp->crp_digest_start, taglen, tag); error = 0; } else { - char digest2[AES_CBC_MAC_HASH_LEN]; + char tag2[AES_CBC_MAC_HASH_LEN]; - crypto_copydata(crp, crp->crp_digest_start, sizeof(digest2), - digest2); - if (timingsafe_bcmp(digest, digest2, sizeof(digest)) == 0) { + crypto_copydata(crp, crp->crp_digest_start, taglen, tag2); + if (timingsafe_bcmp(tag, tag2, taglen) == 0) { error = 0; /* Tag matches, decrypt data. */ @@ -2019,14 +2084,14 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *crp) } } else error = EBADMSG; - explicit_bzero(digest2, sizeof(digest2)); + explicit_bzero(tag2, sizeof(tag2)); } out: zfree(kschedule, M_CCR); zfree(auth_ctx, M_CCR); explicit_bzero(block, sizeof(block)); - explicit_bzero(digest, sizeof(digest)); + explicit_bzero(tag, sizeof(tag)); crp->crp_etype = error; crypto_done(crp); } diff --git a/sys/opencrypto/cbc_mac.c b/sys/opencrypto/cbc_mac.c index 40afae5373bf..9a030cd54173 100644 --- a/sys/opencrypto/cbc_mac.c +++ b/sys/opencrypto/cbc_mac.c @@ -75,85 +75,23 @@ AES_CBC_MAC_Setkey(void *vctx, const uint8_t *key, u_int klen) /* * This is called to set the nonce, aka IV. - * Before this call, the authDataLength and cryptDataLength fields - * MUST have been set. Sadly, there's no way to return an error. * - * The CBC-MAC algorithm requires that the first block contain the - * nonce, as well as information about the sizes and lengths involved. + * Note that the caller is responsible for constructing b0 as well + * as the length and padding around the AAD and passing that data + * to _Update. */ void AES_CBC_MAC_Reinit(void *vctx, const uint8_t *nonce, u_int nonceLen) { struct aes_cbc_mac_ctx *ctx = vctx; - uint8_t b0[CCM_CBC_BLOCK_LEN]; - uint8_t *bp = b0, flags = 0; - uint8_t L = 0; - uint64_t dataLength = ctx->cryptDataLength; - - KASSERT(nonceLen >= 7 && nonceLen <= 13, - ("nonceLen must be between 7 and 13 bytes")); ctx->nonce = nonce; ctx->nonceLength = nonceLen; - - ctx->authDataCount = 0; + ctx->blockIndex = 0; - explicit_bzero(ctx->staging_block, sizeof(ctx->staging_block)); - - /* - * Need to determine the L field value. This is the number of - * bytes needed to specify the length of the message; the length - * is whatever is left in the 16 bytes after specifying flags and - * the nonce. - */ - L = 15 - nonceLen; - - flags = ((ctx->authDataLength > 0) << 6) + - (((AES_CBC_MAC_HASH_LEN - 2) / 2) << 3) + - L - 1; - /* - * Now we need to set up the first block, which has flags, nonce, - * and the message length. - */ - b0[0] = flags; - bcopy(nonce, b0 + 1, nonceLen); - bp = b0 + 1 + nonceLen; - /* Need to copy L' [aka L-1] bytes of cryptDataLength */ - for (uint8_t *dst = b0 + sizeof(b0) - 1; dst >= bp; dst--) { - *dst = dataLength; - dataLength >>= 8; - } - /* Now need to encrypt b0 */ - rijndaelEncrypt(ctx->keysched, ctx->rounds, b0, ctx->block); - /* If there is auth data, we need to set up the staging block */ - if (ctx->authDataLength) { - size_t addLength; - if (ctx->authDataLength < ((1<<16) - (1<<8))) { - uint16_t sizeVal = htobe16(ctx->authDataLength); - bcopy(&sizeVal, ctx->staging_block, sizeof(sizeVal)); - addLength = sizeof(sizeVal); - } else if (ctx->authDataLength < (1ULL<<32)) { - uint32_t sizeVal = htobe32(ctx->authDataLength); - ctx->staging_block[0] = 0xff; - ctx->staging_block[1] = 0xfe; - bcopy(&sizeVal, ctx->staging_block+2, sizeof(sizeVal)); - addLength = 2 + sizeof(sizeVal); - } else { - uint64_t sizeVal = htobe64(ctx->authDataLength); - ctx->staging_block[0] = 0xff; - ctx->staging_block[1] = 0xff; - bcopy(&sizeVal, ctx->staging_block+2, sizeof(sizeVal)); - addLength = 2 + sizeof(sizeVal); - } - ctx->blockIndex = addLength; - /* - * The length descriptor goes into the AAD buffer, so we - * need to account for it. - */ - ctx->authDataLength += addLength; - ctx->authDataCount = addLength; - } + /* XOR b0 with all 0's on first call to _Update. */ + memset(ctx->block, 0, CCM_CBC_BLOCK_LEN); } int @@ -167,85 +105,35 @@ AES_CBC_MAC_Update(void *vctx, const void *vdata, u_int length) data = vdata; /* - * This will be called in one of two phases: - * (1) Applying authentication data, or - * (2) Applying the payload data. - * - * Because CBC-MAC puts the authentication data size before the - * data, subsequent calls won't be block-size-aligned. Which - * complicates things a fair bit. - * - * The payload data doesn't have that problem. + * _Update can be called with non-aligned update lengths. Use + * the staging block when necessary. */ - - if (ctx->authDataCount < ctx->authDataLength) { - /* - * We need to process data as authentication data. - * Since we may be out of sync, we may also need - * to pad out the staging block. - */ - const uint8_t *ptr = data; - while (length > 0) { - - copy_amt = MIN(length, - sizeof(ctx->staging_block) - ctx->blockIndex); - - bcopy(ptr, ctx->staging_block + ctx->blockIndex, - copy_amt); - ptr += copy_amt; - length -= copy_amt; - ctx->authDataCount += copy_amt; - ctx->blockIndex += copy_amt; - ctx->blockIndex %= sizeof(ctx->staging_block); + while (length != 0) { + uint8_t *ptr; - if (ctx->blockIndex == 0 || - ctx->authDataCount == ctx->authDataLength) { - /* - * We're done with this block, so we - * xor staging_block with block, and then - * encrypt it. - */ - xor_and_encrypt(ctx, ctx->staging_block, ctx->block); - bzero(ctx->staging_block, sizeof(ctx->staging_block)); - ctx->blockIndex = 0; - if (ctx->authDataCount >= ctx->authDataLength) - break; - } - } /* - * We'd like to be able to check length == 0 and return - * here, but the way OCF calls us, length is always - * blksize (16, in this case). So we have to count on - * the fact that OCF calls us separately for the AAD and - * for the real data. + * If there is no partial block and the length is at + * least a full block, encrypt the full block without + * copying to the staging block. */ - return (0); - } - /* - * If we're here, then we're encoding payload data. - * This is marginally easier, except that _Update can - * be called with non-aligned update lengths. As a result, - * we still need to use the staging block. - */ - KASSERT((length + ctx->cryptDataCount) <= ctx->cryptDataLength, - ("More encryption data than allowed")); + if (ctx->blockIndex == 0 && length >= CCM_CBC_BLOCK_LEN) { + xor_and_encrypt(ctx, data, ctx->block); + length -= CCM_CBC_BLOCK_LEN; + data += CCM_CBC_BLOCK_LEN; + continue; + } - while (length) { - uint8_t *ptr; - copy_amt = MIN(sizeof(ctx->staging_block) - ctx->blockIndex, length); ptr = ctx->staging_block + ctx->blockIndex; bcopy(data, ptr, copy_amt); data += copy_amt; ctx->blockIndex += copy_amt; - ctx->cryptDataCount += copy_amt; length -= copy_amt; if (ctx->blockIndex == sizeof(ctx->staging_block)) { /* We've got a full block */ xor_and_encrypt(ctx, ctx->staging_block, ctx->block); ctx->blockIndex = 0; - bzero(ctx->staging_block, sizeof(ctx->staging_block)); } } return (0); @@ -264,11 +152,12 @@ AES_CBC_MAC_Final(uint8_t *buf, void *vctx) * left over to encrypt. */ if (ctx->blockIndex != 0) { + memset(ctx->staging_block + ctx->blockIndex, 0, + CCM_CBC_BLOCK_LEN - ctx->blockIndex); xor_and_encrypt(ctx, ctx->staging_block, ctx->block); - ctx->cryptDataCount += ctx->blockIndex; - ctx->blockIndex = 0; - explicit_bzero(ctx->staging_block, sizeof(ctx->staging_block)); } + explicit_bzero(ctx->staging_block, sizeof(ctx->staging_block)); + bzero(s0, sizeof(s0)); s0[0] = (15 - ctx->nonceLength) - 1; bcopy(ctx->nonce, s0 + 1, ctx->nonceLength); diff --git a/sys/opencrypto/cbc_mac.h b/sys/opencrypto/cbc_mac.h index 51833a212f6c..50694e5d4b44 100644 --- a/sys/opencrypto/cbc_mac.h +++ b/sys/opencrypto/cbc_mac.h @@ -46,13 +46,11 @@ * the encryption one is similar. */ struct aes_cbc_mac_ctx { - uint64_t authDataLength, authDataCount; - uint64_t cryptDataLength, cryptDataCount; - int blockIndex; uint8_t staging_block[CCM_CBC_BLOCK_LEN]; uint8_t block[CCM_CBC_BLOCK_LEN]; - const uint8_t *nonce; + int blockIndex; int nonceLength; /* This one is in bytes, not bits! */ + const uint8_t *nonce; /* AES state data */ int rounds; uint32_t keysched[4*(RIJNDAEL_MAXNR+1)]; diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index ae71f0d6c096..e51bade8a3f8 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -636,16 +636,69 @@ out: return (error); } +static void +build_ccm_b0(const char *nonce, u_int nonce_length, u_int aad_length, + u_int data_length, u_int tag_length, uint8_t *b0) +{ + uint8_t *bp; + uint8_t flags, L; + + KASSERT(nonce_length >= 7 && nonce_length <= 13, + ("nonce_length must be between 7 and 13 bytes")); + + /* + * Need to determine the L field value. This is the number of + * bytes needed to specify the length of the message; the length + * is whatever is left in the 16 bytes after specifying flags and + * the nonce. + */ + L = 15 - nonce_length; + + flags = ((aad_length > 0) << 6) + + (((tag_length - 2) / 2) << 3) + + L - 1; + + /* + * Now we need to set up the first block, which has flags, nonce, + * and the message length. + */ + b0[0] = flags; + memcpy(b0 + 1, nonce, nonce_length); + bp = b0 + 1 + nonce_length; + + /* Need to copy L' [aka L-1] bytes of data_length */ + for (uint8_t *dst = b0 + CCM_CBC_BLOCK_LEN - 1; dst >= bp; dst--) { + *dst = data_length; + data_length >>= 8; + } +} + +/* NB: OCF only supports AAD lengths < 2^32. */ +static int +build_ccm_aad_length(u_int aad_length, uint8_t *blk) +{ + if (aad_length < ((1 << 16) - (1 << 8))) { + be16enc(blk, aad_length); + return (sizeof(uint16_t)); + } else { + blk[0] = 0xff; + blk[1] = 0xfe; + be32enc(blk + 2, aad_length); + return (2 + sizeof(uint32_t)); + } +} + static int swcr_ccm_cbc_mac(struct swcr_session *ses, struct cryptop *crp) { - u_char tag[AES_CBC_MAC_HASH_LEN]; u_char iv[AES_BLOCK_LEN]; + u_char blk[CCM_CBC_BLOCK_LEN]; + u_char tag[AES_CBC_MAC_HASH_LEN]; union authctx ctx; const struct crypto_session_params *csp; struct swcr_auth *swa; const struct auth_hash *axf; - int error, ivlen; + int error, ivlen, len; csp = crypto_get_params(crp->crp_session); swa = &ses->swcr_auth; @@ -657,25 +710,24 @@ swcr_ccm_cbc_mac(struct swcr_session *ses, struct cryptop *crp) ivlen = csp->csp_ivlen; crypto_read_iv(crp, iv); - /* - * AES CCM-CBC-MAC needs to know the length of both the auth - * data and payload data before doing the auth computation. - */ - ctx.aes_cbc_mac_ctx.authDataLength = crp->crp_payload_length; - ctx.aes_cbc_mac_ctx.cryptDataLength = 0; + /* Supply MAC with IV */ + axf->Reinit(&ctx, crp->crp_iv, ivlen); - axf->Reinit(&ctx, iv, ivlen); - if (crp->crp_aad != NULL) - error = axf->Update(&ctx, crp->crp_aad, crp->crp_aad_length); - else - error = crypto_apply(crp, crp->crp_payload_start, - crp->crp_payload_length, axf->Update, &ctx); - if (error) - return (error); + /* Supply MAC with b0. */ + build_ccm_b0(crp->crp_iv, ivlen, crp->crp_payload_length, 0, + swa->sw_mlen, blk); + axf->Update(&ctx, blk, CCM_CBC_BLOCK_LEN); + + len = build_ccm_aad_length(crp->crp_payload_length, blk); + axf->Update(&ctx, blk, len); + + crypto_apply(crp, crp->crp_payload_start, crp->crp_payload_length, + axf->Update, &ctx); /* Finalize MAC */ axf->Final(tag, &ctx); + error = 0; if (crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) { u_char tag2[AES_CBC_MAC_HASH_LEN]; @@ -689,6 +741,7 @@ swcr_ccm_cbc_mac(struct swcr_session *ses, struct cryptop *crp) crypto_copyback(crp, crp->crp_digest_start, swa->sw_mlen, tag); } explicit_bzero(tag, sizeof(tag)); + explicit_bzero(blk, sizeof(blk)); explicit_bzero(iv, sizeof(iv)); return (error); } @@ -733,24 +786,35 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) ivlen = csp->csp_ivlen; - /* - * AES CCM-CBC-MAC needs to know the length of both the auth - * data and payload data before doing the auth computation. - */ - ctx.aes_cbc_mac_ctx.authDataLength = crp->crp_aad_length; - ctx.aes_cbc_mac_ctx.cryptDataLength = crp->crp_payload_length; - /* Supply MAC with IV */ axf->Reinit(&ctx, crp->crp_iv, ivlen); + /* Supply MAC with b0. */ + _Static_assert(sizeof(blkbuf) >= CCM_CBC_BLOCK_LEN, + "blkbuf too small for b0"); + build_ccm_b0(crp->crp_iv, ivlen, crp->crp_aad_length, + crp->crp_payload_length, swa->sw_mlen, blk); + axf->Update(&ctx, blk, CCM_CBC_BLOCK_LEN); + /* Supply MAC with AAD */ - if (crp->crp_aad != NULL) - error = axf->Update(&ctx, crp->crp_aad, crp->crp_aad_length); - else - error = crypto_apply(crp, crp->crp_aad_start, - crp->crp_aad_length, axf->Update, &ctx); - if (error) - return (error); + if (crp->crp_aad_length != 0) { + len = build_ccm_aad_length(crp->crp_aad_length, blk); + axf->Update(&ctx, blk, len); + if (crp->crp_aad != NULL) + axf->Update(&ctx, crp->crp_aad, + crp->crp_aad_length); + else + crypto_apply(crp, crp->crp_aad_start, + crp->crp_aad_length, axf->Update, &ctx); + + /* Pad the AAD (including length field) to a full block. */ + len = (len + crp->crp_aad_length) % CCM_CBC_BLOCK_LEN; + if (len != 0) { + len = CCM_CBC_BLOCK_LEN - len; + memset(blk, 0, CCM_CBC_BLOCK_LEN); + axf->Update(&ctx, blk, len); + } + } if (crp->crp_cipher_key != NULL) exf->setkey(swe->sw_kschedule, crp->crp_cipher_key, From nobody Wed Oct 6 21:10:43 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 40BEC12D4573; Wed, 6 Oct 2021 21:10:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPnDR4Q7nz3HnR; Wed, 6 Oct 2021 21:10:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 479762720E; Wed, 6 Oct 2021 21:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAhKw062404; Wed, 6 Oct 2021 21:10:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAhj1062403; Wed, 6 Oct 2021 21:10:43 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:43 GMT Message-Id: <202110062110.196LAhj1062403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 42dcd39528c6 - main - crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42dcd39528c6188a259951e28bbad309234324e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=42dcd39528c6188a259951e28bbad309234324e4 commit 42dcd39528c6188a259951e28bbad309234324e4 Author: John Baldwin AuthorDate: 2021-10-06 21:08:49 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:49 +0000 crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes. This is useful for WireGuard which uses a nonce of 8 bytes rather than the 12 bytes used for IPsec and TLS. Note that this also fixes a (should be) harmless bug in ossl(4) where the counter was incorrectly treated as a 64-bit counter instead of a 32-bit counter in terms of wrapping when using a 12 byte nonce. However, this required a single message (TLS record) longer than 64 * (2^32 - 1) bytes (about 256 GB) to trigger. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32122 --- share/man/man7/crypto.7 | 2 +- sys/crypto/openssl/ossl_chacha20.c | 14 ++++++++------ sys/opencrypto/crypto.c | 7 ++++++- sys/opencrypto/cryptosoft.c | 3 --- sys/opencrypto/xform_chacha20_poly1305.c | 31 +++++++++++++++++++++++++------ tools/tools/crypto/cryptocheck.c | 4 ++-- 6 files changed, 42 insertions(+), 19 deletions(-) diff --git a/share/man/man7/crypto.7 b/share/man/man7/crypto.7 index d75daa62adcb..c7af22af4deb 100644 --- a/share/man/man7/crypto.7 +++ b/share/man/man7/crypto.7 @@ -167,7 +167,7 @@ The following AEAD algorithms are supported: AES Galois/Counter Mode .It Dv CRYPTO_AES_CCM_16 Ta 12, 7-13 Ta 16, 24, 32 Ta 16 Ta AES Counter with CBC-MAC -.It Dv CRYPTO_CHACHA20_POLY1305 Ta 12 Ta 32 Ta 16 Ta +.It Dv CRYPTO_CHACHA20_POLY1305 Ta 12, 8 Ta 32 Ta 16 Ta ChaCha20-Poly1305 .El .Sh SEE ALSO diff --git a/sys/crypto/openssl/ossl_chacha20.c b/sys/crypto/openssl/ossl_chacha20.c index a6f56aca1f8f..aa125121e8b4 100644 --- a/sys/crypto/openssl/ossl_chacha20.c +++ b/sys/crypto/openssl/ossl_chacha20.c @@ -161,7 +161,8 @@ ossl_chacha20_poly1305_encrypt(struct cryptop *crp, for (i = 0; i < nitems(key); i++) key[i] = CHACHA_U8TOU32(cipher_key + i * 4); - crypto_read_iv(crp, counter + 1); + memset(counter, 0, sizeof(counter)); + crypto_read_iv(crp, counter + (CHACHA_CTR_SIZE - csp->csp_ivlen) / 4); for (i = 1; i < nitems(counter); i++) counter[i] = le32toh(counter[i]); @@ -223,7 +224,7 @@ ossl_chacha20_poly1305_encrypt(struct cryptop *crp, /* Truncate if the 32-bit counter would roll over. */ next_counter = counter[0] + todo / CHACHA_BLK_SIZE; - if (next_counter < counter[0]) { + if (csp->csp_ivlen == 8 && next_counter < counter[0]) { todo -= next_counter * CHACHA_BLK_SIZE; next_counter = 0; } @@ -232,7 +233,7 @@ ossl_chacha20_poly1305_encrypt(struct cryptop *crp, Poly1305_Update(&auth_ctx, out, todo); counter[0] = next_counter; - if (counter[0] == 0) + if (csp->csp_ivlen == 8 && counter[0] == 0) counter[1]++; if (out == block) { @@ -307,7 +308,8 @@ ossl_chacha20_poly1305_decrypt(struct cryptop *crp, for (i = 0; i < nitems(key); i++) key[i] = CHACHA_U8TOU32(cipher_key + i * 4); - crypto_read_iv(crp, counter + 1); + memset(counter, 0, sizeof(counter)); + crypto_read_iv(crp, counter + (CHACHA_CTR_SIZE - csp->csp_ivlen) / 4); for (i = 1; i < nitems(counter); i++) counter[i] = le32toh(counter[i]); @@ -391,7 +393,7 @@ ossl_chacha20_poly1305_decrypt(struct cryptop *crp, /* Truncate if the 32-bit counter would roll over. */ next_counter = counter[0] + todo / CHACHA_BLK_SIZE; - if (next_counter < counter[0]) { + if (csp->csp_ivlen == 8 && next_counter < counter[0]) { todo -= next_counter * CHACHA_BLK_SIZE; next_counter = 0; } @@ -399,7 +401,7 @@ ossl_chacha20_poly1305_decrypt(struct cryptop *crp, ChaCha20_ctr32(out, in, todo, key, counter); counter[0] = next_counter; - if (counter[0] == 0) + if (csp->csp_ivlen == 8 && counter[0] == 0) counter[1]++; if (out == block) { diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 3a71e53129be..85c22fd51ee2 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -852,10 +852,15 @@ check_csp(const struct crypto_session_params *csp) return (false); break; case CRYPTO_AES_NIST_GCM_16: - case CRYPTO_CHACHA20_POLY1305: if (csp->csp_auth_mlen > 16) return (false); break; + case CRYPTO_CHACHA20_POLY1305: + if (csp->csp_ivlen != 8 && csp->csp_ivlen != 12) + return (false); + if (csp->csp_auth_mlen > POLY1305_HASH_LEN) + return (false); + break; } break; case CSP_MODE_ETA: diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index e51bade8a3f8..94ba1a5af8f5 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -1393,9 +1393,6 @@ swcr_setup_chacha20_poly1305(struct swcr_session *ses, struct swcr_auth *swa; const struct auth_hash *axf; - if (csp->csp_ivlen != CHACHA20_POLY1305_IV_LEN) - return (EINVAL); - /* First, setup the auth side. */ swa = &ses->swcr_auth; axf = &auth_hash_chacha20_poly1305; diff --git a/sys/opencrypto/xform_chacha20_poly1305.c b/sys/opencrypto/xform_chacha20_poly1305.c index 51ae11c923e7..47d26dbd1d21 100644 --- a/sys/opencrypto/xform_chacha20_poly1305.c +++ b/sys/opencrypto/xform_chacha20_poly1305.c @@ -34,6 +34,7 @@ struct chacha20_poly1305_cipher_ctx { const void *key; uint32_t ic; + bool ietf; char nonce[CHACHA20_POLY1305_IV_LEN]; }; @@ -58,7 +59,8 @@ chacha20_poly1305_reinit(void *vctx, const uint8_t *iv, size_t ivlen) ("%s: invalid nonce length", __func__)); /* Block 0 is used for the poly1305 key. */ - memcpy(ctx->nonce, iv, sizeof(ctx->nonce)); + memcpy(ctx->nonce, iv, ivlen); + ctx->ietf = (ivlen == CHACHA20_POLY1305_IV_LEN); ctx->ic = 1; } @@ -68,8 +70,12 @@ chacha20_poly1305_crypt(void *vctx, const uint8_t *in, uint8_t *out) struct chacha20_poly1305_cipher_ctx *ctx = vctx; int error; - error = crypto_stream_chacha20_ietf_xor_ic(out, in, - CHACHA20_NATIVE_BLOCK_LEN, ctx->nonce, ctx->ic, ctx->key); + if (ctx->ietf) + error = crypto_stream_chacha20_ietf_xor_ic(out, in, + CHACHA20_NATIVE_BLOCK_LEN, ctx->nonce, ctx->ic, ctx->key); + else + error = crypto_stream_chacha20_xor_ic(out, in, + CHACHA20_NATIVE_BLOCK_LEN, ctx->nonce, ctx->ic, ctx->key); KASSERT(error == 0, ("%s failed: %d", __func__, error)); ctx->ic++; } @@ -82,8 +88,12 @@ chacha20_poly1305_crypt_last(void *vctx, const uint8_t *in, uint8_t *out, int error; - error = crypto_stream_chacha20_ietf_xor_ic(out, in, len, ctx->nonce, - ctx->ic, ctx->key); + if (ctx->ietf) + error = crypto_stream_chacha20_ietf_xor_ic(out, in, len, + ctx->nonce, ctx->ic, ctx->key); + else + error = crypto_stream_chacha20_xor_ic(out, in, len, ctx->nonce, + ctx->ic, ctx->key); KASSERT(error == 0, ("%s failed: %d", __func__, error)); } @@ -129,7 +139,16 @@ chacha20_poly1305_Reinit(void *vctx, const uint8_t *nonce, u_int noncelen) struct chacha20_poly1305_auth_ctx *ctx = vctx; char block[CHACHA20_NATIVE_BLOCK_LEN]; - crypto_stream_chacha20_ietf(block, sizeof(block), nonce, ctx->key); + switch (noncelen) { + case 8: + crypto_stream_chacha20(block, sizeof(block), nonce, ctx->key); + break; + case CHACHA20_POLY1305_IV_LEN: + crypto_stream_chacha20_ietf(block, sizeof(block), nonce, ctx->key); + break; + default: + __assert_unreachable(); + } crypto_onetimeauth_poly1305_init(&ctx->state, block); explicit_bzero(block, sizeof(block)); } diff --git a/tools/tools/crypto/cryptocheck.c b/tools/tools/crypto/cryptocheck.c index 63c6ce1f9d28..05b761a0c87a 100644 --- a/tools/tools/crypto/cryptocheck.c +++ b/tools/tools/crypto/cryptocheck.c @@ -126,7 +126,7 @@ * aes-ccm 128-bit AES-CCM * aes-ccm192 192-bit AES-CCM * aes-ccm256 256-bit AES-CCM - * chacha20-poly1305 Chacha20 (96 bit nonce) with Poly1305 per RFC 8439 + * chacha20-poly1305 Chacha20 with Poly1305 per RFC 8439 */ #include @@ -233,7 +233,7 @@ static const struct alg { .evp_cipher = EVP_aes_256_ccm }, { .name = "chacha20-poly1305", .cipher = CRYPTO_CHACHA20_POLY1305, .type = T_AEAD, .tag_len = POLY1305_HASH_LEN, - .iv_sizes = { CHACHA20_POLY1305_IV_LEN }, + .iv_sizes = { CHACHA20_POLY1305_IV_LEN, 8 }, .evp_cipher = EVP_chacha20_poly1305 }, }; From nobody Wed Oct 6 21:10:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B00C512D47EF; Wed, 6 Oct 2021 21:10:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPnDT06JQz3Hqq; Wed, 6 Oct 2021 21:10:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FCBB26FD9; Wed, 6 Oct 2021 21:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LAiPT062428; Wed, 6 Oct 2021 21:10:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAiqj062427; Wed, 6 Oct 2021 21:10:44 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:44 GMT Message-Id: <202110062110.196LAiqj062427@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ac847dbf7368 - main - Bump __FreeBSD_version for OCF changes to support variable nonce lengths. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac847dbf73685a5df9f70bbcdefa9fdeb559071d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ac847dbf73685a5df9f70bbcdefa9fdeb559071d commit ac847dbf73685a5df9f70bbcdefa9fdeb559071d Author: John Baldwin AuthorDate: 2021-10-06 21:09:18 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:09:18 +0000 Bump __FreeBSD_version for OCF changes to support variable nonce lengths. Sponsored by: The FreeBSD Foundation --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 899ae1793b28..9a016e35323e 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400035 +#define __FreeBSD_version 1400036 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Wed Oct 6 21:11:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7695A12D5070 for ; Wed, 6 Oct 2021 21:11:16 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPnDy4SF4z3J5Y for ; Wed, 6 Oct 2021 21:11:14 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2d.google.com with SMTP id n65so8495005ybb.7 for ; Wed, 06 Oct 2021 14:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=up768brcJ8vDfDIFmKAjKP2bJU4MUldduGn2hQLjrH0=; b=ojKjEQ6BMk/XqMrTNi64yKbJG4OPS+pO/yxWIdCyW/79KJSYMLRWagbcAGIuyTlqL6 iIAduBBfOClnzUjKn/XaKlhEkbOCtIVOQVWwPRvpIfdipi35nZBFBHjdvposYHvF0b0N EptNVWI7MymgtU/PpN5ZnBl8Urv48XkwOmIdk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=up768brcJ8vDfDIFmKAjKP2bJU4MUldduGn2hQLjrH0=; b=ALkEA9uvzEjfCpouoC7HZAHv0qzcq5OIoRiaTHAoJX+a+NZCxT6M8yTADFSUjoeZAm xqqi2/h+GNGWkOf2FZyeQ3nOk6n54TaFHnGSh5zBrXDFHQw2jPLJtbIg3/SD3asVmJCM uXGIEe46RRqfi7kcO/Pm8K4vnS7Ym5dpmGOGLccmy4ac+uDzZt7GSELYFWwjD5591gL6 rzq2bY6eOuoibgogzsWKPxeBdjROvdCMHhoBEtmweu24PyVuoEIYC29Gy8pSu0x/iqKM VxIfrGeY0JzNPmm/NmXLz6v7ZwztuzXvgLY2fKjptwwA7me7WVtEwT6Zxk0HSP1ek3aq FaNg== X-Gm-Message-State: AOAM532/CjAeLdsZ+x1pyYz8Qbe4gCDWpWrVN5uKdm4rgVu84HK6eOoh g3Ckb6f772iRVCT+2Gpk7JxI18lTUawy5+0+NDK4tQ== X-Google-Smtp-Source: ABdhPJwgi4QC4W8xaWDc6irVuRAYB3cNdu7iiDz1Qriazh+EF/xzWXV+1LDDcXZYfHa7PKluhtZEOREhERFqVFZGJyE= X-Received: by 2002:a25:bb08:: with SMTP id z8mr487736ybg.306.1633554673807; Wed, 06 Oct 2021 14:11:13 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> <20211004101726.wraje5ol5vwbhjcv@pleb> In-Reply-To: From: Kevin Bowling Date: Wed, 6 Oct 2021 14:11:01 -0700 Message-ID: Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Hans Petter Selasky Cc: Christos Margiolis , Mateusz Piotrowski <0mp@freebsd.org>, src-committers , "" , "dev-commits-src-main@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HPnDy4SF4z3J5Y X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 6, 2021 at 1:43 PM Hans Petter Selasky wrote: > > On 10/6/21 10:37 PM, Kevin Bowling wrote: > > I still get a bunch of spam from rc.d on boot and it doesn't seem to > > save my mixer settings on shutdown, is there some settings file I > > should blow away or is there a better way to handle upgrades? > > Hi Kevin, > > Did you install the new /etc/rc.d/mixer script? > > Or do you see this diff: There is no diff with 'diff -u /usr/src/libexec/rc/rc.d/mixer /etc/rc.d/mixer' for me. > > > diff -u /usr/src/libexec/rc/rc.d/mixer /etc/rc.d/mixer > > --- /usr/src/libexec/rc/rc.d/mixer 2021-09-22 22:09:36.193543000 +0200 > > +++ /etc/rc.d/mixer 2019-12-26 22:43:45.276389000 +0100 > > @@ -58,7 +58,7 @@ > > > > dev="/dev/${1}" > > if [ -r ${dev} ]; then > > - /usr/sbin/mixer -f ${dev} -o > /var/db/${1}-state 2>/dev/null > > + /usr/sbin/mixer -f ${dev} -s > /var/db/${1}-state 2>/dev/null > > fi > > } > > --HPS From nobody Wed Oct 6 21:40:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F3B4412DFBE7; Wed, 6 Oct 2021 21:40: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 4HPntb6VSWz3mlw; Wed, 6 Oct 2021 21:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9A69274DB; Wed, 6 Oct 2021 21:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196LeN6V099555; Wed, 6 Oct 2021 21:40:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LeN3r099553; Wed, 6 Oct 2021 21:40:23 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:40:23 GMT Message-Id: <202110062140.196LeN3r099553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: a30efc5ca727 - main - contrib/bc: update to version 5.1.1 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a30efc5ca7272e446abb71f0d72c76539f267bb6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=a30efc5ca7272e446abb71f0d72c76539f267bb6 commit a30efc5ca7272e446abb71f0d72c76539f267bb6 Merge: ac847dbf7368 6f49f5cdde1c Author: Stefan Eßer AuthorDate: 2021-10-06 21:30:59 +0000 Commit: Stefan Eßer CommitDate: 2021-10-06 21:30:59 +0000 contrib/bc: update to version 5.1.1 Merge commit '6f49f5cdde1c62c4e5a743e895f3afe592b5c0e5' contrib/bc/NEWS.md | 8 ++++++ contrib/bc/include/bc.h | 9 +++++++ contrib/bc/include/version.h | 2 +- contrib/bc/manuals/build.md | 6 ++--- contrib/bc/src/bc_parse.c | 47 +++++++++++++++++++++++++++----- contrib/bc/src/vm.c | 43 +++++------------------------ contrib/bc/tests/bc/scripts/all.txt | 2 ++ contrib/bc/tests/bc/scripts/ifs.bc | 49 ++++++++++++++++++++++++++++++++++ contrib/bc/tests/bc/scripts/ifs.txt | 18 +++++++++++++ contrib/bc/tests/bc/scripts/ifs2.bc | 33 +++++++++++++++++++++++ contrib/bc/tests/bc/scripts/ifs2.txt | 34 +++++++++++++++++++++++ contrib/bc/tests/bc/stdin2.txt | 3 +++ contrib/bc/tests/bc/stdin2_results.txt | 21 +++++++++++++++ contrib/bc/tests/stdin.sh | 4 +-- contrib/bc/vs/bin/some.txt | 0 contrib/bc/vs/tests/some.txt | 0 16 files changed, 230 insertions(+), 49 deletions(-) diff --cc contrib/bc/tests/bc/scripts/ifs.bc index 000000000000,9d6ab2dbb0ef..9d6ab2dbb0ef mode 000000,100644..100644 --- a/contrib/bc/tests/bc/scripts/ifs.bc +++ b/contrib/bc/tests/bc/scripts/ifs.bc diff --cc contrib/bc/tests/bc/scripts/ifs.txt index 000000000000,56e07330f1f2..56e07330f1f2 mode 000000,100644..100644 --- a/contrib/bc/tests/bc/scripts/ifs.txt +++ b/contrib/bc/tests/bc/scripts/ifs.txt diff --cc contrib/bc/tests/bc/scripts/ifs2.bc index 000000000000,052ef06ee4e3..052ef06ee4e3 mode 000000,100644..100644 --- a/contrib/bc/tests/bc/scripts/ifs2.bc +++ b/contrib/bc/tests/bc/scripts/ifs2.bc diff --cc contrib/bc/tests/bc/scripts/ifs2.txt index 000000000000,b226e98ad44b..b226e98ad44b mode 000000,100644..100644 --- a/contrib/bc/tests/bc/scripts/ifs2.txt +++ b/contrib/bc/tests/bc/scripts/ifs2.txt From nobody Wed Oct 6 23:23:59 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9FB1D17E9D1F; Wed, 6 Oct 2021 23:23: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 4HPrB745Ldz3txj; Wed, 6 Oct 2021 23:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C62D10F3; Wed, 6 Oct 2021 23:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196NNx3r039004; Wed, 6 Oct 2021 23:23:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196NNx0t039003; Wed, 6 Oct 2021 23:23:59 GMT (envelope-from git) Date: Wed, 6 Oct 2021 23:23:59 GMT Message-Id: <202110062323.196NNx0t039003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 9b3e252e59c6 - main - e1000: Lock nvm print sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b3e252e59c6e63594fb20e3f65188dab9e1eeff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9b3e252e59c6e63594fb20e3f65188dab9e1eeff commit 9b3e252e59c6e63594fb20e3f65188dab9e1eeff Author: Kevin Bowling AuthorDate: 2021-10-06 23:20:26 +0000 Commit: Kevin Bowling CommitDate: 2021-10-06 23:20:26 +0000 e1000: Lock nvm print sysctl Otherwise results in KASSERT with debug kernels because we rely on the iflib CTX lock to implement the software serialization to the NVM model Reviewed by: gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32333 --- sys/dev/e1000/if_em.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 3153a44000c5..52eff393e848 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4510,20 +4510,27 @@ em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS) static void em_print_nvm_info(struct e1000_softc *sc) { + struct e1000_hw *hw = &sc->hw; + struct sx *iflib_ctx_lock = iflib_ctx_lock_get(sc->ctx); u16 eeprom_data; int i, j, row = 0; /* Its a bit crude, but it gets the job done */ printf("\nInterface EEPROM Dump:\n"); printf("Offset\n0x0000 "); + + /* We rely on the IFLIB_CTX_LOCK as part of NVM locking model */ + sx_xlock(iflib_ctx_lock); + ASSERT_CTX_LOCK_HELD(hw); for (i = 0, j = 0; i < 32; i++, j++) { if (j == 8) { /* Make the offset block */ j = 0; ++row; printf("\n0x00%x0 ",row); } - e1000_read_nvm(&sc->hw, i, 1, &eeprom_data); + e1000_read_nvm(hw, i, 1, &eeprom_data); printf("%04x ", eeprom_data); } + sx_xunlock(iflib_ctx_lock); printf("\n"); } From nobody Wed Oct 6 23:28:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5ABD917EA57A; Wed, 6 Oct 2021 23:28: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 4HPrGp23dQz3vht; Wed, 6 Oct 2021 23:28:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26576FA8; Wed, 6 Oct 2021 23:28:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 196NS2DO039665; Wed, 6 Oct 2021 23:28:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196NS2OS039664; Wed, 6 Oct 2021 23:28:02 GMT (envelope-from git) Date: Wed, 6 Oct 2021 23:28:02 GMT Message-Id: <202110062328.196NS2OS039664@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 293663f4da9e - main - e1000: print EEPROM/NVM/OROM versions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 293663f4da9e8b8aeb106ce3b73a8ed2aa2a8a90 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=293663f4da9e8b8aeb106ce3b73a8ed2aa2a8a90 commit 293663f4da9e8b8aeb106ce3b73a8ed2aa2a8a90 Author: Kevin Bowling AuthorDate: 2021-10-06 23:25:03 +0000 Commit: Kevin Bowling CommitDate: 2021-10-06 23:25:03 +0000 e1000: print EEPROM/NVM/OROM versions This is useful for diagnosing problems. In particular, the errata sheets identify the EEPROM version for many fixes. Reviewed by: gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32333 --- sys/dev/e1000/if_em.c | 185 ++++++++++++++++++++++++++++++++++++++++++-------- sys/dev/e1000/if_em.h | 3 + 2 files changed, 158 insertions(+), 30 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 52eff393e848..b3775b351c70 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -305,6 +305,10 @@ static void em_if_vlan_filter_write(struct e1000_softc *); static void em_setup_vlan_hw_support(struct e1000_softc *); static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); static void em_print_nvm_info(struct e1000_softc *); +static void em_fw_version_locked(if_ctx_t); +static void em_sbuf_fw_version(struct e1000_fw_version *, struct sbuf *); +static void em_print_fw_version(struct e1000_softc *); +static int em_sysctl_print_fw_version(SYSCTL_HANDLER_ARGS); static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS); static int em_get_rs(SYSCTL_HANDLER_ARGS); static void em_print_debug_info(struct e1000_softc *); @@ -792,6 +796,8 @@ em_if_attach_pre(if_ctx_t ctx) if_softc_ctx_t scctx; device_t dev; struct e1000_hw *hw; + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx_list; int error = 0; INIT_DEBUGOUT("em_if_attach_pre: begin"); @@ -806,37 +812,38 @@ em_if_attach_pre(if_ctx_t ctx) sc->tx_process_limit = scctx->isc_ntxd[0]; + /* Determine hardware and mac info */ + em_identify_hardware(ctx); + /* SYSCTL stuff */ - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "nvm", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, - sc, 0, em_sysctl_nvm_info, "I", "NVM Information"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "debug", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, - sc, 0, em_sysctl_debug_info, "I", "Debug Information"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, - sc, 0, em_set_flowcntl, "I", "Flow Control"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "reg_dump", + ctx_list = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "nvm", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + em_sysctl_nvm_info, "I", "NVM Information"); + + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "fw_version", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + em_sysctl_print_fw_version, "A", + "Prints FW/NVM Versions"); + + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "debug", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + em_sysctl_debug_info, "I", "Debug Information"); + + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "fc", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + em_set_flowcntl, "I", "Flow Control"); + + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "reg_dump", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, em_get_regs, "A", "Dump Registers"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "rs_dump", + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "rs_dump", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, em_get_rs, "I", "Dump RS indexes"); - /* Determine hardware and mac info */ - em_identify_hardware(ctx); - scctx->isc_tx_nsegments = EM_MAX_SCATTER; scctx->isc_nrxqsets_max = scctx->isc_ntxqsets_max = em_set_num_queues(ctx); if (bootverbose) @@ -1045,12 +1052,9 @@ em_if_attach_pre(if_ctx_t ctx) /* Sysctl for setting Energy Efficient Ethernet */ hw->dev_spec.ich8lan.eee_disable = eee_setting; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "eee_control", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, - sc, 0, em_sysctl_eee, "I", - "Disable Energy Efficient Ethernet"); + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "eee_control", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + em_sysctl_eee, "I", "Disable Energy Efficient Ethernet"); /* ** Start from a known state, this is @@ -1093,6 +1097,11 @@ em_if_attach_pre(if_ctx_t ctx) } } + /* Save the EEPROM/NVM versions, must be done under IFLIB_CTX_LOCK */ + em_fw_version_locked(ctx); + + em_print_fw_version(sc); + /* Disable ULP support */ e1000_disable_ulp_lpt_lp(hw, true); @@ -4476,6 +4485,122 @@ em_add_hw_stats(struct e1000_softc *sc) "Interrupt Cause Receiver Overrun Count"); } +static void +em_fw_version_locked(if_ctx_t ctx) +{ + struct e1000_softc *sc = iflib_get_softc(ctx); + struct e1000_hw *hw = &sc->hw; + struct e1000_fw_version *fw_ver = &sc->fw_ver; + uint16_t eep = 0; + + /* + * em_fw_version_locked() must run under the IFLIB_CTX_LOCK to meet the + * NVM locking model, so we do it in em_if_attach_pre() and store the + * info in the softc + */ + ASSERT_CTX_LOCK_HELD(hw); + + *fw_ver = (struct e1000_fw_version){0}; + + if (hw->mac.type >= igb_mac_min) { + /* + * Use the Shared Code for igb(4) + */ + e1000_get_fw_version(hw, fw_ver); + } else { + /* + * Otherwise, EEPROM version should be present on (almost?) all + * devices here + */ + if(e1000_read_nvm(hw, NVM_VERSION, 1, &eep)) { + INIT_DEBUGOUT("can't get EEPROM version"); + return; + } + + fw_ver->eep_major = (eep & NVM_MAJOR_MASK) >> NVM_MAJOR_SHIFT; + fw_ver->eep_minor = (eep & NVM_MINOR_MASK) >> NVM_MINOR_SHIFT; + fw_ver->eep_build = (eep & NVM_IMAGE_ID_MASK); + } +} + +static void +em_sbuf_fw_version(struct e1000_fw_version *fw_ver, struct sbuf *buf) +{ + const char *space = ""; + + if (fw_ver->eep_major || fw_ver->eep_minor || fw_ver->eep_build) { + sbuf_printf(buf, "EEPROM V%d.%d-%d", fw_ver->eep_major, + fw_ver->eep_minor, fw_ver->eep_build); + space = " "; + } + + if (fw_ver->invm_major || fw_ver->invm_minor || fw_ver->invm_img_type) { + sbuf_printf(buf, "%sNVM V%d.%d imgtype%d", + space, fw_ver->invm_major, fw_ver->invm_minor, + fw_ver->invm_img_type); + space = " "; + } + + if (fw_ver->or_valid) { + sbuf_printf(buf, "%sOption ROM V%d-b%d-p%d", + space, fw_ver->or_major, fw_ver->or_build, + fw_ver->or_patch); + space = " "; + } + + if (fw_ver->etrack_id) + sbuf_printf(buf, "%seTrack 0x%08x", space, fw_ver->etrack_id); +} + +static void +em_print_fw_version(struct e1000_softc *sc ) +{ + device_t dev = sc->dev; + struct sbuf *buf; + int error = 0; + + buf = sbuf_new_auto(); + if (!buf) { + device_printf(dev, "Could not allocate sbuf for output.\n"); + return; + } + + em_sbuf_fw_version(&sc->fw_ver, buf); + + error = sbuf_finish(buf); + if (error) + device_printf(dev, "Error finishing sbuf: %d\n", error); + else if (sbuf_len(buf)) + device_printf(dev, "%s\n", sbuf_data(buf)); + + sbuf_delete(buf); +} + +static int +em_sysctl_print_fw_version(SYSCTL_HANDLER_ARGS) +{ + struct e1000_softc *sc = (struct e1000_softc *)arg1; + device_t dev = sc->dev; + struct sbuf *buf; + int error = 0; + + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (!buf) { + device_printf(dev, "Could not allocate sbuf for output.\n"); + return (ENOMEM); + } + + em_sbuf_fw_version(&sc->fw_ver, buf); + + error = sbuf_finish(buf); + if (error) + device_printf(dev, "Error finishing sbuf: %d\n", error); + + sbuf_delete(buf); + + return (0); +} + /********************************************************************** * * This routine provides a way to dump out the adapter eeprom, diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index 41deecb69bf3..33ba22a88552 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -510,6 +510,9 @@ struct e1000_softc { u64 que_mask; + /* We need to store this at attach due to e1000 hw/sw locking model */ + struct e1000_fw_version fw_ver; + struct em_int_delay_info tx_int_delay; struct em_int_delay_info tx_abs_int_delay; struct em_int_delay_info rx_int_delay; From nobody Thu Oct 7 00:26:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0251612B8F69; Thu, 7 Oct 2021 00:26: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 4HPsZh69DNz4XKt; Thu, 7 Oct 2021 00:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B35BC1BC0; Thu, 7 Oct 2021 00:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1970QqEr019699; Thu, 7 Oct 2021 00:26:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1970QqTf019698; Thu, 7 Oct 2021 00:26:52 GMT (envelope-from git) Date: Thu, 7 Oct 2021 00:26:52 GMT Message-Id: <202110070026.1970QqTf019698@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: 10ff414c14ee - main - Import libcbor at 'contrib/libcbor/' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 10ff414c14eef433d8157f0c17904d740693933b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=10ff414c14eef433d8157f0c17904d740693933b commit 10ff414c14eef433d8157f0c17904d740693933b Merge: 293663f4da9e 5b2defbd2a1a Author: Ed Maste AuthorDate: 2021-10-07 00:26:10 +0000 Commit: Ed Maste CommitDate: 2021-10-07 00:26:10 +0000 Import libcbor at 'contrib/libcbor/' git-subtree-dir: contrib/libcbor git-subtree-mainline: 293663f4da9e8b8aeb106ce3b73a8ed2aa2a8a90 git-subtree-split: 5b2defbd2a1aa991bd0a2855eef8e15107572747 contrib/libcbor/.clang-format | 151 ++ contrib/libcbor/.github/workflows/fuzz.yml | 23 + contrib/libcbor/.gitignore | 8 + contrib/libcbor/.travis.yml | 66 + contrib/libcbor/CHANGELOG.md | 109 + contrib/libcbor/CMakeLists.txt | 159 ++ contrib/libcbor/CMakeModules/FindCJSON.cmake | 9 + contrib/libcbor/CMakeModules/FindCMocka.cmake | 49 + contrib/libcbor/CMakeModules/LibFindMacros.cmake | 120 + contrib/libcbor/Doxyfile | 2417 ++++++++++++++++++++ contrib/libcbor/LICENSE.md | 21 + contrib/libcbor/README.md | 122 + contrib/libcbor/appveyor.yml | 27 + contrib/libcbor/clang-format.sh | 17 + contrib/libcbor/codecov.yml | 2 + contrib/libcbor/doc/Makefile | 180 ++ contrib/libcbor/doc/doxy_frontpage.md | 37 + contrib/libcbor/doc/make.bat | 242 ++ contrib/libcbor/doc/source/api.rst | 39 + contrib/libcbor/doc/source/api/decoding.rst | 53 + contrib/libcbor/doc/source/api/encoding.rst | 23 + .../doc/source/api/item_reference_counting.rst | 41 + contrib/libcbor/doc/source/api/item_types.rst | 41 + contrib/libcbor/doc/source/api/type_0_1.rst | 91 + contrib/libcbor/doc/source/api/type_2.rst | 66 + contrib/libcbor/doc/source/api/type_3.rst | 55 + contrib/libcbor/doc/source/api/type_4.rst | 62 + contrib/libcbor/doc/source/api/type_5.rst | 44 + contrib/libcbor/doc/source/api/type_6.rst | 21 + contrib/libcbor/doc/source/api/type_7.rst | 75 + contrib/libcbor/doc/source/changelog.rst | 4 + contrib/libcbor/doc/source/conf.py | 296 +++ contrib/libcbor/doc/source/development.rst | 143 ++ contrib/libcbor/doc/source/getting_started.rst | 190 ++ contrib/libcbor/doc/source/img/win_1.png | Bin 0 -> 29291 bytes contrib/libcbor/doc/source/img/win_2.png | Bin 0 -> 20179 bytes contrib/libcbor/doc/source/img/win_3.png | Bin 0 -> 47224 bytes contrib/libcbor/doc/source/img/win_4.png | Bin 0 -> 11272 bytes contrib/libcbor/doc/source/img/win_5.png | Bin 0 -> 29490 bytes contrib/libcbor/doc/source/img/win_6.png | Bin 0 -> 25195 bytes contrib/libcbor/doc/source/index.rst | 40 + contrib/libcbor/doc/source/internal.rst | 128 ++ contrib/libcbor/doc/source/requirements.txt | 39 + contrib/libcbor/doc/source/rfc_conformance.rst | 17 + contrib/libcbor/doc/source/streaming.rst | 13 + contrib/libcbor/doc/source/streaming/decoding.rst | 40 + contrib/libcbor/doc/source/streaming/encoding.rst | 4 + contrib/libcbor/doc/source/tests.rst | 39 + contrib/libcbor/doc/source/using.rst | 173 ++ contrib/libcbor/examples/CMakeLists.txt | 25 + contrib/libcbor/examples/cjson2cbor.c | 145 ++ contrib/libcbor/examples/create_items.c | 33 + contrib/libcbor/examples/data/floats.cbor | Bin 0 -> 39 bytes contrib/libcbor/examples/data/indef_string.cbor | 1 + contrib/libcbor/examples/data/integer.cbor | 1 + contrib/libcbor/examples/data/json_example.json | 6 + contrib/libcbor/examples/data/map.cbor | Bin 0 -> 26 bytes contrib/libcbor/examples/data/nested_array.cbor | 1 + contrib/libcbor/examples/data/tagged_date.cbor | 1 + contrib/libcbor/examples/hello.c | 16 + contrib/libcbor/examples/readfile.c | 78 + contrib/libcbor/examples/sort.c | 41 + contrib/libcbor/examples/streaming_parser.c | 58 + contrib/libcbor/misc/bytes.rb | 3 + contrib/libcbor/misc/file_to_bytes.rb | 5 + contrib/libcbor/misc/hooks/pre-commit | 18 + contrib/libcbor/misc/repeat.rb | 3 + contrib/libcbor/misc/seq.rb | 3 + contrib/libcbor/misc/update_version.py | 38 + contrib/libcbor/oss-fuzz/build.sh | 28 + contrib/libcbor/oss-fuzz/cbor_load_fuzzer.cc | 37 + contrib/libcbor/release.sh | 75 + contrib/libcbor/src/CMakeLists.txt | 45 + contrib/libcbor/src/allocators.c | 19 + contrib/libcbor/src/cbor.c | 345 +++ contrib/libcbor/src/cbor.h | 68 + contrib/libcbor/src/cbor/arrays.c | 135 ++ contrib/libcbor/src/cbor/arrays.h | 116 + contrib/libcbor/src/cbor/bytestrings.c | 117 + contrib/libcbor/src/cbor/bytestrings.h | 132 ++ contrib/libcbor/src/cbor/callbacks.c | 116 + contrib/libcbor/src/cbor/callbacks.h | 187 ++ contrib/libcbor/src/cbor/common.c | 160 ++ contrib/libcbor/src/cbor/common.h | 303 +++ contrib/libcbor/src/cbor/configuration.h.in | 16 + contrib/libcbor/src/cbor/data.h | 255 +++ contrib/libcbor/src/cbor/encoding.c | 192 ++ contrib/libcbor/src/cbor/encoding.h | 109 + contrib/libcbor/src/cbor/floats_ctrls.c | 189 ++ contrib/libcbor/src/cbor/floats_ctrls.h | 212 ++ .../libcbor/src/cbor/internal/builder_callbacks.c | 389 ++++ .../libcbor/src/cbor/internal/builder_callbacks.h | 81 + contrib/libcbor/src/cbor/internal/encoders.c | 98 + contrib/libcbor/src/cbor/internal/encoders.h | 36 + contrib/libcbor/src/cbor/internal/loaders.c | 80 + contrib/libcbor/src/cbor/internal/loaders.h | 36 + contrib/libcbor/src/cbor/internal/memory_utils.c | 44 + contrib/libcbor/src/cbor/internal/memory_utils.h | 39 + contrib/libcbor/src/cbor/internal/stack.c | 33 + contrib/libcbor/src/cbor/internal/stack.h | 41 + contrib/libcbor/src/cbor/internal/unicode.c | 94 + contrib/libcbor/src/cbor/internal/unicode.h | 32 + contrib/libcbor/src/cbor/ints.c | 191 ++ contrib/libcbor/src/cbor/ints.h | 210 ++ contrib/libcbor/src/cbor/maps.c | 125 + contrib/libcbor/src/cbor/maps.h | 112 + contrib/libcbor/src/cbor/serialization.c | 286 +++ contrib/libcbor/src/cbor/serialization.h | 135 ++ contrib/libcbor/src/cbor/streaming.c | 664 ++++++ contrib/libcbor/src/cbor/streaming.h | 37 + contrib/libcbor/src/cbor/strings.c | 133 ++ contrib/libcbor/src/cbor/strings.h | 153 ++ contrib/libcbor/src/cbor/tags.c | 43 + contrib/libcbor/src/cbor/tags.h | 65 + contrib/libcbor/src/libcbor.pc.in | 11 + contrib/libcbor/test/CMakeLists.txt | 29 + contrib/libcbor/test/assertions.c | 53 + contrib/libcbor/test/assertions.h | 34 + contrib/libcbor/test/bad_inputs_test.c | 121 + contrib/libcbor/test/callbacks_test.c | 40 + contrib/libcbor/test/cbor_serialize_test.c | 323 +++ contrib/libcbor/test/cbor_stream_decode_test.c | 599 +++++ contrib/libcbor/test/copy_test.c | 207 ++ contrib/libcbor/test/cpp_linkage_test.cpp | 11 + contrib/libcbor/test/data/callbacks.cbor | Bin 0 -> 79 bytes contrib/libcbor/test/data/callbacks.diag | 1 + contrib/libcbor/test/data/pretty.cbor | 3 + contrib/libcbor/test/data/pretty.diag | 1 + contrib/libcbor/test/fuzz_test.c | 87 + contrib/libcbor/test/memory_allocation_test.c | 277 +++ contrib/libcbor/test/pretty_printer_test.c | 43 + contrib/libcbor/test/stack_over_limit_test.c | 35 + contrib/libcbor/test/stream_expectations.c | 317 +++ contrib/libcbor/test/stream_expectations.h | 151 ++ contrib/libcbor/test/type_0_encoders_test.c | 74 + contrib/libcbor/test/type_0_test.c | 147 ++ contrib/libcbor/test/type_1_encoders_test.c | 75 + contrib/libcbor/test/type_1_test.c | 102 + contrib/libcbor/test/type_2_encoders_test.c | 41 + contrib/libcbor/test/type_2_test.c | 327 +++ contrib/libcbor/test/type_3_encoders_test.c | 41 + contrib/libcbor/test/type_3_test.c | 242 ++ contrib/libcbor/test/type_4_encoders_test.c | 55 + contrib/libcbor/test/type_4_test.c | 127 + contrib/libcbor/test/type_5_encoders_test.c | 40 + contrib/libcbor/test/type_5_test.c | 190 ++ contrib/libcbor/test/type_6_encoders_test.c | 35 + contrib/libcbor/test/type_6_test.c | 117 + contrib/libcbor/test/type_7_encoders_test.c | 109 + contrib/libcbor/test/type_7_test.c | 111 + contrib/libcbor/test/unicode_test.c | 41 + 151 files changed, 16202 insertions(+) diff --cc contrib/libcbor/.clang-format index 000000000000,000000000000..de0dc5e77907 new file mode 100644 --- /dev/null +++ b/contrib/libcbor/.clang-format @@@ -1,0 -1,0 +1,151 @@@ ++--- ++Language: Cpp ++# BasedOnStyle: Google ++AccessModifierOffset: -1 ++AlignAfterOpenBracket: Align ++AlignConsecutiveAssignments: false ++AlignConsecutiveDeclarations: false ++AlignEscapedNewlines: Left ++AlignOperands: true ++AlignTrailingComments: true ++AllowAllParametersOfDeclarationOnNextLine: true ++AllowShortBlocksOnASingleLine: false ++AllowShortCaseLabelsOnASingleLine: false ++AllowShortFunctionsOnASingleLine: All ++AllowShortIfStatementsOnASingleLine: true ++AllowShortLoopsOnASingleLine: true ++AlwaysBreakAfterDefinitionReturnType: None ++AlwaysBreakAfterReturnType: None ++AlwaysBreakBeforeMultilineStrings: true ++AlwaysBreakTemplateDeclarations: true ++BinPackArguments: true ++BinPackParameters: true ++BraceWrapping: ++ AfterClass: false ++ AfterControlStatement: false ++ AfterEnum: false ++ AfterFunction: false ++ AfterNamespace: false ++ AfterObjCDeclaration: false ++ AfterStruct: false ++ AfterUnion: false ++ AfterExternBlock: false ++ BeforeCatch: false ++ BeforeElse: false ++ IndentBraces: false ++ SplitEmptyFunction: true ++ SplitEmptyRecord: true ++ SplitEmptyNamespace: true ++BreakBeforeBinaryOperators: None ++BreakBeforeBraces: Attach ++BreakBeforeInheritanceComma: false ++BreakInheritanceList: BeforeColon ++BreakBeforeTernaryOperators: true ++BreakConstructorInitializersBeforeComma: false ++BreakConstructorInitializers: BeforeColon ++BreakAfterJavaFieldAnnotations: false ++BreakStringLiterals: true ++ColumnLimit: 80 ++CommentPragmas: '^ IWYU pragma:' ++CompactNamespaces: false ++ConstructorInitializerAllOnOneLineOrOnePerLine: true ++ConstructorInitializerIndentWidth: 4 ++ContinuationIndentWidth: 4 ++Cpp11BracedListStyle: true ++DerivePointerAlignment: true ++DisableFormat: false ++ExperimentalAutoDetectBinPacking: false ++FixNamespaceComments: true ++ForEachMacros: ++ - foreach ++ - Q_FOREACH ++ - BOOST_FOREACH ++IncludeBlocks: Preserve ++IncludeCategories: ++ - Regex: '^' ++ Priority: 2 ++ - Regex: '^<.*\.h>' ++ Priority: 1 ++ - Regex: '^<.*' ++ Priority: 2 ++ - Regex: '.*' ++ Priority: 3 ++IncludeIsMainRegex: '([-_](test|unittest))?$' ++IndentCaseLabels: true ++IndentPPDirectives: None ++IndentWidth: 2 ++IndentWrappedFunctionNames: false ++JavaScriptQuotes: Leave ++JavaScriptWrapImports: true ++KeepEmptyLinesAtTheStartOfBlocks: false ++MacroBlockBegin: '' ++MacroBlockEnd: '' ++MaxEmptyLinesToKeep: 1 ++NamespaceIndentation: None ++ObjCBinPackProtocolList: Never ++ObjCBlockIndentWidth: 2 ++ObjCSpaceAfterProperty: false ++ObjCSpaceBeforeProtocolList: true ++PenaltyBreakAssignment: 2 ++PenaltyBreakBeforeFirstCallParameter: 1 ++PenaltyBreakComment: 300 ++PenaltyBreakFirstLessLess: 120 ++PenaltyBreakString: 1000 ++PenaltyBreakTemplateDeclaration: 10 ++PenaltyExcessCharacter: 1000000 ++PenaltyReturnTypeOnItsOwnLine: 200 ++PointerAlignment: Left ++RawStringFormats: ++ - Language: Cpp ++ Delimiters: ++ - cc ++ - CC ++ - cpp ++ - Cpp ++ - CPP ++ - 'c++' ++ - 'C++' ++ CanonicalDelimiter: '' ++ BasedOnStyle: google ++ - Language: TextProto ++ Delimiters: ++ - pb ++ - PB ++ - proto ++ - PROTO ++ EnclosingFunctions: ++ - EqualsProto ++ - EquivToProto ++ - PARSE_PARTIAL_TEXT_PROTO ++ - PARSE_TEST_PROTO ++ - PARSE_TEXT_PROTO ++ - ParseTextOrDie ++ - ParseTextProtoOrDie ++ CanonicalDelimiter: '' ++ BasedOnStyle: google ++ReflowComments: true ++SortIncludes: true ++SortUsingDeclarations: true ++SpaceAfterCStyleCast: false ++SpaceAfterTemplateKeyword: true ++SpaceBeforeAssignmentOperators: true ++SpaceBeforeCpp11BracedList: false ++SpaceBeforeCtorInitializerColon: true ++SpaceBeforeInheritanceColon: true ++SpaceBeforeParens: ControlStatements ++SpaceBeforeRangeBasedForLoopColon: true ++SpaceInEmptyParentheses: false ++SpacesBeforeTrailingComments: 2 ++SpacesInAngles: false ++SpacesInContainerLiterals: true ++SpacesInCStyleCastParentheses: false ++SpacesInParentheses: false ++SpacesInSquareBrackets: false ++Standard: Auto ++StatementMacros: ++ - Q_UNUSED ++ - QT_REQUIRE_VERSION ++TabWidth: 8 ++UseTab: Never ++... ++ diff --cc contrib/libcbor/.github/workflows/fuzz.yml index 000000000000,c5275121868f..c5275121868f mode 000000,100644..100644 --- a/contrib/libcbor/.github/workflows/fuzz.yml +++ b/contrib/libcbor/.github/workflows/fuzz.yml diff --cc contrib/libcbor/.gitignore index 000000000000,000000000000..b6fe00f938ad new file mode 100644 --- /dev/null +++ b/contrib/libcbor/.gitignore @@@ -1,0 -1,0 +1,8 @@@ ++build ++*~ ++nbproject ++.idea ++doxygen_docs ++*/*.out ++cmake-build-debug ++venv diff --cc contrib/libcbor/.travis.yml index 000000000000,288de2903399..288de2903399 mode 000000,100644..100644 --- a/contrib/libcbor/.travis.yml +++ b/contrib/libcbor/.travis.yml diff --cc contrib/libcbor/CHANGELOG.md index 000000000000,0f13a45d6b24..0f13a45d6b24 mode 000000,100644..100644 --- a/contrib/libcbor/CHANGELOG.md +++ b/contrib/libcbor/CHANGELOG.md diff --cc contrib/libcbor/CMakeLists.txt index 000000000000,edba03720d2f..edba03720d2f mode 000000,100644..100644 --- a/contrib/libcbor/CMakeLists.txt +++ b/contrib/libcbor/CMakeLists.txt diff --cc contrib/libcbor/CMakeModules/FindCJSON.cmake index 000000000000,e0629057def7..e0629057def7 mode 000000,100644..100644 --- a/contrib/libcbor/CMakeModules/FindCJSON.cmake +++ b/contrib/libcbor/CMakeModules/FindCJSON.cmake diff --cc contrib/libcbor/CMakeModules/FindCMocka.cmake index 000000000000,770b44afc426..770b44afc426 mode 000000,100644..100644 --- a/contrib/libcbor/CMakeModules/FindCMocka.cmake +++ b/contrib/libcbor/CMakeModules/FindCMocka.cmake diff --cc contrib/libcbor/CMakeModules/LibFindMacros.cmake index 000000000000,baea8c2be928..baea8c2be928 mode 000000,100644..100644 --- a/contrib/libcbor/CMakeModules/LibFindMacros.cmake +++ b/contrib/libcbor/CMakeModules/LibFindMacros.cmake diff --cc contrib/libcbor/Doxyfile index 000000000000,b197d2bcdedc..b197d2bcdedc mode 000000,100644..100644 --- a/contrib/libcbor/Doxyfile +++ b/contrib/libcbor/Doxyfile diff --cc contrib/libcbor/LICENSE.md index 000000000000,49e9b5390364..49e9b5390364 mode 000000,100644..100644 --- a/contrib/libcbor/LICENSE.md +++ b/contrib/libcbor/LICENSE.md diff --cc contrib/libcbor/README.md index 000000000000,000000000000..cffae9191d01 new file mode 100644 --- /dev/null +++ b/contrib/libcbor/README.md @@@ -1,0 -1,0 +1,122 @@@ ++# [libcbor](https://github.com/PJK/libcbor) ++ ++[![Build Status](https://travis-ci.org/PJK/libcbor.svg?branch=master)](https://travis-ci.org/PJK/libcbor) ++[![Build status](https://ci.appveyor.com/api/projects/status/8kkmvmefelsxp5u2?svg=true)](https://ci.appveyor.com/project/PJK/libcbor) ++[![Documentation Status](https://readthedocs.org/projects/libcbor/badge/?version=latest)](https://readthedocs.org/projects/libcbor/?badge=latest) ++[![latest packaged version(s)](https://repology.org/badge/latest-versions/libcbor.svg)](https://repology.org/project/libcbor/versions) ++[![codecov](https://codecov.io/gh/PJK/libcbor/branch/master/graph/badge.svg)](https://codecov.io/gh/PJK/libcbor) ++ ++**libcbor** is a C library for parsing and generating [CBOR](http://tools.ietf.org/html/rfc7049), the general-purpose schema-less binary data format. ++ ++## Main features ++ - Complete RFC conformance ++ - Robust C99 implementation ++ - Layered architecture offers both control and convenience ++ - Flexible memory management ++ - No shared global state - threading friendly ++ - Proper handling of UTF-8 ++ - Full support for streams & incremental processing ++ - Extensive documentation and test suite ++ - No runtime dependencies, small footprint ++ ++## Getting started ++ ++### Compile from source ++ ++```bash ++git clone https://github.com/PJK/libcbor ++cmake -DCMAKE_BUILD_TYPE=Release -DCBOR_CUSTOM_ALLOC=ON libcbor ++make ++make install ++``` ++ ++### Homebrew ++ ++```bash ++brew install libcbor ++``` ++ ++### Ubuntu 18.04 and above ++ ++```bash ++sudo add-apt-repository universe ++sudo apt-get install libcbor-dev ++``` ++ ++### Fedora & RPM friends ++ ++```bash ++yum install libcbor-devel ++``` ++ ++### Others ++ ++
++ Packaged libcbor is available from 15+ major repositories. Click here for more detail ++ ++ [![Packaging status](https://repology.org/badge/vertical-allrepos/libcbor.svg)](https://repology.org/project/libcbor/versions) ++
++ ++## Usage example ++ ++```c ++#include ++#include ++ ++int main(int argc, char * argv[]) ++{ ++ /* Preallocate the map structure */ ++ cbor_item_t * root = cbor_new_definite_map(2); ++ /* Add the content */ ++ cbor_map_add(root, (struct cbor_pair) { ++ .key = cbor_move(cbor_build_string("Is CBOR awesome?")), ++ .value = cbor_move(cbor_build_bool(true)) ++ }); ++ cbor_map_add(root, (struct cbor_pair) { ++ .key = cbor_move(cbor_build_uint8(42)), ++ .value = cbor_move(cbor_build_string("Is the answer")) ++ }); ++ /* Output: `length` bytes of data in the `buffer` */ ++ unsigned char * buffer; ++ size_t buffer_size, ++ length = cbor_serialize_alloc(root, &buffer, &buffer_size); ++ ++ fwrite(buffer, 1, length, stdout); ++ free(buffer); ++ ++ fflush(stdout); ++ cbor_decref(&root); ++} ++``` ++ ++## Documentation ++Get the latest documentation at [libcbor.readthedocs.org](http://libcbor.readthedocs.org/) ++ ++## Contributions ++ ++All bug reports and contributions are welcome. Please see https://github.com/PJK/libcbor for more info. ++ ++Kudos to all the [contributors](https://github.com/PJK/libcbor/graphs/contributors)! ++ ++## License ++The MIT License (MIT) ++ ++Copyright (c) Pavel Kalvoda, 2014-2020 ++ ++Permission is hereby granted, free of charge, to any person obtaining a copy ++of this software and associated documentation files (the "Software"), to deal ++in the Software without restriction, including without limitation the rights ++to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++copies of the Software, and to permit persons to whom the Software is ++furnished to do so, subject to the following conditions: ++ ++The above copyright notice and this permission notice shall be included in all ++copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++SOFTWARE. diff --cc contrib/libcbor/appveyor.yml index 000000000000,452ced5666b7..452ced5666b7 mode 000000,100644..100644 --- a/contrib/libcbor/appveyor.yml +++ b/contrib/libcbor/appveyor.yml diff --cc contrib/libcbor/clang-format.sh index 000000000000,e4076500c4f0..e4076500c4f0 mode 000000,100755..100755 --- a/contrib/libcbor/clang-format.sh +++ b/contrib/libcbor/clang-format.sh diff --cc contrib/libcbor/codecov.yml index 000000000000,e374997dcd15..e374997dcd15 mode 000000,100644..100644 --- a/contrib/libcbor/codecov.yml +++ b/contrib/libcbor/codecov.yml diff --cc contrib/libcbor/doc/Makefile index 000000000000,97a6bdc99543..97a6bdc99543 mode 000000,100644..100644 --- a/contrib/libcbor/doc/Makefile +++ b/contrib/libcbor/doc/Makefile diff --cc contrib/libcbor/doc/doxy_frontpage.md index 000000000000,30980c4872d4..30980c4872d4 mode 000000,100644..100644 --- a/contrib/libcbor/doc/doxy_frontpage.md +++ b/contrib/libcbor/doc/doxy_frontpage.md diff --cc contrib/libcbor/doc/make.bat index 000000000000,b3647968e8a5..b3647968e8a5 mode 000000,100644..100644 --- a/contrib/libcbor/doc/make.bat +++ b/contrib/libcbor/doc/make.bat diff --cc contrib/libcbor/doc/source/api.rst index 000000000000,c25629115060..c25629115060 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api.rst +++ b/contrib/libcbor/doc/source/api.rst diff --cc contrib/libcbor/doc/source/api/decoding.rst index 000000000000,e3a41f467a15..e3a41f467a15 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/decoding.rst +++ b/contrib/libcbor/doc/source/api/decoding.rst diff --cc contrib/libcbor/doc/source/api/encoding.rst index 000000000000,af6bbbe7b9d3..af6bbbe7b9d3 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/encoding.rst +++ b/contrib/libcbor/doc/source/api/encoding.rst diff --cc contrib/libcbor/doc/source/api/item_reference_counting.rst index 000000000000,0c0fa7257826..0c0fa7257826 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/item_reference_counting.rst +++ b/contrib/libcbor/doc/source/api/item_reference_counting.rst diff --cc contrib/libcbor/doc/source/api/item_types.rst index 000000000000,1452b3e5f90e..1452b3e5f90e mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/item_types.rst +++ b/contrib/libcbor/doc/source/api/item_types.rst diff --cc contrib/libcbor/doc/source/api/type_0_1.rst index 000000000000,4fc851dd1ed1..4fc851dd1ed1 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/type_0_1.rst +++ b/contrib/libcbor/doc/source/api/type_0_1.rst diff --cc contrib/libcbor/doc/source/api/type_2.rst index 000000000000,17df5716ccc2..17df5716ccc2 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/type_2.rst +++ b/contrib/libcbor/doc/source/api/type_2.rst diff --cc contrib/libcbor/doc/source/api/type_3.rst index 000000000000,abec24de40a3..abec24de40a3 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/type_3.rst +++ b/contrib/libcbor/doc/source/api/type_3.rst diff --cc contrib/libcbor/doc/source/api/type_4.rst index 000000000000,c3bb88a9cd8a..c3bb88a9cd8a mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/type_4.rst +++ b/contrib/libcbor/doc/source/api/type_4.rst diff --cc contrib/libcbor/doc/source/api/type_5.rst index 000000000000,c9b2e904af6e..c9b2e904af6e mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/type_5.rst +++ b/contrib/libcbor/doc/source/api/type_5.rst diff --cc contrib/libcbor/doc/source/api/type_6.rst index 000000000000,e98457ceae2a..e98457ceae2a mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/type_6.rst +++ b/contrib/libcbor/doc/source/api/type_6.rst diff --cc contrib/libcbor/doc/source/api/type_7.rst index 000000000000,d2e75c8bf0b3..d2e75c8bf0b3 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/api/type_7.rst +++ b/contrib/libcbor/doc/source/api/type_7.rst diff --cc contrib/libcbor/doc/source/changelog.rst index 000000000000,89e7008afab2..89e7008afab2 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/changelog.rst +++ b/contrib/libcbor/doc/source/changelog.rst diff --cc contrib/libcbor/doc/source/conf.py index 000000000000,3ca95bd6dd1f..3ca95bd6dd1f mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/conf.py +++ b/contrib/libcbor/doc/source/conf.py diff --cc contrib/libcbor/doc/source/development.rst index 000000000000,13e91ef25762..13e91ef25762 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/development.rst +++ b/contrib/libcbor/doc/source/development.rst diff --cc contrib/libcbor/doc/source/getting_started.rst index 000000000000,3e56f2c84c08..3e56f2c84c08 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/getting_started.rst +++ b/contrib/libcbor/doc/source/getting_started.rst diff --cc contrib/libcbor/doc/source/img/win_1.png index 000000000000,1bc34e5f8de5..1bc34e5f8de5 mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/doc/source/img/win_2.png index 000000000000,f6af59949df6..f6af59949df6 mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/doc/source/img/win_3.png index 000000000000,68ba112cbae0..68ba112cbae0 mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/doc/source/img/win_4.png index 000000000000,b274be7d530b..b274be7d530b mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/doc/source/img/win_5.png index 000000000000,dffeb882f744..dffeb882f744 mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/doc/source/img/win_6.png index 000000000000,850e3e2f6cc8..850e3e2f6cc8 mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/doc/source/index.rst index 000000000000,1922586097e3..1922586097e3 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/index.rst +++ b/contrib/libcbor/doc/source/index.rst diff --cc contrib/libcbor/doc/source/internal.rst index 000000000000,2c62a82b2329..2c62a82b2329 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/internal.rst +++ b/contrib/libcbor/doc/source/internal.rst diff --cc contrib/libcbor/doc/source/requirements.txt index 000000000000,461bb7e804d2..461bb7e804d2 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/requirements.txt +++ b/contrib/libcbor/doc/source/requirements.txt diff --cc contrib/libcbor/doc/source/rfc_conformance.rst index 000000000000,817614835a1f..817614835a1f mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/rfc_conformance.rst +++ b/contrib/libcbor/doc/source/rfc_conformance.rst diff --cc contrib/libcbor/doc/source/streaming.rst index 000000000000,8e3bb0d9bade..8e3bb0d9bade mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/streaming.rst +++ b/contrib/libcbor/doc/source/streaming.rst diff --cc contrib/libcbor/doc/source/streaming/decoding.rst index 000000000000,70174aa2715d..70174aa2715d mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/streaming/decoding.rst +++ b/contrib/libcbor/doc/source/streaming/decoding.rst diff --cc contrib/libcbor/doc/source/streaming/encoding.rst index 000000000000,8a56461d3584..8a56461d3584 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/streaming/encoding.rst +++ b/contrib/libcbor/doc/source/streaming/encoding.rst diff --cc contrib/libcbor/doc/source/tests.rst index 000000000000,47357ba36cd6..47357ba36cd6 mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/tests.rst +++ b/contrib/libcbor/doc/source/tests.rst diff --cc contrib/libcbor/doc/source/using.rst index 000000000000,dbc09819d46b..dbc09819d46b mode 000000,100644..100644 --- a/contrib/libcbor/doc/source/using.rst +++ b/contrib/libcbor/doc/source/using.rst diff --cc contrib/libcbor/examples/CMakeLists.txt index 000000000000,d1ddfb17b28a..d1ddfb17b28a mode 000000,100644..100644 --- a/contrib/libcbor/examples/CMakeLists.txt +++ b/contrib/libcbor/examples/CMakeLists.txt diff --cc contrib/libcbor/examples/cjson2cbor.c index 000000000000,2e3071fb47c5..2e3071fb47c5 mode 000000,100644..100644 --- a/contrib/libcbor/examples/cjson2cbor.c +++ b/contrib/libcbor/examples/cjson2cbor.c diff --cc contrib/libcbor/examples/create_items.c index 000000000000,b875720b5d91..b875720b5d91 mode 000000,100644..100644 --- a/contrib/libcbor/examples/create_items.c +++ b/contrib/libcbor/examples/create_items.c diff --cc contrib/libcbor/examples/data/floats.cbor index 000000000000,afb5e4a92f4a..afb5e4a92f4a mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/examples/data/indef_string.cbor index 000000000000,ef51440cfe21..ef51440cfe21 mode 000000,100644..100644 --- a/contrib/libcbor/examples/data/indef_string.cbor +++ b/contrib/libcbor/examples/data/indef_string.cbor diff --cc contrib/libcbor/examples/data/integer.cbor index 000000000000,d9ba7315ac8a..d9ba7315ac8a mode 000000,100644..100644 --- a/contrib/libcbor/examples/data/integer.cbor +++ b/contrib/libcbor/examples/data/integer.cbor diff --cc contrib/libcbor/examples/data/json_example.json index 000000000000,9646aad098d1..9646aad098d1 mode 000000,100644..100644 --- a/contrib/libcbor/examples/data/json_example.json +++ b/contrib/libcbor/examples/data/json_example.json diff --cc contrib/libcbor/examples/data/map.cbor index 000000000000,699abb42b598..699abb42b598 mode 000000,100644..100644 Binary files differ diff --cc contrib/libcbor/examples/data/nested_array.cbor index 000000000000,6c9f0d7acf59..6c9f0d7acf59 mode 000000,100644..100644 --- a/contrib/libcbor/examples/data/nested_array.cbor +++ b/contrib/libcbor/examples/data/nested_array.cbor diff --cc contrib/libcbor/examples/data/tagged_date.cbor index 000000000000,d2fbff8927a3..d2fbff8927a3 mode 000000,100644..100644 --- a/contrib/libcbor/examples/data/tagged_date.cbor +++ b/contrib/libcbor/examples/data/tagged_date.cbor diff --cc contrib/libcbor/examples/hello.c index 000000000000,275267445dac..275267445dac mode 000000,100644..100644 --- a/contrib/libcbor/examples/hello.c +++ b/contrib/libcbor/examples/hello.c diff --cc contrib/libcbor/examples/readfile.c index 000000000000,213ee77f0fdd..213ee77f0fdd mode 000000,100644..100644 --- a/contrib/libcbor/examples/readfile.c +++ b/contrib/libcbor/examples/readfile.c diff --cc contrib/libcbor/examples/sort.c index 000000000000,d5e3aaff9dbe..d5e3aaff9dbe mode 000000,100644..100644 --- a/contrib/libcbor/examples/sort.c +++ b/contrib/libcbor/examples/sort.c diff --cc contrib/libcbor/examples/streaming_parser.c index 000000000000,fe3ab853d978..fe3ab853d978 mode 000000,100644..100644 --- a/contrib/libcbor/examples/streaming_parser.c +++ b/contrib/libcbor/examples/streaming_parser.c diff --cc contrib/libcbor/misc/bytes.rb index 000000000000,ed453a4fcd81..ed453a4fcd81 mode 000000,100755..100755 --- a/contrib/libcbor/misc/bytes.rb +++ b/contrib/libcbor/misc/bytes.rb diff --cc contrib/libcbor/misc/file_to_bytes.rb index 000000000000,047c91054f5e..047c91054f5e mode 000000,100755..100755 --- a/contrib/libcbor/misc/file_to_bytes.rb +++ b/contrib/libcbor/misc/file_to_bytes.rb diff --cc contrib/libcbor/misc/hooks/pre-commit index 000000000000,f3ac9f483799..f3ac9f483799 mode 000000,100755..100755 --- a/contrib/libcbor/misc/hooks/pre-commit +++ b/contrib/libcbor/misc/hooks/pre-commit diff --cc contrib/libcbor/misc/repeat.rb index 000000000000,fa3da5dbdffb..fa3da5dbdffb mode 000000,100755..100755 --- a/contrib/libcbor/misc/repeat.rb +++ b/contrib/libcbor/misc/repeat.rb diff --cc contrib/libcbor/misc/seq.rb index 000000000000,0902eb0d96f5..0902eb0d96f5 mode 000000,100755..100755 --- a/contrib/libcbor/misc/seq.rb +++ b/contrib/libcbor/misc/seq.rb diff --cc contrib/libcbor/misc/update_version.py index 000000000000,eb330215d375..eb330215d375 mode 000000,100755..100755 --- a/contrib/libcbor/misc/update_version.py +++ b/contrib/libcbor/misc/update_version.py diff --cc contrib/libcbor/oss-fuzz/build.sh index 000000000000,4b19b7203f8b..4b19b7203f8b mode 000000,100755..100755 --- a/contrib/libcbor/oss-fuzz/build.sh +++ b/contrib/libcbor/oss-fuzz/build.sh diff --cc contrib/libcbor/oss-fuzz/cbor_load_fuzzer.cc index 000000000000,b32a082bb8a9..b32a082bb8a9 mode 000000,100644..100644 --- a/contrib/libcbor/oss-fuzz/cbor_load_fuzzer.cc +++ b/contrib/libcbor/oss-fuzz/cbor_load_fuzzer.cc diff --cc contrib/libcbor/release.sh index 000000000000,2fd73d967c22..2fd73d967c22 mode 000000,100755..100755 --- a/contrib/libcbor/release.sh +++ b/contrib/libcbor/release.sh diff --cc contrib/libcbor/src/CMakeLists.txt index 000000000000,2a1492bf6ee3..2a1492bf6ee3 mode 000000,100644..100644 --- a/contrib/libcbor/src/CMakeLists.txt +++ b/contrib/libcbor/src/CMakeLists.txt diff --cc contrib/libcbor/src/allocators.c index 000000000000,43c5440ddb2a..43c5440ddb2a mode 000000,100644..100644 --- a/contrib/libcbor/src/allocators.c +++ b/contrib/libcbor/src/allocators.c diff --cc contrib/libcbor/src/cbor.c index 000000000000,76b892c6b709..76b892c6b709 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor.c +++ b/contrib/libcbor/src/cbor.c diff --cc contrib/libcbor/src/cbor.h index 000000000000,d490e6c5862e..d490e6c5862e mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor.h +++ b/contrib/libcbor/src/cbor.h diff --cc contrib/libcbor/src/cbor/arrays.c index 000000000000,c1d01afafee1..c1d01afafee1 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/arrays.c +++ b/contrib/libcbor/src/cbor/arrays.c diff --cc contrib/libcbor/src/cbor/arrays.h index 000000000000,85fe51dcd8dc..85fe51dcd8dc mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/arrays.h +++ b/contrib/libcbor/src/cbor/arrays.h diff --cc contrib/libcbor/src/cbor/bytestrings.c index 000000000000,75a737bd92ae..75a737bd92ae mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/bytestrings.c +++ b/contrib/libcbor/src/cbor/bytestrings.c diff --cc contrib/libcbor/src/cbor/bytestrings.h index 000000000000,71483f708e26..71483f708e26 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/bytestrings.h +++ b/contrib/libcbor/src/cbor/bytestrings.h diff --cc contrib/libcbor/src/cbor/callbacks.c index 000000000000,3f1f547a09ef..3f1f547a09ef mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/callbacks.c +++ b/contrib/libcbor/src/cbor/callbacks.c diff --cc contrib/libcbor/src/cbor/callbacks.h index 000000000000,9e5965f2d921..9e5965f2d921 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/callbacks.h +++ b/contrib/libcbor/src/cbor/callbacks.h diff --cc contrib/libcbor/src/cbor/common.c index 000000000000,7ccce38ac25b..7ccce38ac25b mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/common.c +++ b/contrib/libcbor/src/cbor/common.c diff --cc contrib/libcbor/src/cbor/common.h index 000000000000,1f9b79e16d9d..1f9b79e16d9d mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/common.h +++ b/contrib/libcbor/src/cbor/common.h diff --cc contrib/libcbor/src/cbor/configuration.h.in index 000000000000,6f65980aa8a2..6f65980aa8a2 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/configuration.h.in +++ b/contrib/libcbor/src/cbor/configuration.h.in diff --cc contrib/libcbor/src/cbor/data.h index 000000000000,982e6a2c9987..982e6a2c9987 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/data.h +++ b/contrib/libcbor/src/cbor/data.h diff --cc contrib/libcbor/src/cbor/encoding.c index 000000000000,19281520edd9..19281520edd9 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/encoding.c +++ b/contrib/libcbor/src/cbor/encoding.c diff --cc contrib/libcbor/src/cbor/encoding.h index 000000000000,e4f2102b636a..e4f2102b636a mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/encoding.h +++ b/contrib/libcbor/src/cbor/encoding.h diff --cc contrib/libcbor/src/cbor/floats_ctrls.c index 000000000000,b7e5fcef8530..b7e5fcef8530 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/floats_ctrls.c +++ b/contrib/libcbor/src/cbor/floats_ctrls.c diff --cc contrib/libcbor/src/cbor/floats_ctrls.h index 000000000000,92eb8bc3eaa3..92eb8bc3eaa3 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/floats_ctrls.h +++ b/contrib/libcbor/src/cbor/floats_ctrls.h diff --cc contrib/libcbor/src/cbor/internal/builder_callbacks.c index 000000000000,f6c571136162..f6c571136162 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/builder_callbacks.c +++ b/contrib/libcbor/src/cbor/internal/builder_callbacks.c diff --cc contrib/libcbor/src/cbor/internal/builder_callbacks.h index 000000000000,a93afb1ca8f8..a93afb1ca8f8 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/builder_callbacks.h +++ b/contrib/libcbor/src/cbor/internal/builder_callbacks.h diff --cc contrib/libcbor/src/cbor/internal/encoders.c index 000000000000,657e25c3987a..657e25c3987a mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/encoders.c +++ b/contrib/libcbor/src/cbor/internal/encoders.c diff --cc contrib/libcbor/src/cbor/internal/encoders.h index 000000000000,14ad5015cb5a..14ad5015cb5a mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/encoders.h +++ b/contrib/libcbor/src/cbor/internal/encoders.h diff --cc contrib/libcbor/src/cbor/internal/loaders.c index 000000000000,af00f135527f..af00f135527f mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/loaders.c +++ b/contrib/libcbor/src/cbor/internal/loaders.c diff --cc contrib/libcbor/src/cbor/internal/loaders.h index 000000000000,a4c82b209f55..a4c82b209f55 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/loaders.h +++ b/contrib/libcbor/src/cbor/internal/loaders.h diff --cc contrib/libcbor/src/cbor/internal/memory_utils.c index 000000000000,918b708e3313..918b708e3313 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/memory_utils.c +++ b/contrib/libcbor/src/cbor/internal/memory_utils.c diff --cc contrib/libcbor/src/cbor/internal/memory_utils.h index 000000000000,c41ace67948f..c41ace67948f mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/memory_utils.h +++ b/contrib/libcbor/src/cbor/internal/memory_utils.h diff --cc contrib/libcbor/src/cbor/internal/stack.c index 000000000000,79c9e5e5297e..79c9e5e5297e mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/stack.c +++ b/contrib/libcbor/src/cbor/internal/stack.c diff --cc contrib/libcbor/src/cbor/internal/stack.h index 000000000000,42ed04429c7e..42ed04429c7e mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/stack.h +++ b/contrib/libcbor/src/cbor/internal/stack.h diff --cc contrib/libcbor/src/cbor/internal/unicode.c index 000000000000,98b49728989e..98b49728989e mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/unicode.c +++ b/contrib/libcbor/src/cbor/internal/unicode.c diff --cc contrib/libcbor/src/cbor/internal/unicode.h index 000000000000,5f6456029306..5f6456029306 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/internal/unicode.h +++ b/contrib/libcbor/src/cbor/internal/unicode.h diff --cc contrib/libcbor/src/cbor/ints.c index 000000000000,880982e5a3e5..880982e5a3e5 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/ints.c +++ b/contrib/libcbor/src/cbor/ints.c diff --cc contrib/libcbor/src/cbor/ints.h index 000000000000,fc7de600102e..fc7de600102e mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/ints.h +++ b/contrib/libcbor/src/cbor/ints.h diff --cc contrib/libcbor/src/cbor/maps.c index 000000000000,45140e2cfa2b..45140e2cfa2b mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/maps.c +++ b/contrib/libcbor/src/cbor/maps.c diff --cc contrib/libcbor/src/cbor/maps.h index 000000000000,370c6fcd4336..370c6fcd4336 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/maps.h +++ b/contrib/libcbor/src/cbor/maps.h diff --cc contrib/libcbor/src/cbor/serialization.c index 000000000000,56a48176aab4..56a48176aab4 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/serialization.c +++ b/contrib/libcbor/src/cbor/serialization.c diff --cc contrib/libcbor/src/cbor/serialization.h index 000000000000,3f7707afca61..3f7707afca61 mode 000000,100644..100644 --- a/contrib/libcbor/src/cbor/serialization.h +++ b/contrib/libcbor/src/cbor/serialization.h diff --cc contrib/libcbor/src/cbor/streaming.c *** 213 LINES SKIPPED *** From nobody Thu Oct 7 01:24:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 833AF12BED48; Thu, 7 Oct 2021 01:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPtsH3HLdz4bnb; Thu, 7 Oct 2021 01:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 514A826DA; Thu, 7 Oct 2021 01:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1971OZjq099107; Thu, 7 Oct 2021 01:24:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1971OZIh099106; Thu, 7 Oct 2021 01:24:35 GMT (envelope-from git) Date: Thu, 7 Oct 2021 01:24:35 GMT Message-Id: <202110070124.1971OZIh099106@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: d586c978b9b4 - main - stand: fix build after recent opencrypto 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: d586c978b9b4216869e589daa5bbcc33225a0e35 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d586c978b9b4216869e589daa5bbcc33225a0e35 commit d586c978b9b4216869e589daa5bbcc33225a0e35 Author: Kyle Evans AuthorDate: 2021-10-07 01:19:47 +0000 Commit: Kyle Evans CommitDate: 2021-10-07 01:23:44 +0000 stand: fix build after recent opencrypto changes Pass the ivlen along through, and just drop this KASSERT() if we're building _STANDALONE for the time being. Fixes: 1833d6042c9a ("crypto: Permit variable-sized IVs ...") --- stand/libsa/geli/geliboot.c | 2 +- stand/libsa/geli/geliboot_crypto.c | 7 ++++--- stand/libsa/geli/geliboot_internal.h | 2 +- sys/opencrypto/xform_aes_xts.c | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/stand/libsa/geli/geliboot.c b/stand/libsa/geli/geliboot.c index 954a3ec34044..56499e96b295 100644 --- a/stand/libsa/geli/geliboot.c +++ b/stand/libsa/geli/geliboot.c @@ -345,7 +345,7 @@ geli_io(struct geli_dev *gdev, geli_op_t enc, off_t offset, u_char *buf, g_eli_key_fill(&gdev->sc, &gkey, keyno); error = geliboot_crypt(gdev->sc.sc_ealgo, enc, pbuf, secsize, - gkey.gek_key, gdev->sc.sc_ekeylen, iv); + gkey.gek_key, gdev->sc.sc_ekeylen, iv, sizeof(iv)); if (error != 0) { explicit_bzero(&gkey, sizeof(gkey)); diff --git a/stand/libsa/geli/geliboot_crypto.c b/stand/libsa/geli/geliboot_crypto.c index 8478d2754d6f..fcc5d7bcd7fb 100644 --- a/stand/libsa/geli/geliboot_crypto.c +++ b/stand/libsa/geli/geliboot_crypto.c @@ -36,7 +36,7 @@ int geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, - const u_char *key, size_t keysize, u_char *iv) + const u_char *key, size_t keysize, u_char *iv, size_t ivlen) { keyInstance aeskey; cipherInstance cipher; @@ -81,7 +81,7 @@ geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, ctxp = &xtsctx; enc_xform_aes_xts.setkey(ctxp, key, xts_len / 8); - enc_xform_aes_xts.reinit(ctxp, iv); + enc_xform_aes_xts.reinit(ctxp, iv, ivlen); switch (enc) { case GELI_DECRYPT: @@ -113,7 +113,8 @@ g_eli_crypto_cipher(u_int algo, geli_op_t enc, u_char *data, size_t datasize, u_char iv[keysize]; explicit_bzero(iv, sizeof(iv)); - return (geliboot_crypt(algo, enc, data, datasize, key, keysize, iv)); + return (geliboot_crypt(algo, enc, data, datasize, key, keysize, iv, + sizeof(iv))); } int diff --git a/stand/libsa/geli/geliboot_internal.h b/stand/libsa/geli/geliboot_internal.h index 2af74466179f..2318690297f8 100644 --- a/stand/libsa/geli/geliboot_internal.h +++ b/stand/libsa/geli/geliboot_internal.h @@ -68,6 +68,6 @@ struct geli_dev { }; int geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, - const u_char *key, size_t keysize, u_char *iv); + const u_char *key, size_t keysize, u_char *iv, size_t ivlen); #endif /* _GELIBOOT_INTERNAL_H_ */ diff --git a/sys/opencrypto/xform_aes_xts.c b/sys/opencrypto/xform_aes_xts.c index 7a79d4685d21..9894158c0b79 100644 --- a/sys/opencrypto/xform_aes_xts.c +++ b/sys/opencrypto/xform_aes_xts.c @@ -83,8 +83,10 @@ aes_xts_reinit(void *key, const uint8_t *iv, size_t ivlen) uint64_t blocknum; u_int i; +#ifndef _STANDALONE KASSERT(ivlen == sizeof(blocknum), ("%s: invalid IV length", __func__)); +#endif /* * Prepare tweak as E_k2(IV). IV is specified as LE representation From nobody Thu Oct 7 01:29:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1B09F12BF980; Thu, 7 Oct 2021 01:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPtzJ0BTbz4cQx; Thu, 7 Oct 2021 01:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA558274B; Thu, 7 Oct 2021 01:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1971Tli6099584; Thu, 7 Oct 2021 01:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1971Tl3O099583; Thu, 7 Oct 2021 01:29:47 GMT (envelope-from git) Date: Thu, 7 Oct 2021 01:29:47 GMT Message-Id: <202110070129.1971Tl3O099583@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: 0afa8e065e14 - main - Import libfido2 at 'contrib/libfido2/' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 0afa8e065e14bb8fd338d75690e0238c00167d40 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0afa8e065e14bb8fd338d75690e0238c00167d40 commit 0afa8e065e14bb8fd338d75690e0238c00167d40 Merge: d586c978b9b4 a58dee945a5d Author: Ed Maste AuthorDate: 2021-10-07 01:27:02 +0000 Commit: Ed Maste CommitDate: 2021-10-07 01:29:18 +0000 Import libfido2 at 'contrib/libfido2/' git-subtree-dir: contrib/libfido2 git-subtree-mainline: d586c978b9b4216869e589daa5bbcc33225a0e35 git-subtree-split: a58dee945a5da64d0e97f35a508928e0d17c9cc7 contrib/libfido2/CMakeLists.txt | 418 +++++ contrib/libfido2/LICENSE | 24 + contrib/libfido2/NEWS | 179 +++ contrib/libfido2/README.adoc | 93 ++ contrib/libfido2/examples/CMakeLists.txt | 69 + contrib/libfido2/examples/README.adoc | 98 ++ contrib/libfido2/examples/assert.c | 342 ++++ contrib/libfido2/examples/cred.c | 346 +++++ contrib/libfido2/examples/extern.h | 33 + contrib/libfido2/examples/info.c | 293 ++++ contrib/libfido2/examples/manifest.c | 41 + contrib/libfido2/examples/reset.c | 55 + contrib/libfido2/examples/retries.c | 48 + contrib/libfido2/examples/select.c | 214 +++ contrib/libfido2/examples/setpin.c | 54 + contrib/libfido2/examples/util.c | 413 +++++ contrib/libfido2/fuzz/CMakeLists.txt | 63 + contrib/libfido2/fuzz/Dockerfile | 12 + contrib/libfido2/fuzz/Makefile | 79 + contrib/libfido2/fuzz/README | 33 + contrib/libfido2/fuzz/build-coverage | 31 + contrib/libfido2/fuzz/dummy.h | 96 ++ contrib/libfido2/fuzz/export.gnu | 242 +++ contrib/libfido2/fuzz/functions.txt | 807 ++++++++++ contrib/libfido2/fuzz/fuzz_assert.c | 471 ++++++ contrib/libfido2/fuzz/fuzz_bio.c | 440 ++++++ contrib/libfido2/fuzz/fuzz_cred.c | 455 ++++++ contrib/libfido2/fuzz/fuzz_credman.c | 405 +++++ contrib/libfido2/fuzz/fuzz_hid.c | 215 +++ contrib/libfido2/fuzz/fuzz_largeblob.c | 270 ++++ contrib/libfido2/fuzz/fuzz_mgmt.c | 480 ++++++ contrib/libfido2/fuzz/fuzz_netlink.c | 249 +++ contrib/libfido2/fuzz/libfuzzer.c | 177 +++ contrib/libfido2/fuzz/mutator_aux.c | 326 ++++ contrib/libfido2/fuzz/mutator_aux.h | 96 ++ contrib/libfido2/fuzz/preload-fuzz.c | 104 ++ contrib/libfido2/fuzz/preload-snoop.c | 217 +++ contrib/libfido2/fuzz/prng.c | 113 ++ contrib/libfido2/fuzz/report.tgz | Bin 0 -> 303082 bytes contrib/libfido2/fuzz/summary.txt | 51 + contrib/libfido2/fuzz/udev.c | 269 ++++ contrib/libfido2/fuzz/uniform_random.c | 57 + contrib/libfido2/fuzz/wiredata_fido2.h | 633 ++++++++ contrib/libfido2/fuzz/wiredata_u2f.h | 152 ++ contrib/libfido2/fuzz/wrap.c | 582 +++++++ contrib/libfido2/fuzz/wrapped.sym | 83 + contrib/libfido2/man/CMakeLists.txt | 371 +++++ contrib/libfido2/man/NOTES | 7 + contrib/libfido2/man/dyc.css | 14 + contrib/libfido2/man/eddsa_pk_new.3 | 122 ++ contrib/libfido2/man/es256_pk_new.3 | 126 ++ contrib/libfido2/man/fido2-assert.1 | 256 +++ contrib/libfido2/man/fido2-cred.1 | 267 ++++ contrib/libfido2/man/fido2-token.1 | 388 +++++ contrib/libfido2/man/fido_assert_allow_cred.3 | 47 + contrib/libfido2/man/fido_assert_new.3 | 243 +++ contrib/libfido2/man/fido_assert_set_authdata.3 | 221 +++ contrib/libfido2/man/fido_assert_verify.3 | 79 + contrib/libfido2/man/fido_bio_dev_get_info.3 | 122 ++ contrib/libfido2/man/fido_bio_enroll_new.3 | 95 ++ contrib/libfido2/man/fido_bio_info_new.3 | 81 + contrib/libfido2/man/fido_bio_template.3 | 179 +++ contrib/libfido2/man/fido_cbor_info_new.3 | 231 +++ contrib/libfido2/man/fido_cred_exclude.3 | 60 + contrib/libfido2/man/fido_cred_new.3 | 257 +++ contrib/libfido2/man/fido_cred_set_authdata.3 | 307 ++++ contrib/libfido2/man/fido_cred_verify.3 | 69 + contrib/libfido2/man/fido_credman_metadata_new.3 | 326 ++++ contrib/libfido2/man/fido_dev_enable_entattest.3 | 98 ++ contrib/libfido2/man/fido_dev_get_assert.3 | 76 + contrib/libfido2/man/fido_dev_get_touch_begin.3 | 73 + contrib/libfido2/man/fido_dev_info_manifest.3 | 143 ++ contrib/libfido2/man/fido_dev_largeblob_get.3 | 194 +++ contrib/libfido2/man/fido_dev_make_cred.3 | 77 + contrib/libfido2/man/fido_dev_open.3 | 250 +++ contrib/libfido2/man/fido_dev_set_io_functions.3 | 134 ++ contrib/libfido2/man/fido_dev_set_pin.3 | 103 ++ contrib/libfido2/man/fido_init.3 | 52 + contrib/libfido2/man/fido_strerr.3 | 27 + contrib/libfido2/man/rs256_pk_new.3 | 122 ++ contrib/libfido2/man/style.css | 24 + contrib/libfido2/openbsd-compat/bsd-getline.c | 115 ++ contrib/libfido2/openbsd-compat/bsd-getpagesize.c | 27 + contrib/libfido2/openbsd-compat/clock_gettime.c | 32 + contrib/libfido2/openbsd-compat/endian_win32.c | 51 + contrib/libfido2/openbsd-compat/err.h | 85 + contrib/libfido2/openbsd-compat/explicit_bzero.c | 57 + .../libfido2/openbsd-compat/explicit_bzero_win32.c | 19 + contrib/libfido2/openbsd-compat/freezero.c | 30 + contrib/libfido2/openbsd-compat/getopt.h | 74 + contrib/libfido2/openbsd-compat/getopt_long.c | 523 +++++++ contrib/libfido2/openbsd-compat/hkdf.c | 124 ++ contrib/libfido2/openbsd-compat/hkdf.h | 65 + contrib/libfido2/openbsd-compat/openbsd-compat.h | 119 ++ .../libfido2/openbsd-compat/posix_ioctl_check.c | 7 + contrib/libfido2/openbsd-compat/posix_win.c | 61 + contrib/libfido2/openbsd-compat/posix_win.h | 47 + contrib/libfido2/openbsd-compat/readpassphrase.c | 214 +++ contrib/libfido2/openbsd-compat/readpassphrase.h | 44 + .../libfido2/openbsd-compat/readpassphrase_win32.c | 131 ++ contrib/libfido2/openbsd-compat/recallocarray.c | 91 ++ contrib/libfido2/openbsd-compat/strlcat.c | 63 + contrib/libfido2/openbsd-compat/strlcpy.c | 59 + contrib/libfido2/openbsd-compat/time.h | 61 + contrib/libfido2/openbsd-compat/timingsafe_bcmp.c | 35 + contrib/libfido2/openbsd-compat/types.h | 69 + contrib/libfido2/regress/CMakeLists.txt | 16 + contrib/libfido2/regress/assert.c | 553 +++++++ contrib/libfido2/regress/cred.c | 988 ++++++++++++ contrib/libfido2/regress/dev.c | 266 ++++ contrib/libfido2/src/CMakeLists.txt | 136 ++ contrib/libfido2/src/aes256.c | 215 +++ contrib/libfido2/src/assert.c | 1134 ++++++++++++++ contrib/libfido2/src/authkey.c | 97 ++ contrib/libfido2/src/bio.c | 841 ++++++++++ contrib/libfido2/src/blob.c | 133 ++ contrib/libfido2/src/blob.h | 41 + contrib/libfido2/src/buf.c | 33 + contrib/libfido2/src/cbor.c | 1635 ++++++++++++++++++++ contrib/libfido2/src/compress.c | 49 + contrib/libfido2/src/config.c | 191 +++ contrib/libfido2/src/cred.c | 1086 +++++++++++++ contrib/libfido2/src/credman.c | 767 +++++++++ contrib/libfido2/src/dev.c | 732 +++++++++ contrib/libfido2/src/diff_exports.sh | 26 + contrib/libfido2/src/ecdh.c | 207 +++ contrib/libfido2/src/eddsa.c | 172 ++ contrib/libfido2/src/err.c | 136 ++ contrib/libfido2/src/es256.c | 453 ++++++ contrib/libfido2/src/export.gnu | 234 +++ contrib/libfido2/src/export.llvm | 229 +++ contrib/libfido2/src/export.msvc | 230 +++ contrib/libfido2/src/extern.h | 240 +++ contrib/libfido2/src/fido.h | 228 +++ contrib/libfido2/src/fido/bio.h | 111 ++ contrib/libfido2/src/fido/config.h | 34 + contrib/libfido2/src/fido/credman.h | 91 ++ contrib/libfido2/src/fido/eddsa.h | 54 + contrib/libfido2/src/fido/err.h | 84 + contrib/libfido2/src/fido/es256.h | 48 + contrib/libfido2/src/fido/param.h | 117 ++ contrib/libfido2/src/fido/rs256.h | 36 + contrib/libfido2/src/fido/types.h | 281 ++++ contrib/libfido2/src/hid.c | 179 +++ contrib/libfido2/src/hid_freebsd.c | 253 +++ contrib/libfido2/src/hid_hidapi.c | 268 ++++ contrib/libfido2/src/hid_linux.c | 375 +++++ contrib/libfido2/src/hid_netbsd.c | 338 ++++ contrib/libfido2/src/hid_openbsd.c | 260 ++++ contrib/libfido2/src/hid_osx.c | 571 +++++++ contrib/libfido2/src/hid_unix.c | 76 + contrib/libfido2/src/hid_win.c | 540 +++++++ contrib/libfido2/src/info.c | 553 +++++++ contrib/libfido2/src/io.c | 288 ++++ contrib/libfido2/src/iso7816.c | 64 + contrib/libfido2/src/iso7816.h | 49 + contrib/libfido2/src/largeblob.c | 881 +++++++++++ contrib/libfido2/src/libfido2.pc.in | 12 + contrib/libfido2/src/log.c | 121 ++ contrib/libfido2/src/netlink.c | 782 ++++++++++ contrib/libfido2/src/netlink.h | 44 + contrib/libfido2/src/nfc_linux.c | 631 ++++++++ contrib/libfido2/src/packed.h | 22 + contrib/libfido2/src/pin.c | 690 +++++++++ contrib/libfido2/src/random.c | 82 + contrib/libfido2/src/reset.c | 43 + contrib/libfido2/src/rs256.c | 200 +++ contrib/libfido2/src/u2f.c | 820 ++++++++++ contrib/libfido2/src/winhello.c | 934 +++++++++++ contrib/libfido2/tools/CMakeLists.txt | 77 + contrib/libfido2/tools/assert_get.c | 316 ++++ contrib/libfido2/tools/assert_verify.c | 192 +++ contrib/libfido2/tools/base64.c | 134 ++ contrib/libfido2/tools/bio.c | 277 ++++ contrib/libfido2/tools/config.c | 149 ++ contrib/libfido2/tools/cred_make.c | 242 +++ contrib/libfido2/tools/cred_verify.c | 181 +++ contrib/libfido2/tools/credman.c | 329 ++++ contrib/libfido2/tools/extern.h | 99 ++ contrib/libfido2/tools/fido2-assert.c | 54 + contrib/libfido2/tools/fido2-attach.sh | 14 + contrib/libfido2/tools/fido2-cred.c | 52 + contrib/libfido2/tools/fido2-detach.sh | 12 + contrib/libfido2/tools/fido2-token.c | 107 ++ contrib/libfido2/tools/fido2-unprot.sh | 75 + contrib/libfido2/tools/include_check.sh | 21 + contrib/libfido2/tools/largeblob.c | 593 +++++++ contrib/libfido2/tools/pin.c | 143 ++ contrib/libfido2/tools/test.sh | 296 ++++ contrib/libfido2/tools/token.c | 576 +++++++ contrib/libfido2/tools/util.c | 591 +++++++ contrib/libfido2/udev/70-u2f.rules | 217 +++ contrib/libfido2/udev/CMakeLists.txt | 7 + contrib/libfido2/udev/check.sh | 31 + contrib/libfido2/udev/fidodevs | 126 ++ contrib/libfido2/udev/genrules.awk | 55 + contrib/libfido2/windows/build.ps1 | 272 ++++ contrib/libfido2/windows/libressl.gpg | Bin 0 -> 16425 bytes 198 files changed, 43610 insertions(+) diff --cc contrib/libfido2/CMakeLists.txt index 000000000000,101b7b33e2fc..101b7b33e2fc mode 000000,100644..100644 --- a/contrib/libfido2/CMakeLists.txt +++ b/contrib/libfido2/CMakeLists.txt diff --cc contrib/libfido2/LICENSE index 000000000000,4224f20992c0..4224f20992c0 mode 000000,100644..100644 --- a/contrib/libfido2/LICENSE +++ b/contrib/libfido2/LICENSE diff --cc contrib/libfido2/NEWS index 000000000000,a89766b72e89..a89766b72e89 mode 000000,100644..100644 --- a/contrib/libfido2/NEWS +++ b/contrib/libfido2/NEWS diff --cc contrib/libfido2/README.adoc index 000000000000,f5ffa7e4e602..f5ffa7e4e602 mode 000000,100644..100644 --- a/contrib/libfido2/README.adoc +++ b/contrib/libfido2/README.adoc diff --cc contrib/libfido2/examples/CMakeLists.txt index 000000000000,ad3d44faad6b..ad3d44faad6b mode 000000,100644..100644 --- a/contrib/libfido2/examples/CMakeLists.txt +++ b/contrib/libfido2/examples/CMakeLists.txt diff --cc contrib/libfido2/examples/README.adoc index 000000000000,bcecb22f5258..bcecb22f5258 mode 000000,100644..100644 --- a/contrib/libfido2/examples/README.adoc +++ b/contrib/libfido2/examples/README.adoc diff --cc contrib/libfido2/examples/assert.c index 000000000000,dc3fda3ac447..dc3fda3ac447 mode 000000,100644..100644 --- a/contrib/libfido2/examples/assert.c +++ b/contrib/libfido2/examples/assert.c diff --cc contrib/libfido2/examples/cred.c index 000000000000,74145c761380..74145c761380 mode 000000,100644..100644 --- a/contrib/libfido2/examples/cred.c +++ b/contrib/libfido2/examples/cred.c diff --cc contrib/libfido2/examples/extern.h index 000000000000,0ea68c4fb585..0ea68c4fb585 mode 000000,100644..100644 --- a/contrib/libfido2/examples/extern.h +++ b/contrib/libfido2/examples/extern.h diff --cc contrib/libfido2/examples/info.c index 000000000000,72b786a8bd83..72b786a8bd83 mode 000000,100644..100644 --- a/contrib/libfido2/examples/info.c +++ b/contrib/libfido2/examples/info.c diff --cc contrib/libfido2/examples/manifest.c index 000000000000,d38166a9fea9..d38166a9fea9 mode 000000,100644..100644 --- a/contrib/libfido2/examples/manifest.c +++ b/contrib/libfido2/examples/manifest.c diff --cc contrib/libfido2/examples/reset.c index 000000000000,eb341c26c0cd..eb341c26c0cd mode 000000,100644..100644 --- a/contrib/libfido2/examples/reset.c +++ b/contrib/libfido2/examples/reset.c diff --cc contrib/libfido2/examples/retries.c index 000000000000,b96118b1e154..b96118b1e154 mode 000000,100644..100644 --- a/contrib/libfido2/examples/retries.c +++ b/contrib/libfido2/examples/retries.c diff --cc contrib/libfido2/examples/select.c index 000000000000,6ede9b490a95..6ede9b490a95 mode 000000,100644..100644 --- a/contrib/libfido2/examples/select.c +++ b/contrib/libfido2/examples/select.c diff --cc contrib/libfido2/examples/setpin.c index 000000000000,4b9e792769d9..4b9e792769d9 mode 000000,100644..100644 --- a/contrib/libfido2/examples/setpin.c +++ b/contrib/libfido2/examples/setpin.c diff --cc contrib/libfido2/examples/util.c index 000000000000,caa68aa880ee..caa68aa880ee mode 000000,100644..100644 --- a/contrib/libfido2/examples/util.c +++ b/contrib/libfido2/examples/util.c diff --cc contrib/libfido2/fuzz/CMakeLists.txt index 000000000000,b1eebd55481b..b1eebd55481b mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/CMakeLists.txt +++ b/contrib/libfido2/fuzz/CMakeLists.txt diff --cc contrib/libfido2/fuzz/Dockerfile index 000000000000,895da69e4c4c..895da69e4c4c mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/Dockerfile +++ b/contrib/libfido2/fuzz/Dockerfile diff --cc contrib/libfido2/fuzz/Makefile index 000000000000,4b067c23aac2..4b067c23aac2 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/Makefile +++ b/contrib/libfido2/fuzz/Makefile diff --cc contrib/libfido2/fuzz/README index 000000000000,28fc7f8f51b2..28fc7f8f51b2 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/README +++ b/contrib/libfido2/fuzz/README diff --cc contrib/libfido2/fuzz/build-coverage index 000000000000,e0e90da02b5d..e0e90da02b5d mode 000000,100755..100755 --- a/contrib/libfido2/fuzz/build-coverage +++ b/contrib/libfido2/fuzz/build-coverage diff --cc contrib/libfido2/fuzz/dummy.h index 000000000000,981cceec37b5..981cceec37b5 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/dummy.h +++ b/contrib/libfido2/fuzz/dummy.h diff --cc contrib/libfido2/fuzz/export.gnu index 000000000000,bd70d1c7eaac..bd70d1c7eaac mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/export.gnu +++ b/contrib/libfido2/fuzz/export.gnu diff --cc contrib/libfido2/fuzz/functions.txt index 000000000000,28fe4f6af17b..28fe4f6af17b mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/functions.txt +++ b/contrib/libfido2/fuzz/functions.txt diff --cc contrib/libfido2/fuzz/fuzz_assert.c index 000000000000,1ecbde38bd0a..1ecbde38bd0a mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/fuzz_assert.c +++ b/contrib/libfido2/fuzz/fuzz_assert.c diff --cc contrib/libfido2/fuzz/fuzz_bio.c index 000000000000,ed3deec93693..ed3deec93693 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/fuzz_bio.c +++ b/contrib/libfido2/fuzz/fuzz_bio.c diff --cc contrib/libfido2/fuzz/fuzz_cred.c index 000000000000,004852d3451a..004852d3451a mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/fuzz_cred.c +++ b/contrib/libfido2/fuzz/fuzz_cred.c diff --cc contrib/libfido2/fuzz/fuzz_credman.c index 000000000000,89a37379d87f..89a37379d87f mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/fuzz_credman.c +++ b/contrib/libfido2/fuzz/fuzz_credman.c diff --cc contrib/libfido2/fuzz/fuzz_hid.c index 000000000000,6aca7ef5da5b..6aca7ef5da5b mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/fuzz_hid.c +++ b/contrib/libfido2/fuzz/fuzz_hid.c diff --cc contrib/libfido2/fuzz/fuzz_largeblob.c index 000000000000,6886261bf529..6886261bf529 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/fuzz_largeblob.c +++ b/contrib/libfido2/fuzz/fuzz_largeblob.c diff --cc contrib/libfido2/fuzz/fuzz_mgmt.c index 000000000000,28afbc6aae5f..28afbc6aae5f mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/fuzz_mgmt.c +++ b/contrib/libfido2/fuzz/fuzz_mgmt.c diff --cc contrib/libfido2/fuzz/fuzz_netlink.c index 000000000000,9b7f930cde38..9b7f930cde38 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/fuzz_netlink.c +++ b/contrib/libfido2/fuzz/fuzz_netlink.c diff --cc contrib/libfido2/fuzz/libfuzzer.c index 000000000000,09aec4ea2b68..09aec4ea2b68 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/libfuzzer.c +++ b/contrib/libfido2/fuzz/libfuzzer.c diff --cc contrib/libfido2/fuzz/mutator_aux.c index 000000000000,0dc3ae1bf054..0dc3ae1bf054 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/mutator_aux.c +++ b/contrib/libfido2/fuzz/mutator_aux.c diff --cc contrib/libfido2/fuzz/mutator_aux.h index 000000000000,6b1a98215b07..6b1a98215b07 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/mutator_aux.h +++ b/contrib/libfido2/fuzz/mutator_aux.h diff --cc contrib/libfido2/fuzz/preload-fuzz.c index 000000000000,efcb8c632605..efcb8c632605 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/preload-fuzz.c +++ b/contrib/libfido2/fuzz/preload-fuzz.c diff --cc contrib/libfido2/fuzz/preload-snoop.c index 000000000000,373acc560a60..373acc560a60 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/preload-snoop.c +++ b/contrib/libfido2/fuzz/preload-snoop.c diff --cc contrib/libfido2/fuzz/prng.c index 000000000000,61114ac94228..61114ac94228 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/prng.c +++ b/contrib/libfido2/fuzz/prng.c diff --cc contrib/libfido2/fuzz/report.tgz index 000000000000,c8d4d3f38028..c8d4d3f38028 mode 000000,100644..100644 Binary files differ diff --cc contrib/libfido2/fuzz/summary.txt index 000000000000,8516bf3723aa..8516bf3723aa mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/summary.txt +++ b/contrib/libfido2/fuzz/summary.txt diff --cc contrib/libfido2/fuzz/udev.c index 000000000000,3984d8f555ed..3984d8f555ed mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/udev.c +++ b/contrib/libfido2/fuzz/udev.c diff --cc contrib/libfido2/fuzz/uniform_random.c index 000000000000,357091c3c2f1..357091c3c2f1 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/uniform_random.c +++ b/contrib/libfido2/fuzz/uniform_random.c diff --cc contrib/libfido2/fuzz/wiredata_fido2.h index 000000000000,da905516f92a..da905516f92a mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/wiredata_fido2.h +++ b/contrib/libfido2/fuzz/wiredata_fido2.h diff --cc contrib/libfido2/fuzz/wiredata_u2f.h index 000000000000,afe418fe9d96..afe418fe9d96 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/wiredata_u2f.h +++ b/contrib/libfido2/fuzz/wiredata_u2f.h diff --cc contrib/libfido2/fuzz/wrap.c index 000000000000,5b91a64dbf4b..5b91a64dbf4b mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/wrap.c +++ b/contrib/libfido2/fuzz/wrap.c diff --cc contrib/libfido2/fuzz/wrapped.sym index 000000000000,de4f24ae0355..de4f24ae0355 mode 000000,100644..100644 --- a/contrib/libfido2/fuzz/wrapped.sym +++ b/contrib/libfido2/fuzz/wrapped.sym diff --cc contrib/libfido2/man/CMakeLists.txt index 000000000000,ad9f339e6f9b..ad9f339e6f9b mode 000000,100644..100644 --- a/contrib/libfido2/man/CMakeLists.txt +++ b/contrib/libfido2/man/CMakeLists.txt diff --cc contrib/libfido2/man/NOTES index 000000000000,5cba43663b7f..5cba43663b7f mode 000000,100644..100644 --- a/contrib/libfido2/man/NOTES +++ b/contrib/libfido2/man/NOTES diff --cc contrib/libfido2/man/dyc.css index 000000000000,1ff5b593e8d2..1ff5b593e8d2 mode 000000,100644..100644 --- a/contrib/libfido2/man/dyc.css +++ b/contrib/libfido2/man/dyc.css diff --cc contrib/libfido2/man/eddsa_pk_new.3 index 000000000000,65bf9a9f753d..65bf9a9f753d mode 000000,100644..100644 --- a/contrib/libfido2/man/eddsa_pk_new.3 +++ b/contrib/libfido2/man/eddsa_pk_new.3 diff --cc contrib/libfido2/man/es256_pk_new.3 index 000000000000,54439cd300cf..54439cd300cf mode 000000,100644..100644 --- a/contrib/libfido2/man/es256_pk_new.3 +++ b/contrib/libfido2/man/es256_pk_new.3 diff --cc contrib/libfido2/man/fido2-assert.1 index 000000000000,da47d6f19dd3..da47d6f19dd3 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido2-assert.1 +++ b/contrib/libfido2/man/fido2-assert.1 diff --cc contrib/libfido2/man/fido2-cred.1 index 000000000000,301564d688e5..301564d688e5 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido2-cred.1 +++ b/contrib/libfido2/man/fido2-cred.1 diff --cc contrib/libfido2/man/fido2-token.1 index 000000000000,43f1c0ea48b7..43f1c0ea48b7 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido2-token.1 +++ b/contrib/libfido2/man/fido2-token.1 diff --cc contrib/libfido2/man/fido_assert_allow_cred.3 index 000000000000,bbe6e4d8929a..bbe6e4d8929a mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_assert_allow_cred.3 +++ b/contrib/libfido2/man/fido_assert_allow_cred.3 diff --cc contrib/libfido2/man/fido_assert_new.3 index 000000000000,16f4e3a6e46d..16f4e3a6e46d mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_assert_new.3 +++ b/contrib/libfido2/man/fido_assert_new.3 diff --cc contrib/libfido2/man/fido_assert_set_authdata.3 index 000000000000,2f2ca5b45d6e..2f2ca5b45d6e mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_assert_set_authdata.3 +++ b/contrib/libfido2/man/fido_assert_set_authdata.3 diff --cc contrib/libfido2/man/fido_assert_verify.3 index 000000000000,82e64e12e27a..82e64e12e27a mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_assert_verify.3 +++ b/contrib/libfido2/man/fido_assert_verify.3 diff --cc contrib/libfido2/man/fido_bio_dev_get_info.3 index 000000000000,1fe3e8ebc18f..1fe3e8ebc18f mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_bio_dev_get_info.3 +++ b/contrib/libfido2/man/fido_bio_dev_get_info.3 diff --cc contrib/libfido2/man/fido_bio_enroll_new.3 index 000000000000,3db3e7acd45d..3db3e7acd45d mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_bio_enroll_new.3 +++ b/contrib/libfido2/man/fido_bio_enroll_new.3 diff --cc contrib/libfido2/man/fido_bio_info_new.3 index 000000000000,c82733337b4e..c82733337b4e mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_bio_info_new.3 +++ b/contrib/libfido2/man/fido_bio_info_new.3 diff --cc contrib/libfido2/man/fido_bio_template.3 index 000000000000,12a379e9a46a..12a379e9a46a mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_bio_template.3 +++ b/contrib/libfido2/man/fido_bio_template.3 diff --cc contrib/libfido2/man/fido_cbor_info_new.3 index 000000000000,ecba77291f53..ecba77291f53 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_cbor_info_new.3 +++ b/contrib/libfido2/man/fido_cbor_info_new.3 diff --cc contrib/libfido2/man/fido_cred_exclude.3 index 000000000000,700d6afd8746..700d6afd8746 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_cred_exclude.3 +++ b/contrib/libfido2/man/fido_cred_exclude.3 diff --cc contrib/libfido2/man/fido_cred_new.3 index 000000000000,8cecf5f29850..8cecf5f29850 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_cred_new.3 +++ b/contrib/libfido2/man/fido_cred_new.3 diff --cc contrib/libfido2/man/fido_cred_set_authdata.3 index 000000000000,91e1edbaf810..91e1edbaf810 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_cred_set_authdata.3 +++ b/contrib/libfido2/man/fido_cred_set_authdata.3 diff --cc contrib/libfido2/man/fido_cred_verify.3 index 000000000000,6b720f2132ea..6b720f2132ea mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_cred_verify.3 +++ b/contrib/libfido2/man/fido_cred_verify.3 diff --cc contrib/libfido2/man/fido_credman_metadata_new.3 index 000000000000,31f240fbbe8c..31f240fbbe8c mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_credman_metadata_new.3 +++ b/contrib/libfido2/man/fido_credman_metadata_new.3 diff --cc contrib/libfido2/man/fido_dev_enable_entattest.3 index 000000000000,7cb766d41d0c..7cb766d41d0c mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_enable_entattest.3 +++ b/contrib/libfido2/man/fido_dev_enable_entattest.3 diff --cc contrib/libfido2/man/fido_dev_get_assert.3 index 000000000000,2e33fc516e7d..2e33fc516e7d mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_get_assert.3 +++ b/contrib/libfido2/man/fido_dev_get_assert.3 diff --cc contrib/libfido2/man/fido_dev_get_touch_begin.3 index 000000000000,8372c6ff010b..8372c6ff010b mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_get_touch_begin.3 +++ b/contrib/libfido2/man/fido_dev_get_touch_begin.3 diff --cc contrib/libfido2/man/fido_dev_info_manifest.3 index 000000000000,22519e29b9fa..22519e29b9fa mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_info_manifest.3 +++ b/contrib/libfido2/man/fido_dev_info_manifest.3 diff --cc contrib/libfido2/man/fido_dev_largeblob_get.3 index 000000000000,830534ed0e7b..830534ed0e7b mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_largeblob_get.3 +++ b/contrib/libfido2/man/fido_dev_largeblob_get.3 diff --cc contrib/libfido2/man/fido_dev_make_cred.3 index 000000000000,cd156dc94f89..cd156dc94f89 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_make_cred.3 +++ b/contrib/libfido2/man/fido_dev_make_cred.3 diff --cc contrib/libfido2/man/fido_dev_open.3 index 000000000000,f2af7817d801..f2af7817d801 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_open.3 +++ b/contrib/libfido2/man/fido_dev_open.3 diff --cc contrib/libfido2/man/fido_dev_set_io_functions.3 index 000000000000,231ae2411be8..231ae2411be8 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_set_io_functions.3 +++ b/contrib/libfido2/man/fido_dev_set_io_functions.3 diff --cc contrib/libfido2/man/fido_dev_set_pin.3 index 000000000000,f5ef94ff6fb5..f5ef94ff6fb5 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_dev_set_pin.3 +++ b/contrib/libfido2/man/fido_dev_set_pin.3 diff --cc contrib/libfido2/man/fido_init.3 index 000000000000,dcfc530c59ae..dcfc530c59ae mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_init.3 +++ b/contrib/libfido2/man/fido_init.3 diff --cc contrib/libfido2/man/fido_strerr.3 index 000000000000,05c86b92a158..05c86b92a158 mode 000000,100644..100644 --- a/contrib/libfido2/man/fido_strerr.3 +++ b/contrib/libfido2/man/fido_strerr.3 diff --cc contrib/libfido2/man/rs256_pk_new.3 index 000000000000,4ad0ebe936f3..4ad0ebe936f3 mode 000000,100644..100644 --- a/contrib/libfido2/man/rs256_pk_new.3 +++ b/contrib/libfido2/man/rs256_pk_new.3 diff --cc contrib/libfido2/man/style.css index 000000000000,8c223faa9a19..8c223faa9a19 mode 000000,100644..100644 --- a/contrib/libfido2/man/style.css +++ b/contrib/libfido2/man/style.css diff --cc contrib/libfido2/openbsd-compat/bsd-getline.c index 000000000000,52b44f70ba2f..52b44f70ba2f mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/bsd-getline.c +++ b/contrib/libfido2/openbsd-compat/bsd-getline.c diff --cc contrib/libfido2/openbsd-compat/bsd-getpagesize.c index 000000000000,903bfc310fb9..903bfc310fb9 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/bsd-getpagesize.c +++ b/contrib/libfido2/openbsd-compat/bsd-getpagesize.c diff --cc contrib/libfido2/openbsd-compat/clock_gettime.c index 000000000000,ca261a65e7f1..ca261a65e7f1 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/clock_gettime.c +++ b/contrib/libfido2/openbsd-compat/clock_gettime.c diff --cc contrib/libfido2/openbsd-compat/endian_win32.c index 000000000000,9981dfafbaeb..9981dfafbaeb mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/endian_win32.c +++ b/contrib/libfido2/openbsd-compat/endian_win32.c diff --cc contrib/libfido2/openbsd-compat/err.h index 000000000000,394c7bb12f68..394c7bb12f68 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/err.h +++ b/contrib/libfido2/openbsd-compat/err.h diff --cc contrib/libfido2/openbsd-compat/explicit_bzero.c index 000000000000,ac64e69b4d18..ac64e69b4d18 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/explicit_bzero.c +++ b/contrib/libfido2/openbsd-compat/explicit_bzero.c diff --cc contrib/libfido2/openbsd-compat/explicit_bzero_win32.c index 000000000000,8017aff99991..8017aff99991 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/explicit_bzero_win32.c +++ b/contrib/libfido2/openbsd-compat/explicit_bzero_win32.c diff --cc contrib/libfido2/openbsd-compat/freezero.c index 000000000000,d1e00661fd27..d1e00661fd27 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/freezero.c +++ b/contrib/libfido2/openbsd-compat/freezero.c diff --cc contrib/libfido2/openbsd-compat/getopt.h index 000000000000,8eb12447ed64..8eb12447ed64 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/getopt.h +++ b/contrib/libfido2/openbsd-compat/getopt.h diff --cc contrib/libfido2/openbsd-compat/getopt_long.c index 000000000000,dabbb461cbe5..dabbb461cbe5 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/getopt_long.c +++ b/contrib/libfido2/openbsd-compat/getopt_long.c diff --cc contrib/libfido2/openbsd-compat/hkdf.c index 000000000000,745b420f3747..745b420f3747 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/hkdf.c +++ b/contrib/libfido2/openbsd-compat/hkdf.c diff --cc contrib/libfido2/openbsd-compat/hkdf.h index 000000000000,34450f9dd7f0..34450f9dd7f0 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/hkdf.h +++ b/contrib/libfido2/openbsd-compat/hkdf.h diff --cc contrib/libfido2/openbsd-compat/openbsd-compat.h index 000000000000,1be3aa295051..1be3aa295051 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/openbsd-compat.h +++ b/contrib/libfido2/openbsd-compat/openbsd-compat.h diff --cc contrib/libfido2/openbsd-compat/posix_ioctl_check.c index 000000000000,599a3bff3bc6..599a3bff3bc6 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/posix_ioctl_check.c +++ b/contrib/libfido2/openbsd-compat/posix_ioctl_check.c diff --cc contrib/libfido2/openbsd-compat/posix_win.c index 000000000000,eac67c2304f8..eac67c2304f8 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/posix_win.c +++ b/contrib/libfido2/openbsd-compat/posix_win.c diff --cc contrib/libfido2/openbsd-compat/posix_win.h index 000000000000,a1e0888cc7f5..a1e0888cc7f5 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/posix_win.h +++ b/contrib/libfido2/openbsd-compat/posix_win.h diff --cc contrib/libfido2/openbsd-compat/readpassphrase.c index 000000000000,8b841906a735..8b841906a735 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/readpassphrase.c +++ b/contrib/libfido2/openbsd-compat/readpassphrase.c diff --cc contrib/libfido2/openbsd-compat/readpassphrase.h index 000000000000,e4451f302ba5..e4451f302ba5 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/readpassphrase.h +++ b/contrib/libfido2/openbsd-compat/readpassphrase.h diff --cc contrib/libfido2/openbsd-compat/readpassphrase_win32.c index 000000000000,968987c563ab..968987c563ab mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/readpassphrase_win32.c +++ b/contrib/libfido2/openbsd-compat/readpassphrase_win32.c diff --cc contrib/libfido2/openbsd-compat/recallocarray.c index 000000000000,5d2f8d9885fd..5d2f8d9885fd mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/recallocarray.c +++ b/contrib/libfido2/openbsd-compat/recallocarray.c diff --cc contrib/libfido2/openbsd-compat/strlcat.c index 000000000000,44470debc972..44470debc972 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/strlcat.c +++ b/contrib/libfido2/openbsd-compat/strlcat.c diff --cc contrib/libfido2/openbsd-compat/strlcpy.c index 000000000000,a8b18eaccf8f..a8b18eaccf8f mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/strlcpy.c +++ b/contrib/libfido2/openbsd-compat/strlcpy.c diff --cc contrib/libfido2/openbsd-compat/time.h index 000000000000,b125f73a7072..b125f73a7072 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/time.h +++ b/contrib/libfido2/openbsd-compat/time.h diff --cc contrib/libfido2/openbsd-compat/timingsafe_bcmp.c index 000000000000,3f7b9e541cec..3f7b9e541cec mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/timingsafe_bcmp.c +++ b/contrib/libfido2/openbsd-compat/timingsafe_bcmp.c diff --cc contrib/libfido2/openbsd-compat/types.h index 000000000000,617023078be3..617023078be3 mode 000000,100644..100644 --- a/contrib/libfido2/openbsd-compat/types.h +++ b/contrib/libfido2/openbsd-compat/types.h diff --cc contrib/libfido2/regress/CMakeLists.txt index 000000000000,0314c38f7161..0314c38f7161 mode 000000,100644..100644 --- a/contrib/libfido2/regress/CMakeLists.txt +++ b/contrib/libfido2/regress/CMakeLists.txt diff --cc contrib/libfido2/regress/assert.c index 000000000000,dfaf50662c76..dfaf50662c76 mode 000000,100644..100644 --- a/contrib/libfido2/regress/assert.c +++ b/contrib/libfido2/regress/assert.c diff --cc contrib/libfido2/regress/cred.c index 000000000000,01df1ef9320d..01df1ef9320d mode 000000,100644..100644 --- a/contrib/libfido2/regress/cred.c +++ b/contrib/libfido2/regress/cred.c diff --cc contrib/libfido2/regress/dev.c index 000000000000,35061aabbb64..35061aabbb64 mode 000000,100644..100644 --- a/contrib/libfido2/regress/dev.c +++ b/contrib/libfido2/regress/dev.c diff --cc contrib/libfido2/src/CMakeLists.txt index 000000000000,f9efd3f234ed..f9efd3f234ed mode 000000,100644..100644 --- a/contrib/libfido2/src/CMakeLists.txt +++ b/contrib/libfido2/src/CMakeLists.txt diff --cc contrib/libfido2/src/aes256.c index 000000000000,f093b7ce0bd5..f093b7ce0bd5 mode 000000,100644..100644 --- a/contrib/libfido2/src/aes256.c +++ b/contrib/libfido2/src/aes256.c diff --cc contrib/libfido2/src/assert.c index 000000000000,b36f8e324660..b36f8e324660 mode 000000,100644..100644 --- a/contrib/libfido2/src/assert.c +++ b/contrib/libfido2/src/assert.c diff --cc contrib/libfido2/src/authkey.c index 000000000000,c3474ccafc01..c3474ccafc01 mode 000000,100644..100644 --- a/contrib/libfido2/src/authkey.c +++ b/contrib/libfido2/src/authkey.c diff --cc contrib/libfido2/src/bio.c index 000000000000,06bc32eea7ed..06bc32eea7ed mode 000000,100644..100644 --- a/contrib/libfido2/src/bio.c +++ b/contrib/libfido2/src/bio.c diff --cc contrib/libfido2/src/blob.c index 000000000000,31e4cab0edc4..31e4cab0edc4 mode 000000,100644..100644 --- a/contrib/libfido2/src/blob.c +++ b/contrib/libfido2/src/blob.c diff --cc contrib/libfido2/src/blob.h index 000000000000,76a8dd994f22..76a8dd994f22 mode 000000,100644..100644 --- a/contrib/libfido2/src/blob.h +++ b/contrib/libfido2/src/blob.h diff --cc contrib/libfido2/src/buf.c index 000000000000,f7161e64a9ca..f7161e64a9ca mode 000000,100644..100644 --- a/contrib/libfido2/src/buf.c +++ b/contrib/libfido2/src/buf.c diff --cc contrib/libfido2/src/cbor.c index 000000000000,5c1b11583e7b..5c1b11583e7b mode 000000,100644..100644 --- a/contrib/libfido2/src/cbor.c +++ b/contrib/libfido2/src/cbor.c diff --cc contrib/libfido2/src/compress.c index 000000000000,ee5501b4a4a1..ee5501b4a4a1 mode 000000,100644..100644 --- a/contrib/libfido2/src/compress.c +++ b/contrib/libfido2/src/compress.c diff --cc contrib/libfido2/src/config.c index 000000000000,0dda16163bc8..0dda16163bc8 mode 000000,100644..100644 --- a/contrib/libfido2/src/config.c +++ b/contrib/libfido2/src/config.c diff --cc contrib/libfido2/src/cred.c index 000000000000,5e65b08293b1..5e65b08293b1 mode 000000,100644..100644 --- a/contrib/libfido2/src/cred.c +++ b/contrib/libfido2/src/cred.c diff --cc contrib/libfido2/src/credman.c index 000000000000,e48ca4543b10..e48ca4543b10 mode 000000,100644..100644 --- a/contrib/libfido2/src/credman.c +++ b/contrib/libfido2/src/credman.c diff --cc contrib/libfido2/src/dev.c index 000000000000,a003854f89d2..a003854f89d2 mode 000000,100644..100644 --- a/contrib/libfido2/src/dev.c +++ b/contrib/libfido2/src/dev.c diff --cc contrib/libfido2/src/diff_exports.sh index 000000000000,9cff0095a201..9cff0095a201 mode 000000,100755..100755 --- a/contrib/libfido2/src/diff_exports.sh +++ b/contrib/libfido2/src/diff_exports.sh diff --cc contrib/libfido2/src/ecdh.c index 000000000000,3ea47ae6457e..3ea47ae6457e mode 000000,100644..100644 --- a/contrib/libfido2/src/ecdh.c +++ b/contrib/libfido2/src/ecdh.c diff --cc contrib/libfido2/src/eddsa.c index 000000000000,89b84c5a6bd4..89b84c5a6bd4 mode 000000,100644..100644 --- a/contrib/libfido2/src/eddsa.c +++ b/contrib/libfido2/src/eddsa.c diff --cc contrib/libfido2/src/err.c index 000000000000,8c2ae5ff4170..8c2ae5ff4170 mode 000000,100644..100644 --- a/contrib/libfido2/src/err.c +++ b/contrib/libfido2/src/err.c diff --cc contrib/libfido2/src/es256.c index 000000000000,9cdb48e4832d..9cdb48e4832d mode 000000,100644..100644 --- a/contrib/libfido2/src/es256.c +++ b/contrib/libfido2/src/es256.c diff --cc contrib/libfido2/src/export.gnu index 000000000000,40dc7915e6e2..40dc7915e6e2 mode 000000,100644..100644 --- a/contrib/libfido2/src/export.gnu +++ b/contrib/libfido2/src/export.gnu diff --cc contrib/libfido2/src/export.llvm index 000000000000,8d3810f92ce9..8d3810f92ce9 mode 000000,100644..100644 --- a/contrib/libfido2/src/export.llvm +++ b/contrib/libfido2/src/export.llvm diff --cc contrib/libfido2/src/export.msvc index 000000000000,ca4971dec2d1..ca4971dec2d1 mode 000000,100644..100644 --- a/contrib/libfido2/src/export.msvc +++ b/contrib/libfido2/src/export.msvc diff --cc contrib/libfido2/src/extern.h index 000000000000,3be33236f2b1..3be33236f2b1 mode 000000,100644..100644 --- a/contrib/libfido2/src/extern.h +++ b/contrib/libfido2/src/extern.h diff --cc contrib/libfido2/src/fido.h index 000000000000,d5446516f972..d5446516f972 mode 000000,100644..100644 --- a/contrib/libfido2/src/fido.h +++ b/contrib/libfido2/src/fido.h diff --cc contrib/libfido2/src/fido/bio.h index 000000000000,afe9ca4752b4..afe9ca4752b4 mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/bio.h +++ b/contrib/libfido2/src/fido/bio.h diff --cc contrib/libfido2/src/fido/config.h index 000000000000,869927df914b..869927df914b mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/config.h +++ b/contrib/libfido2/src/fido/config.h diff --cc contrib/libfido2/src/fido/credman.h index 000000000000,66a966970501..66a966970501 mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/credman.h +++ b/contrib/libfido2/src/fido/credman.h diff --cc contrib/libfido2/src/fido/eddsa.h index 000000000000,4a810179b6fa..4a810179b6fa mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/eddsa.h +++ b/contrib/libfido2/src/fido/eddsa.h diff --cc contrib/libfido2/src/fido/err.h index 000000000000,74fdf9d2bfe8..74fdf9d2bfe8 mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/err.h +++ b/contrib/libfido2/src/fido/err.h diff --cc contrib/libfido2/src/fido/es256.h index 000000000000,80f4db39c7b0..80f4db39c7b0 mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/es256.h +++ b/contrib/libfido2/src/fido/es256.h diff --cc contrib/libfido2/src/fido/param.h index 000000000000,025bb57dd81c..025bb57dd81c mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/param.h +++ b/contrib/libfido2/src/fido/param.h diff --cc contrib/libfido2/src/fido/rs256.h index 000000000000,2b08d59980c1..2b08d59980c1 mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/rs256.h +++ b/contrib/libfido2/src/fido/rs256.h diff --cc contrib/libfido2/src/fido/types.h index 000000000000,00b6058c7e13..00b6058c7e13 mode 000000,100644..100644 --- a/contrib/libfido2/src/fido/types.h +++ b/contrib/libfido2/src/fido/types.h diff --cc contrib/libfido2/src/hid.c index 000000000000,a3768ad3cae8..a3768ad3cae8 mode 000000,100644..100644 --- a/contrib/libfido2/src/hid.c +++ b/contrib/libfido2/src/hid.c diff --cc contrib/libfido2/src/hid_freebsd.c index 000000000000,86c1854e9c8c..86c1854e9c8c mode 000000,100644..100644 --- a/contrib/libfido2/src/hid_freebsd.c +++ b/contrib/libfido2/src/hid_freebsd.c diff --cc contrib/libfido2/src/hid_hidapi.c index 000000000000,f6d21711e152..f6d21711e152 mode 000000,100644..100644 --- a/contrib/libfido2/src/hid_hidapi.c +++ b/contrib/libfido2/src/hid_hidapi.c diff --cc contrib/libfido2/src/hid_linux.c index 000000000000,c622880a2594..c622880a2594 mode 000000,100644..100644 --- a/contrib/libfido2/src/hid_linux.c +++ b/contrib/libfido2/src/hid_linux.c diff --cc contrib/libfido2/src/hid_netbsd.c index 000000000000,c24c6de7ce29..c24c6de7ce29 mode 000000,100644..100644 --- a/contrib/libfido2/src/hid_netbsd.c +++ b/contrib/libfido2/src/hid_netbsd.c diff --cc contrib/libfido2/src/hid_openbsd.c index 000000000000,fbf10fd11ab9..fbf10fd11ab9 mode 000000,100644..100644 --- a/contrib/libfido2/src/hid_openbsd.c +++ b/contrib/libfido2/src/hid_openbsd.c diff --cc contrib/libfido2/src/hid_osx.c index 000000000000,e9866658a4eb..e9866658a4eb mode 000000,100644..100644 --- a/contrib/libfido2/src/hid_osx.c +++ b/contrib/libfido2/src/hid_osx.c diff --cc contrib/libfido2/src/hid_unix.c index 000000000000,4b2aff9d67f6..4b2aff9d67f6 mode 000000,100644..100644 --- a/contrib/libfido2/src/hid_unix.c +++ b/contrib/libfido2/src/hid_unix.c diff --cc contrib/libfido2/src/hid_win.c index 000000000000,455cf8bae835..455cf8bae835 mode 000000,100644..100644 --- a/contrib/libfido2/src/hid_win.c +++ b/contrib/libfido2/src/hid_win.c diff --cc contrib/libfido2/src/info.c index 000000000000,57bc8de44063..57bc8de44063 mode 000000,100644..100644 --- a/contrib/libfido2/src/info.c +++ b/contrib/libfido2/src/info.c diff --cc contrib/libfido2/src/io.c index 000000000000,e2594203efb0..e2594203efb0 mode 000000,100644..100644 --- a/contrib/libfido2/src/io.c +++ b/contrib/libfido2/src/io.c diff --cc contrib/libfido2/src/iso7816.c *** 218 LINES SKIPPED *** From nobody Thu Oct 7 01:41:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1307412D0ADB; Thu, 7 Oct 2021 01:41: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 4HPvDg00Wpz4dgR; Thu, 7 Oct 2021 01:41:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D49652D53; Thu, 7 Oct 2021 01:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1971fMOH021791; Thu, 7 Oct 2021 01:41:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1971fMKu021790; Thu, 7 Oct 2021 01:41:22 GMT (envelope-from git) Date: Thu, 7 Oct 2021 01:41:22 GMT Message-Id: <202110070141.1971fMKu021790@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: 224a95f12427 - main - libfido2: Address CHERI 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 224a95f124270275ddd7ab9f8f87dd47bad7c282 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=224a95f124270275ddd7ab9f8f87dd47bad7c282 commit 224a95f124270275ddd7ab9f8f87dd47bad7c282 Author: Jessica Clarke AuthorDate: 2021-10-02 15:51:38 +0000 Commit: Ed Maste CommitDate: 2021-10-07 01:40:26 +0000 libfido2: Address CHERI compatibility Cherry-picked from libfido2 upstream f20a735c0a6f: iso7816: Avoid storing pointers in a packed structure On CHERI, and thus Arm's experimental Morello prototype architecture, pointers are represented as capabilities, which are unforgeable bounded pointers, providing always-on fine-grained spatial memory safety. The unforgeability is enforced through the use of tagged memory, with one validity tag bit per capability-sized-and-aligned word in memory. This means that storing a pointer to an unaligned location, which is not guaranteed to work per the C standard, either traps or results in the capability losing its tag (and thus never being dereferenceable again), depending on how exactly the store is done (specifically, whether a capability store or memcpy is used). However, iso7816 itself does not need to be packed, and doing so likely causes inefficiencies on existing architectures. The iso7816_header_t member is packed, and the flexible payload array is a uint8_t (which by definition has no padding bits and is exactly 8 bits in size and, since CHAR_BITS must be at least 8, its existence implies that it has the same representation as unsigned char, and that it has size and alignment 1) so there will never be any padding inserted between header and payload (but payload may overlap with padding at the end of the struct due to how flexible arrays work, which means we need to be careful about our calculations). Co-authored-by: pedro martelletto --- contrib/libfido2/src/iso7816.c | 4 ++-- contrib/libfido2/src/iso7816.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/contrib/libfido2/src/iso7816.c b/contrib/libfido2/src/iso7816.c index a11aae3e99d1..a4902277c6d8 100644 --- a/contrib/libfido2/src/iso7816.c +++ b/contrib/libfido2/src/iso7816.c @@ -59,6 +59,6 @@ iso7816_ptr(const iso7816_apdu_t *apdu) size_t iso7816_len(const iso7816_apdu_t *apdu) { - return apdu->alloc_len - sizeof(apdu->alloc_len) - - sizeof(apdu->payload_len) - sizeof(apdu->payload_ptr); + return apdu->alloc_len - offsetof(iso7816_apdu_t, header) - + (sizeof(iso7816_apdu_t) - offsetof(iso7816_apdu_t, payload)); } diff --git a/contrib/libfido2/src/iso7816.h b/contrib/libfido2/src/iso7816.h index 5f5363a63a56..9bfad1fbab9d 100644 --- a/contrib/libfido2/src/iso7816.h +++ b/contrib/libfido2/src/iso7816.h @@ -27,14 +27,13 @@ struct iso7816_header { uint8_t lc3; }) -PACKED_TYPE(iso7816_apdu_t, -struct iso7816_apdu { +typedef struct iso7816_apdu { size_t alloc_len; uint16_t payload_len; uint8_t *payload_ptr; iso7816_header_t header; uint8_t payload[]; -}) +} iso7816_apdu_t; const unsigned char *iso7816_ptr(const iso7816_apdu_t *); int iso7816_add(iso7816_apdu_t *, const void *, size_t); From nobody Thu Oct 7 01:46:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F293412D167A; Thu, 7 Oct 2021 01:46: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 4HPvL56SGCz4f90; Thu, 7 Oct 2021 01:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDB342A64; Thu, 7 Oct 2021 01:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1971k5Y2025574; Thu, 7 Oct 2021 01:46:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1971k51N025573; Thu, 7 Oct 2021 01:46:05 GMT (envelope-from git) Date: Thu, 7 Oct 2021 01:46:05 GMT Message-Id: <202110070146.1971k51N025573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 3f66b96d8658 - main - ixgbe: Update shared code catchup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f66b96d8658f8721e6b1c6f035611bec44675b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3f66b96d8658f8721e6b1c6f035611bec44675b9 commit 3f66b96d8658f8721e6b1c6f035611bec44675b9 Author: Kevin Bowling AuthorDate: 2021-10-07 01:43:27 +0000 Commit: Kevin Bowling CommitDate: 2021-10-07 01:45:55 +0000 ixgbe: Update shared code catchup Leftovers from DPDK sync Reviewed by: grehan Obtained from: DPDK MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D31621 --- sys/dev/ixgbe/ixgbe_82599.c | 5 ++ sys/dev/ixgbe/ixgbe_api.c | 54 ++++++++++++++ sys/dev/ixgbe/ixgbe_api.h | 3 + sys/dev/ixgbe/ixgbe_common.c | 174 ++++++++++++++++++++++++++++++++++++++++++- sys/dev/ixgbe/ixgbe_common.h | 14 +++- sys/dev/ixgbe/ixgbe_dcb.c | 20 ----- sys/dev/ixgbe/ixgbe_mbx.c | 116 ++++++++++++++++++++++++++++- sys/dev/ixgbe/ixgbe_mbx.h | 7 ++ sys/dev/ixgbe/ixgbe_phy.c | 11 ++- sys/dev/ixgbe/ixgbe_phy.h | 2 - sys/dev/ixgbe/ixgbe_type.h | 52 +++++++++++-- sys/dev/ixgbe/ixgbe_vf.c | 4 - sys/dev/ixgbe/ixgbe_x540.c | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 12 ++- 14 files changed, 427 insertions(+), 49 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 9eb3904a30f9..698602080592 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -395,6 +395,11 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) /* Manageability interface */ mac->ops.set_fw_drv_ver = ixgbe_set_fw_drv_ver_generic; + mac->ops.get_thermal_sensor_data = + ixgbe_get_thermal_sensor_data_generic; + mac->ops.init_thermal_sensor_thresh = + ixgbe_init_thermal_sensor_thresh_generic; + mac->ops.bypass_rw = ixgbe_bypass_rw_generic; mac->ops.bypass_valid_rd = ixgbe_bypass_valid_rd_generic; mac->ops.bypass_set = ixgbe_bypass_set_generic; diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index 5a425f087f1a..87b213a99b0e 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -113,6 +113,13 @@ s32 ixgbe_init_shared_code(struct ixgbe_hw *hw) case ixgbe_mac_X550EM_a: status = ixgbe_init_ops_X550EM_a(hw); break; + case ixgbe_mac_82599_vf: + case ixgbe_mac_X540_vf: + case ixgbe_mac_X550_vf: + case ixgbe_mac_X550EM_x_vf: + case ixgbe_mac_X550EM_a_vf: + status = ixgbe_init_ops_vf(hw); + break; default: status = IXGBE_ERR_DEVICE_NOT_SUPPORTED; break; @@ -176,6 +183,15 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *hw) case IXGBE_DEV_ID_82599_T3_LOM: hw->mac.type = ixgbe_mac_82599EB; break; + case IXGBE_DEV_ID_82599_VF: + case IXGBE_DEV_ID_82599_VF_HV: + hw->mac.type = ixgbe_mac_82599_vf; + break; + case IXGBE_DEV_ID_X540_VF: + case IXGBE_DEV_ID_X540_VF_HV: + hw->mac.type = ixgbe_mac_X540_vf; + hw->mvals = ixgbe_mvals_X540; + break; case IXGBE_DEV_ID_X540T: case IXGBE_DEV_ID_X540T1: case IXGBE_DEV_ID_X540_BYPASS: @@ -210,6 +226,21 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *hw) hw->mac.type = ixgbe_mac_X550EM_a; hw->mvals = ixgbe_mvals_X550EM_a; break; + case IXGBE_DEV_ID_X550_VF: + case IXGBE_DEV_ID_X550_VF_HV: + hw->mac.type = ixgbe_mac_X550_vf; + hw->mvals = ixgbe_mvals_X550; + break; + case IXGBE_DEV_ID_X550EM_X_VF: + case IXGBE_DEV_ID_X550EM_X_VF_HV: + hw->mac.type = ixgbe_mac_X550EM_x_vf; + hw->mvals = ixgbe_mvals_X550EM_x; + break; + case IXGBE_DEV_ID_X550EM_A_VF: + case IXGBE_DEV_ID_X550EM_A_VF_HV: + hw->mac.type = ixgbe_mac_X550EM_a_vf; + hw->mvals = ixgbe_mvals_X550EM_a; + break; default: ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED; ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED, @@ -1146,6 +1177,29 @@ s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, } +/** + * ixgbe_get_thermal_sensor_data - Gathers thermal sensor data + * @hw: pointer to hardware structure + * + * Updates the temperatures in mac.thermal_sensor_data + **/ +s32 ixgbe_get_thermal_sensor_data(struct ixgbe_hw *hw) +{ + return ixgbe_call_func(hw, hw->mac.ops.get_thermal_sensor_data, (hw), + IXGBE_NOT_IMPLEMENTED); +} + +/** + * ixgbe_init_thermal_sensor_thresh - Inits thermal sensor thresholds + * @hw: pointer to hardware structure + * + * Inits the thermal sensor thresholds according to the NVM map + **/ +s32 ixgbe_init_thermal_sensor_thresh(struct ixgbe_hw *hw) +{ + return ixgbe_call_func(hw, hw->mac.ops.init_thermal_sensor_thresh, (hw), + IXGBE_NOT_IMPLEMENTED); +} /** * ixgbe_dmac_config - Configure DMA Coalescing registers. diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index c70f27c6aa2c..7fd300bfe4ee 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -49,6 +49,7 @@ extern s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw); extern s32 ixgbe_init_ops_X550EM(struct ixgbe_hw *hw); extern s32 ixgbe_init_ops_X550EM_x(struct ixgbe_hw *hw); extern s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw); +extern s32 ixgbe_init_ops_vf(struct ixgbe_hw *hw); s32 ixgbe_set_mac_type(struct ixgbe_hw *hw); s32 ixgbe_init_hw(struct ixgbe_hw *hw); @@ -135,6 +136,8 @@ s32 ixgbe_fc_enable(struct ixgbe_hw *hw); s32 ixgbe_setup_fc(struct ixgbe_hw *hw); s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, u8 ver, u16 len, char *driver_ver); +s32 ixgbe_get_thermal_sensor_data(struct ixgbe_hw *hw); +s32 ixgbe_init_thermal_sensor_thresh(struct ixgbe_hw *hw); void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr); s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, u16 *firmware_version); diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 50e18bcba997..0ad538a465ea 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4132,7 +4132,7 @@ s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw) for (offset = 0; offset < IXGBE_VLVF_ENTRIES; offset++) { IXGBE_WRITE_REG(hw, IXGBE_VLVF(offset), 0); IXGBE_WRITE_REG(hw, IXGBE_VLVFB(offset * 2), 0); - IXGBE_WRITE_REG(hw, IXGBE_VLVFB((offset * 2) + 1), 0); + IXGBE_WRITE_REG(hw, IXGBE_VLVFB(offset * 2 + 1), 0); } return IXGBE_SUCCESS; @@ -4626,7 +4626,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, /* first pull in the header so we know the buffer length */ for (bi = 0; bi < dword_len; bi++) { buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); - IXGBE_LE32_TO_CPUS(&buffer[bi]); + IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]); } /* @@ -4662,7 +4662,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, /* Pull in the rest of the buffer (bi is where we left off) */ for (; bi <= dword_len; bi++) { buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); - IXGBE_LE32_TO_CPUS(&buffer[bi]); + IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]); } rel_out: @@ -4852,6 +4852,174 @@ out: IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); } +static const u8 ixgbe_emc_temp_data[4] = { + IXGBE_EMC_INTERNAL_DATA, + IXGBE_EMC_DIODE1_DATA, + IXGBE_EMC_DIODE2_DATA, + IXGBE_EMC_DIODE3_DATA +}; +static const u8 ixgbe_emc_therm_limit[4] = { + IXGBE_EMC_INTERNAL_THERM_LIMIT, + IXGBE_EMC_DIODE1_THERM_LIMIT, + IXGBE_EMC_DIODE2_THERM_LIMIT, + IXGBE_EMC_DIODE3_THERM_LIMIT +}; + +/** + * ixgbe_get_thermal_sensor_data - Gathers thermal sensor data + * @hw: pointer to hardware structure + * + * Returns the thermal sensor data structure + **/ +s32 ixgbe_get_thermal_sensor_data_generic(struct ixgbe_hw *hw) +{ + s32 status = IXGBE_SUCCESS; + u16 ets_offset; + u16 ets_cfg; + u16 ets_sensor; + u8 num_sensors; + u8 sensor_index; + u8 sensor_location; + u8 i; + struct ixgbe_thermal_sensor_data *data = &hw->mac.thermal_sensor_data; + + DEBUGFUNC("ixgbe_get_thermal_sensor_data_generic"); + + /* Only support thermal sensors attached to 82599 physical port 0 */ + if ((hw->mac.type != ixgbe_mac_82599EB) || + (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1)) { + status = IXGBE_NOT_IMPLEMENTED; + goto out; + } + + status = hw->eeprom.ops.read(hw, IXGBE_ETS_CFG, &ets_offset); + if (status) + goto out; + + if ((ets_offset == 0x0000) || (ets_offset == 0xFFFF)) { + status = IXGBE_NOT_IMPLEMENTED; + goto out; + } + + status = hw->eeprom.ops.read(hw, ets_offset, &ets_cfg); + if (status) + goto out; + + if (((ets_cfg & IXGBE_ETS_TYPE_MASK) >> IXGBE_ETS_TYPE_SHIFT) + != IXGBE_ETS_TYPE_EMC) { + status = IXGBE_NOT_IMPLEMENTED; + goto out; + } + + num_sensors = (ets_cfg & IXGBE_ETS_NUM_SENSORS_MASK); + if (num_sensors > IXGBE_MAX_SENSORS) + num_sensors = IXGBE_MAX_SENSORS; + + for (i = 0; i < num_sensors; i++) { + status = hw->eeprom.ops.read(hw, (ets_offset + 1 + i), + &ets_sensor); + if (status) + goto out; + + sensor_index = ((ets_sensor & IXGBE_ETS_DATA_INDEX_MASK) >> + IXGBE_ETS_DATA_INDEX_SHIFT); + sensor_location = ((ets_sensor & IXGBE_ETS_DATA_LOC_MASK) >> + IXGBE_ETS_DATA_LOC_SHIFT); + + if (sensor_location != 0) { + status = hw->phy.ops.read_i2c_byte(hw, + ixgbe_emc_temp_data[sensor_index], + IXGBE_I2C_THERMAL_SENSOR_ADDR, + &data->sensor[i].temp); + if (status) + goto out; + } + } +out: + return status; +} + +/** + * ixgbe_init_thermal_sensor_thresh_generic - Inits thermal sensor thresholds + * @hw: pointer to hardware structure + * + * Inits the thermal sensor thresholds according to the NVM map + * and save off the threshold and location values into mac.thermal_sensor_data + **/ +s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw) +{ + s32 status = IXGBE_SUCCESS; + u16 offset; + u16 ets_offset; + u16 ets_cfg; + u16 ets_sensor; + u8 low_thresh_delta; + u8 num_sensors; + u8 sensor_index; + u8 sensor_location; + u8 therm_limit; + u8 i; + struct ixgbe_thermal_sensor_data *data = &hw->mac.thermal_sensor_data; + + DEBUGFUNC("ixgbe_init_thermal_sensor_thresh_generic"); + + memset(data, 0, sizeof(struct ixgbe_thermal_sensor_data)); + + /* Only support thermal sensors attached to 82599 physical port 0 */ + if ((hw->mac.type != ixgbe_mac_82599EB) || + (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1)) + return IXGBE_NOT_IMPLEMENTED; + + offset = IXGBE_ETS_CFG; + if (hw->eeprom.ops.read(hw, offset, &ets_offset)) + goto eeprom_err; + if ((ets_offset == 0x0000) || (ets_offset == 0xFFFF)) + return IXGBE_NOT_IMPLEMENTED; + + offset = ets_offset; + if (hw->eeprom.ops.read(hw, offset, &ets_cfg)) + goto eeprom_err; + if (((ets_cfg & IXGBE_ETS_TYPE_MASK) >> IXGBE_ETS_TYPE_SHIFT) + != IXGBE_ETS_TYPE_EMC) + return IXGBE_NOT_IMPLEMENTED; + + low_thresh_delta = ((ets_cfg & IXGBE_ETS_LTHRES_DELTA_MASK) >> + IXGBE_ETS_LTHRES_DELTA_SHIFT); + num_sensors = (ets_cfg & IXGBE_ETS_NUM_SENSORS_MASK); + + for (i = 0; i < num_sensors; i++) { + offset = ets_offset + 1 + i; + if (hw->eeprom.ops.read(hw, offset, &ets_sensor)) { + ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE, + "eeprom read at offset %d failed", + offset); + continue; + } + sensor_index = ((ets_sensor & IXGBE_ETS_DATA_INDEX_MASK) >> + IXGBE_ETS_DATA_INDEX_SHIFT); + sensor_location = ((ets_sensor & IXGBE_ETS_DATA_LOC_MASK) >> + IXGBE_ETS_DATA_LOC_SHIFT); + therm_limit = ets_sensor & IXGBE_ETS_DATA_HTHRESH_MASK; + + hw->phy.ops.write_i2c_byte(hw, + ixgbe_emc_therm_limit[sensor_index], + IXGBE_I2C_THERMAL_SENSOR_ADDR, therm_limit); + + if ((i < IXGBE_MAX_SENSORS) && (sensor_location != 0)) { + data->sensor[i].location = sensor_location; + data->sensor[i].caution_thresh = therm_limit; + data->sensor[i].max_op_thresh = therm_limit - + low_thresh_delta; + } + } + return status; + +eeprom_err: + ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE, + "eeprom read at offset %d failed", offset); + return IXGBE_NOT_IMPLEMENTED; +} + /** * ixgbe_bypass_rw_generic - Bit bang data into by_pass FW * diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index 051af213b628..e5a186f73ea9 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -43,12 +43,10 @@ IXGBE_WRITE_REG(hw, reg + 4, (u32) (value >> 32)); \ } while (0) #define IXGBE_REMOVED(a) (0) -#if !defined(NO_READ_PBA_RAW) || !defined(NO_WRITE_PBA_RAW) struct ixgbe_pba { u16 word[2]; u16 *pba_block; }; -#endif void ixgbe_dcb_get_rtrup2tc_generic(struct ixgbe_hw *hw, u8 *map); @@ -180,6 +178,18 @@ extern void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw); bool ixgbe_mng_present(struct ixgbe_hw *hw); bool ixgbe_mng_enabled(struct ixgbe_hw *hw); +#define IXGBE_I2C_THERMAL_SENSOR_ADDR 0xF8 +#define IXGBE_EMC_INTERNAL_DATA 0x00 +#define IXGBE_EMC_INTERNAL_THERM_LIMIT 0x20 +#define IXGBE_EMC_DIODE1_DATA 0x01 +#define IXGBE_EMC_DIODE1_THERM_LIMIT 0x19 +#define IXGBE_EMC_DIODE2_DATA 0x23 +#define IXGBE_EMC_DIODE2_THERM_LIMIT 0x1A +#define IXGBE_EMC_DIODE3_DATA 0x2A +#define IXGBE_EMC_DIODE3_THERM_LIMIT 0x30 + +s32 ixgbe_get_thermal_sensor_data_generic(struct ixgbe_hw *hw); +s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw); void ixgbe_get_etk_id(struct ixgbe_hw *hw, struct ixgbe_nvm_version *nvm_ver); void ixgbe_get_oem_prod_version(struct ixgbe_hw *hw, diff --git a/sys/dev/ixgbe/ixgbe_dcb.c b/sys/dev/ixgbe/ixgbe_dcb.c index d096321b23c1..54102f312dbb 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.c +++ b/sys/dev/ixgbe/ixgbe_dcb.c @@ -409,10 +409,8 @@ s32 ixgbe_dcb_get_tc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ret = ixgbe_dcb_get_tc_stats_82599(hw, stats, tc_count); break; -#endif default: break; } @@ -440,10 +438,8 @@ s32 ixgbe_dcb_get_pfc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ret = ixgbe_dcb_get_pfc_stats_82599(hw, stats, tc_count); break; -#endif default: break; } @@ -482,11 +478,9 @@ s32 ixgbe_dcb_config_rx_arbiter_cee(struct ixgbe_hw *hw, case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ret = ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, bwgid, tsa, map); break; -#endif default: break; } @@ -524,11 +518,9 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_cee(struct ixgbe_hw *hw, case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ret = ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max, bwgid, tsa); break; -#endif default: break; } @@ -568,12 +560,10 @@ s32 ixgbe_dcb_config_tx_data_arbiter_cee(struct ixgbe_hw *hw, case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ret = ixgbe_dcb_config_tx_data_arbiter_82599(hw, refill, max, bwgid, tsa, map); break; -#endif default: break; } @@ -606,10 +596,8 @@ s32 ixgbe_dcb_config_pfc_cee(struct ixgbe_hw *hw, case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ret = ixgbe_dcb_config_pfc_82599(hw, pfc_en, map); break; -#endif default: break; } @@ -635,10 +623,8 @@ s32 ixgbe_dcb_config_tc_stats(struct ixgbe_hw *hw) case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ret = ixgbe_dcb_config_tc_stats_82599(hw, NULL); break; -#endif default: break; } @@ -683,7 +669,6 @@ s32 ixgbe_dcb_hw_config_cee(struct ixgbe_hw *hw, case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ixgbe_dcb_config_82599(hw, dcb_config); ret = ixgbe_dcb_hw_config_82599(hw, dcb_config->link_speed, refill, max, bwgid, @@ -691,7 +676,6 @@ s32 ixgbe_dcb_hw_config_cee(struct ixgbe_hw *hw, ixgbe_dcb_config_tc_stats_82599(hw, dcb_config); break; -#endif default: break; } @@ -718,10 +702,8 @@ s32 ixgbe_dcb_config_pfc(struct ixgbe_hw *hw, u8 pfc_en, u8 *map) case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ret = ixgbe_dcb_config_pfc_82599(hw, pfc_en, map); break; -#endif default: break; } @@ -744,7 +726,6 @@ s32 ixgbe_dcb_hw_config(struct ixgbe_hw *hw, u16 *refill, u16 *max, case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: -#if !defined(NO_82599_SUPPORT) || !defined(NO_X540_SUPPORT) ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, bwg_id, tsa, map); ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max, bwg_id, @@ -752,7 +733,6 @@ s32 ixgbe_dcb_hw_config(struct ixgbe_hw *hw, u16 *refill, u16 *max, ixgbe_dcb_config_tx_data_arbiter_82599(hw, refill, max, bwg_id, tsa, map); break; -#endif default: break; } diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index f72bbf34256a..443ebb478993 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -36,6 +36,118 @@ #include "ixgbe_type.h" #include "ixgbe_mbx.h" +/** + * ixgbe_read_mbx - Reads a message from the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfully read message from buffer + **/ +s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_MBX; + + DEBUGFUNC("ixgbe_read_mbx"); + + /* limit read to size of mailbox */ + if (size > mbx->size) + size = mbx->size; + + if (mbx->ops.read) + ret_val = mbx->ops.read(hw, msg, size, mbx_id); + + return ret_val; +} + +/** + * ixgbe_write_mbx - Write a message to the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_SUCCESS; + + DEBUGFUNC("ixgbe_write_mbx"); + + if (size > mbx->size) { + ret_val = IXGBE_ERR_MBX; + ERROR_REPORT2(IXGBE_ERROR_ARGUMENT, + "Invalid mailbox message size %d", size); + } else if (mbx->ops.write) + ret_val = mbx->ops.write(hw, msg, size, mbx_id); + + return ret_val; +} + +/** + * ixgbe_check_for_msg - checks to see if someone sent us mail + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_MBX; + + DEBUGFUNC("ixgbe_check_for_msg"); + + if (mbx->ops.check_for_msg) + ret_val = mbx->ops.check_for_msg(hw, mbx_id); + + return ret_val; +} + +/** + * ixgbe_check_for_ack - checks to see if someone sent us ACK + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_MBX; + + DEBUGFUNC("ixgbe_check_for_ack"); + + if (mbx->ops.check_for_ack) + ret_val = mbx->ops.check_for_ack(hw, mbx_id); + + return ret_val; +} + +/** + * ixgbe_check_for_rst - checks to see if other side has reset + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id) +{ + struct ixgbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = IXGBE_ERR_MBX; + + DEBUGFUNC("ixgbe_check_for_rst"); + + if (mbx->ops.check_for_rst) + ret_val = mbx->ops.check_for_rst(hw, mbx_id); + + return ret_val; +} + /** * ixgbe_poll_for_msg - Wait for message notification * @hw: pointer to the HW structure @@ -110,7 +222,7 @@ out: * returns SUCCESS if it successfully received a message notification and * copied it into the receive buffer. **/ -static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, +s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; @@ -140,7 +252,7 @@ out: * returns SUCCESS if it successfully copied message into the buffer and * received an ack to that message within delay * timeout period **/ -static s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, +s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) { struct ixgbe_mbx_info *mbx = &hw->mbx; diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index 9b3deb28f149..88387ea3f7c2 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -153,6 +153,13 @@ enum ixgbevf_xcast_modes { #define IXGBE_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */ #define IXGBE_VF_MBX_INIT_DELAY 500 /* microseconds between retries */ +s32 ixgbe_read_mbx(struct ixgbe_hw *, u32 *, u16, u16); +s32 ixgbe_write_mbx(struct ixgbe_hw *, u32 *, u16, u16); +s32 ixgbe_read_posted_mbx(struct ixgbe_hw *, u32 *, u16, u16); +s32 ixgbe_write_posted_mbx(struct ixgbe_hw *, u32 *, u16, u16); +s32 ixgbe_check_for_msg(struct ixgbe_hw *, u16); +s32 ixgbe_check_for_ack(struct ixgbe_hw *, u16); +s32 ixgbe_check_for_rst(struct ixgbe_hw *, u16); void ixgbe_init_mbx_ops_generic(struct ixgbe_hw *hw); void ixgbe_init_mbx_params_vf(struct ixgbe_hw *); void ixgbe_init_mbx_params_pf(struct ixgbe_hw *); diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index 5a2f49e9ebac..eef1d40448d3 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -1536,7 +1536,10 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) status = IXGBE_SUCCESS; } else { if (hw->allow_unsupported_sfp == true) { - EWARN(hw, "WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. Intel Corporation is not responsible for any harm caused by using untested modules.\n"); + EWARN(hw, + "WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. " + "Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. " + "Intel Corporation is not responsible for any harm caused by using untested modules.\n"); status = IXGBE_SUCCESS; } else { DEBUGOUT("SFP+ module not supported\n"); @@ -1789,7 +1792,10 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) status = IXGBE_SUCCESS; } else { if (hw->allow_unsupported_sfp == true) { - EWARN(hw, "WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. Intel Corporation is not responsible for any harm caused by using untested modules.\n"); + EWARN(hw, + "WARNING: Intel (R) Network Connections are quality tested using Intel (R) Ethernet Optics. " + "Using untested modules is not supported and may cause unstable operation or damage to the module or the adapter. " + "Intel Corporation is not responsible for any harm caused by using untested modules.\n"); status = IXGBE_SUCCESS; } else { DEBUGOUT("QSFP module not supported\n"); @@ -2571,7 +2577,6 @@ static bool ixgbe_get_i2c_data(struct ixgbe_hw *hw, u32 *i2cctl) { u32 data_oe_bit = IXGBE_I2C_DATA_OE_N_EN_BY_MAC(hw); bool data; - UNREFERENCED_1PARAMETER(hw); DEBUGFUNC("ixgbe_get_i2c_data"); diff --git a/sys/dev/ixgbe/ixgbe_phy.h b/sys/dev/ixgbe/ixgbe_phy.h index 7f51ccc1dd2c..09d7ea4afbc0 100644 --- a/sys/dev/ixgbe/ixgbe_phy.h +++ b/sys/dev/ixgbe/ixgbe_phy.h @@ -147,10 +147,8 @@ #define IXGBE_I2C_T_SU_STO 4 #define IXGBE_I2C_T_BUF 5 -#ifndef IXGBE_SFP_DETECT_RETRIES #define IXGBE_SFP_DETECT_RETRIES 10 -#endif /* IXGBE_SFP_DETECT_RETRIES */ #define IXGBE_TN_LASI_STATUS_REG 0x9005 #define IXGBE_TN_LASI_STATUS_TEMP_ALARM 0x0008 diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 1c04f09df77c..1eb446184990 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -48,8 +48,8 @@ * * - IXGBE_ERROR_POLLING * This category is for errors related to polling/timeout issues and should be - * used in any case where the timeout occurred, or a failure to obtain a lock, or - * failure to receive data within the time limit. + * used in any case where the timeout occurred, or a failure to obtain a lock, + * or failure to receive data within the time limit. * * - IXGBE_ERROR_CAUTION * This category should be used for reporting issues that may be the cause of @@ -157,7 +157,7 @@ #define IXGBE_DEV_ID_X550EM_X_VF 0x15A8 #define IXGBE_DEV_ID_X550EM_X_VF_HV 0x15A9 -#define IXGBE_CAT(r,m) IXGBE_##r##m +#define IXGBE_CAT(r, m) IXGBE_##r##m #define IXGBE_BY_MAC(_hw, r) ((_hw)->mvals[IXGBE_CAT(r, _IDX)]) @@ -284,6 +284,26 @@ #define IXGBE_I2C_CLK_OE_N_EN_BY_MAC(_hw) IXGBE_BY_MAC((_hw), I2C_CLK_OE_N_EN) #define IXGBE_I2C_CLOCK_STRETCHING_TIMEOUT 500 +#define IXGBE_I2C_THERMAL_SENSOR_ADDR 0xF8 +#define IXGBE_EMC_INTERNAL_DATA 0x00 +#define IXGBE_EMC_INTERNAL_THERM_LIMIT 0x20 +#define IXGBE_EMC_DIODE1_DATA 0x01 +#define IXGBE_EMC_DIODE1_THERM_LIMIT 0x19 +#define IXGBE_EMC_DIODE2_DATA 0x23 +#define IXGBE_EMC_DIODE2_THERM_LIMIT 0x1A + +#define IXGBE_MAX_SENSORS 3 + +struct ixgbe_thermal_diode_data { + u8 location; + u8 temp; + u8 caution_thresh; + u8 max_op_thresh; +}; + +struct ixgbe_thermal_sensor_data { + struct ixgbe_thermal_diode_data sensor[IXGBE_MAX_SENSORS]; +}; #define NVM_OROM_OFFSET 0x17 @@ -2358,6 +2378,20 @@ enum { #define IXGBE_ALT_MAC_ADDR_PTR 0x37 #define IXGBE_FREE_SPACE_PTR 0X3E +/* External Thermal Sensor Config */ +#define IXGBE_ETS_CFG 0x26 +#define IXGBE_ETS_LTHRES_DELTA_MASK 0x07C0 +#define IXGBE_ETS_LTHRES_DELTA_SHIFT 6 +#define IXGBE_ETS_TYPE_MASK 0x0038 +#define IXGBE_ETS_TYPE_SHIFT 3 +#define IXGBE_ETS_TYPE_EMC 0x000 +#define IXGBE_ETS_NUM_SENSORS_MASK 0x0007 +#define IXGBE_ETS_DATA_LOC_MASK 0x3C00 +#define IXGBE_ETS_DATA_LOC_SHIFT 10 +#define IXGBE_ETS_DATA_INDEX_MASK 0x0300 +#define IXGBE_ETS_DATA_INDEX_SHIFT 8 +#define IXGBE_ETS_DATA_HTHRESH_MASK 0x00FF + #define IXGBE_SAN_MAC_ADDR_PTR 0x28 #define IXGBE_DEVICE_CAPS 0x2C #define IXGBE_82599_SERIAL_NUMBER_MAC_ADDR 0x11 @@ -2412,9 +2446,7 @@ enum { #define IXGBE_EEPROM_CTRL_2 1 /* EEPROM CTRL word 2 */ #define IXGBE_EEPROM_CCD_BIT 2 -#ifndef IXGBE_EEPROM_GRANT_ATTEMPTS #define IXGBE_EEPROM_GRANT_ATTEMPTS 1000 /* EEPROM attempts to gain grant */ -#endif /* Number of 5 microseconds we wait for EERD read and * EERW write to complete */ @@ -3932,7 +3964,6 @@ struct ixgbe_mac_operations { s32 (*get_fcoe_boot_status)(struct ixgbe_hw *, u16 *); s32 (*stop_adapter)(struct ixgbe_hw *); s32 (*get_bus_info)(struct ixgbe_hw *); - s32 (*negotiate_api_version)(struct ixgbe_hw *, int); void (*set_lan_id)(struct ixgbe_hw *); s32 (*read_analog_reg8)(struct ixgbe_hw*, u32, u8*); s32 (*write_analog_reg8)(struct ixgbe_hw*, u32, u8); @@ -3945,6 +3976,7 @@ struct ixgbe_mac_operations { void (*init_swfw_sync)(struct ixgbe_hw *); s32 (*prot_autoc_read)(struct ixgbe_hw *, bool *, u32 *); s32 (*prot_autoc_write)(struct ixgbe_hw *, u32, bool); + s32 (*negotiate_api_version)(struct ixgbe_hw *hw, int api); /* Link */ void (*disable_tx_laser)(struct ixgbe_hw *); @@ -3980,17 +4012,17 @@ struct ixgbe_mac_operations { ixgbe_mc_addr_itr); s32 (*update_mc_addr_list)(struct ixgbe_hw *, u8 *, u32, ixgbe_mc_addr_itr, bool clear); - s32 (*update_xcast_mode)(struct ixgbe_hw *, int); s32 (*enable_mc)(struct ixgbe_hw *); s32 (*disable_mc)(struct ixgbe_hw *); s32 (*clear_vfta)(struct ixgbe_hw *); s32 (*set_vfta)(struct ixgbe_hw *, u32, u32, bool, bool); s32 (*set_vlvf)(struct ixgbe_hw *, u32, u32, bool, u32 *, u32, bool); - s32 (*set_rlpml)(struct ixgbe_hw *, u16); s32 (*init_uta_tables)(struct ixgbe_hw *); void (*set_mac_anti_spoofing)(struct ixgbe_hw *, bool, int); void (*set_vlan_anti_spoofing)(struct ixgbe_hw *, bool, int); + s32 (*update_xcast_mode)(struct ixgbe_hw *, int); + s32 (*set_rlpml)(struct ixgbe_hw *, u16); /* Flow Control */ s32 (*fc_enable)(struct ixgbe_hw *); @@ -4000,6 +4032,8 @@ struct ixgbe_mac_operations { /* Manageability interface */ s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8, u16, const char *); + s32 (*get_thermal_sensor_data)(struct ixgbe_hw *); + s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw); s32 (*bypass_rw) (struct ixgbe_hw *hw, u32 cmd, u32 *status); bool (*bypass_valid_rd) (u32 in_reg, u32 out_reg); s32 (*bypass_set) (struct ixgbe_hw *hw, u32 cmd, u32 event, u32 action); @@ -4107,6 +4141,8 @@ struct ixgbe_mac_info { bool orig_link_settings_stored; bool autotry_restart; u8 flags; + struct ixgbe_thermal_sensor_data thermal_sensor_data; + bool thermal_sensor_enabled; struct ixgbe_dmac_config dmac_config; bool set_lben; u32 max_link_up_time; diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 82800b4a3d87..f70f4d667aee 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -36,12 +36,8 @@ #include "ixgbe.h" -#ifndef IXGBE_VFWRITE_REG #define IXGBE_VFWRITE_REG IXGBE_WRITE_REG -#endif -#ifndef IXGBE_VFREAD_REG #define IXGBE_VFREAD_REG IXGBE_READ_REG -#endif /** * ixgbe_init_ops_vf - Initialize the pointers for vf diff --git a/sys/dev/ixgbe/ixgbe_x540.c b/sys/dev/ixgbe/ixgbe_x540.c index d03b34ee8135..ea45cd31a4c3 100644 --- a/sys/dev/ixgbe/ixgbe_x540.c +++ b/sys/dev/ixgbe/ixgbe_x540.c @@ -819,7 +819,7 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) * bits in the SW_FW_SYNC register. */ if (ixgbe_get_swfw_sync_semaphore(hw)) { - DEBUGOUT("Failed to get NVM sempahore and register semaphore while forcefully ignoring FW sempahore bit(s) and setting SW semaphore bit(s), returning IXGBE_ERR_SWFW_SYNC\n"); + DEBUGOUT("Failed to get NVM semaphore and register semaphore while forcefully ignoring FW semaphore bit(s) and setting SW semaphore bit(s), returning IXGBE_ERR_SWFW_SYNC\n"); return IXGBE_ERR_SWFW_SYNC; } swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw)); diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 7fc556662b00..3353d91e228e 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -619,6 +619,10 @@ s32 ixgbe_init_ops_X550EM(struct ixgbe_hw *hw) * the pointers to NULL explicitly here to overwrite * the values being set in the x540 function. */ + /* Thermal sensor not supported in x550EM */ + mac->ops.get_thermal_sensor_data = NULL; + mac->ops.init_thermal_sensor_thresh = NULL; + mac->thermal_sensor_enabled = false; /* Bypass not supported in x550EM */ mac->ops.bypass_rw = NULL; @@ -1135,7 +1139,7 @@ s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, u32 data) { u32 gssr = IXGBE_GSSR_PHY1_SM | IXGBE_GSSR_PHY0_SM; - u32 command, error __unused; + u32 command, error; s32 ret; ret = ixgbe_acquire_swfw_semaphore(hw, gssr); @@ -1181,7 +1185,7 @@ s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, u32 *data) { u32 gssr = IXGBE_GSSR_PHY1_SM | IXGBE_GSSR_PHY0_SM; - u32 command, error __unused; + u32 command, error; s32 ret; ret = ixgbe_acquire_swfw_semaphore(hw, gssr); @@ -2716,7 +2720,7 @@ static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed) * @speed: new link speed * @autoneg_wait_to_complete: unused * - * Configure the the integrated PHY for SFP support. + * Configure the integrated PHY for SFP support. **/ s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -3688,7 +3692,7 @@ u64 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw) physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX; break; case ixgbe_phy_ext_1g_t: - physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T; + physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T; break; default: break; From nobody Thu Oct 7 03:03:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 69E5312D9B18; Thu, 7 Oct 2021 03:03: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 4HPx3k2dS1z4m8F; Thu, 7 Oct 2021 03:03:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A2563AF1; Thu, 7 Oct 2021 03:03:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19733kbq033801; Thu, 7 Oct 2021 03:03:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19733k8d033800; Thu, 7 Oct 2021 03:03:46 GMT (envelope-from git) Date: Thu, 7 Oct 2021 03:03:46 GMT Message-Id: <202110070303.19733k8d033800@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: 4d7876aa70e2 - main - build: slap a libtinfo dependency on libncurses List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 4d7876aa70e2b7c7c941399a61b6f5e5f8fee088 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4d7876aa70e2b7c7c941399a61b6f5e5f8fee088 commit 4d7876aa70e2b7c7c941399a61b6f5e5f8fee088 Author: Kyle Evans AuthorDate: 2021-10-07 03:01:05 +0000 Commit: Kyle Evans CommitDate: 2021-10-07 03:03:37 +0000 build: slap a libtinfo dependency on libncurses This mirrors the SUBDIR_DEPEND in lib/ncurses/Makefile. Reported by: jenkins (e.g., riscv64 build #23984) Fixes: 396851c20aeb ("ncurses: split libtinfo from libncurses") --- Makefile.inc1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 6dcfa6a17d3d..9b81d4029608 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2973,6 +2973,8 @@ lib/libkvm__L: lib/libelf__L _lib_libradius= lib/libradius .endif +lib/ncurses/ncurses__L: lib/ncurses/tinfo__L + .if ${MK_OFED} != "no" _prebuild_libs+= \ lib/ofed/libibverbs \ From nobody Thu Oct 7 06:05:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 91B2D17EE6CF; Thu, 7 Oct 2021 06:05: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 4HQ14t3kdMz3M3S; Thu, 7 Oct 2021 06:05:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FC8F6998; Thu, 7 Oct 2021 06:05:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1976529M073372; Thu, 7 Oct 2021 06:05:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1976525Y073371; Thu, 7 Oct 2021 06:05:02 GMT (envelope-from git) Date: Thu, 7 Oct 2021 06:05:02 GMT Message-Id: <202110070605.1976525Y073371@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: 67bceb38f463 - main - i2c(8): fix option 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: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67bceb38f463d8a929c55efdcfcfefc9aedfeff6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=67bceb38f463d8a929c55efdcfcfefc9aedfeff6 commit 67bceb38f463d8a929c55efdcfcfefc9aedfeff6 Author: Martin Birgmeier AuthorDate: 2021-10-07 05:20:56 +0000 Commit: Robert Wing CommitDate: 2021-10-07 05:56:20 +0000 i2c(8): fix option handling Recognize the '-o' option when processing command line arguments. Fixes: 9c10d00bf8cd ("i2c(8): Add interpreted mode for batch/scripted...") PR: 258572 --- usr.sbin/i2c/i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/i2c/i2c.c b/usr.sbin/i2c/i2c.c index 87bb1f0fe983..2ab7c55772de 100644 --- a/usr.sbin/i2c/i2c.c +++ b/usr.sbin/i2c/i2c.c @@ -744,7 +744,7 @@ main(int argc, char** argv) struct options i2c_opt; const char *dev, *err_msg; int fd, error = 0, ch; - const char *optflags = "a:f:d:o:w:c:m:n:sbvrh"; + const char *optflags = "a:f:d:o:iw:c:m:n:sbvrh"; char do_what = 0; dev = I2C_DEV; @@ -763,7 +763,7 @@ main(int argc, char** argv) /* Find out what we are going to do */ - while ((ch = getopt(argc, argv, "a:f:d:iw:c:m:n:sbvrh")) != -1) { + while ((ch = getopt(argc, argv, optflags)) != -1) { switch(ch) { case 'a': case 'i': From nobody Thu Oct 7 07:12:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 40F7D12D0A85; Thu, 7 Oct 2021 07:12:24 +0000 (UTC) (envelope-from bapt@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 4HQ2Zc18HQz3mL0; Thu, 7 Oct 2021 07:12:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id E89C8253A6; Thu, 7 Oct 2021 07:12:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id F1B2A5A549; Thu, 7 Oct 2021 09:12:21 +0200 (CEST) Date: Thu, 7 Oct 2021 09:12:21 +0200 From: Baptiste Daroussin To: Kyle Evans Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 4d7876aa70e2 - main - build: slap a libtinfo dependency on libncurses Message-ID: <20211007071221.ngdjdip2qosyhumv@aniel.nours.eu> References: <202110070303.19733k8d033800@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110070303.19733k8d033800@gitrepo.freebsd.org> X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 07, 2021 at 03:03:46AM +0000, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4d7876aa70e2b7c7c941399a61b6f5e5f8fee088 > > commit 4d7876aa70e2b7c7c941399a61b6f5e5f8fee088 > Author: Kyle Evans > AuthorDate: 2021-10-07 03:01:05 +0000 > Commit: Kyle Evans > CommitDate: 2021-10-07 03:03:37 +0000 > > build: slap a libtinfo dependency on libncurses > > This mirrors the SUBDIR_DEPEND in lib/ncurses/Makefile. > > Reported by: jenkins (e.g., riscv64 build #23984) > Fixes: 396851c20aeb ("ncurses: split libtinfo from libncurses") > --- > Makefile.inc1 | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Makefile.inc1 b/Makefile.inc1 > index 6dcfa6a17d3d..9b81d4029608 100644 > --- a/Makefile.inc1 > +++ b/Makefile.inc1 > @@ -2973,6 +2973,8 @@ lib/libkvm__L: lib/libelf__L > _lib_libradius= lib/libradius > .endif > > +lib/ncurses/ncurses__L: lib/ncurses/tinfo__L > + > .if ${MK_OFED} != "no" > _prebuild_libs+= \ > lib/ofed/libibverbs \ > Good catch! thank you! Best regards, Bapt From nobody Thu Oct 7 07:33:57 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 387A012D5308; Thu, 7 Oct 2021 07:34:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_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 4HQ33m0Lf6z3rgQ; Thu, 7 Oct 2021 07:34:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4D4CC260025; Thu, 7 Oct 2021 09:34:10 +0200 (CEST) Subject: Re: git: 903873ce1560 - main - Implement and use new mixer(3) library for FreeBSD. To: Kevin Bowling Cc: Christos Margiolis , Mateusz Piotrowski <0mp@freebsd.org>, src-committers , dev-commits-src-all@freebsd.org, "dev-commits-src-main@FreeBSD.org" References: <202109221803.18MI3gdA013391@gitrepo.freebsd.org> <3d6a23c3-ad2c-4c5b-849e-1ef12dbf8955@FreeBSD.org> <487fa0f2-d845-438f-a035-8b7ccba4285a@selasky.org> <20211004101726.wraje5ol5vwbhjcv@pleb> From: Hans Petter Selasky Message-ID: Date: Thu, 7 Oct 2021 09:33:57 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.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 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HQ33m0Lf6z3rgQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On 10/6/21 11:11 PM, Kevin Bowling wrote: > On Wed, Oct 6, 2021 at 1:43 PM Hans Petter Selasky wrote: >> >> On 10/6/21 10:37 PM, Kevin Bowling wrote: >>> I still get a bunch of spam from rc.d on boot and it doesn't seem to >>> save my mixer settings on shutdown, is there some settings file I >>> should blow away or is there a better way to handle upgrades? >> >> Hi Kevin, >> >> Did you install the new /etc/rc.d/mixer script? >> >> Or do you see this diff: > > There is no diff with 'diff -u /usr/src/libexec/rc/rc.d/mixer > /etc/rc.d/mixer' for me. Could you send those messages to me and Christos off-list? I don't see them. --HPS > >> >>> diff -u /usr/src/libexec/rc/rc.d/mixer /etc/rc.d/mixer >>> --- /usr/src/libexec/rc/rc.d/mixer 2021-09-22 22:09:36.193543000 +0200 >>> +++ /etc/rc.d/mixer 2019-12-26 22:43:45.276389000 +0100 >>> @@ -58,7 +58,7 @@ >>> >>> dev="/dev/${1}" >>> if [ -r ${dev} ]; then >>> - /usr/sbin/mixer -f ${dev} -o > /var/db/${1}-state 2>/dev/null >>> + /usr/sbin/mixer -f ${dev} -s > /var/db/${1}-state 2>/dev/null >>> fi >>> } >> >> --HPS > From nobody Thu Oct 7 15:09:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 803D017EA4E8; Thu, 7 Oct 2021 15:09: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 4HQF9Q3Bjgz3R7f; Thu, 7 Oct 2021 15:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D50C15F0D; Thu, 7 Oct 2021 15:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 197F9kmJ094489; Thu, 7 Oct 2021 15:09:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 197F9kqv094488; Thu, 7 Oct 2021 15:09:46 GMT (envelope-from git) Date: Thu, 7 Oct 2021 15:09:46 GMT Message-Id: <202110071509.197F9kqv094488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 824bbb9a40820fb62bde0a91c0f13e0b894da149 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=824bbb9a40820fb62bde0a91c0f13e0b894da149 commit 824bbb9a40820fb62bde0a91c0f13e0b894da149 Author: Mariusz Zaborski AuthorDate: 2021-10-07 15:07:00 +0000 Commit: Mariusz Zaborski CommitDate: 2021-10-07 15:07:00 +0000 diff: consider two files with same inodes as identical Obtained from: OpenBSD MFC after: 1 week --- usr.bin/diff/diffreg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index fc3c3406a073..995843f9e539 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -440,6 +440,10 @@ files_differ(FILE *f1, FILE *f2, int flags) if ((flags & (D_EMPTY1|D_EMPTY2)) || stb1.st_size != stb2.st_size || (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) return (1); + + if (stb1.st_dev == stb2.st_dev && stb1.st_ino == stb2.st_ino) + return (0); + for (;;) { i = fread(buf1, 1, sizeof(buf1), f1); j = fread(buf2, 1, sizeof(buf2), f2); From nobody Thu Oct 7 15:13:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9A3DB17EAFDA; Thu, 7 Oct 2021 15:13:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_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 4HQFFy2y3Wz3hck; Thu, 7 Oct 2021 15:13:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B92642604E7; Thu, 7 Oct 2021 17:13:34 +0200 (CEST) Subject: Re: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical To: Mariusz Zaborski , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110071509.197F9kqv094488@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <4fd5e142-2fc3-5233-102a-69d5c3a91ea2@selasky.org> Date: Thu, 7 Oct 2021 17:13:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.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 In-Reply-To: <202110071509.197F9kqv094488@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HQFFy2y3Wz3hck X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On 10/7/21 5:09 PM, Mariusz Zaborski wrote: > The branch main has been updated by oshogbo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=824bbb9a40820fb62bde0a91c0f13e0b894da149 > > commit 824bbb9a40820fb62bde0a91c0f13e0b894da149 > Author: Mariusz Zaborski > AuthorDate: 2021-10-07 15:07:00 +0000 > Commit: Mariusz Zaborski > CommitDate: 2021-10-07 15:07:00 +0000 > > diff: consider two files with same inodes as identical > And mounted on the same filesystem? --HPS From nobody Thu Oct 7 15:15:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4868417EB8C7; Thu, 7 Oct 2021 15:14:25 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQFGn1Jfbz3j7L; Thu, 7 Oct 2021 15:14:25 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lf1-f53.google.com with SMTP id j21so8395824lfe.0; Thu, 07 Oct 2021 08:14:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tfwF5EHTkHA2Mc24DUIATUpWC9Yu+QDCuvcWAeBy6jo=; b=v/8WzCpLoPForL6FucG8ZgxjailJ6bkarIaIm3468Jj5BtwXP1co+tQaa6642GatYh l1sfhqDqfUhwpEXetyWYMDCLE7M9zhhYN84S9PZt/jsXVkqBY5QGzurWlWJDJkVsH3sZ OpAw9q+5fiTe0O0BEkFEqPgNPAcUu6qtNnqE15WtrKErj6EdqvVeYgHqCLA907Es/Vsf a9GP5vrxQX1f2HU1MVZqp7ol3I3QN4uURS6PulGdW7njOMisDEsTpclz3fBrG7Euhbee W6Uxb4n1FKX5hKpeOI+wSETzv9AoiJhNMcqEbqKxyq1DiJ+6KgzYcfFBsdyrYTQiArBH BCVA== X-Gm-Message-State: AOAM531tP6w414LwrpxS/F9cE3z0uIciWzXZh/VZRqYZ1vCOgcBwcwBd yJYGwYNR78Zpjq8riFu7v0iVdJds722/FPe394Z6elc9BgE= X-Google-Smtp-Source: ABdhPJybkg8+mZsYHaEWZYa8hVyFdFlXXB8WU7GmoOY/DpoajXC/IIA1dupRFkBU+rAgR+XzDCDi9ZFiZbmnNCc+pm0= X-Received: by 2002:a05:6512:22d5:: with SMTP id g21mr4793490lfu.544.1633619658308; Thu, 07 Oct 2021 08:14:18 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110071509.197F9kqv094488@gitrepo.freebsd.org> <4fd5e142-2fc3-5233-102a-69d5c3a91ea2@selasky.org> In-Reply-To: <4fd5e142-2fc3-5233-102a-69d5c3a91ea2@selasky.org> From: Mariusz Zaborski Date: Thu, 7 Oct 2021 17:15:21 +0200 Message-ID: Subject: Re: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical To: Hans Petter Selasky Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000006e7f0c05cdc4b797" X-Rspamd-Queue-Id: 4HQFGn1Jfbz3j7L X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N --0000000000006e7f0c05cdc4b797 Content-Type: text/plain; charset="UTF-8" And mounted on the same filesystem. On Thu, 7 Oct 2021 at 17:13, Hans Petter Selasky wrote: > On 10/7/21 5:09 PM, Mariusz Zaborski wrote: > > The branch main has been updated by oshogbo: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=824bbb9a40820fb62bde0a91c0f13e0b894da149 > > > > commit 824bbb9a40820fb62bde0a91c0f13e0b894da149 > > Author: Mariusz Zaborski > > AuthorDate: 2021-10-07 15:07:00 +0000 > > Commit: Mariusz Zaborski > > CommitDate: 2021-10-07 15:07:00 +0000 > > > > diff: consider two files with same inodes as identical > > > > And mounted on the same filesystem? > > --HPS > > --0000000000006e7f0c05cdc4b797-- From nobody Thu Oct 7 15:32:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AEBE117ED416; Thu, 7 Oct 2021 15:32:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQFgl3hgKz3kSW; Thu, 7 Oct 2021 15:32:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f179.google.com with SMTP id o83so2062637oif.4; Thu, 07 Oct 2021 08:32:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sL44217jecSciZiR7knXfRVhcyqeiQP3uqs9f6wdvyE=; b=b/Iwl7Q/cmpDktEjujZZuQpiRv/zHnAs8FW/2EHa6/iLnWnv9hUmkxt/RFIddJUXwg 5WP1OuUJ8MP/fZm25nwOmGfzZ6mu55skErU0aqMBgcE/WF4LVDcivFMElVTIgMO/otmV XDoeFIPXPSnMP+EyxBHbBVT7Zz03H+F95KQPhLIyhwQXNG+xTP9kWsYE3iH9NwBMFkgj tUutLC3lS1f8k8+u8At50wAIJaxXJp6u+SLfHjdXY7HgKcXFag2lNe5zQTykGWsXWm7O pIxBgReLNWaBszbcETME2NAJd3jSh1VVCGmXYmmyThDeJYqoIbw/BjliHpTGlwON0l7k kQQg== X-Gm-Message-State: AOAM530nDfawIBOlDzh/siSTuSMQMDhkH1yeM8WOsGDBRZ+TyElt5Xol PiDoTcXjgoKd+80xUFRRmFo1OgAhwPNh2YnOO5yC6U7t X-Google-Smtp-Source: ABdhPJwbin7rMWbpSTf1O+tKnrFPyDsslKSvbqlmSINtSZVXiFPCcUM0biVoy4JbmB5aexcyaDbRj4zFlm3bsh24kx8= X-Received: by 2002:aca:1b09:: with SMTP id b9mr12341542oib.55.1633620748510; Thu, 07 Oct 2021 08:32:28 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110071509.197F9kqv094488@gitrepo.freebsd.org> In-Reply-To: <202110071509.197F9kqv094488@gitrepo.freebsd.org> From: Alan Somers Date: Thu, 7 Oct 2021 09:32:17 -0600 Message-ID: Subject: Re: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical To: Mariusz Zaborski Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HQFgl3hgKz3kSW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 7, 2021 at 9:09 AM Mariusz Zaborski wrote: > > The branch main has been updated by oshogbo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=824bbb9a40820fb62bde0a91c0f13e0b894da149 > > commit 824bbb9a40820fb62bde0a91c0f13e0b894da149 > Author: Mariusz Zaborski > AuthorDate: 2021-10-07 15:07:00 +0000 > Commit: Mariusz Zaborski > CommitDate: 2021-10-07 15:07:00 +0000 > > diff: consider two files with same inodes as identical > > Obtained from: OpenBSD > MFC after: 1 week > --- > usr.bin/diff/diffreg.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c > index fc3c3406a073..995843f9e539 100644 > --- a/usr.bin/diff/diffreg.c > +++ b/usr.bin/diff/diffreg.c > @@ -440,6 +440,10 @@ files_differ(FILE *f1, FILE *f2, int flags) > if ((flags & (D_EMPTY1|D_EMPTY2)) || stb1.st_size != stb2.st_size || > (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) > return (1); > + > + if (stb1.st_dev == stb2.st_dev && stb1.st_ino == stb2.st_ino) > + return (0); > + Checking st_dev is not correct. It does necessarily bear any relation to the specific mounted file system. It might, but that's up to the file system driver. fusefs, for example, allows the server to populate that field with whatever it damn well pleases. diff should use statfs instead, and check the f_fsid field. That would probably work. -Alan From nobody Thu Oct 7 15:40:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1BDF717EE6B6 for ; Thu, 7 Oct 2021 15:40:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5d.ore.mailhop.org (outbound5d.ore.mailhop.org [100.20.105.3]) (using TLSv1.3 with cipher TLS_AES_256_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 4HQFsQ5mcQz3lQs for ; Thu, 7 Oct 2021 15:40:58 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1633621257; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=dgy7a6+eOEDj5D5y51h1/zENRQerwwS20SJRuljibyfJxt/8ptJufW5LdsVlpKYWkvwy0LqFtfQ1y 1a6lpk+rXQRFj/eZpTY9Yv14ZbfjvoDUTH3PV8K8e/vWhRc+zGS+SiasKIJ12OfNxV8bx9t63gl66O x9tVOcDiSof91vg9DWXltBrYaHilS0dErSqSa0Zc/VHkLzqv5X+KibWo5QCEEAbWPWwp8U+NgWkvsL 3iCpnrJaDYwvHMyfekfCF7CU/Ejx8JXah2VFJazlfMDfW1pO6XgA568F8CeOdP6zKZaeSKufLA/O2M Br8uUCEFcaT/af0uipz02TN7KqE88fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=NJt2dyOA9+7japku5TY5cm/4Y4vfx03cL0WGcU30v4E=; b=Sxm1U5EmxamUkNrjts4NyGtBX2ho+j6caw+cuPg4yU6IwMeOoeRSM/Fz2DBFUI+2S9UwLSLsOhW+y ya0xFSvFjFchtD4kMS+OkqSqZCM176I7Y+/GDQuO/53z3O1lRyt+uCwD4/1qmWIV/ty1VmjgM3an5x m6Lyl0WKGZ1FOl/Y3vQrQ3srriH50zgvcnz5Dswz2kpmgzKKsp/70blAmYavwnniaAvLwW1/5V1IBV gGvZE9xDPAJS+t5reppDrn11FhoKaLP2H+BkyeT74yC/uqVWhACsKXo4rfwBrqx4ZwuT4pC++gBZzw UR2kEmjnucxzeYEIagcEGVgxvyhStGQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=24.8.225.114; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=NJt2dyOA9+7japku5TY5cm/4Y4vfx03cL0WGcU30v4E=; b=UeughENp/VEf8SaExB+SczFn6amc0VlO2VdFW/8sKdgTTU1zXFwdmBJ36VeKyAX9FsyzrD47RLqLl wlZ84nFluV1p9lupyfvyAhwjx/4f+IsckKb3X5Yyk/gD8rRUDH45ctQYNlqChsG+RCUMRuviVPBXrT M+XfF3WMDOq7tbOro3wlcLgQoT6IhT7x4cmFqpyFiD2Ns6taHe2HIUIPQ/mOtMslR2dJWWJVRqr/rw 5KVJciVQWc2phLtZjyazLP491XyhiODZYNNwHFzkxC1IrDJvwGrC4egr/RleMZU1h/RRiFWaAPiupT hLHjWgHFn0PAifWANh/SRZJG76i2/cQ== X-Originating-IP: 24.8.225.114 X-MHO-RoutePath: aGlwcGll X-MHO-User: f5957079-2784-11ec-9ab6-bf9d68d023b6 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-24-8-225-114.hsd1.co.comcast.net [24.8.225.114]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id f5957079-2784-11ec-9ab6-bf9d68d023b6; Thu, 07 Oct 2021 15:40:56 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 197FesYs020432; Thu, 7 Oct 2021 09:40:54 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: Subject: Re: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical From: Ian Lepore To: Alan Somers , Mariusz Zaborski Cc: src-committers , "" , dev-commits-src-main@freebsd.org Date: Thu, 07 Oct 2021 09:40:54 -0600 In-Reply-To: References: <202110071509.197F9kqv094488@gitrepo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HQFsQ5mcQz3lQs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, 2021-10-07 at 09:32 -0600, Alan Somers wrote: > On Thu, Oct 7, 2021 at 9:09 AM Mariusz Zaborski > wrote: > > > > The branch main has been updated by oshogbo: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=824bbb9a40820fb62bde0a91c0f13e0b894da149 > > > > commit 824bbb9a40820fb62bde0a91c0f13e0b894da149 > > Author: Mariusz Zaborski > > AuthorDate: 2021-10-07 15:07:00 +0000 > > Commit: Mariusz Zaborski > > CommitDate: 2021-10-07 15:07:00 +0000 > > > > diff: consider two files with same inodes as identical > > > > Obtained from: OpenBSD > > MFC after: 1 week > > --- > > usr.bin/diff/diffreg.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c > > index fc3c3406a073..995843f9e539 100644 > > --- a/usr.bin/diff/diffreg.c > > +++ b/usr.bin/diff/diffreg.c > > @@ -440,6 +440,10 @@ files_differ(FILE *f1, FILE *f2, int flags) > > if ((flags & (D_EMPTY1|D_EMPTY2)) || stb1.st_size != > > stb2.st_size || > > (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) > > return (1); > > + > > + if (stb1.st_dev == stb2.st_dev && stb1.st_ino == > > stb2.st_ino) > > + return (0); > > + > > Checking st_dev is not correct. It does necessarily bear any > relation > to the specific mounted file system. It might, but that's up to the > file system driver. fusefs, for example, allows the server to > populate that field with whatever it damn well pleases. diff should > use statfs instead, and check the f_fsid field. That would probably > work. > -Alan That may be a fusefs bug, then. Posix states The st_ino and st_dev fields taken together uniquely identify the file within the system. And I've seen real-world code more than once that uses st_dev equality to decide whether to rename versus copy-and-delete a file. -- Ian From nobody Thu Oct 7 15:55:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4616C17EFEFB; Thu, 7 Oct 2021 15:54:43 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQG9H1HwNz3n9j; Thu, 7 Oct 2021 15:54:43 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lf1-f49.google.com with SMTP id x27so26905791lfu.5; Thu, 07 Oct 2021 08:54:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AlXfxgOKdK2R+z+NqeAkJAMBrxc6iwM/cURNsplm4r0=; b=Ob2V7QOX1oHTUqljJcecMdLxXjrECBeav8IX7oCeewUF2bRDVXMbimrNzZsSO6k0OH sMOiPU/E4/ekthB36vOwxQYVsUMIQpwJ7a90YH7e02ha6qTmqXhTH18sz4YZ0QvMSVG3 QuZ8Xxg5lFBBRSUqdrYtfnMpldvqIfB6rO/AteZMs9DEAfXCQjVGx0+q881Ie1dID7cd Abyj3/wZmyhdmSv1siL5ejWoeuGJuJQgYrYn71zc/wpgF+YkHTBcke5IHSimyol+vdw3 JJrgFxm76N3H/JjkLWk/QrzjNDA1KYHvtpnyQVjtqZSE0ccCKaqKPia1wdiTOio7AdGp tCag== X-Gm-Message-State: AOAM533udiqBckVZqR130ceSgjRwdCRm/4AmWxp0BEJUvBsY4YwDDtGV StBJ7vV2XpLHUN4KBFoeJG2vJeBumM7LaZCfd8QNGIvGHuk= X-Google-Smtp-Source: ABdhPJxZVtudTqFLtVDxnF+J4wvnRVzgrkWCrnzRyCrkyHVeq7yVbR0FBAqzEJh2oqiL8wTavAPa+2pqrL+8JTAO59k= X-Received: by 2002:a2e:9bd0:: with SMTP id w16mr5542852ljj.390.1633622081997; Thu, 07 Oct 2021 08:54:41 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110071509.197F9kqv094488@gitrepo.freebsd.org> In-Reply-To: From: Mariusz Zaborski Date: Thu, 7 Oct 2021 17:55:44 +0200 Message-ID: Subject: Re: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical To: Ian Lepore Cc: Alan Somers , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000e50eb905cdc54737" X-Rspamd-Queue-Id: 4HQG9H1HwNz3n9j X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N --000000000000e50eb905cdc54737 Content-Type: text/plain; charset="UTF-8" Like Ian said from what I know this is the way of uniquely identify the file. We use this technique in flopen(3), pidfile_open(3) or fts(3). On Thu, 7 Oct 2021 at 17:40, Ian Lepore wrote: > On Thu, 2021-10-07 at 09:32 -0600, Alan Somers wrote: > > On Thu, Oct 7, 2021 at 9:09 AM Mariusz Zaborski > > wrote: > > > > > > The branch main has been updated by oshogbo: > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=824bbb9a40820fb62bde0a91c0f13e0b894da149 > > > > > > commit 824bbb9a40820fb62bde0a91c0f13e0b894da149 > > > Author: Mariusz Zaborski > > > AuthorDate: 2021-10-07 15:07:00 +0000 > > > Commit: Mariusz Zaborski > > > CommitDate: 2021-10-07 15:07:00 +0000 > > > > > > diff: consider two files with same inodes as identical > > > > > > Obtained from: OpenBSD > > > MFC after: 1 week > > > --- > > > usr.bin/diff/diffreg.c | 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c > > > index fc3c3406a073..995843f9e539 100644 > > > --- a/usr.bin/diff/diffreg.c > > > +++ b/usr.bin/diff/diffreg.c > > > @@ -440,6 +440,10 @@ files_differ(FILE *f1, FILE *f2, int flags) > > > if ((flags & (D_EMPTY1|D_EMPTY2)) || stb1.st_size != > > > stb2.st_size || > > > (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) > > > return (1); > > > + > > > + if (stb1.st_dev == stb2.st_dev && stb1.st_ino == > > > stb2.st_ino) > > > + return (0); > > > + > > > > Checking st_dev is not correct. It does necessarily bear any > > relation > > to the specific mounted file system. It might, but that's up to the > > file system driver. fusefs, for example, allows the server to > > populate that field with whatever it damn well pleases. diff should > > use statfs instead, and check the f_fsid field. That would probably > > work. > > -Alan > > That may be a fusefs bug, then. Posix states > > The st_ino and st_dev fields taken together uniquely identify the > file within the system. > > And I've seen real-world code more than once that uses st_dev equality > to decide whether to rename versus copy-and-delete a file. > > -- Ian > > > --000000000000e50eb905cdc54737-- From nobody Thu Oct 7 16:38:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4D02512BCEB4; Thu, 7 Oct 2021 16:38:06 +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 4HQH7L1bTfz3rtn; Thu, 7 Oct 2021 16:38:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 9F36B29DA3; Thu, 7 Oct 2021 16:38:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: d586c978b9b4 - main - stand: fix build after recent opencrypto changes To: Kyle Evans , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110070124.1971OZIh099106@gitrepo.freebsd.org> From: John Baldwin Message-ID: <826605dd-ae91-f8c5-9d59-76072a34f927@FreeBSD.org> Date: Thu, 7 Oct 2021 09:38:04 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.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 In-Reply-To: <202110070124.1971OZIh099106@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 10/6/21 6:24 PM, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d586c978b9b4216869e589daa5bbcc33225a0e35 > > commit d586c978b9b4216869e589daa5bbcc33225a0e35 > Author: Kyle Evans > AuthorDate: 2021-10-07 01:19:47 +0000 > Commit: Kyle Evans > CommitDate: 2021-10-07 01:23:44 +0000 > > stand: fix build after recent opencrypto changes > > Pass the ivlen along through, and just drop this KASSERT() if we're > building _STANDALONE for the time being. > > Fixes: 1833d6042c9a ("crypto: Permit variable-sized IVs ...") Oof, thanks for fixing. -- John Baldwin From nobody Thu Oct 7 16:56:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A2FA212BFC77; Thu, 7 Oct 2021 16:56:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQHXc3zFxz3vDC; Thu, 7 Oct 2021 16:56:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f175.google.com with SMTP id o204so1670233oih.13; Thu, 07 Oct 2021 09:56:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2IpyZMv3JRGOui2WkENFUhSFHKUWrAtTBPD3fi0e+Cs=; b=craZBfK6dvytakVL62R/KZCxoGhvCZ3De4xgFRjhIP5O6L1xCwDJ5cnl1Py0FghhhD KGMaEqZdvac1xW7/5jjI0T2OJpmifHsWEMD5tQ3IfTLxTru0eUCjThVfBKWWsyMvLkJI alku2XyuNQYU1Oppv8M/FqpcPONLYZKciIFiKk95gVDCnIwsmhrbFUWxEtblUwfcroqB lg8H/rST4hCSNb0xs78eOCeT2xVC4LmsNZUXUU8w/+nAbW74hu8LOAn6EjUYEu4F/6xn TNG/Zppasz8d/53mCq5/nAtsObihiua/OuANJESg65/Il3fJhKA1OAhWhmnGhlVByz82 vcCQ== X-Gm-Message-State: AOAM533VWU6E3qGmMkhJe2zszZ2uo2R2HdYImAl+O7y1Ss54MM2tdlYQ z+sYf4C3fjp4SjanAVL/C2eU/sWCt7HV936iznUDKeIV X-Google-Smtp-Source: ABdhPJwnyVT48SHA++nYySk2jrcazGQBn4HGjdAtOGwX2GOuMe6Zqdz+3q8PHQF4uswo1VL3ea8Sz2POLl8diRxax6g= X-Received: by 2002:a54:4e94:: with SMTP id c20mr3912293oiy.57.1633625786341; Thu, 07 Oct 2021 09:56:26 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110071509.197F9kqv094488@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Thu, 7 Oct 2021 10:56:15 -0600 Message-ID: Subject: Re: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical To: Mariusz Zaborski Cc: Ian Lepore , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HQHXc3zFxz3vDC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 7, 2021 at 9:54 AM Mariusz Zaborski wrote: > > Like Ian said from what I know this is the way of uniquely identify the file. > We use this technique in flopen(3), pidfile_open(3) or fts(3). > > On Thu, 7 Oct 2021 at 17:40, Ian Lepore wrote: >> >> On Thu, 2021-10-07 at 09:32 -0600, Alan Somers wrote: >> > On Thu, Oct 7, 2021 at 9:09 AM Mariusz Zaborski >> > wrote: >> > > >> > > The branch main has been updated by oshogbo: >> > > >> > > URL: >> > > https://cgit.FreeBSD.org/src/commit/?id=824bbb9a40820fb62bde0a91c0f13e0b894da149 >> > > >> > > commit 824bbb9a40820fb62bde0a91c0f13e0b894da149 >> > > Author: Mariusz Zaborski >> > > AuthorDate: 2021-10-07 15:07:00 +0000 >> > > Commit: Mariusz Zaborski >> > > CommitDate: 2021-10-07 15:07:00 +0000 >> > > >> > > diff: consider two files with same inodes as identical >> > > >> > > Obtained from: OpenBSD >> > > MFC after: 1 week >> > > --- >> > > usr.bin/diff/diffreg.c | 4 ++++ >> > > 1 file changed, 4 insertions(+) >> > > >> > > diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c >> > > index fc3c3406a073..995843f9e539 100644 >> > > --- a/usr.bin/diff/diffreg.c >> > > +++ b/usr.bin/diff/diffreg.c >> > > @@ -440,6 +440,10 @@ files_differ(FILE *f1, FILE *f2, int flags) >> > > if ((flags & (D_EMPTY1|D_EMPTY2)) || stb1.st_size != >> > > stb2.st_size || >> > > (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) >> > > return (1); >> > > + >> > > + if (stb1.st_dev == stb2.st_dev && stb1.st_ino == >> > > stb2.st_ino) >> > > + return (0); >> > > + >> > >> > Checking st_dev is not correct. It does necessarily bear any >> > relation >> > to the specific mounted file system. It might, but that's up to the >> > file system driver. fusefs, for example, allows the server to >> > populate that field with whatever it damn well pleases. diff should >> > use statfs instead, and check the f_fsid field. That would probably >> > work. >> > -Alan >> >> That may be a fusefs bug, then. Posix states >> >> The st_ino and st_dev fields taken together uniquely identify the >> file within the system. >> >> And I've seen real-world code more than once that uses st_dev equality >> to decide whether to rename versus copy-and-delete a file. >> >> -- Ian Nevermind, I was confusing st_dev with st_rdev. Everything's fine, and this looks like a good optimization. From nobody Thu Oct 7 19:01:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DF24812DFACC; Thu, 7 Oct 2021 19:01: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 4HQLKG623qz4g6K; Thu, 7 Oct 2021 19:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEBE118F3E; Thu, 7 Oct 2021 19:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 197J1sKE013954; Thu, 7 Oct 2021 19:01:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 197J1sNS013953; Thu, 7 Oct 2021 19:01:54 GMT (envelope-from git) Date: Thu, 7 Oct 2021 19:01:54 GMT Message-Id: <202110071901.197J1sNS013953@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: 90dedf0fef71 - main - pfctl: Remove unused variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 90dedf0fef71d3e3081015525665bf335f9c7ee3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=90dedf0fef71d3e3081015525665bf335f9c7ee3 commit 90dedf0fef71d3e3081015525665bf335f9c7ee3 Author: Kristof Provost AuthorDate: 2021-09-30 15:25:45 +0000 Commit: Kristof Provost CommitDate: 2021-10-07 17:50:01 +0000 pfctl: Remove unused variable MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 1 - sbin/pfctl/pfctl_parser.h | 1 - 2 files changed, 2 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 89d5f330da47..4be7bd16649a 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -858,7 +858,6 @@ pfa_anchor : '{' /* steping into a brace anchor */ pf->asd++; pf->bn++; - pf->brace = 1; /* create a holding ruleset in the root */ snprintf(ta, PF_ANCHOR_NAME_SIZE, "_%d", pf->bn); diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 484830c61791..4e144b97567b 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -82,7 +82,6 @@ struct pfctl { int loadopt; int asd; /* anchor stack depth */ int bn; /* brace number */ - int brace; int tdirty; /* kernel dirty */ #define PFCTL_ANCHOR_STACK_DEPTH 64 struct pfctl_anchor *astack[PFCTL_ANCHOR_STACK_DEPTH]; From nobody Thu Oct 7 19:01:55 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4EBF812DF7FF; Thu, 7 Oct 2021 19: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 4HQLKJ0hbnz4fwG; Thu, 7 Oct 2021 19:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF476190B8; Thu, 7 Oct 2021 19:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 197J1tna013982; Thu, 7 Oct 2021 19:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 197J1tkZ013981; Thu, 7 Oct 2021 19:01:55 GMT (envelope-from git) Date: Thu, 7 Oct 2021 19:01:55 GMT Message-Id: <202110071901.197J1tkZ013981@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: 76c2e71c4c65 - main - pf: remove unused field from pf_kanchor List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 76c2e71c4c65a85279505005716aa43101c47bf7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=76c2e71c4c65a85279505005716aa43101c47bf7 commit 76c2e71c4c65a85279505005716aa43101c47bf7 Author: Kristof Provost AuthorDate: 2021-10-04 08:58:27 +0000 Commit: Kristof Provost CommitDate: 2021-10-07 17:50:22 +0000 pf: remove unused field from pf_kanchor The 'match' field is only used in the userspace version of the struct (pf_anchor). MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index ba5a2d341172..9fa1da8b5c07 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1057,7 +1057,6 @@ struct pf_kanchor { char path[MAXPATHLEN]; struct pf_kruleset ruleset; int refcnt; /* anchor rules */ - int match; /* XXX: used for pfctl black magic */ }; RB_PROTOTYPE(pf_kanchor_global, pf_kanchor, entry_global, pf_anchor_compare); RB_PROTOTYPE(pf_kanchor_node, pf_kanchor, entry_node, pf_kanchor_compare); From nobody Thu Oct 7 21:18:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3A86E12BE8A0; Thu, 7 Oct 2021 21:18: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 4HQPLS1CL4z54pc; Thu, 7 Oct 2021 21:18:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0970E1A9D0; Thu, 7 Oct 2021 21:18:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 197LI7om090112; Thu, 7 Oct 2021 21:18:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 197LI7gw090111; Thu, 7 Oct 2021 21:18:07 GMT (envelope-from git) Date: Thu, 7 Oct 2021 21:18:07 GMT Message-Id: <202110072118.197LI7gw090111@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: 4a9f2f8b07c2 - main - riscv: handle page faults in the unmappable region List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 4a9f2f8b07c2d1a1c12f4aabdccd36f56b20cfda Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=4a9f2f8b07c2d1a1c12f4aabdccd36f56b20cfda commit 4a9f2f8b07c2d1a1c12f4aabdccd36f56b20cfda Author: Mitchell Horne AuthorDate: 2021-10-07 21:05:38 +0000 Commit: Mitchell Horne CommitDate: 2021-10-07 21:12:17 +0000 riscv: handle page faults in the unmappable region When handling a kernel page fault, check explicitly that stval resides in either the user or kernel address spaces, and make the page fault fatal if not. Otherwise, a properly crafted address may appear to pmap_fault() as a valid and present page in the kernel map, causing the page fault to be retried continuously. This is mainly due to the fact that the upper bits of virtual addresses are not validated by most of the pmap code. Faults of this nature should only occur due to some kind of bug in the kernel, but it is best to handle them gracefully when they do. Handle user page faults in the same way, sending a SIGSEGV immediately when a malformed address is encountered. Add an assertion to pmap_l1(), which should help catch other bugs of this kind that make it this far. Reviewed by: jrtc27, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31208 --- sys/riscv/include/vmparam.h | 4 ++++ sys/riscv/riscv/pmap.c | 2 ++ sys/riscv/riscv/trap.c | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/sys/riscv/include/vmparam.h b/sys/riscv/include/vmparam.h index 94782da779f7..4ed95def2caa 100644 --- a/sys/riscv/include/vmparam.h +++ b/sys/riscv/include/vmparam.h @@ -186,6 +186,10 @@ #define VM_MINUSER_ADDRESS (VM_MIN_USER_ADDRESS) #define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS) +/* Check if an address resides in a mappable region. */ +#define VIRT_IS_VALID(va) \ + (((va) < VM_MAX_USER_ADDRESS) || ((va) >= VM_MIN_KERNEL_ADDRESS)) + #define KERNBASE (VM_MIN_KERNEL_ADDRESS) #define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) #define USRSTACK SHAREDPAGE diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index df80f07df0ca..0918325c13fb 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -351,6 +351,8 @@ static __inline pd_entry_t * pmap_l1(pmap_t pmap, vm_offset_t va) { + KASSERT(VIRT_IS_VALID(va), + ("%s: malformed virtual address %#lx", __func__, va)); return (&pmap->pm_l1[pmap_l1_index(va)]); } diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c index 8844638c8204..8eb52fcc5337 100644 --- a/sys/riscv/riscv/trap.c +++ b/sys/riscv/riscv/trap.c @@ -200,6 +200,11 @@ page_fault_handler(struct trapframe *frame, int usermode) goto fatal; if (usermode) { + if (!VIRT_IS_VALID(stval)) { + call_trapsignal(td, SIGSEGV, SEGV_MAPERR, (void *)stval, + frame->tf_scause & SCAUSE_CODE); + goto done; + } map = &td->td_proc->p_vmspace->vm_map; } else { /* @@ -208,6 +213,9 @@ page_fault_handler(struct trapframe *frame, int usermode) */ intr_enable(); + if (!VIRT_IS_VALID(stval)) + goto fatal; + if (stval >= VM_MAX_USER_ADDRESS) { map = kernel_map; } else { From nobody Thu Oct 7 21:18:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8B97212BE7CD; Thu, 7 Oct 2021 21:18: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 4HQPLT2z0Kz554w; Thu, 7 Oct 2021 21:18:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F8101A9D1; Thu, 7 Oct 2021 21:18:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 197LI9xC090142; Thu, 7 Oct 2021 21:18:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 197LI9Mq090141; Thu, 7 Oct 2021 21:18:09 GMT (envelope-from git) Date: Thu, 7 Oct 2021 21:18:09 GMT Message-Id: <202110072118.197LI9Mq090141@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: 8babb5582eed - main - riscv: fix VM_MAXUSER_ADDRESS checks in asm routines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 8babb5582eed2250309084d76898798409a2aae0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8babb5582eed2250309084d76898798409a2aae0 commit 8babb5582eed2250309084d76898798409a2aae0 Author: Mitchell Horne AuthorDate: 2021-10-07 21:12:30 +0000 Commit: Mitchell Horne CommitDate: 2021-10-07 21:12:30 +0000 riscv: fix VM_MAXUSER_ADDRESS checks in asm routines There are two issues with the checks against VM_MAXUSER_ADDRESS. First, the comparison should consider the values as unsigned, otherwise addresses with the high bit set will fail to branch. Second, the value of VM_MAXUSER_ADDRESS is, by convention, one larger than the maximum mappable user address and invalid itself. Thus, use the bgeu instruction for these comparisons. Add a regression test case for copyin(9). PR: 257193 Reported by: Robert Morris Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31209 --- sys/riscv/riscv/copyinout.S | 6 +++--- sys/riscv/riscv/support.S | 20 ++++++++++---------- tests/sys/kern/kern_copyin.c | 24 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/sys/riscv/riscv/copyinout.S b/sys/riscv/riscv/copyinout.S index 1f2a44121ecd..5a171f5a5e17 100644 --- a/sys/riscv/riscv/copyinout.S +++ b/sys/riscv/riscv/copyinout.S @@ -118,7 +118,7 @@ ENTRY(copyout) beqz a2, copyout_end /* If len == 0 then skip loop */ add a3, a1, a2 li a4, VM_MAXUSER_ADDRESS - bgt a3, a4, copyio_fault_nopcb + bgeu a3, a4, copyio_fault_nopcb copycommon @@ -136,7 +136,7 @@ ENTRY(copyin) beqz a2, copyin_end /* If len == 0 then skip loop */ add a3, a0, a2 li a4, VM_MAXUSER_ADDRESS - bgt a3, a4, copyio_fault_nopcb + bgeu a3, a4, copyio_fault_nopcb copycommon @@ -159,7 +159,7 @@ ENTRY(copyinstr) ENTER_USER_ACCESS(a7) li a7, VM_MAXUSER_ADDRESS -1: bgt a0, a7, copyio_fault +1: bgeu a0, a7, copyio_fault lb a4, 0(a0) /* Load from uaddr */ addi a0, a0, 1 sb a4, 0(a1) /* Store in kaddr */ diff --git a/sys/riscv/riscv/support.S b/sys/riscv/riscv/support.S index 3f0ec08ac768..7fcd6af283b7 100644 --- a/sys/riscv/riscv/support.S +++ b/sys/riscv/riscv/support.S @@ -56,7 +56,7 @@ END(fsu_fault) */ ENTRY(casueword32) li a4, (VM_MAXUSER_ADDRESS-3) - bgt a0, a4, fsu_fault_nopcb + bgeu a0, a4, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a4) /* And set it */ ENTER_USER_ACCESS(a4) @@ -77,7 +77,7 @@ END(casueword32) */ ENTRY(casueword) li a4, (VM_MAXUSER_ADDRESS-7) - bgt a0, a4, fsu_fault_nopcb + bgeu a0, a4, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a4) /* And set it */ ENTER_USER_ACCESS(a4) @@ -98,7 +98,7 @@ END(casueword) */ ENTRY(fubyte) li a1, VM_MAXUSER_ADDRESS - bgt a0, a1, fsu_fault_nopcb + bgeu a0, a1, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a1) /* And set it */ ENTER_USER_ACCESS(a1) @@ -113,7 +113,7 @@ END(fubyte) */ ENTRY(fuword16) li a1, (VM_MAXUSER_ADDRESS-1) - bgt a0, a1, fsu_fault_nopcb + bgeu a0, a1, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a1) /* And set it */ ENTER_USER_ACCESS(a1) @@ -128,7 +128,7 @@ END(fuword16) */ ENTRY(fueword32) li a2, (VM_MAXUSER_ADDRESS-3) - bgt a0, a2, fsu_fault_nopcb + bgeu a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ ENTER_USER_ACCESS(a2) @@ -147,7 +147,7 @@ END(fueword32) ENTRY(fueword) EENTRY(fueword64) li a2, (VM_MAXUSER_ADDRESS-7) - bgt a0, a2, fsu_fault_nopcb + bgeu a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ ENTER_USER_ACCESS(a2) @@ -165,7 +165,7 @@ END(fueword) */ ENTRY(subyte) li a2, VM_MAXUSER_ADDRESS - bgt a0, a2, fsu_fault_nopcb + bgeu a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ ENTER_USER_ACCESS(a2) @@ -181,7 +181,7 @@ END(subyte) */ ENTRY(suword16) li a2, (VM_MAXUSER_ADDRESS-1) - bgt a0, a2, fsu_fault_nopcb + bgeu a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ ENTER_USER_ACCESS(a2) @@ -197,7 +197,7 @@ END(suword16) */ ENTRY(suword32) li a2, (VM_MAXUSER_ADDRESS-3) - bgt a0, a2, fsu_fault_nopcb + bgeu a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ ENTER_USER_ACCESS(a2) @@ -214,7 +214,7 @@ END(suword32) ENTRY(suword) EENTRY(suword64) li a2, (VM_MAXUSER_ADDRESS-7) - bgt a0, a2, fsu_fault_nopcb + bgeu a0, a2, fsu_fault_nopcb la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a2) /* And set it */ ENTER_USER_ACCESS(a2) diff --git a/tests/sys/kern/kern_copyin.c b/tests/sys/kern/kern_copyin.c index b77360e928fd..eb1fea315b5a 100644 --- a/tests/sys/kern/kern_copyin.c +++ b/tests/sys/kern/kern_copyin.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -54,6 +55,21 @@ copyin_checker(uintptr_t uaddr, size_t len) return (ret == -1 ? errno : 0); } +#if __SIZEOF_POINTER__ == 8 +/* + * A slightly more direct path to calling copyin(), but without the ability + * to specify a length. + */ +static int +copyin_checker2(uintptr_t uaddr) +{ + int ret; + + ret = fcntl(scratch_file, F_GETLK, (const void *)uaddr); + return (ret == -1 ? errno : 0); +} +#endif + #ifdef __amd64__ static uintptr_t get_maxuser_address(void) @@ -83,6 +99,10 @@ get_maxuser_address(void) #endif #define FMAX ULONG_MAX +#if __SIZEOF_POINTER__ == 8 +/* PR 257193 */ +#define ADDR_SIGNED 0x800000c000000000 +#endif ATF_TC_WITHOUT_HEAD(kern_copyin); ATF_TC_BODY(kern_copyin, tc) @@ -122,6 +142,10 @@ ATF_TC_BODY(kern_copyin, tc) ATF_CHECK(copyin_checker(FMAX - 10, 9) == EFAULT); ATF_CHECK(copyin_checker(FMAX - 10, 10) == EFAULT); ATF_CHECK(copyin_checker(FMAX - 10, 11) == EFAULT); +#if __SIZEOF_POINTER__ == 8 + ATF_CHECK(copyin_checker(ADDR_SIGNED, 1) == EFAULT); + ATF_CHECK(copyin_checker2(ADDR_SIGNED) == EFAULT); +#endif } ATF_TP_ADD_TCS(tp) From nobody Thu Oct 7 22:53:43 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B9C2712DAB0A; Thu, 7 Oct 2021 22:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQRSl4s4sz3HLf; Thu, 7 Oct 2021 22:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 865811C0E3; Thu, 7 Oct 2021 22:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 197MrhpT023101; Thu, 7 Oct 2021 22:53:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 197MrhTj023100; Thu, 7 Oct 2021 22:53:43 GMT (envelope-from git) Date: Thu, 7 Oct 2021 22:53:43 GMT Message-Id: <202110072253.197MrhTj023100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 4313e2ae44ba - main - Avoid lost buffers in fsck_ffs. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4313e2ae44ba4e416a7ddaeaccf8ad311902f1c8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=4313e2ae44ba4e416a7ddaeaccf8ad311902f1c8 commit 4313e2ae44ba4e416a7ddaeaccf8ad311902f1c8 Author: Kirk McKusick AuthorDate: 2021-10-07 22:51:56 +0000 Commit: Kirk McKusick CommitDate: 2021-10-07 22:52:58 +0000 Avoid lost buffers in fsck_ffs. The ino_blkatoff() and indir_blkatoff() functions failed to release the buffers holding second and third level indirect blocks. This commit ensures that these buffers are now properly released. MFC after: 1 week Sponsored by: Netflix --- sbin/fsck_ffs/inode.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index ba2d5892238e..dafc99bd92da 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -264,6 +264,8 @@ ino_blkatoff(union dinode *dp, ino_t ino, ufs_lbn_t lbn, int *frags, int i; *frags = 0; + if (bpp != NULL) + *bpp = NULL; /* * Handle extattr blocks first. */ @@ -300,6 +302,8 @@ ino_blkatoff(union dinode *dp, ino_t ino, ufs_lbn_t lbn, int *frags, continue; if (lbn > 0 && lbn >= next) continue; + if (DIP(dp, di_ib[i]) == 0) + return (0); return (indir_blkatoff(DIP(dp, di_ib[i]), ino, -cur - i, lbn, bpp)); } @@ -321,8 +325,6 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t cur, ufs_lbn_t lbn, ufs_lbn_t base; int i, level; - if (blk == 0) - return (0); level = lbn_level(cur); if (level == -1) pfatal("Invalid indir lbn %jd in ino %ju\n", @@ -352,12 +354,14 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t cur, ufs_lbn_t lbn, return (0); blk = IBLK(bp, i); bp->b_index = i; - if (bpp != NULL) - *bpp = bp; - else - brelse(bp); - if (cur == lbn) + if (cur == lbn || blk == 0) { + if (bpp != NULL) + *bpp = bp; + else + brelse(bp); return (blk); + } + brelse(bp); if (level == 0) pfatal("Invalid lbn %jd at level 0 for ino %ju\n", lbn, (uintmax_t)ino); From nobody Fri Oct 8 00:21:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 703A617E3D5B; Fri, 8 Oct 2021 00:21: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 4HQTPn2d1hz3QKq; Fri, 8 Oct 2021 00:21:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B4A81D523; Fri, 8 Oct 2021 00:21:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980LHer038916; Fri, 8 Oct 2021 00:21:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980LHPh038915; Fri, 8 Oct 2021 00:21:17 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:21:17 GMT Message-Id: <202110080021.1980LHPh038915@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: 4c5bf591522c - main - i386: move signal delivery code to exec_machdep.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c5bf591522c5449d017b7ea496488c42f847963 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4c5bf591522c5449d017b7ea496488c42f847963 commit 4c5bf591522c5449d017b7ea496488c42f847963 Author: Konstantin Belousov AuthorDate: 2021-10-04 01:29:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:20:42 +0000 i386: move signal delivery code to exec_machdep.c also move ptrace-related helpers to ptrace_machdep.c Apply some style. Use ANSI C function definitions. Remove MPSAFE annotations. Reviewed by: emaste, imp Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32310 --- sys/conf/files.i386 | 1 + sys/i386/i386/exec_machdep.c | 1443 ++++++++++++++++++++++++++++++++++++++++ sys/i386/i386/machdep.c | 1391 -------------------------------------- sys/i386/i386/ptrace_machdep.c | 32 + 4 files changed, 1476 insertions(+), 1391 deletions(-) diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 3522b04c464a..e22ce97eee4f 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -104,6 +104,7 @@ i386/i386/copyout.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb +i386/i386/exec_machdep.c standard i386/i386/elan-mmcr.c optional cpu_elan | cpu_soekris i386/i386/elf_machdep.c standard i386/i386/exception.s standard diff --git a/sys/i386/i386/exec_machdep.c b/sys/i386/i386/exec_machdep.c new file mode 100644 index 000000000000..7d3022fbc406 --- /dev/null +++ b/sys/i386/i386/exec_machdep.c @@ -0,0 +1,1443 @@ +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * Copyright (c) 1992 Terrence R. Lambert. + * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * Portions of this software were developed by A. Joseph Koshy under + * sponsorship from the FreeBSD Foundation and Google, Inc. + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_cpu.h" +#include "opt_ddb.h" +#include "opt_kstack_pages.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef DDB +#ifndef KDB +#error KDB must be enabled in order for DDB to work! +#endif +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void fpstate_drop(struct thread *td); +static void get_fpcontext(struct thread *td, mcontext_t *mcp, + char *xfpusave, size_t xfpusave_len); +static int set_fpcontext(struct thread *td, mcontext_t *mcp, + char *xfpustate, size_t xfpustate_len); +#ifdef COMPAT_43 +static void osendsig(sig_t catcher, ksiginfo_t *, sigset_t *mask); +#endif +#ifdef COMPAT_FREEBSD4 +static void freebsd4_sendsig(sig_t catcher, ksiginfo_t *, sigset_t *mask); +#endif + +extern struct sysentvec elf32_freebsd_sysvec; + +/* + * Send an interrupt to process. + * + * Stack is set up to allow sigcode stored at top to call routine, + * followed by call to sigreturn routine below. After sigreturn + * resets the signal mask, the stack, and the frame pointer, it + * returns to the user specified pc, psl. + */ +#ifdef COMPAT_43 +static void +osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) +{ + struct osigframe sf, *fp; + struct proc *p; + struct thread *td; + struct sigacts *psp; + struct trapframe *regs; + int sig; + int oonstack; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + sig = ksi->ksi_signo; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); + regs = td->td_frame; + oonstack = sigonstack(regs->tf_esp); + + /* Allocate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + fp = (struct osigframe *)((uintptr_t)td->td_sigstk.ss_sp + + td->td_sigstk.ss_size - sizeof(struct osigframe)); +#if defined(COMPAT_43) + td->td_sigstk.ss_flags |= SS_ONSTACK; +#endif + } else + fp = (struct osigframe *)regs->tf_esp - 1; + + /* Build the argument list for the signal handler. */ + sf.sf_signum = sig; + sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; + bzero(&sf.sf_siginfo, sizeof(sf.sf_siginfo)); + if (SIGISMEMBER(psp->ps_siginfo, sig)) { + /* Signal handler installed with SA_SIGINFO. */ + sf.sf_arg2 = (register_t)&fp->sf_siginfo; + sf.sf_siginfo.si_signo = sig; + sf.sf_siginfo.si_code = ksi->ksi_code; + sf.sf_ahu.sf_action = (__osiginfohandler_t *)catcher; + sf.sf_addr = 0; + } else { + /* Old FreeBSD-style arguments. */ + sf.sf_arg2 = ksi->ksi_code; + sf.sf_addr = (register_t)ksi->ksi_addr; + sf.sf_ahu.sf_handler = catcher; + } + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(p); + + /* Save most if not all of trap frame. */ + sf.sf_siginfo.si_sc.sc_eax = regs->tf_eax; + sf.sf_siginfo.si_sc.sc_ebx = regs->tf_ebx; + sf.sf_siginfo.si_sc.sc_ecx = regs->tf_ecx; + sf.sf_siginfo.si_sc.sc_edx = regs->tf_edx; + sf.sf_siginfo.si_sc.sc_esi = regs->tf_esi; + sf.sf_siginfo.si_sc.sc_edi = regs->tf_edi; + sf.sf_siginfo.si_sc.sc_cs = regs->tf_cs; + sf.sf_siginfo.si_sc.sc_ds = regs->tf_ds; + sf.sf_siginfo.si_sc.sc_ss = regs->tf_ss; + sf.sf_siginfo.si_sc.sc_es = regs->tf_es; + sf.sf_siginfo.si_sc.sc_fs = regs->tf_fs; + sf.sf_siginfo.si_sc.sc_gs = rgs(); + sf.sf_siginfo.si_sc.sc_isp = regs->tf_isp; + + /* Build the signal context to be used by osigreturn(). */ + sf.sf_siginfo.si_sc.sc_onstack = (oonstack) ? 1 : 0; + SIG2OSIG(*mask, sf.sf_siginfo.si_sc.sc_mask); + sf.sf_siginfo.si_sc.sc_sp = regs->tf_esp; + sf.sf_siginfo.si_sc.sc_fp = regs->tf_ebp; + sf.sf_siginfo.si_sc.sc_pc = regs->tf_eip; + sf.sf_siginfo.si_sc.sc_ps = regs->tf_eflags; + sf.sf_siginfo.si_sc.sc_trapno = regs->tf_trapno; + sf.sf_siginfo.si_sc.sc_err = regs->tf_err; + + /* + * If we're a vm86 process, we want to save the segment registers. + * We also change eflags to be our emulated eflags, not the actual + * eflags. + */ + if (regs->tf_eflags & PSL_VM) { + /* XXX confusing names: `tf' isn't a trapframe; `regs' is. */ + struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs; + struct vm86_kernel *vm86 = &td->td_pcb->pcb_ext->ext_vm86; + + sf.sf_siginfo.si_sc.sc_gs = tf->tf_vm86_gs; + sf.sf_siginfo.si_sc.sc_fs = tf->tf_vm86_fs; + sf.sf_siginfo.si_sc.sc_es = tf->tf_vm86_es; + sf.sf_siginfo.si_sc.sc_ds = tf->tf_vm86_ds; + + if (vm86->vm86_has_vme == 0) + sf.sf_siginfo.si_sc.sc_ps = + (tf->tf_eflags & ~(PSL_VIF | PSL_VIP)) | + (vm86->vm86_eflags & (PSL_VIF | PSL_VIP)); + + /* See sendsig() for comments. */ + tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_VIF | PSL_VIP); + } + + /* + * Copy the sigframe out to the user's stack. + */ + if (copyout(&sf, fp, sizeof(*fp)) != 0) { + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + regs->tf_esp = (int)fp; + if (p->p_sysent->sv_sigcode_base != 0) { + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szosigcode; + } else { + /* a.out sysentvec does not use shared page */ + regs->tf_eip = p->p_sysent->sv_psstrings - szosigcode; + } + regs->tf_eflags &= ~(PSL_T | PSL_D); + regs->tf_cs = _ucodesel; + regs->tf_ds = _udatasel; + regs->tf_es = _udatasel; + regs->tf_fs = _udatasel; + load_gs(_udatasel); + regs->tf_ss = _udatasel; + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); +} +#endif /* COMPAT_43 */ + +#ifdef COMPAT_FREEBSD4 +static void +freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) +{ + struct sigframe4 sf, *sfp; + struct proc *p; + struct thread *td; + struct sigacts *psp; + struct trapframe *regs; + int sig; + int oonstack; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + sig = ksi->ksi_signo; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); + regs = td->td_frame; + oonstack = sigonstack(regs->tf_esp); + + /* Save user context. */ + bzero(&sf, sizeof(sf)); + sf.sf_uc.uc_sigmask = *mask; + sf.sf_uc.uc_stack = td->td_sigstk; + sf.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) + ? ((oonstack) ? SS_ONSTACK : 0) : SS_DISABLE; + sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0; + sf.sf_uc.uc_mcontext.mc_gs = rgs(); + bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs)); + bzero(sf.sf_uc.uc_mcontext.mc_fpregs, + sizeof(sf.sf_uc.uc_mcontext.mc_fpregs)); + bzero(sf.sf_uc.uc_mcontext.__spare__, + sizeof(sf.sf_uc.uc_mcontext.__spare__)); + bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); + + /* Allocate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + sfp = (struct sigframe4 *)((uintptr_t)td->td_sigstk.ss_sp + + td->td_sigstk.ss_size - sizeof(struct sigframe4)); +#if defined(COMPAT_43) + td->td_sigstk.ss_flags |= SS_ONSTACK; +#endif + } else + sfp = (struct sigframe4 *)regs->tf_esp - 1; + + /* Build the argument list for the signal handler. */ + sf.sf_signum = sig; + sf.sf_ucontext = (register_t)&sfp->sf_uc; + bzero(&sf.sf_si, sizeof(sf.sf_si)); + if (SIGISMEMBER(psp->ps_siginfo, sig)) { + /* Signal handler installed with SA_SIGINFO. */ + sf.sf_siginfo = (register_t)&sfp->sf_si; + sf.sf_ahu.sf_action = (__siginfohandler_t *)catcher; + + /* Fill in POSIX parts */ + sf.sf_si.si_signo = sig; + sf.sf_si.si_code = ksi->ksi_code; + sf.sf_si.si_addr = ksi->ksi_addr; + } else { + /* Old FreeBSD-style arguments. */ + sf.sf_siginfo = ksi->ksi_code; + sf.sf_addr = (register_t)ksi->ksi_addr; + sf.sf_ahu.sf_handler = catcher; + } + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(p); + + /* + * If we're a vm86 process, we want to save the segment registers. + * We also change eflags to be our emulated eflags, not the actual + * eflags. + */ + if (regs->tf_eflags & PSL_VM) { + struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs; + struct vm86_kernel *vm86 = &td->td_pcb->pcb_ext->ext_vm86; + + sf.sf_uc.uc_mcontext.mc_gs = tf->tf_vm86_gs; + sf.sf_uc.uc_mcontext.mc_fs = tf->tf_vm86_fs; + sf.sf_uc.uc_mcontext.mc_es = tf->tf_vm86_es; + sf.sf_uc.uc_mcontext.mc_ds = tf->tf_vm86_ds; + + if (vm86->vm86_has_vme == 0) + sf.sf_uc.uc_mcontext.mc_eflags = + (tf->tf_eflags & ~(PSL_VIF | PSL_VIP)) | + (vm86->vm86_eflags & (PSL_VIF | PSL_VIP)); + + /* + * Clear PSL_NT to inhibit T_TSSFLT faults on return from + * syscalls made by the signal handler. This just avoids + * wasting time for our lazy fixup of such faults. PSL_NT + * does nothing in vm86 mode, but vm86 programs can set it + * almost legitimately in probes for old cpu types. + */ + tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_VIF | PSL_VIP); + } + + /* + * Copy the sigframe out to the user's stack. + */ + if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + regs->tf_esp = (int)sfp; + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szfreebsd4_sigcode; + regs->tf_eflags &= ~(PSL_T | PSL_D); + regs->tf_cs = _ucodesel; + regs->tf_ds = _udatasel; + regs->tf_es = _udatasel; + regs->tf_fs = _udatasel; + regs->tf_ss = _udatasel; + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); +} +#endif /* COMPAT_FREEBSD4 */ + +void +sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) +{ + struct sigframe sf, *sfp; + struct proc *p; + struct thread *td; + struct sigacts *psp; + char *sp; + struct trapframe *regs; + struct segment_descriptor *sdp; + char *xfpusave; + size_t xfpusave_len; + int sig; + int oonstack; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + sig = ksi->ksi_signo; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); +#ifdef COMPAT_FREEBSD4 + if (SIGISMEMBER(psp->ps_freebsd4, sig)) { + freebsd4_sendsig(catcher, ksi, mask); + return; + } +#endif +#ifdef COMPAT_43 + if (SIGISMEMBER(psp->ps_osigset, sig)) { + osendsig(catcher, ksi, mask); + return; + } +#endif + regs = td->td_frame; + oonstack = sigonstack(regs->tf_esp); + + if (cpu_max_ext_state_size > sizeof(union savefpu) && use_xsave) { + xfpusave_len = cpu_max_ext_state_size - sizeof(union savefpu); + xfpusave = __builtin_alloca(xfpusave_len); + } else { + xfpusave_len = 0; + xfpusave = NULL; + } + + /* Save user context. */ + bzero(&sf, sizeof(sf)); + sf.sf_uc.uc_sigmask = *mask; + sf.sf_uc.uc_stack = td->td_sigstk; + sf.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) + ? ((oonstack) ? SS_ONSTACK : 0) : SS_DISABLE; + sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0; + sf.sf_uc.uc_mcontext.mc_gs = rgs(); + bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs)); + sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ + get_fpcontext(td, &sf.sf_uc.uc_mcontext, xfpusave, xfpusave_len); + fpstate_drop(td); + /* + * Unconditionally fill the fsbase and gsbase into the mcontext. + */ + sdp = &td->td_pcb->pcb_fsd; + sf.sf_uc.uc_mcontext.mc_fsbase = sdp->sd_hibase << 24 | + sdp->sd_lobase; + sdp = &td->td_pcb->pcb_gsd; + sf.sf_uc.uc_mcontext.mc_gsbase = sdp->sd_hibase << 24 | + sdp->sd_lobase; + bzero(sf.sf_uc.uc_mcontext.mc_spare2, + sizeof(sf.sf_uc.uc_mcontext.mc_spare2)); + + /* Allocate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; +#if defined(COMPAT_43) + td->td_sigstk.ss_flags |= SS_ONSTACK; +#endif + } else + sp = (char *)regs->tf_esp - 128; + if (xfpusave != NULL) { + sp -= xfpusave_len; + sp = (char *)((unsigned int)sp & ~0x3F); + sf.sf_uc.uc_mcontext.mc_xfpustate = (register_t)sp; + } + sp -= sizeof(struct sigframe); + + /* Align to 16 bytes. */ + sfp = (struct sigframe *)((unsigned int)sp & ~0xF); + + /* Build the argument list for the signal handler. */ + sf.sf_signum = sig; + sf.sf_ucontext = (register_t)&sfp->sf_uc; + bzero(&sf.sf_si, sizeof(sf.sf_si)); + if (SIGISMEMBER(psp->ps_siginfo, sig)) { + /* Signal handler installed with SA_SIGINFO. */ + sf.sf_siginfo = (register_t)&sfp->sf_si; + sf.sf_ahu.sf_action = (__siginfohandler_t *)catcher; + + /* Fill in POSIX parts */ + sf.sf_si = ksi->ksi_info; + sf.sf_si.si_signo = sig; /* maybe a translated signal */ + } else { + /* Old FreeBSD-style arguments. */ + sf.sf_siginfo = ksi->ksi_code; + sf.sf_addr = (register_t)ksi->ksi_addr; + sf.sf_ahu.sf_handler = catcher; + } + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(p); + + /* + * If we're a vm86 process, we want to save the segment registers. + * We also change eflags to be our emulated eflags, not the actual + * eflags. + */ + if (regs->tf_eflags & PSL_VM) { + struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs; + struct vm86_kernel *vm86 = &td->td_pcb->pcb_ext->ext_vm86; + + sf.sf_uc.uc_mcontext.mc_gs = tf->tf_vm86_gs; + sf.sf_uc.uc_mcontext.mc_fs = tf->tf_vm86_fs; + sf.sf_uc.uc_mcontext.mc_es = tf->tf_vm86_es; + sf.sf_uc.uc_mcontext.mc_ds = tf->tf_vm86_ds; + + if (vm86->vm86_has_vme == 0) + sf.sf_uc.uc_mcontext.mc_eflags = + (tf->tf_eflags & ~(PSL_VIF | PSL_VIP)) | + (vm86->vm86_eflags & (PSL_VIF | PSL_VIP)); + + /* + * Clear PSL_NT to inhibit T_TSSFLT faults on return from + * syscalls made by the signal handler. This just avoids + * wasting time for our lazy fixup of such faults. PSL_NT + * does nothing in vm86 mode, but vm86 programs can set it + * almost legitimately in probes for old cpu types. + */ + tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_VIF | PSL_VIP); + } + + /* + * Copy the sigframe out to the user's stack. + */ + if (copyout(&sf, sfp, sizeof(*sfp)) != 0 || + (xfpusave != NULL && copyout(xfpusave, + (void *)sf.sf_uc.uc_mcontext.mc_xfpustate, xfpusave_len) + != 0)) { + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + regs->tf_esp = (int)sfp; + regs->tf_eip = p->p_sysent->sv_sigcode_base; + if (regs->tf_eip == 0) + regs->tf_eip = p->p_sysent->sv_psstrings - szsigcode; + regs->tf_eflags &= ~(PSL_T | PSL_D); + regs->tf_cs = _ucodesel; + regs->tf_ds = _udatasel; + regs->tf_es = _udatasel; + regs->tf_fs = _udatasel; + regs->tf_ss = _udatasel; + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); +} + +/* + * System call to cleanup state after a signal has been taken. Reset + * signal mask and stack state from context left by sendsig (above). + * Return to previous pc and psl as specified by context left by + * sendsig. Check carefully to make sure that the user has not + * modified the state to gain improper privileges. + */ +#ifdef COMPAT_43 +int +osigreturn(struct thread *td, struct osigreturn_args *uap) +{ + struct osigcontext sc; + struct trapframe *regs; + struct osigcontext *scp; + int eflags, error; + ksiginfo_t ksi; + + regs = td->td_frame; + error = copyin(uap->sigcntxp, &sc, sizeof(sc)); + if (error != 0) + return (error); + scp = ≻ + eflags = scp->sc_ps; + if (eflags & PSL_VM) { + struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs; + struct vm86_kernel *vm86; + + /* + * if pcb_ext == 0 or vm86_inited == 0, the user hasn't + * set up the vm86 area, and we can't enter vm86 mode. + */ + if (td->td_pcb->pcb_ext == 0) + return (EINVAL); + vm86 = &td->td_pcb->pcb_ext->ext_vm86; + if (vm86->vm86_inited == 0) + return (EINVAL); + + /* Go back to user mode if both flags are set. */ + if ((eflags & PSL_VIP) && (eflags & PSL_VIF)) { + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGBUS; + ksi.ksi_code = BUS_OBJERR; + ksi.ksi_addr = (void *)regs->tf_eip; + trapsignal(td, &ksi); + } + + if (vm86->vm86_has_vme) { + eflags = (tf->tf_eflags & ~VME_USERCHANGE) | + (eflags & VME_USERCHANGE) | PSL_VM; + } else { + vm86->vm86_eflags = eflags; /* save VIF, VIP */ + eflags = (tf->tf_eflags & ~VM_USERCHANGE) | + (eflags & VM_USERCHANGE) | PSL_VM; + } + tf->tf_vm86_ds = scp->sc_ds; + tf->tf_vm86_es = scp->sc_es; + tf->tf_vm86_fs = scp->sc_fs; + tf->tf_vm86_gs = scp->sc_gs; + tf->tf_ds = _udatasel; + tf->tf_es = _udatasel; + tf->tf_fs = _udatasel; + } else { + /* + * Don't allow users to change privileged or reserved flags. + */ + if (!EFL_SECURE(eflags, regs->tf_eflags)) { + return (EINVAL); + } + + /* + * Don't allow users to load a valid privileged %cs. Let the + * hardware check for invalid selectors, excess privilege in + * other selectors, invalid %eip's and invalid %esp's. + */ + if (!CS_SECURE(scp->sc_cs)) { + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGBUS; + ksi.ksi_code = BUS_OBJERR; + ksi.ksi_trapno = T_PROTFLT; + ksi.ksi_addr = (void *)regs->tf_eip; + trapsignal(td, &ksi); + return (EINVAL); + } + regs->tf_ds = scp->sc_ds; + regs->tf_es = scp->sc_es; + regs->tf_fs = scp->sc_fs; + } + + /* Restore remaining registers. */ + regs->tf_eax = scp->sc_eax; + regs->tf_ebx = scp->sc_ebx; + regs->tf_ecx = scp->sc_ecx; + regs->tf_edx = scp->sc_edx; + regs->tf_esi = scp->sc_esi; + regs->tf_edi = scp->sc_edi; + regs->tf_cs = scp->sc_cs; + regs->tf_ss = scp->sc_ss; + regs->tf_isp = scp->sc_isp; + regs->tf_ebp = scp->sc_fp; + regs->tf_esp = scp->sc_sp; + regs->tf_eip = scp->sc_pc; + regs->tf_eflags = eflags; + +#if defined(COMPAT_43) + if (scp->sc_onstack & 1) + td->td_sigstk.ss_flags |= SS_ONSTACK; + else + td->td_sigstk.ss_flags &= ~SS_ONSTACK; +#endif + kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL, + SIGPROCMASK_OLD); + return (EJUSTRETURN); +} +#endif /* COMPAT_43 */ + +#ifdef COMPAT_FREEBSD4 +int +freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) +{ + struct ucontext4 uc; + struct trapframe *regs; + struct ucontext4 *ucp; + int cs, eflags, error; + ksiginfo_t ksi; + + error = copyin(uap->sigcntxp, &uc, sizeof(uc)); + if (error != 0) + return (error); + ucp = &uc; + regs = td->td_frame; + eflags = ucp->uc_mcontext.mc_eflags; + if (eflags & PSL_VM) { + struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs; + struct vm86_kernel *vm86; + + /* + * if pcb_ext == 0 or vm86_inited == 0, the user hasn't + * set up the vm86 area, and we can't enter vm86 mode. + */ + if (td->td_pcb->pcb_ext == 0) + return (EINVAL); + vm86 = &td->td_pcb->pcb_ext->ext_vm86; + if (vm86->vm86_inited == 0) + return (EINVAL); + + /* Go back to user mode if both flags are set. */ + if ((eflags & PSL_VIP) && (eflags & PSL_VIF)) { + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGBUS; + ksi.ksi_code = BUS_OBJERR; + ksi.ksi_addr = (void *)regs->tf_eip; + trapsignal(td, &ksi); + } + if (vm86->vm86_has_vme) { + eflags = (tf->tf_eflags & ~VME_USERCHANGE) | + (eflags & VME_USERCHANGE) | PSL_VM; + } else { + vm86->vm86_eflags = eflags; /* save VIF, VIP */ + eflags = (tf->tf_eflags & ~VM_USERCHANGE) | + (eflags & VM_USERCHANGE) | PSL_VM; + } + bcopy(&ucp->uc_mcontext.mc_fs, tf, sizeof(struct trapframe)); + tf->tf_eflags = eflags; + tf->tf_vm86_ds = tf->tf_ds; + tf->tf_vm86_es = tf->tf_es; + tf->tf_vm86_fs = tf->tf_fs; + tf->tf_vm86_gs = ucp->uc_mcontext.mc_gs; + tf->tf_ds = _udatasel; + tf->tf_es = _udatasel; + tf->tf_fs = _udatasel; + } else { + /* + * Don't allow users to change privileged or reserved flags. + */ + if (!EFL_SECURE(eflags, regs->tf_eflags)) { + uprintf( + "pid %d (%s): freebsd4_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); + return (EINVAL); + } + + /* + * Don't allow users to load a valid privileged %cs. Let the + * hardware check for invalid selectors, excess privilege in + * other selectors, invalid %eip's and invalid %esp's. + */ + cs = ucp->uc_mcontext.mc_cs; + if (!CS_SECURE(cs)) { + uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGBUS; + ksi.ksi_code = BUS_OBJERR; + ksi.ksi_trapno = T_PROTFLT; + ksi.ksi_addr = (void *)regs->tf_eip; + trapsignal(td, &ksi); + return (EINVAL); + } + + bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); + } + +#if defined(COMPAT_43) + if (ucp->uc_mcontext.mc_onstack & 1) + td->td_sigstk.ss_flags |= SS_ONSTACK; + else + td->td_sigstk.ss_flags &= ~SS_ONSTACK; +#endif + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); + return (EJUSTRETURN); +} +#endif /* COMPAT_FREEBSD4 */ + +int +sys_sigreturn(struct thread *td, struct sigreturn_args *uap) +{ + ucontext_t uc; + struct proc *p; + struct trapframe *regs; + ucontext_t *ucp; + char *xfpustate; + size_t xfpustate_len; + int cs, eflags, error, ret; + ksiginfo_t ksi; + + p = td->td_proc; + + error = copyin(uap->sigcntxp, &uc, sizeof(uc)); + if (error != 0) + return (error); + ucp = &uc; + if ((ucp->uc_mcontext.mc_flags & ~_MC_FLAG_MASK) != 0) { + uprintf("pid %d (%s): sigreturn mc_flags %x\n", p->p_pid, + td->td_name, ucp->uc_mcontext.mc_flags); + return (EINVAL); + } + regs = td->td_frame; + eflags = ucp->uc_mcontext.mc_eflags; + if (eflags & PSL_VM) { + struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs; + struct vm86_kernel *vm86; + + /* + * if pcb_ext == 0 or vm86_inited == 0, the user hasn't + * set up the vm86 area, and we can't enter vm86 mode. + */ + if (td->td_pcb->pcb_ext == 0) + return (EINVAL); + vm86 = &td->td_pcb->pcb_ext->ext_vm86; + if (vm86->vm86_inited == 0) + return (EINVAL); + + /* Go back to user mode if both flags are set. */ + if ((eflags & PSL_VIP) && (eflags & PSL_VIF)) { + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGBUS; + ksi.ksi_code = BUS_OBJERR; + ksi.ksi_addr = (void *)regs->tf_eip; + trapsignal(td, &ksi); + } + + if (vm86->vm86_has_vme) { + eflags = (tf->tf_eflags & ~VME_USERCHANGE) | + (eflags & VME_USERCHANGE) | PSL_VM; + } else { + vm86->vm86_eflags = eflags; /* save VIF, VIP */ + eflags = (tf->tf_eflags & ~VM_USERCHANGE) | + (eflags & VM_USERCHANGE) | PSL_VM; + } + bcopy(&ucp->uc_mcontext.mc_fs, tf, sizeof(struct trapframe)); + tf->tf_eflags = eflags; + tf->tf_vm86_ds = tf->tf_ds; + tf->tf_vm86_es = tf->tf_es; + tf->tf_vm86_fs = tf->tf_fs; + tf->tf_vm86_gs = ucp->uc_mcontext.mc_gs; + tf->tf_ds = _udatasel; + tf->tf_es = _udatasel; + tf->tf_fs = _udatasel; + } else { + /* + * Don't allow users to change privileged or reserved flags. + */ + if (!EFL_SECURE(eflags, regs->tf_eflags)) { + uprintf("pid %d (%s): sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); + return (EINVAL); + } + + /* + * Don't allow users to load a valid privileged %cs. Let the + * hardware check for invalid selectors, excess privilege in + * other selectors, invalid %eip's and invalid %esp's. + */ + cs = ucp->uc_mcontext.mc_cs; + if (!CS_SECURE(cs)) { + uprintf("pid %d (%s): sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGBUS; + ksi.ksi_code = BUS_OBJERR; + ksi.ksi_trapno = T_PROTFLT; + ksi.ksi_addr = (void *)regs->tf_eip; + trapsignal(td, &ksi); + return (EINVAL); + } + + if ((uc.uc_mcontext.mc_flags & _MC_HASFPXSTATE) != 0) { + xfpustate_len = uc.uc_mcontext.mc_xfpustate_len; + if (xfpustate_len > cpu_max_ext_state_size - + sizeof(union savefpu)) { + uprintf( + "pid %d (%s): sigreturn xfpusave_len = 0x%zx\n", + p->p_pid, td->td_name, xfpustate_len); + return (EINVAL); + } + xfpustate = __builtin_alloca(xfpustate_len); + error = copyin( + (const void *)uc.uc_mcontext.mc_xfpustate, + xfpustate, xfpustate_len); + if (error != 0) { + uprintf( + "pid %d (%s): sigreturn copying xfpustate failed\n", + p->p_pid, td->td_name); + return (error); + } + } else { + xfpustate = NULL; + xfpustate_len = 0; + } + ret = set_fpcontext(td, &ucp->uc_mcontext, xfpustate, + xfpustate_len); + if (ret != 0) + return (ret); + bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); + } + +#if defined(COMPAT_43) + if (ucp->uc_mcontext.mc_onstack & 1) + td->td_sigstk.ss_flags |= SS_ONSTACK; + else + td->td_sigstk.ss_flags &= ~SS_ONSTACK; +#endif + + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); + return (EJUSTRETURN); +} + +/* + * Reset the hardware debug registers if they were in use. + * They won't have any meaning for the newly exec'd process. + */ +void +x86_clear_dbregs(struct pcb *pcb) +{ + if ((pcb->pcb_flags & PCB_DBREGS) == 0) + return; + + pcb->pcb_dr0 = 0; + pcb->pcb_dr1 = 0; + pcb->pcb_dr2 = 0; + pcb->pcb_dr3 = 0; + pcb->pcb_dr6 = 0; + pcb->pcb_dr7 = 0; + + if (pcb == curpcb) { + /* + * Clear the debug registers on the running CPU, + * otherwise they will end up affecting the next + * process we switch to. + */ + reset_dbregs(); + } + pcb->pcb_flags &= ~PCB_DBREGS; +} + +#ifdef COMPAT_43 +static void +setup_priv_lcall_gate(struct proc *p) +{ + struct i386_ldt_args uap; + union descriptor desc; + u_int lcall_addr; + + bzero(&uap, sizeof(uap)); + uap.start = 0; + uap.num = 1; + lcall_addr = p->p_sysent->sv_psstrings - sz_lcall_tramp; + bzero(&desc, sizeof(desc)); + desc.sd.sd_type = SDT_MEMERA; + desc.sd.sd_dpl = SEL_UPL; + desc.sd.sd_p = 1; + desc.sd.sd_def32 = 1; + desc.sd.sd_gran = 1; + desc.sd.sd_lolimit = 0xffff; + desc.sd.sd_hilimit = 0xf; + desc.sd.sd_lobase = lcall_addr; + desc.sd.sd_hibase = lcall_addr >> 24; + i386_set_ldt(curthread, &uap, &desc); +} +#endif + +/* + * Reset registers to default values on exec. + */ +void *** 1973 LINES SKIPPED *** From nobody Fri Oct 8 00:21:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C4C9B17E3CB7; Fri, 8 Oct 2021 00:21: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 4HQTPp44hLz3Q8p; Fri, 8 Oct 2021 00:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 533161D681; Fri, 8 Oct 2021 00:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980LIWF038940; Fri, 8 Oct 2021 00:21:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980LIP9038939; Fri, 8 Oct 2021 00:21:18 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:21:18 GMT Message-Id: <202110080021.1980LIP9038939@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: b4ae6b166066 - main - arm64: move signal delivery code to exec_machdep.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4ae6b166066a789641e4a579020ca6b10b40cfa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b4ae6b166066a789641e4a579020ca6b10b40cfa commit b4ae6b166066a789641e4a579020ca6b10b40cfa Author: Konstantin Belousov AuthorDate: 2021-10-04 06:55:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:20:42 +0000 arm64: move signal delivery code to exec_machdep.c also move ptrace-related helpers to ptrace_machdep.c. Reviewed by: emaste, imp Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32310 --- sys/arm64/arm64/exec_machdep.c | 617 +++++++++++++++++++++++++++++++++++++++ sys/arm64/arm64/machdep.c | 588 ------------------------------------- sys/arm64/arm64/ptrace_machdep.c | 76 +++++ sys/conf/files.arm64 | 2 + 4 files changed, 695 insertions(+), 588 deletions(-) diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c new file mode 100644 index 000000000000..25fd9401df8c --- /dev/null +++ b/sys/arm64/arm64/exec_machdep.c @@ -0,0 +1,617 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#ifdef VFP +#include +#endif + +static void get_fpcontext(struct thread *td, mcontext_t *mcp); +static void set_fpcontext(struct thread *td, mcontext_t *mcp); + +int +fill_regs(struct thread *td, struct reg *regs) +{ + struct trapframe *frame; + + frame = td->td_frame; + regs->sp = frame->tf_sp; + regs->lr = frame->tf_lr; + regs->elr = frame->tf_elr; + regs->spsr = frame->tf_spsr; + + memcpy(regs->x, frame->tf_x, sizeof(regs->x)); + +#ifdef COMPAT_FREEBSD32 + /* + * We may be called here for a 32bits process, if we're using a + * 64bits debugger. If so, put PC and SPSR where it expects it. + */ + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + regs->x[15] = frame->tf_elr; + regs->x[16] = frame->tf_spsr; + } +#endif + return (0); +} + +int +set_regs(struct thread *td, struct reg *regs) +{ + struct trapframe *frame; + + frame = td->td_frame; + frame->tf_sp = regs->sp; + frame->tf_lr = regs->lr; + frame->tf_spsr &= ~PSR_FLAGS; + + memcpy(frame->tf_x, regs->x, sizeof(frame->tf_x)); + +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + /* + * We may be called for a 32bits process if we're using + * a 64bits debugger. If so, get PC and SPSR from where + * it put it. + */ + frame->tf_elr = regs->x[15]; + frame->tf_spsr |= regs->x[16] & PSR_FLAGS; + } else +#endif + { + frame->tf_elr = regs->elr; + frame->tf_spsr |= regs->spsr & PSR_FLAGS; + } + return (0); +} + +int +fill_fpregs(struct thread *td, struct fpreg *regs) +{ +#ifdef VFP + struct pcb *pcb; + + pcb = td->td_pcb; + if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) { + /* + * If we have just been running VFP instructions we will + * need to save the state to memcpy it below. + */ + if (td == curthread) + vfp_save_state(td, pcb); + + KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, + ("Called fill_fpregs while the kernel is using the VFP")); + memcpy(regs->fp_q, pcb->pcb_fpustate.vfp_regs, + sizeof(regs->fp_q)); + regs->fp_cr = pcb->pcb_fpustate.vfp_fpcr; + regs->fp_sr = pcb->pcb_fpustate.vfp_fpsr; + } else +#endif + memset(regs, 0, sizeof(*regs)); + return (0); +} + +int +set_fpregs(struct thread *td, struct fpreg *regs) +{ +#ifdef VFP + struct pcb *pcb; + + pcb = td->td_pcb; + KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, + ("Called set_fpregs while the kernel is using the VFP")); + memcpy(pcb->pcb_fpustate.vfp_regs, regs->fp_q, sizeof(regs->fp_q)); + pcb->pcb_fpustate.vfp_fpcr = regs->fp_cr; + pcb->pcb_fpustate.vfp_fpsr = regs->fp_sr; +#endif + return (0); +} + +int +fill_dbregs(struct thread *td, struct dbreg *regs) +{ + struct debug_monitor_state *monitor; + int i; + uint8_t debug_ver, nbkpts, nwtpts; + + memset(regs, 0, sizeof(*regs)); + + extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_DebugVer_SHIFT, + &debug_ver); + extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_BRPs_SHIFT, + &nbkpts); + extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_WRPs_SHIFT, + &nwtpts); + + /* + * The BRPs field contains the number of breakpoints - 1. Armv8-A + * allows the hardware to provide 2-16 breakpoints so this won't + * overflow an 8 bit value. The same applies to the WRPs field. + */ + nbkpts++; + nwtpts++; + + regs->db_debug_ver = debug_ver; + regs->db_nbkpts = nbkpts; + regs->db_nwtpts = nwtpts; + + monitor = &td->td_pcb->pcb_dbg_regs; + if ((monitor->dbg_flags & DBGMON_ENABLED) != 0) { + for (i = 0; i < nbkpts; i++) { + regs->db_breakregs[i].dbr_addr = monitor->dbg_bvr[i]; + regs->db_breakregs[i].dbr_ctrl = monitor->dbg_bcr[i]; + } + for (i = 0; i < nwtpts; i++) { + regs->db_watchregs[i].dbw_addr = monitor->dbg_wvr[i]; + regs->db_watchregs[i].dbw_ctrl = monitor->dbg_wcr[i]; + } + } + + return (0); +} + +int +set_dbregs(struct thread *td, struct dbreg *regs) +{ + struct debug_monitor_state *monitor; + uint64_t addr; + uint32_t ctrl; + int count; + int i; + + monitor = &td->td_pcb->pcb_dbg_regs; + count = 0; + monitor->dbg_enable_count = 0; + + for (i = 0; i < DBG_BRP_MAX; i++) { + addr = regs->db_breakregs[i].dbr_addr; + ctrl = regs->db_breakregs[i].dbr_ctrl; + + /* + * Don't let the user set a breakpoint on a kernel or + * non-canonical user address. + */ + if (addr >= VM_MAXUSER_ADDRESS) + return (EINVAL); + + /* + * The lowest 2 bits are ignored, so record the effective + * address. + */ + addr = rounddown2(addr, 4); + + /* + * Some control fields are ignored, and other bits reserved. + * Only unlinked, address-matching breakpoints are supported. + * + * XXX: fields that appear unvalidated, such as BAS, have + * constrained undefined behaviour. If the user mis-programs + * these, there is no risk to the system. + */ + ctrl &= DBG_BCR_EN | DBG_BCR_PMC | DBG_BCR_BAS; + if ((ctrl & DBG_BCR_EN) != 0) { + /* Only target EL0. */ + if ((ctrl & DBG_BCR_PMC) != DBG_BCR_PMC_EL0) + return (EINVAL); + + monitor->dbg_enable_count++; + } + + monitor->dbg_bvr[i] = addr; + monitor->dbg_bcr[i] = ctrl; + } + + for (i = 0; i < DBG_WRP_MAX; i++) { + addr = regs->db_watchregs[i].dbw_addr; + ctrl = regs->db_watchregs[i].dbw_ctrl; + + /* + * Don't let the user set a watchpoint on a kernel or + * non-canonical user address. + */ + if (addr >= VM_MAXUSER_ADDRESS) + return (EINVAL); + + /* + * Some control fields are ignored, and other bits reserved. + * Only unlinked watchpoints are supported. + */ + ctrl &= DBG_WCR_EN | DBG_WCR_PAC | DBG_WCR_LSC | DBG_WCR_BAS | + DBG_WCR_MASK; + + if ((ctrl & DBG_WCR_EN) != 0) { + /* Only target EL0. */ + if ((ctrl & DBG_WCR_PAC) != DBG_WCR_PAC_EL0) + return (EINVAL); + + /* Must set at least one of the load/store bits. */ + if ((ctrl & DBG_WCR_LSC) == 0) + return (EINVAL); + + /* + * When specifying the address range with BAS, the MASK + * field must be zero. + */ + if ((ctrl & DBG_WCR_BAS) != DBG_WCR_BAS_MASK && + (ctrl & DBG_WCR_MASK) != 0) + return (EINVAL); + + monitor->dbg_enable_count++; + } + monitor->dbg_wvr[i] = addr; + monitor->dbg_wcr[i] = ctrl; + } + + if (monitor->dbg_enable_count > 0) + monitor->dbg_flags |= DBGMON_ENABLED; + + return (0); +} + +#ifdef COMPAT_FREEBSD32 +int +fill_regs32(struct thread *td, struct reg32 *regs) +{ + int i; + struct trapframe *tf; + + tf = td->td_frame; + for (i = 0; i < 13; i++) + regs->r[i] = tf->tf_x[i]; + /* For arm32, SP is r13 and LR is r14 */ + regs->r_sp = tf->tf_x[13]; + regs->r_lr = tf->tf_x[14]; + regs->r_pc = tf->tf_elr; + regs->r_cpsr = tf->tf_spsr; + + return (0); +} + +int +set_regs32(struct thread *td, struct reg32 *regs) +{ + int i; + struct trapframe *tf; + + tf = td->td_frame; + for (i = 0; i < 13; i++) + tf->tf_x[i] = regs->r[i]; + /* For arm 32, SP is r13 an LR is r14 */ + tf->tf_x[13] = regs->r_sp; + tf->tf_x[14] = regs->r_lr; + tf->tf_elr = regs->r_pc; + tf->tf_spsr &= ~PSR_FLAGS; + tf->tf_spsr |= regs->r_cpsr & PSR_FLAGS; + + return (0); +} + +/* XXX fill/set dbregs/fpregs are stubbed on 32-bit arm. */ +int +fill_fpregs32(struct thread *td, struct fpreg32 *regs) +{ + + memset(regs, 0, sizeof(*regs)); + return (0); +} + +int +set_fpregs32(struct thread *td, struct fpreg32 *regs) +{ + + return (0); +} + +int +fill_dbregs32(struct thread *td, struct dbreg32 *regs) +{ + + memset(regs, 0, sizeof(*regs)); + return (0); +} + +int +set_dbregs32(struct thread *td, struct dbreg32 *regs) +{ + + return (0); +} +#endif + +void +exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) +{ + struct trapframe *tf = td->td_frame; + struct pcb *pcb = td->td_pcb; + + memset(tf, 0, sizeof(struct trapframe)); + + tf->tf_x[0] = stack; + tf->tf_sp = STACKALIGN(stack); + tf->tf_lr = imgp->entry_addr; + tf->tf_elr = imgp->entry_addr; + + td->td_pcb->pcb_tpidr_el0 = 0; + td->td_pcb->pcb_tpidrro_el0 = 0; + WRITE_SPECIALREG(tpidrro_el0, 0); + WRITE_SPECIALREG(tpidr_el0, 0); + +#ifdef VFP + vfp_reset_state(td, pcb); +#endif + + /* + * Clear debug register state. It is not applicable to the new process. + */ + bzero(&pcb->pcb_dbg_regs, sizeof(pcb->pcb_dbg_regs)); +} + +/* Sanity check these are the same size, they will be memcpy'd to and from */ +CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == + sizeof((struct gpregs *)0)->gp_x); +CTASSERT(sizeof(((struct trapframe *)0)->tf_x) == + sizeof((struct reg *)0)->x); + +int +get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret) +{ + struct trapframe *tf = td->td_frame; + + if (clear_ret & GET_MC_CLEAR_RET) { + mcp->mc_gpregs.gp_x[0] = 0; + mcp->mc_gpregs.gp_spsr = tf->tf_spsr & ~PSR_C; + } else { + mcp->mc_gpregs.gp_x[0] = tf->tf_x[0]; + mcp->mc_gpregs.gp_spsr = tf->tf_spsr; + } + + memcpy(&mcp->mc_gpregs.gp_x[1], &tf->tf_x[1], + sizeof(mcp->mc_gpregs.gp_x[1]) * (nitems(mcp->mc_gpregs.gp_x) - 1)); + + mcp->mc_gpregs.gp_sp = tf->tf_sp; + mcp->mc_gpregs.gp_lr = tf->tf_lr; + mcp->mc_gpregs.gp_elr = tf->tf_elr; + get_fpcontext(td, mcp); + + return (0); +} + +int +set_mcontext(struct thread *td, mcontext_t *mcp) +{ + struct trapframe *tf = td->td_frame; + uint32_t spsr; + + spsr = mcp->mc_gpregs.gp_spsr; + if ((spsr & PSR_M_MASK) != PSR_M_EL0t || + (spsr & PSR_AARCH32) != 0 || + (spsr & PSR_DAIF) != (td->td_frame->tf_spsr & PSR_DAIF)) + return (EINVAL); + + memcpy(tf->tf_x, mcp->mc_gpregs.gp_x, sizeof(tf->tf_x)); + + tf->tf_sp = mcp->mc_gpregs.gp_sp; + tf->tf_lr = mcp->mc_gpregs.gp_lr; + tf->tf_elr = mcp->mc_gpregs.gp_elr; + tf->tf_spsr = mcp->mc_gpregs.gp_spsr; + set_fpcontext(td, mcp); + + return (0); +} + +static void +get_fpcontext(struct thread *td, mcontext_t *mcp) +{ +#ifdef VFP + struct pcb *curpcb; + + critical_enter(); + + curpcb = curthread->td_pcb; + + if ((curpcb->pcb_fpflags & PCB_FP_STARTED) != 0) { + /* + * If we have just been running VFP instructions we will + * need to save the state to memcpy it below. + */ + vfp_save_state(td, curpcb); + + KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, + ("Called get_fpcontext while the kernel is using the VFP")); + KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, + ("Non-userspace FPU flags set in get_fpcontext")); + memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_fpustate.vfp_regs, + sizeof(mcp->mc_fpregs.fp_q)); + mcp->mc_fpregs.fp_cr = curpcb->pcb_fpustate.vfp_fpcr; + mcp->mc_fpregs.fp_sr = curpcb->pcb_fpustate.vfp_fpsr; + mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; + mcp->mc_flags |= _MC_FP_VALID; + } + + critical_exit(); +#endif +} + +static void +set_fpcontext(struct thread *td, mcontext_t *mcp) +{ +#ifdef VFP + struct pcb *curpcb; + + critical_enter(); + + if ((mcp->mc_flags & _MC_FP_VALID) != 0) { + curpcb = curthread->td_pcb; + + /* + * Discard any vfp state for the current thread, we + * are about to override it. + */ + vfp_discard(td); + + KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, + ("Called set_fpcontext while the kernel is using the VFP")); + memcpy(curpcb->pcb_fpustate.vfp_regs, mcp->mc_fpregs.fp_q, + sizeof(mcp->mc_fpregs.fp_q)); + curpcb->pcb_fpustate.vfp_fpcr = mcp->mc_fpregs.fp_cr; + curpcb->pcb_fpustate.vfp_fpsr = mcp->mc_fpregs.fp_sr; + curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; + } + + critical_exit(); +#endif +} + +int +sys_sigreturn(struct thread *td, struct sigreturn_args *uap) +{ + ucontext_t uc; + int error; + + if (copyin(uap->sigcntxp, &uc, sizeof(uc))) + return (EFAULT); + + error = set_mcontext(td, &uc.uc_mcontext); + if (error != 0) + return (error); + + /* Restore signal mask. */ + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); + + return (EJUSTRETURN); +} + +void +sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) +{ + struct thread *td; + struct proc *p; + struct trapframe *tf; + struct sigframe *fp, frame; + struct sigacts *psp; + struct sysentvec *sysent; + int onstack, sig; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + sig = ksi->ksi_signo; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); + + tf = td->td_frame; + onstack = sigonstack(tf->tf_sp); + + CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, + catcher, sig); + + /* Allocate and validate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + + td->td_sigstk.ss_size); +#if defined(COMPAT_43) + td->td_sigstk.ss_flags |= SS_ONSTACK; +#endif + } else { + fp = (struct sigframe *)td->td_frame->tf_sp; + } + + /* Make room, keeping the stack aligned */ + fp--; + fp = (struct sigframe *)STACKALIGN(fp); + + /* Fill in the frame to copy out */ + bzero(&frame, sizeof(frame)); + get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); + frame.sf_si = ksi->ksi_info; + frame.sf_uc.uc_sigmask = *mask; + frame.sf_uc.uc_stack = td->td_sigstk; + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? + (onstack ? SS_ONSTACK : 0) : SS_DISABLE; + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(td->td_proc); + + /* Copy the sigframe out to the user's stack. */ + if (copyout(&frame, fp, sizeof(*fp)) != 0) { + /* Process has trashed its stack. Kill it. */ + CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp); + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + tf->tf_x[0]= sig; + tf->tf_x[1] = (register_t)&fp->sf_si; + tf->tf_x[2] = (register_t)&fp->sf_uc; + + tf->tf_elr = (register_t)catcher; + tf->tf_sp = (register_t)fp; + sysent = p->p_sysent; + if (sysent->sv_sigcode_base != 0) + tf->tf_lr = (register_t)sysent->sv_sigcode_base; + else + tf->tf_lr = (register_t)(sysent->sv_psstrings - + *(sysent->sv_szsigcode)); + + CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_elr, + tf->tf_sp); + + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); +} diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 30f07bce5551..bca5a9e045cd 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -100,9 +100,6 @@ __FBSDID("$FreeBSD$"); #include #endif -static void get_fpcontext(struct thread *td, mcontext_t *mcp); -static void set_fpcontext(struct thread *td, mcontext_t *mcp); - enum arm64_bus arm64_bus_method = ARM64_BUS_NONE; struct pcpu __pcpu[MAXCPU]; @@ -220,486 +217,6 @@ cpu_idle_wakeup(int cpu) return (0); } -int -fill_regs(struct thread *td, struct reg *regs) -{ - struct trapframe *frame; - - frame = td->td_frame; - regs->sp = frame->tf_sp; - regs->lr = frame->tf_lr; - regs->elr = frame->tf_elr; - regs->spsr = frame->tf_spsr; - - memcpy(regs->x, frame->tf_x, sizeof(regs->x)); - -#ifdef COMPAT_FREEBSD32 - /* - * We may be called here for a 32bits process, if we're using a - * 64bits debugger. If so, put PC and SPSR where it expects it. - */ - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { - regs->x[15] = frame->tf_elr; - regs->x[16] = frame->tf_spsr; - } -#endif - return (0); -} - -int -set_regs(struct thread *td, struct reg *regs) -{ - struct trapframe *frame; - - frame = td->td_frame; - frame->tf_sp = regs->sp; - frame->tf_lr = regs->lr; - frame->tf_spsr &= ~PSR_FLAGS; - - memcpy(frame->tf_x, regs->x, sizeof(frame->tf_x)); - -#ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { - /* - * We may be called for a 32bits process if we're using - * a 64bits debugger. If so, get PC and SPSR from where - * it put it. - */ - frame->tf_elr = regs->x[15]; - frame->tf_spsr |= regs->x[16] & PSR_FLAGS; - } else -#endif - { - frame->tf_elr = regs->elr; - frame->tf_spsr |= regs->spsr & PSR_FLAGS; - } - return (0); -} - -int -fill_fpregs(struct thread *td, struct fpreg *regs) -{ -#ifdef VFP - struct pcb *pcb; - - pcb = td->td_pcb; - if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) { - /* - * If we have just been running VFP instructions we will - * need to save the state to memcpy it below. - */ - if (td == curthread) - vfp_save_state(td, pcb); - - KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, - ("Called fill_fpregs while the kernel is using the VFP")); - memcpy(regs->fp_q, pcb->pcb_fpustate.vfp_regs, - sizeof(regs->fp_q)); - regs->fp_cr = pcb->pcb_fpustate.vfp_fpcr; - regs->fp_sr = pcb->pcb_fpustate.vfp_fpsr; - } else -#endif - memset(regs, 0, sizeof(*regs)); - return (0); -} - -int -set_fpregs(struct thread *td, struct fpreg *regs) -{ -#ifdef VFP - struct pcb *pcb; - - pcb = td->td_pcb; - KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, - ("Called set_fpregs while the kernel is using the VFP")); - memcpy(pcb->pcb_fpustate.vfp_regs, regs->fp_q, sizeof(regs->fp_q)); - pcb->pcb_fpustate.vfp_fpcr = regs->fp_cr; - pcb->pcb_fpustate.vfp_fpsr = regs->fp_sr; -#endif - return (0); -} - -int -fill_dbregs(struct thread *td, struct dbreg *regs) -{ - struct debug_monitor_state *monitor; - int i; - uint8_t debug_ver, nbkpts, nwtpts; - - memset(regs, 0, sizeof(*regs)); - - extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_DebugVer_SHIFT, - &debug_ver); - extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_BRPs_SHIFT, - &nbkpts); - extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_WRPs_SHIFT, - &nwtpts); - - /* - * The BRPs field contains the number of breakpoints - 1. Armv8-A - * allows the hardware to provide 2-16 breakpoints so this won't - * overflow an 8 bit value. The same applies to the WRPs field. - */ - nbkpts++; - nwtpts++; - - regs->db_debug_ver = debug_ver; - regs->db_nbkpts = nbkpts; - regs->db_nwtpts = nwtpts; - - monitor = &td->td_pcb->pcb_dbg_regs; - if ((monitor->dbg_flags & DBGMON_ENABLED) != 0) { - for (i = 0; i < nbkpts; i++) { - regs->db_breakregs[i].dbr_addr = monitor->dbg_bvr[i]; - regs->db_breakregs[i].dbr_ctrl = monitor->dbg_bcr[i]; - } - for (i = 0; i < nwtpts; i++) { - regs->db_watchregs[i].dbw_addr = monitor->dbg_wvr[i]; - regs->db_watchregs[i].dbw_ctrl = monitor->dbg_wcr[i]; - } - } - - return (0); -} - -int -set_dbregs(struct thread *td, struct dbreg *regs) -{ - struct debug_monitor_state *monitor; - uint64_t addr; - uint32_t ctrl; - int count; - int i; - - monitor = &td->td_pcb->pcb_dbg_regs; - count = 0; - monitor->dbg_enable_count = 0; - - for (i = 0; i < DBG_BRP_MAX; i++) { - addr = regs->db_breakregs[i].dbr_addr; - ctrl = regs->db_breakregs[i].dbr_ctrl; - - /* - * Don't let the user set a breakpoint on a kernel or - * non-canonical user address. - */ - if (addr >= VM_MAXUSER_ADDRESS) - return (EINVAL); - - /* - * The lowest 2 bits are ignored, so record the effective - * address. - */ - addr = rounddown2(addr, 4); - - /* - * Some control fields are ignored, and other bits reserved. - * Only unlinked, address-matching breakpoints are supported. - * - * XXX: fields that appear unvalidated, such as BAS, have - * constrained undefined behaviour. If the user mis-programs - * these, there is no risk to the system. - */ - ctrl &= DBG_BCR_EN | DBG_BCR_PMC | DBG_BCR_BAS; - if ((ctrl & DBG_BCR_EN) != 0) { - /* Only target EL0. */ - if ((ctrl & DBG_BCR_PMC) != DBG_BCR_PMC_EL0) - return (EINVAL); - - monitor->dbg_enable_count++; - } - - monitor->dbg_bvr[i] = addr; - monitor->dbg_bcr[i] = ctrl; - } - - for (i = 0; i < DBG_WRP_MAX; i++) { - addr = regs->db_watchregs[i].dbw_addr; - ctrl = regs->db_watchregs[i].dbw_ctrl; - - /* - * Don't let the user set a watchpoint on a kernel or - * non-canonical user address. - */ - if (addr >= VM_MAXUSER_ADDRESS) - return (EINVAL); - - /* - * Some control fields are ignored, and other bits reserved. - * Only unlinked watchpoints are supported. - */ - ctrl &= DBG_WCR_EN | DBG_WCR_PAC | DBG_WCR_LSC | DBG_WCR_BAS | - DBG_WCR_MASK; - - if ((ctrl & DBG_WCR_EN) != 0) { - /* Only target EL0. */ - if ((ctrl & DBG_WCR_PAC) != DBG_WCR_PAC_EL0) - return (EINVAL); - - /* Must set at least one of the load/store bits. */ - if ((ctrl & DBG_WCR_LSC) == 0) - return (EINVAL); - - /* - * When specifying the address range with BAS, the MASK - * field must be zero. - */ - if ((ctrl & DBG_WCR_BAS) != DBG_WCR_BAS_MASK && - (ctrl & DBG_WCR_MASK) != 0) - return (EINVAL); - - monitor->dbg_enable_count++; - } - monitor->dbg_wvr[i] = addr; - monitor->dbg_wcr[i] = ctrl; - } - - if (monitor->dbg_enable_count > 0) - monitor->dbg_flags |= DBGMON_ENABLED; - - return (0); -} - -#ifdef COMPAT_FREEBSD32 -int -fill_regs32(struct thread *td, struct reg32 *regs) -{ - int i; - struct trapframe *tf; - - tf = td->td_frame; - for (i = 0; i < 13; i++) - regs->r[i] = tf->tf_x[i]; - /* For arm32, SP is r13 and LR is r14 */ - regs->r_sp = tf->tf_x[13]; - regs->r_lr = tf->tf_x[14]; - regs->r_pc = tf->tf_elr; - regs->r_cpsr = tf->tf_spsr; - - return (0); -} - -int -set_regs32(struct thread *td, struct reg32 *regs) -{ - int i; - struct trapframe *tf; - - tf = td->td_frame; - for (i = 0; i < 13; i++) - tf->tf_x[i] = regs->r[i]; - /* For arm 32, SP is r13 an LR is r14 */ - tf->tf_x[13] = regs->r_sp; - tf->tf_x[14] = regs->r_lr; - tf->tf_elr = regs->r_pc; - tf->tf_spsr &= ~PSR_FLAGS; - tf->tf_spsr |= regs->r_cpsr & PSR_FLAGS; - - return (0); -} - -/* XXX fill/set dbregs/fpregs are stubbed on 32-bit arm. */ -int -fill_fpregs32(struct thread *td, struct fpreg32 *regs) -{ - - memset(regs, 0, sizeof(*regs)); - return (0); -} - -int -set_fpregs32(struct thread *td, struct fpreg32 *regs) -{ - - return (0); -} - -int -fill_dbregs32(struct thread *td, struct dbreg32 *regs) -{ - - memset(regs, 0, sizeof(*regs)); - return (0); -} - -int -set_dbregs32(struct thread *td, struct dbreg32 *regs) -{ - - return (0); -} -#endif - -int -ptrace_set_pc(struct thread *td, u_long addr) -{ - - td->td_frame->tf_elr = addr; - return (0); -} - -int -ptrace_single_step(struct thread *td) *** 384 LINES SKIPPED *** From nobody Fri Oct 8 00:21:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 08D9D17E4087; Fri, 8 Oct 2021 00:21: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 4HQTPr4BzGz3Q6M; Fri, 8 Oct 2021 00:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CE231D4E0; Fri, 8 Oct 2021 00:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980LJP0038970; Fri, 8 Oct 2021 00:21:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980LJY3038969; Fri, 8 Oct 2021 00:21:19 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:21:19 GMT Message-Id: <202110080021.1980LJY3038969@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: dfaf65023ef0 - main - arm: move signal delivery code to exec_machdep.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfaf65023ef0d9f68da856f3795448596751a69d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dfaf65023ef0d9f68da856f3795448596751a69d commit dfaf65023ef0d9f68da856f3795448596751a69d Author: Konstantin Belousov AuthorDate: 2021-10-04 11:39:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:20:42 +0000 arm: move signal delivery code to exec_machdep.c Reviewed by: emaste, imp Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32310 --- sys/arm/arm/exec_machdep.c | 379 +++++++++++++++++++++++++++++++++++++++++++++ sys/arm/arm/machdep.c | 322 -------------------------------------- sys/conf/files.arm | 1 + 3 files changed, 380 insertions(+), 322 deletions(-) diff --git a/sys/arm/arm/exec_machdep.c b/sys/arm/arm/exec_machdep.c new file mode 100644 index 000000000000..3b952463b1ad --- /dev/null +++ b/sys/arm/arm/exec_machdep.c @@ -0,0 +1,379 @@ +/* $NetBSD: arm32_machdep.c,v 1.44 2004/03/24 15:34:47 atatat Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (c) 2004 Olivier Houchard + * Copyright (c) 1994-1998 Mark Brinicombe. + * Copyright (c) 1994 Brini. + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Mark Brinicombe + * for the NetBSD Project. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/* + * Clear registers on exec + */ +void +exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) +{ + struct trapframe *tf = td->td_frame; + + memset(tf, 0, sizeof(*tf)); + tf->tf_usr_sp = stack; + tf->tf_usr_lr = imgp->entry_addr; + tf->tf_svc_lr = 0x77777777; + tf->tf_pc = imgp->entry_addr; + tf->tf_spsr = PSR_USR32_MODE; + if ((register_t)imgp->entry_addr & 1) + tf->tf_spsr |= PSR_T; +} + +#ifdef VFP +/* + * Get machine VFP context. + */ +void +get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) +{ + struct pcb *pcb; + + pcb = td->td_pcb; + if (td == curthread) { + critical_enter(); + vfp_store(&pcb->pcb_vfpstate, false); + critical_exit(); + } else + MPASS(TD_IS_SUSPENDED(td)); + memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg, + sizeof(vfp->mcv_reg)); + vfp->mcv_fpscr = pcb->pcb_vfpstate.fpscr; +} + +/* + * Set machine VFP context. + */ +void +set_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) +{ + struct pcb *pcb; + + pcb = td->td_pcb; + if (td == curthread) { + critical_enter(); + vfp_discard(td); + critical_exit(); + } else + MPASS(TD_IS_SUSPENDED(td)); + memcpy(pcb->pcb_vfpstate.reg, vfp->mcv_reg, + sizeof(pcb->pcb_vfpstate.reg)); + pcb->pcb_vfpstate.fpscr = vfp->mcv_fpscr; +} +#endif + +int +arm_get_vfpstate(struct thread *td, void *args) +{ + int rv; + struct arm_get_vfpstate_args ua; + mcontext_vfp_t mcontext_vfp; + + rv = copyin(args, &ua, sizeof(ua)); + if (rv != 0) + return (rv); + if (ua.mc_vfp_size != sizeof(mcontext_vfp_t)) + return (EINVAL); +#ifdef VFP + get_vfpcontext(td, &mcontext_vfp); +#else + bzero(&mcontext_vfp, sizeof(mcontext_vfp)); +#endif + + rv = copyout(&mcontext_vfp, ua.mc_vfp, sizeof(mcontext_vfp)); + if (rv != 0) + return (rv); + return (0); +} + +/* + * Get machine context. + */ +int +get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret) +{ + struct trapframe *tf = td->td_frame; + __greg_t *gr = mcp->__gregs; + + if (clear_ret & GET_MC_CLEAR_RET) { + gr[_REG_R0] = 0; + gr[_REG_CPSR] = tf->tf_spsr & ~PSR_C; + } else { + gr[_REG_R0] = tf->tf_r0; + gr[_REG_CPSR] = tf->tf_spsr; + } + gr[_REG_R1] = tf->tf_r1; + gr[_REG_R2] = tf->tf_r2; + gr[_REG_R3] = tf->tf_r3; + gr[_REG_R4] = tf->tf_r4; + gr[_REG_R5] = tf->tf_r5; + gr[_REG_R6] = tf->tf_r6; + gr[_REG_R7] = tf->tf_r7; + gr[_REG_R8] = tf->tf_r8; + gr[_REG_R9] = tf->tf_r9; + gr[_REG_R10] = tf->tf_r10; + gr[_REG_R11] = tf->tf_r11; + gr[_REG_R12] = tf->tf_r12; + gr[_REG_SP] = tf->tf_usr_sp; + gr[_REG_LR] = tf->tf_usr_lr; + gr[_REG_PC] = tf->tf_pc; + + mcp->mc_vfp_size = 0; + mcp->mc_vfp_ptr = NULL; + memset(&mcp->mc_spare, 0, sizeof(mcp->mc_spare)); + + return (0); +} + +/* + * Set machine context. + * + * However, we don't set any but the user modifiable flags, and we won't + * touch the cs selector. + */ +int +set_mcontext(struct thread *td, mcontext_t *mcp) +{ + mcontext_vfp_t mc_vfp, *vfp; + struct trapframe *tf = td->td_frame; + const __greg_t *gr = mcp->__gregs; + int spsr; + + /* + * Make sure the processor mode has not been tampered with and + * interrupts have not been disabled. + */ + spsr = gr[_REG_CPSR]; + if ((spsr & PSR_MODE) != PSR_USR32_MODE || + (spsr & (PSR_I | PSR_F)) != 0) + return (EINVAL); + +#ifdef WITNESS + if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_size != sizeof(mc_vfp)) { + printf("%s: %s: Malformed mc_vfp_size: %d (0x%08X)\n", + td->td_proc->p_comm, __func__, + mcp->mc_vfp_size, mcp->mc_vfp_size); + } else if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_ptr == NULL) { + printf("%s: %s: c_vfp_size != 0 but mc_vfp_ptr == NULL\n", + td->td_proc->p_comm, __func__); + } +#endif + + if (mcp->mc_vfp_size == sizeof(mc_vfp) && mcp->mc_vfp_ptr != NULL) { + if (copyin(mcp->mc_vfp_ptr, &mc_vfp, sizeof(mc_vfp)) != 0) + return (EFAULT); + vfp = &mc_vfp; + } else { + vfp = NULL; + } + + tf->tf_r0 = gr[_REG_R0]; + tf->tf_r1 = gr[_REG_R1]; + tf->tf_r2 = gr[_REG_R2]; + tf->tf_r3 = gr[_REG_R3]; + tf->tf_r4 = gr[_REG_R4]; + tf->tf_r5 = gr[_REG_R5]; + tf->tf_r6 = gr[_REG_R6]; + tf->tf_r7 = gr[_REG_R7]; + tf->tf_r8 = gr[_REG_R8]; + tf->tf_r9 = gr[_REG_R9]; + tf->tf_r10 = gr[_REG_R10]; + tf->tf_r11 = gr[_REG_R11]; + tf->tf_r12 = gr[_REG_R12]; + tf->tf_usr_sp = gr[_REG_SP]; + tf->tf_usr_lr = gr[_REG_LR]; + tf->tf_pc = gr[_REG_PC]; + tf->tf_spsr = gr[_REG_CPSR]; +#ifdef VFP + if (vfp != NULL) + set_vfpcontext(td, vfp); +#endif + return (0); +} + +void +sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) +{ + struct thread *td; + struct proc *p; + struct trapframe *tf; + struct sigframe *fp, frame; + struct sigacts *psp; + struct sysentvec *sysent; + int onstack; + int sig; + int code; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + sig = ksi->ksi_signo; + code = ksi->ksi_code; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); + tf = td->td_frame; + onstack = sigonstack(tf->tf_usr_sp); + + CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, + catcher, sig); + + /* Allocate and validate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + + td->td_sigstk.ss_size); +#if defined(COMPAT_43) + td->td_sigstk.ss_flags |= SS_ONSTACK; +#endif + } else + fp = (struct sigframe *)td->td_frame->tf_usr_sp; + + /* make room on the stack */ + fp--; + + /* make the stack aligned */ + fp = (struct sigframe *)STACKALIGN(fp); + /* Populate the siginfo frame. */ + bzero(&frame, sizeof(frame)); + get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); +#ifdef VFP + get_vfpcontext(td, &frame.sf_vfp); + frame.sf_uc.uc_mcontext.mc_vfp_size = sizeof(fp->sf_vfp); + frame.sf_uc.uc_mcontext.mc_vfp_ptr = &fp->sf_vfp; +#else + frame.sf_uc.uc_mcontext.mc_vfp_size = 0; + frame.sf_uc.uc_mcontext.mc_vfp_ptr = NULL; +#endif + frame.sf_si = ksi->ksi_info; + frame.sf_uc.uc_sigmask = *mask; + frame.sf_uc.uc_stack = td->td_sigstk; + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? + (onstack ? SS_ONSTACK : 0) : SS_DISABLE; + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(td->td_proc); + + /* Copy the sigframe out to the user's stack. */ + if (copyout(&frame, fp, sizeof(*fp)) != 0) { + /* Process has trashed its stack. Kill it. */ + CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp); + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + /* + * Build context to run handler in. We invoke the handler + * directly, only returning via the trampoline. Note the + * trampoline version numbers are coordinated with machine- + * dependent code in libc. + */ + + tf->tf_r0 = sig; + tf->tf_r1 = (register_t)&fp->sf_si; + tf->tf_r2 = (register_t)&fp->sf_uc; + + /* the trampoline uses r5 as the uc address */ + tf->tf_r5 = (register_t)&fp->sf_uc; + tf->tf_pc = (register_t)catcher; + tf->tf_usr_sp = (register_t)fp; + sysent = p->p_sysent; + if (sysent->sv_sigcode_base != 0) + tf->tf_usr_lr = (register_t)sysent->sv_sigcode_base; + else + tf->tf_usr_lr = (register_t)(sysent->sv_psstrings - + *(sysent->sv_szsigcode)); + /* Set the mode to enter in the signal handler */ +#if __ARM_ARCH >= 7 + if ((register_t)catcher & 1) + tf->tf_spsr |= PSR_T; + else + tf->tf_spsr &= ~PSR_T; +#endif + + CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_usr_lr, + tf->tf_usr_sp); + + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); +} + +int +sys_sigreturn(struct thread *td, struct sigreturn_args *uap) +{ + ucontext_t uc; + int error; + + if (uap == NULL) + return (EFAULT); + if (copyin(uap->sigcntxp, &uc, sizeof(uc))) + return (EFAULT); + /* Restore register context. */ + error = set_mcontext(td, &uc.uc_mcontext); + if (error != 0) + return (error); + + /* Restore signal mask. */ + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); + + return (EJUSTRETURN); +} diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index c852187087b3..933edfb0dc84 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -332,328 +332,6 @@ spinlock_exit(void) } } -/* - * Clear registers on exec - */ -void -exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) -{ - struct trapframe *tf = td->td_frame; - - memset(tf, 0, sizeof(*tf)); - tf->tf_usr_sp = stack; - tf->tf_usr_lr = imgp->entry_addr; - tf->tf_svc_lr = 0x77777777; - tf->tf_pc = imgp->entry_addr; - tf->tf_spsr = PSR_USR32_MODE; - if ((register_t)imgp->entry_addr & 1) - tf->tf_spsr |= PSR_T; -} - -#ifdef VFP -/* - * Get machine VFP context. - */ -void -get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) -{ - struct pcb *pcb; - - pcb = td->td_pcb; - if (td == curthread) { - critical_enter(); - vfp_store(&pcb->pcb_vfpstate, false); - critical_exit(); - } else - MPASS(TD_IS_SUSPENDED(td)); - memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg, - sizeof(vfp->mcv_reg)); - vfp->mcv_fpscr = pcb->pcb_vfpstate.fpscr; -} - -/* - * Set machine VFP context. - */ -void -set_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) -{ - struct pcb *pcb; - - pcb = td->td_pcb; - if (td == curthread) { - critical_enter(); - vfp_discard(td); - critical_exit(); - } else - MPASS(TD_IS_SUSPENDED(td)); - memcpy(pcb->pcb_vfpstate.reg, vfp->mcv_reg, - sizeof(pcb->pcb_vfpstate.reg)); - pcb->pcb_vfpstate.fpscr = vfp->mcv_fpscr; -} -#endif - -int -arm_get_vfpstate(struct thread *td, void *args) -{ - int rv; - struct arm_get_vfpstate_args ua; - mcontext_vfp_t mcontext_vfp; - - rv = copyin(args, &ua, sizeof(ua)); - if (rv != 0) - return (rv); - if (ua.mc_vfp_size != sizeof(mcontext_vfp_t)) - return (EINVAL); -#ifdef VFP - get_vfpcontext(td, &mcontext_vfp); -#else - bzero(&mcontext_vfp, sizeof(mcontext_vfp)); -#endif - - rv = copyout(&mcontext_vfp, ua.mc_vfp, sizeof(mcontext_vfp)); - if (rv != 0) - return (rv); - return (0); -} - -/* - * Get machine context. - */ -int -get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret) -{ - struct trapframe *tf = td->td_frame; - __greg_t *gr = mcp->__gregs; - - if (clear_ret & GET_MC_CLEAR_RET) { - gr[_REG_R0] = 0; - gr[_REG_CPSR] = tf->tf_spsr & ~PSR_C; - } else { - gr[_REG_R0] = tf->tf_r0; - gr[_REG_CPSR] = tf->tf_spsr; - } - gr[_REG_R1] = tf->tf_r1; - gr[_REG_R2] = tf->tf_r2; - gr[_REG_R3] = tf->tf_r3; - gr[_REG_R4] = tf->tf_r4; - gr[_REG_R5] = tf->tf_r5; - gr[_REG_R6] = tf->tf_r6; - gr[_REG_R7] = tf->tf_r7; - gr[_REG_R8] = tf->tf_r8; - gr[_REG_R9] = tf->tf_r9; - gr[_REG_R10] = tf->tf_r10; - gr[_REG_R11] = tf->tf_r11; - gr[_REG_R12] = tf->tf_r12; - gr[_REG_SP] = tf->tf_usr_sp; - gr[_REG_LR] = tf->tf_usr_lr; - gr[_REG_PC] = tf->tf_pc; - - mcp->mc_vfp_size = 0; - mcp->mc_vfp_ptr = NULL; - memset(&mcp->mc_spare, 0, sizeof(mcp->mc_spare)); - - return (0); -} - -/* - * Set machine context. - * - * However, we don't set any but the user modifiable flags, and we won't - * touch the cs selector. - */ -int -set_mcontext(struct thread *td, mcontext_t *mcp) -{ - mcontext_vfp_t mc_vfp, *vfp; - struct trapframe *tf = td->td_frame; - const __greg_t *gr = mcp->__gregs; - int spsr; - - /* - * Make sure the processor mode has not been tampered with and - * interrupts have not been disabled. - */ - spsr = gr[_REG_CPSR]; - if ((spsr & PSR_MODE) != PSR_USR32_MODE || - (spsr & (PSR_I | PSR_F)) != 0) - return (EINVAL); - -#ifdef WITNESS - if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_size != sizeof(mc_vfp)) { - printf("%s: %s: Malformed mc_vfp_size: %d (0x%08X)\n", - td->td_proc->p_comm, __func__, - mcp->mc_vfp_size, mcp->mc_vfp_size); - } else if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_ptr == NULL) { - printf("%s: %s: c_vfp_size != 0 but mc_vfp_ptr == NULL\n", - td->td_proc->p_comm, __func__); - } -#endif - - if (mcp->mc_vfp_size == sizeof(mc_vfp) && mcp->mc_vfp_ptr != NULL) { - if (copyin(mcp->mc_vfp_ptr, &mc_vfp, sizeof(mc_vfp)) != 0) - return (EFAULT); - vfp = &mc_vfp; - } else { - vfp = NULL; - } - - tf->tf_r0 = gr[_REG_R0]; - tf->tf_r1 = gr[_REG_R1]; - tf->tf_r2 = gr[_REG_R2]; - tf->tf_r3 = gr[_REG_R3]; - tf->tf_r4 = gr[_REG_R4]; - tf->tf_r5 = gr[_REG_R5]; - tf->tf_r6 = gr[_REG_R6]; - tf->tf_r7 = gr[_REG_R7]; - tf->tf_r8 = gr[_REG_R8]; - tf->tf_r9 = gr[_REG_R9]; - tf->tf_r10 = gr[_REG_R10]; - tf->tf_r11 = gr[_REG_R11]; - tf->tf_r12 = gr[_REG_R12]; - tf->tf_usr_sp = gr[_REG_SP]; - tf->tf_usr_lr = gr[_REG_LR]; - tf->tf_pc = gr[_REG_PC]; - tf->tf_spsr = gr[_REG_CPSR]; -#ifdef VFP - if (vfp != NULL) - set_vfpcontext(td, vfp); -#endif - return (0); -} - -void -sendsig(catcher, ksi, mask) - sig_t catcher; - ksiginfo_t *ksi; - sigset_t *mask; -{ - struct thread *td; - struct proc *p; - struct trapframe *tf; - struct sigframe *fp, frame; - struct sigacts *psp; - struct sysentvec *sysent; - int onstack; - int sig; - int code; - - td = curthread; - p = td->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); - sig = ksi->ksi_signo; - code = ksi->ksi_code; - psp = p->p_sigacts; - mtx_assert(&psp->ps_mtx, MA_OWNED); - tf = td->td_frame; - onstack = sigonstack(tf->tf_usr_sp); - - CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, - catcher, sig); - - /* Allocate and validate space for the signal handler context. */ - if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && - SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + - td->td_sigstk.ss_size); -#if defined(COMPAT_43) - td->td_sigstk.ss_flags |= SS_ONSTACK; -#endif - } else - fp = (struct sigframe *)td->td_frame->tf_usr_sp; - - /* make room on the stack */ - fp--; - - /* make the stack aligned */ - fp = (struct sigframe *)STACKALIGN(fp); - /* Populate the siginfo frame. */ - bzero(&frame, sizeof(frame)); - get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); -#ifdef VFP - get_vfpcontext(td, &frame.sf_vfp); - frame.sf_uc.uc_mcontext.mc_vfp_size = sizeof(fp->sf_vfp); - frame.sf_uc.uc_mcontext.mc_vfp_ptr = &fp->sf_vfp; -#else - frame.sf_uc.uc_mcontext.mc_vfp_size = 0; - frame.sf_uc.uc_mcontext.mc_vfp_ptr = NULL; -#endif - frame.sf_si = ksi->ksi_info; - frame.sf_uc.uc_sigmask = *mask; - frame.sf_uc.uc_stack = td->td_sigstk; - frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? - (onstack ? SS_ONSTACK : 0) : SS_DISABLE; - mtx_unlock(&psp->ps_mtx); - PROC_UNLOCK(td->td_proc); - - /* Copy the sigframe out to the user's stack. */ - if (copyout(&frame, fp, sizeof(*fp)) != 0) { - /* Process has trashed its stack. Kill it. */ - CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp); - PROC_LOCK(p); - sigexit(td, SIGILL); - } - - /* - * Build context to run handler in. We invoke the handler - * directly, only returning via the trampoline. Note the - * trampoline version numbers are coordinated with machine- - * dependent code in libc. - */ - - tf->tf_r0 = sig; - tf->tf_r1 = (register_t)&fp->sf_si; - tf->tf_r2 = (register_t)&fp->sf_uc; - - /* the trampoline uses r5 as the uc address */ - tf->tf_r5 = (register_t)&fp->sf_uc; - tf->tf_pc = (register_t)catcher; - tf->tf_usr_sp = (register_t)fp; - sysent = p->p_sysent; - if (sysent->sv_sigcode_base != 0) - tf->tf_usr_lr = (register_t)sysent->sv_sigcode_base; - else - tf->tf_usr_lr = (register_t)(sysent->sv_psstrings - - *(sysent->sv_szsigcode)); - /* Set the mode to enter in the signal handler */ -#if __ARM_ARCH >= 7 - if ((register_t)catcher & 1) - tf->tf_spsr |= PSR_T; - else - tf->tf_spsr &= ~PSR_T; -#endif - - CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_usr_lr, - tf->tf_usr_sp); - - PROC_LOCK(p); - mtx_lock(&psp->ps_mtx); -} - -int -sys_sigreturn(td, uap) - struct thread *td; - struct sigreturn_args /* { - const struct __ucontext *sigcntxp; - } */ *uap; -{ - ucontext_t uc; - int error; - - if (uap == NULL) - return (EFAULT); - if (copyin(uap->sigcntxp, &uc, sizeof(uc))) - return (EFAULT); - /* Restore register context. */ - error = set_mcontext(td, &uc.uc_mcontext); - if (error != 0) - return (error); - - /* Restore signal mask. */ - kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); - - return (EJUSTRETURN); -} - /* * Construct a PCB from a trapframe. This is called from kdb_trap() where * we want to start a backtrace from the function that caused us to enter diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 76f62eb2e14e..ce9c4933a024 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -25,6 +25,7 @@ arm/arm/dump_machdep.c standard arm/arm/elf_machdep.c standard arm/arm/elf_note.S standard arm/arm/exception.S standard +arm/arm/exec_machdep.c standard arm/arm/fiq.c standard arm/arm/fiq_subr.S standard arm/arm/fusu.S standard From nobody Fri Oct 8 00:21:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 68FE017E3E32; Fri, 8 Oct 2021 00:21: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 4HQTPs09dXz3Q48; Fri, 8 Oct 2021 00:21:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84E281D526; Fri, 8 Oct 2021 00:21:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980LKSg038994; Fri, 8 Oct 2021 00:21:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980LKca038993; Fri, 8 Oct 2021 00:21:20 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:21:20 GMT Message-Id: <202110080021.1980LKca038993@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: aba66031f27c - main - riscv: move signal delivery code to exec_machdep.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aba66031f27cec0bf9f6c6bc5d857e03eaf97d4f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=aba66031f27cec0bf9f6c6bc5d857e03eaf97d4f commit aba66031f27cec0bf9f6c6bc5d857e03eaf97d4f Author: Konstantin Belousov AuthorDate: 2021-10-04 15:15:17 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:20:42 +0000 riscv: move signal delivery code to exec_machdep.c Reviewed by: emaste, imp Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32310 --- sys/conf/files.riscv | 2 + sys/riscv/riscv/exec_machdep.c | 420 +++++++++++++++++++++++++++++++++++++++ sys/riscv/riscv/machdep.c | 386 +---------------------------------- sys/riscv/riscv/ptrace_machdep.c | 90 +++++++++ 4 files changed, 515 insertions(+), 383 deletions(-) diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index c5eef10f3519..72939b42d67d 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -45,6 +45,7 @@ riscv/riscv/db_trace.c optional ddb riscv/riscv/dump_machdep.c standard riscv/riscv/elf_machdep.c standard riscv/riscv/exception.S standard +riscv/riscv/exec_machdep.c standard riscv/riscv/intr_machdep.c standard riscv/riscv/in_cksum.c optional inet | inet6 riscv/riscv/identcpu.c standard @@ -57,6 +58,7 @@ riscv/riscv/nexus.c standard riscv/riscv/ofw_machdep.c optional fdt riscv/riscv/plic.c standard riscv/riscv/pmap.c standard +riscv/riscv/ptrace_machdep.c standard riscv/riscv/riscv_console.c optional rcons riscv/riscv/riscv_syscon.c optional ext_resources syscon riscv_syscon fdt riscv/riscv/sbi.c standard diff --git a/sys/riscv/riscv/exec_machdep.c b/sys/riscv/riscv/exec_machdep.c new file mode 100644 index 000000000000..8bc9ba1df568 --- /dev/null +++ b/sys/riscv/riscv/exec_machdep.c @@ -0,0 +1,420 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * Copyright (c) 2015-2017 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef FPE +#include +#endif + +static void get_fpcontext(struct thread *td, mcontext_t *mcp); +static void set_fpcontext(struct thread *td, mcontext_t *mcp); + +int +fill_regs(struct thread *td, struct reg *regs) +{ + struct trapframe *frame; + + frame = td->td_frame; + regs->sepc = frame->tf_sepc; + regs->sstatus = frame->tf_sstatus; + regs->ra = frame->tf_ra; + regs->sp = frame->tf_sp; + regs->gp = frame->tf_gp; + regs->tp = frame->tf_tp; + + memcpy(regs->t, frame->tf_t, sizeof(regs->t)); + memcpy(regs->s, frame->tf_s, sizeof(regs->s)); + memcpy(regs->a, frame->tf_a, sizeof(regs->a)); + + return (0); +} + +int +set_regs(struct thread *td, struct reg *regs) +{ + struct trapframe *frame; + + frame = td->td_frame; + frame->tf_sepc = regs->sepc; + frame->tf_ra = regs->ra; + frame->tf_sp = regs->sp; + frame->tf_gp = regs->gp; + frame->tf_tp = regs->tp; + + memcpy(frame->tf_t, regs->t, sizeof(frame->tf_t)); + memcpy(frame->tf_s, regs->s, sizeof(frame->tf_s)); + memcpy(frame->tf_a, regs->a, sizeof(frame->tf_a)); + + return (0); +} + +int +fill_fpregs(struct thread *td, struct fpreg *regs) +{ +#ifdef FPE + struct pcb *pcb; + + pcb = td->td_pcb; + + if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) { + /* + * If we have just been running FPE instructions we will + * need to save the state to memcpy it below. + */ + if (td == curthread) + fpe_state_save(td); + + memcpy(regs->fp_x, pcb->pcb_x, sizeof(regs->fp_x)); + regs->fp_fcsr = pcb->pcb_fcsr; + } else +#endif + memset(regs, 0, sizeof(*regs)); + + return (0); +} + +int +set_fpregs(struct thread *td, struct fpreg *regs) +{ +#ifdef FPE + struct trapframe *frame; + struct pcb *pcb; + + frame = td->td_frame; + pcb = td->td_pcb; + + memcpy(pcb->pcb_x, regs->fp_x, sizeof(regs->fp_x)); + pcb->pcb_fcsr = regs->fp_fcsr; + pcb->pcb_fpflags |= PCB_FP_STARTED; + frame->tf_sstatus &= ~SSTATUS_FS_MASK; + frame->tf_sstatus |= SSTATUS_FS_CLEAN; +#endif + + return (0); +} + +int +fill_dbregs(struct thread *td, struct dbreg *regs) +{ + + panic("fill_dbregs"); +} + +int +set_dbregs(struct thread *td, struct dbreg *regs) +{ + + panic("set_dbregs"); +} + +void +exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) +{ + struct trapframe *tf; + struct pcb *pcb; + + tf = td->td_frame; + pcb = td->td_pcb; + + memset(tf, 0, sizeof(struct trapframe)); + + tf->tf_a[0] = stack; + tf->tf_sp = STACKALIGN(stack); + tf->tf_ra = imgp->entry_addr; + tf->tf_sepc = imgp->entry_addr; + + pcb->pcb_fpflags &= ~PCB_FP_STARTED; +} + +/* Sanity check these are the same size, they will be memcpy'd to and from */ +CTASSERT(sizeof(((struct trapframe *)0)->tf_a) == + sizeof((struct gpregs *)0)->gp_a); +CTASSERT(sizeof(((struct trapframe *)0)->tf_s) == + sizeof((struct gpregs *)0)->gp_s); +CTASSERT(sizeof(((struct trapframe *)0)->tf_t) == + sizeof((struct gpregs *)0)->gp_t); +CTASSERT(sizeof(((struct trapframe *)0)->tf_a) == + sizeof((struct reg *)0)->a); +CTASSERT(sizeof(((struct trapframe *)0)->tf_s) == + sizeof((struct reg *)0)->s); +CTASSERT(sizeof(((struct trapframe *)0)->tf_t) == + sizeof((struct reg *)0)->t); + +int +get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret) +{ + struct trapframe *tf = td->td_frame; + + memcpy(mcp->mc_gpregs.gp_t, tf->tf_t, sizeof(mcp->mc_gpregs.gp_t)); + memcpy(mcp->mc_gpregs.gp_s, tf->tf_s, sizeof(mcp->mc_gpregs.gp_s)); + memcpy(mcp->mc_gpregs.gp_a, tf->tf_a, sizeof(mcp->mc_gpregs.gp_a)); + + if (clear_ret & GET_MC_CLEAR_RET) { + mcp->mc_gpregs.gp_a[0] = 0; + mcp->mc_gpregs.gp_t[0] = 0; /* clear syscall error */ + } + + mcp->mc_gpregs.gp_ra = tf->tf_ra; + mcp->mc_gpregs.gp_sp = tf->tf_sp; + mcp->mc_gpregs.gp_gp = tf->tf_gp; + mcp->mc_gpregs.gp_tp = tf->tf_tp; + mcp->mc_gpregs.gp_sepc = tf->tf_sepc; + mcp->mc_gpregs.gp_sstatus = tf->tf_sstatus; + get_fpcontext(td, mcp); + + return (0); +} + +int +set_mcontext(struct thread *td, mcontext_t *mcp) +{ + struct trapframe *tf; + + tf = td->td_frame; + + /* + * Permit changes to the USTATUS bits of SSTATUS. + * + * Ignore writes to read-only bits (SD, XS). + * + * Ignore writes to the FS field as set_fpcontext() will set + * it explicitly. + */ + if (((mcp->mc_gpregs.gp_sstatus ^ tf->tf_sstatus) & + ~(SSTATUS_SD | SSTATUS_XS_MASK | SSTATUS_FS_MASK | SSTATUS_UPIE | + SSTATUS_UIE)) != 0) + return (EINVAL); + + memcpy(tf->tf_t, mcp->mc_gpregs.gp_t, sizeof(tf->tf_t)); + memcpy(tf->tf_s, mcp->mc_gpregs.gp_s, sizeof(tf->tf_s)); + memcpy(tf->tf_a, mcp->mc_gpregs.gp_a, sizeof(tf->tf_a)); + + tf->tf_ra = mcp->mc_gpregs.gp_ra; + tf->tf_sp = mcp->mc_gpregs.gp_sp; + tf->tf_gp = mcp->mc_gpregs.gp_gp; + tf->tf_sepc = mcp->mc_gpregs.gp_sepc; + tf->tf_sstatus = mcp->mc_gpregs.gp_sstatus; + set_fpcontext(td, mcp); + + return (0); +} + +static void +get_fpcontext(struct thread *td, mcontext_t *mcp) +{ +#ifdef FPE + struct pcb *curpcb; + + critical_enter(); + + curpcb = curthread->td_pcb; + + KASSERT(td->td_pcb == curpcb, ("Invalid fpe pcb")); + + if ((curpcb->pcb_fpflags & PCB_FP_STARTED) != 0) { + /* + * If we have just been running FPE instructions we will + * need to save the state to memcpy it below. + */ + fpe_state_save(td); + + KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, + ("Non-userspace FPE flags set in get_fpcontext")); + memcpy(mcp->mc_fpregs.fp_x, curpcb->pcb_x, + sizeof(mcp->mc_fpregs.fp_x)); + mcp->mc_fpregs.fp_fcsr = curpcb->pcb_fcsr; + mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; + mcp->mc_flags |= _MC_FP_VALID; + } + + critical_exit(); +#endif +} + +static void +set_fpcontext(struct thread *td, mcontext_t *mcp) +{ +#ifdef FPE + struct pcb *curpcb; +#endif + + td->td_frame->tf_sstatus &= ~SSTATUS_FS_MASK; + td->td_frame->tf_sstatus |= SSTATUS_FS_OFF; + +#ifdef FPE + critical_enter(); + + if ((mcp->mc_flags & _MC_FP_VALID) != 0) { + curpcb = curthread->td_pcb; + /* FPE usage is enabled, override registers. */ + memcpy(curpcb->pcb_x, mcp->mc_fpregs.fp_x, + sizeof(mcp->mc_fpregs.fp_x)); + curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr; + curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; + td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN; + } + + critical_exit(); +#endif +} + +int +sys_sigreturn(struct thread *td, struct sigreturn_args *uap) +{ + ucontext_t uc; + int error; + + if (copyin(uap->sigcntxp, &uc, sizeof(uc))) + return (EFAULT); + + error = set_mcontext(td, &uc.uc_mcontext); + if (error != 0) + return (error); + + /* Restore signal mask. */ + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); + + return (EJUSTRETURN); +} + +void +sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) +{ + struct sigframe *fp, frame; + struct sysentvec *sysent; + struct trapframe *tf; + struct sigacts *psp; + struct thread *td; + struct proc *p; + int onstack; + int sig; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + sig = ksi->ksi_signo; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); + + tf = td->td_frame; + onstack = sigonstack(tf->tf_sp); + + CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, + catcher, sig); + + /* Allocate and validate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + + td->td_sigstk.ss_size); + } else { + fp = (struct sigframe *)td->td_frame->tf_sp; + } + + /* Make room, keeping the stack aligned */ + fp--; + fp = (struct sigframe *)STACKALIGN(fp); + + /* Fill in the frame to copy out */ + bzero(&frame, sizeof(frame)); + get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); + frame.sf_si = ksi->ksi_info; + frame.sf_uc.uc_sigmask = *mask; + frame.sf_uc.uc_stack = td->td_sigstk; + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? + (onstack ? SS_ONSTACK : 0) : SS_DISABLE; + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(td->td_proc); + + /* Copy the sigframe out to the user's stack. */ + if (copyout(&frame, fp, sizeof(*fp)) != 0) { + /* Process has trashed its stack. Kill it. */ + CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp); + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + tf->tf_a[0] = sig; + tf->tf_a[1] = (register_t)&fp->sf_si; + tf->tf_a[2] = (register_t)&fp->sf_uc; + + tf->tf_sepc = (register_t)catcher; + tf->tf_sp = (register_t)fp; + + sysent = p->p_sysent; + if (sysent->sv_sigcode_base != 0) + tf->tf_ra = (register_t)sysent->sv_sigcode_base; + else + tf->tf_ra = (register_t)(sysent->sv_psstrings - + *(sysent->sv_szsigcode)); + + CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_sepc, + tf->tf_sp); + + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); +} diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index ad57e8339c7d..340b94448cfe 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -102,9 +102,6 @@ __FBSDID("$FreeBSD$"); #include #endif -static void get_fpcontext(struct thread *td, mcontext_t *mcp); -static void set_fpcontext(struct thread *td, mcontext_t *mcp); - struct pcpu __pcpu[MAXCPU]; static struct trapframe proc0_tf; @@ -182,282 +179,6 @@ cpu_idle_wakeup(int cpu) return (0); } -int -fill_regs(struct thread *td, struct reg *regs) -{ - struct trapframe *frame; - - frame = td->td_frame; - regs->sepc = frame->tf_sepc; - regs->sstatus = frame->tf_sstatus; - regs->ra = frame->tf_ra; - regs->sp = frame->tf_sp; - regs->gp = frame->tf_gp; - regs->tp = frame->tf_tp; - - memcpy(regs->t, frame->tf_t, sizeof(regs->t)); - memcpy(regs->s, frame->tf_s, sizeof(regs->s)); - memcpy(regs->a, frame->tf_a, sizeof(regs->a)); - - return (0); -} - -int -set_regs(struct thread *td, struct reg *regs) -{ - struct trapframe *frame; - - frame = td->td_frame; - frame->tf_sepc = regs->sepc; - frame->tf_ra = regs->ra; - frame->tf_sp = regs->sp; - frame->tf_gp = regs->gp; - frame->tf_tp = regs->tp; - - memcpy(frame->tf_t, regs->t, sizeof(frame->tf_t)); - memcpy(frame->tf_s, regs->s, sizeof(frame->tf_s)); - memcpy(frame->tf_a, regs->a, sizeof(frame->tf_a)); - - return (0); -} - -int -fill_fpregs(struct thread *td, struct fpreg *regs) -{ -#ifdef FPE - struct pcb *pcb; - - pcb = td->td_pcb; - - if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) { - /* - * If we have just been running FPE instructions we will - * need to save the state to memcpy it below. - */ - if (td == curthread) - fpe_state_save(td); - - memcpy(regs->fp_x, pcb->pcb_x, sizeof(regs->fp_x)); - regs->fp_fcsr = pcb->pcb_fcsr; - } else -#endif - memset(regs, 0, sizeof(*regs)); - - return (0); -} - -int -set_fpregs(struct thread *td, struct fpreg *regs) -{ -#ifdef FPE - struct trapframe *frame; - struct pcb *pcb; - - frame = td->td_frame; - pcb = td->td_pcb; - - memcpy(pcb->pcb_x, regs->fp_x, sizeof(regs->fp_x)); - pcb->pcb_fcsr = regs->fp_fcsr; - pcb->pcb_fpflags |= PCB_FP_STARTED; - frame->tf_sstatus &= ~SSTATUS_FS_MASK; - frame->tf_sstatus |= SSTATUS_FS_CLEAN; -#endif - - return (0); -} - -int -fill_dbregs(struct thread *td, struct dbreg *regs) -{ - - panic("fill_dbregs"); -} - -int -set_dbregs(struct thread *td, struct dbreg *regs) -{ - - panic("set_dbregs"); -} - -int -ptrace_set_pc(struct thread *td, u_long addr) -{ - - td->td_frame->tf_sepc = addr; - return (0); -} - -int -ptrace_single_step(struct thread *td) -{ - - /* TODO; */ - return (EOPNOTSUPP); -} - -int -ptrace_clear_single_step(struct thread *td) -{ - - /* TODO; */ - return (EOPNOTSUPP); -} - -void -exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) -{ - struct trapframe *tf; - struct pcb *pcb; - - tf = td->td_frame; - pcb = td->td_pcb; - - memset(tf, 0, sizeof(struct trapframe)); - - tf->tf_a[0] = stack; - tf->tf_sp = STACKALIGN(stack); - tf->tf_ra = imgp->entry_addr; - tf->tf_sepc = imgp->entry_addr; - - pcb->pcb_fpflags &= ~PCB_FP_STARTED; -} - -/* Sanity check these are the same size, they will be memcpy'd to and fro */ -CTASSERT(sizeof(((struct trapframe *)0)->tf_a) == - sizeof((struct gpregs *)0)->gp_a); -CTASSERT(sizeof(((struct trapframe *)0)->tf_s) == - sizeof((struct gpregs *)0)->gp_s); -CTASSERT(sizeof(((struct trapframe *)0)->tf_t) == - sizeof((struct gpregs *)0)->gp_t); -CTASSERT(sizeof(((struct trapframe *)0)->tf_a) == - sizeof((struct reg *)0)->a); -CTASSERT(sizeof(((struct trapframe *)0)->tf_s) == - sizeof((struct reg *)0)->s); -CTASSERT(sizeof(((struct trapframe *)0)->tf_t) == - sizeof((struct reg *)0)->t); - -/* Support for FDT configurations only. */ -CTASSERT(FDT); - -int -get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret) -{ - struct trapframe *tf = td->td_frame; - - memcpy(mcp->mc_gpregs.gp_t, tf->tf_t, sizeof(mcp->mc_gpregs.gp_t)); - memcpy(mcp->mc_gpregs.gp_s, tf->tf_s, sizeof(mcp->mc_gpregs.gp_s)); - memcpy(mcp->mc_gpregs.gp_a, tf->tf_a, sizeof(mcp->mc_gpregs.gp_a)); - - if (clear_ret & GET_MC_CLEAR_RET) { - mcp->mc_gpregs.gp_a[0] = 0; - mcp->mc_gpregs.gp_t[0] = 0; /* clear syscall error */ - } - - mcp->mc_gpregs.gp_ra = tf->tf_ra; - mcp->mc_gpregs.gp_sp = tf->tf_sp; - mcp->mc_gpregs.gp_gp = tf->tf_gp; - mcp->mc_gpregs.gp_tp = tf->tf_tp; - mcp->mc_gpregs.gp_sepc = tf->tf_sepc; - mcp->mc_gpregs.gp_sstatus = tf->tf_sstatus; - get_fpcontext(td, mcp); - - return (0); -} - -int -set_mcontext(struct thread *td, mcontext_t *mcp) -{ - struct trapframe *tf; - - tf = td->td_frame; - - /* - * Permit changes to the USTATUS bits of SSTATUS. - * - * Ignore writes to read-only bits (SD, XS). - * - * Ignore writes to the FS field as set_fpcontext() will set - * it explicitly. - */ - if (((mcp->mc_gpregs.gp_sstatus ^ tf->tf_sstatus) & - ~(SSTATUS_SD | SSTATUS_XS_MASK | SSTATUS_FS_MASK | SSTATUS_UPIE | - SSTATUS_UIE)) != 0) - return (EINVAL); - - memcpy(tf->tf_t, mcp->mc_gpregs.gp_t, sizeof(tf->tf_t)); - memcpy(tf->tf_s, mcp->mc_gpregs.gp_s, sizeof(tf->tf_s)); - memcpy(tf->tf_a, mcp->mc_gpregs.gp_a, sizeof(tf->tf_a)); - - tf->tf_ra = mcp->mc_gpregs.gp_ra; - tf->tf_sp = mcp->mc_gpregs.gp_sp; - tf->tf_gp = mcp->mc_gpregs.gp_gp; - tf->tf_sepc = mcp->mc_gpregs.gp_sepc; - tf->tf_sstatus = mcp->mc_gpregs.gp_sstatus; - set_fpcontext(td, mcp); - - return (0); -} - -static void -get_fpcontext(struct thread *td, mcontext_t *mcp) -{ -#ifdef FPE - struct pcb *curpcb; - - critical_enter(); - - curpcb = curthread->td_pcb; - - KASSERT(td->td_pcb == curpcb, ("Invalid fpe pcb")); - - if ((curpcb->pcb_fpflags & PCB_FP_STARTED) != 0) { - /* - * If we have just been running FPE instructions we will - * need to save the state to memcpy it below. - */ - fpe_state_save(td); - - KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, - ("Non-userspace FPE flags set in get_fpcontext")); - memcpy(mcp->mc_fpregs.fp_x, curpcb->pcb_x, - sizeof(mcp->mc_fpregs.fp_x)); - mcp->mc_fpregs.fp_fcsr = curpcb->pcb_fcsr; - mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; - mcp->mc_flags |= _MC_FP_VALID; - } - - critical_exit(); -#endif -} - -static void -set_fpcontext(struct thread *td, mcontext_t *mcp) -{ -#ifdef FPE - struct pcb *curpcb; -#endif - - td->td_frame->tf_sstatus &= ~SSTATUS_FS_MASK; - td->td_frame->tf_sstatus |= SSTATUS_FS_OFF; - -#ifdef FPE - critical_enter(); - - if ((mcp->mc_flags & _MC_FP_VALID) != 0) { - curpcb = curthread->td_pcb; - /* FPE usage is enabled, override registers. */ - memcpy(curpcb->pcb_x, mcp->mc_fpregs.fp_x, - sizeof(mcp->mc_fpregs.fp_x)); - curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr; - curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; - td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN; - } - - critical_exit(); -#endif -} - void cpu_idle(int busy) { @@ -545,31 +266,6 @@ spinlock_exit(void) } } -#ifndef _SYS_SYSPROTO_H_ -struct sigreturn_args { - ucontext_t *ucp; -}; -#endif - -int -sys_sigreturn(struct thread *td, struct sigreturn_args *uap) -{ - ucontext_t uc; - int error; - - if (copyin(uap->sigcntxp, &uc, sizeof(uc))) - return (EFAULT); - - error = set_mcontext(td, &uc.uc_mcontext); - if (error != 0) - return (error); - - /* Restore signal mask. */ - kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); - - return (EJUSTRETURN); -} - /* * Construct a PCB from a trapframe. This is called from kdb_trap() where * we want to start a backtrace from the function that caused us to enter @@ -589,85 +285,6 @@ makectx(struct trapframe *tf, struct pcb *pcb) pcb->pcb_tp = tf->tf_tp; } -void -sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) -{ - struct sigframe *fp, frame; - struct sysentvec *sysent; - struct trapframe *tf; - struct sigacts *psp; - struct thread *td; - struct proc *p; - int onstack; - int sig; - - td = curthread; - p = td->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); - - sig = ksi->ksi_signo; - psp = p->p_sigacts; - mtx_assert(&psp->ps_mtx, MA_OWNED); - - tf = td->td_frame; - onstack = sigonstack(tf->tf_sp); - - CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, - catcher, sig); - - /* Allocate and validate space for the signal handler context. */ - if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack && - SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + - td->td_sigstk.ss_size); - } else { - fp = (struct sigframe *)td->td_frame->tf_sp; - } - - /* Make room, keeping the stack aligned */ - fp--; - fp = (struct sigframe *)STACKALIGN(fp); - - /* Fill in the frame to copy out */ - bzero(&frame, sizeof(frame)); - get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); - frame.sf_si = ksi->ksi_info; - frame.sf_uc.uc_sigmask = *mask; - frame.sf_uc.uc_stack = td->td_sigstk; - frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? - (onstack ? SS_ONSTACK : 0) : SS_DISABLE; - mtx_unlock(&psp->ps_mtx); - PROC_UNLOCK(td->td_proc); - - /* Copy the sigframe out to the user's stack. */ - if (copyout(&frame, fp, sizeof(*fp)) != 0) { - /* Process has trashed its stack. Kill it. */ - CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp); - PROC_LOCK(p); - sigexit(td, SIGILL); - } - - tf->tf_a[0] = sig; - tf->tf_a[1] = (register_t)&fp->sf_si; - tf->tf_a[2] = (register_t)&fp->sf_uc; - - tf->tf_sepc = (register_t)catcher; - tf->tf_sp = (register_t)fp; - - sysent = p->p_sysent; - if (sysent->sv_sigcode_base != 0) - tf->tf_ra = (register_t)sysent->sv_sigcode_base; - else - tf->tf_ra = (register_t)(sysent->sv_psstrings - - *(sysent->sv_szsigcode)); - - CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_sepc, - tf->tf_sp); - - PROC_LOCK(p); - mtx_lock(&psp->ps_mtx); -} - static void init_proc0(vm_offset_t kstack) { @@ -803,6 +420,9 @@ fake_preload_metadata(struct riscv_bootparams *rvbp) rvbp->kern_phys, rvbp->kern_phys + (lastaddr - KERNBASE)); } +/* Support for FDT configurations only. */ +CTASSERT(FDT); + #ifdef FDT static void parse_fdt_bootargs(void) diff --git a/sys/riscv/riscv/ptrace_machdep.c b/sys/riscv/riscv/ptrace_machdep.c new file mode 100644 index 000000000000..e42bc8bf6b1b --- /dev/null +++ b/sys/riscv/riscv/ptrace_machdep.c @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * Copyright (c) 2015-2017 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +int +ptrace_set_pc(struct thread *td, u_long addr) +{ + + td->td_frame->tf_sepc = addr; + return (0); +} + +int +ptrace_single_step(struct thread *td) +{ + + /* TODO; */ + return (EOPNOTSUPP); +} + +int +ptrace_clear_single_step(struct thread *td) +{ + *** 4 LINES SKIPPED *** From nobody Fri Oct 8 00:22:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7B1BA17E529A; Fri, 8 Oct 2021 00: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 4HQTQj5xQNz3R55; Fri, 8 Oct 2021 00:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3058F1D3C8; Fri, 8 Oct 2021 00:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980M5Xf042197; Fri, 8 Oct 2021 00:22:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980M5gi042182; Fri, 8 Oct 2021 00:22:05 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:22:05 GMT Message-Id: <202110080022.1980M5gi042182@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: dc2d0899bba6 - main - kern_sig.c: Remove unused SIGPROP_CANTMASK List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: dc2d0899bba62d79083daeb83c6fac49abf28c3b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dc2d0899bba62d79083daeb83c6fac49abf28c3b commit dc2d0899bba62d79083daeb83c6fac49abf28c3b Author: Konstantin Belousov AuthorDate: 2021-10-05 04:55:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:21:42 +0000 kern_sig.c: Remove unused SIGPROP_CANTMASK Reviewed by: imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313 --- sys/kern/kern_sig.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b88556f2954d..c891cc1fbbad 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -214,7 +214,6 @@ SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, &coredump_devctl, #define SIGPROP_TTYSTOP 0x08 /* ditto, from tty */ #define SIGPROP_IGNORE 0x10 /* ignore by default */ #define SIGPROP_CONT 0x20 /* continue if suspended */ -#define SIGPROP_CANTMASK 0x40 /* non-maskable, catchable */ static int sigproptbl[NSIG] = { [SIGHUP] = SIGPROP_KILL, From nobody Fri Oct 8 00:22:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D28BE17E52A0; Fri, 8 Oct 2021 00: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 4HQTQk3FVlz3R9D; Fri, 8 Oct 2021 00:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BBB21CEE1; Fri, 8 Oct 2021 00:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980M6hd042990; Fri, 8 Oct 2021 00:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980M645042980; Fri, 8 Oct 2021 00:22:06 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:22:06 GMT Message-Id: <202110080022.1980M645042980@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: 7a9775e9d06f - main - sys/proc.h: remove dead prototype List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 7a9775e9d06f629c5441124204d68d43a9f326dc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7a9775e9d06f629c5441124204d68d43a9f326dc commit 7a9775e9d06f629c5441124204d68d43a9f326dc Author: Konstantin Belousov AuthorDate: 2021-10-05 05:07:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:21:43 +0000 sys/proc.h: remove dead prototype Reviewed by: imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313 --- sys/sys/proc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 8fa9406bd378..a9cef631529d 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1161,7 +1161,6 @@ int cpu_idle_wakeup(int); extern void (*cpu_idle_hook)(sbintime_t); /* Hook to machdep CPU idler. */ void cpu_switch(struct thread *, struct thread *, struct mtx *); void cpu_throw(struct thread *, struct thread *) __dead2; -void unsleep(struct thread *); void userret(struct thread *, struct trapframe *); void cpu_exit(struct thread *); From nobody Fri Oct 8 00:22:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 809E717E50EA; Fri, 8 Oct 2021 00:22:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQTQm0CNZz3RCx; Fri, 8 Oct 2021 00:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70EF01D536; Fri, 8 Oct 2021 00:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980M71s043243; Fri, 8 Oct 2021 00:22:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980M704043242; Fri, 8 Oct 2021 00:22:07 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:22:07 GMT Message-Id: <202110080022.1980M704043242@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: 244ab56611c1 - main - Add curproc_sigkilled() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 244ab56611c15e737b76cb3950c32e37b67c26fc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=244ab56611c15e737b76cb3950c32e37b67c26fc commit 244ab56611c15e737b76cb3950c32e37b67c26fc Author: Konstantin Belousov AuthorDate: 2021-10-05 05:08:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:21:43 +0000 Add curproc_sigkilled() Function returns an indicator that the process was killed with SIGKILL Reviewed by: imp, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313 --- sys/kern/kern_sig.c | 23 +++++++++++++++++++++++ sys/sys/proc.h | 1 + 2 files changed, 24 insertions(+) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index c891cc1fbbad..edafa7eda57a 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3296,6 +3296,29 @@ sig_intr(void) return (ret); } +bool +curproc_sigkilled(void) +{ + struct thread *td; + struct proc *p; + struct sigacts *ps; + bool res; + + td = curthread; + if ((td->td_flags & TDF_NEEDSIGCHK) == 0) + return (false); + + p = td->td_proc; + PROC_LOCK(p); + ps = p->p_sigacts; + mtx_lock(&ps->ps_mtx); + res = SIGISMEMBER(td->td_sigqueue.sq_signals, SIGKILL) || + SIGISMEMBER(p->p_sigqueue.sq_signals, SIGKILL); + mtx_unlock(&ps->ps_mtx); + PROC_UNLOCK(p); + return (res); +} + void proc_wkilled(struct proc *p) { diff --git a/sys/sys/proc.h b/sys/sys/proc.h index a9cef631529d..691bdae8b41a 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1161,6 +1161,7 @@ int cpu_idle_wakeup(int); extern void (*cpu_idle_hook)(sbintime_t); /* Hook to machdep CPU idler. */ void cpu_switch(struct thread *, struct thread *, struct mtx *); void cpu_throw(struct thread *, struct thread *) __dead2; +bool curproc_sigkilled(void); void userret(struct thread *, struct trapframe *); void cpu_exit(struct thread *); From nobody Fri Oct 8 00:22:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 84AB217E5163; Fri, 8 Oct 2021 00:22: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 4HQTQn4CrHz3R9P; Fri, 8 Oct 2021 00:22:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 883EC1D695; Fri, 8 Oct 2021 00:22:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980M8Gl043267; Fri, 8 Oct 2021 00:22:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980M8il043266; Fri, 8 Oct 2021 00:22:08 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:22:08 GMT Message-Id: <202110080022.1980M8il043266@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: 2ec505d2b863 - main - core(5): explicitly mention the core file size limit name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 2ec505d2b863ca03d542a94e8417358e48e2606d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2ec505d2b863ca03d542a94e8417358e48e2606d commit 2ec505d2b863ca03d542a94e8417358e48e2606d Author: Konstantin Belousov AuthorDate: 2021-10-05 14:52:44 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:21:43 +0000 core(5): explicitly mention the core file size limit name Reviewed by: imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313 --- share/man/man5/core.5 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man5/core.5 b/share/man/man5/core.5 index 500da31a310c..d176548d1570 100644 --- a/share/man/man5/core.5 +++ b/share/man/man5/core.5 @@ -51,8 +51,10 @@ a system crash. (In this event, the decision to save the core file is arbitrary, see .Xr savecore 8 . ) .Pp -The maximum size of a core file is limited by -.Xr setrlimit 2 . +The maximum size of a core file is limited by the +.Dv RLIMIT_CORE +.Xr setrlimit 2 +limit. Files which would be larger than the limit are not created. .Pp The name of the file is controlled via the From nobody Fri Oct 8 00:22:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BDF7D17E5328; Fri, 8 Oct 2021 00:22: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 4HQTQp3mjcz3RG8; Fri, 8 Oct 2021 00:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3B7A1D698; Fri, 8 Oct 2021 00:22:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1980M906043291; Fri, 8 Oct 2021 00:22:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1980M9HS043290; Fri, 8 Oct 2021 00:22:09 GMT (envelope-from git) Date: Fri, 8 Oct 2021 00:22:09 GMT Message-Id: <202110080022.1980M9HS043290@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: b5cadc643e85 - main - Make core dump writes interruptible with SIGKILL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: b5cadc643e853fa4cb23e5315e6f40bf9979a9c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b5cadc643e853fa4cb23e5315e6f40bf9979a9c0 commit b5cadc643e853fa4cb23e5315e6f40bf9979a9c0 Author: Konstantin Belousov AuthorDate: 2021-10-05 05:11:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 00:21:43 +0000 Make core dump writes interruptible with SIGKILL This can be disabled by sysctl kern.core_dump_can_intr Reported and tested by: pho Reviewed by: imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313 --- share/man/man5/core.5 | 16 +++++++++++++++- sys/kern/kern_exec.c | 7 +++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/share/man/man5/core.5 b/share/man/man5/core.5 index d176548d1570..0af1b2b7e8bf 100644 --- a/share/man/man5/core.5 +++ b/share/man/man5/core.5 @@ -28,7 +28,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd August 2, 2020 +.Dd October 5, 2021 .Dt CORE 5 .Os .Sh NAME @@ -57,6 +57,20 @@ The maximum size of a core file is limited by the limit. Files which would be larger than the limit are not created. .Pp +With a large limit, a process that had mapped a very large, +and perhaps sparsely populated, virtual memory region, could take +a very long time to create core dumps. +The system ignores all signals sent to a process writing a core file, except +.Dv SIGKILL +which terminates the writing and causes immediate exit of the process. +The behavior of +.Dv SIGKILL +can be disabled by setting tunable +.Xr sysctl 8 +variable +.Va kern.core_dump_can_intr +to zero. +.Pp The name of the file is controlled via the .Xr sysctl 8 variable diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 4b3035cb7e08..7ec405ee6a62 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -151,6 +151,11 @@ static int map_at_zero = 0; SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RWTUN, &map_at_zero, 0, "Permit processes to map an object at virtual address 0."); +static int core_dump_can_intr = 1; +SYSCTL_INT(_kern, OID_AUTO, core_dump_can_intr, CTLFLAG_RWTUN, + &core_dump_can_intr, 0, + "Core dumping interruptible with SIGKILL"); + static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS) { @@ -1943,6 +1948,8 @@ core_output(char *base, size_t len, off_t offset, struct coredump_params *cp, * anonymous memory or truncated files, for example. */ for (runlen = 0; runlen < len; runlen += PAGE_SIZE) { + if (core_dump_can_intr && curproc_sigkilled()) + return (EINTR); error = vm_fault(map, (uintptr_t)base + runlen, VM_PROT_READ, VM_FAULT_NOFILL, NULL); if (runlen == 0) From nobody Fri Oct 8 01:26:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3EF6A12DC2E8; Fri, 8 Oct 2021 01:26: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 4HQVrq3494z4bDM; Fri, 8 Oct 2021 01:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D51211DCF4; Fri, 8 Oct 2021 01:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1981QIgU024301; Fri, 8 Oct 2021 01:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1981QIJq024300; Fri, 8 Oct 2021 01:26:18 GMT (envelope-from git) Date: Fri, 8 Oct 2021 01:26:18 GMT Message-Id: <202110080126.1981QIJq024300@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: 8ff2b5224140 - main - prometheus_sysctl_exporter(8): filter output using a regex List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 8ff2b52241400f2b5c2287b91e6e12b97ffd5773 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=8ff2b52241400f2b5c2287b91e6e12b97ffd5773 commit 8ff2b52241400f2b5c2287b91e6e12b97ffd5773 Author: Robert Wing AuthorDate: 2021-10-08 01:00:27 +0000 Commit: Robert Wing CommitDate: 2021-10-08 01:02:57 +0000 prometheus_sysctl_exporter(8): filter output using a regex Add two options, -i and -e, for filtering prometheus metrics. Each option takes a regular expression as an argument. The provided regex will be tested against the prometheus metric name. The -i option includes metrics matching the given regex. The -e option excludes metrics matching the given regex. Sponsored by: Modirum MDPay Sponsored by: Klara Inc. Reviewed by: 0mp, debdrup Differential Revision: https://reviews.freebsd.org/D32269 --- .../prometheus_sysctl_exporter.8 | 18 ++++- .../prometheus_sysctl_exporter.c | 88 ++++++++++++++++------ 2 files changed, 80 insertions(+), 26 deletions(-) diff --git a/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 b/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 index f4ac44891ecb..7d73e3cab8cd 100644 --- a/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 +++ b/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8 @@ -22,7 +22,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd December 18, 2016 +.Dd October 7, 2021 .Dt PROMETHEUS_SYSCTL_EXPORTER 8 .Os .Sh NAME @@ -31,6 +31,8 @@ .Sh SYNOPSIS .Nm prometheus_sysctl_exporter .Op Fl dgh +.Op Fl e Ar pattern +.Op Fl i Ar pattern .Op Ar prefix ... .Sh DESCRIPTION Prometheus is a monitoring system that gathers metrics from its targets @@ -74,12 +76,26 @@ The following options are available: .Bl -tag -width indent .It Fl d Print descriptions of metrics when available. +.It Fl e Ar pattern +Same as +.Fl i , +except exclude metrics that match +.Ar pattern . .It Fl g Gzip compresses the HTTP response body. .It Fl h Precede the output with a HTTP response header. This flag is required when running this utility through .Xr inetd 8 . +.It Fl i Ar pattern +If specified, include metrics that match +.Ar pattern . +The format of +.Ar pattern +is to be a regular expression as described in +.Xr re_format 7 . +The provided regular expression is tested against the Prometheus +metric name. .El .Sh SEE ALSO .Xr cron 8 , diff --git a/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c b/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c index b1f24ddf203a..25e60f5dddbe 100644 --- a/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c +++ b/usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -44,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* Regular expressions for filtering output. */ +static regex_t inc_regex; +static regex_t exc_regex; + /* * Cursor for iterating over all of the system's sysctl OIDs. */ @@ -370,25 +375,27 @@ oid_get_name(const struct oid *o, struct oidname *on) on->oid = *o; } -/* Prints the name and labels of an OID to a file stream. */ +/* Populates the name and labels of an OID to a buffer. */ static void -oidname_print(const struct oidname *on, const struct oidformat *of, - FILE *fp) +oid_get_metric(const struct oidname *on, const struct oidformat *of, + char *metric, size_t mlen) { const char *name, *label; size_t i; - char separator; + char separator, buf[BUFSIZ]; /* Print the name of the metric. */ - fprintf(fp, "sysctl"); + snprintf(metric, mlen, "%s", "sysctl"); name = on->names; label = on->labels; for (i = 0; i < on->oid.len; ++i) { if (*label == '\0') { - fputc('_', fp); + strlcat(metric, "_", mlen); while (*name != '\0') { /* Map unsupported characters to underscores. */ - fputc(isalnum(*name) ? *name : '_', fp); + snprintf(buf, sizeof(buf), "%c", + isalnum(*name) ? *name : '_'); + strlcat(metric, buf, mlen); ++name; } } @@ -396,9 +403,9 @@ oidname_print(const struct oidname *on, const struct oidformat *of, label += strlen(label) + 1; } if (oidformat_is_temperature(of)) - fprintf(fp, "_celcius"); + strlcat(metric, "_celcius", mlen); else if (oidformat_is_timeval(of)) - fprintf(fp, "_seconds"); + strlcat(metric, "_seconds", mlen); /* Print the labels of the metric. */ name = on->names; @@ -410,21 +417,23 @@ oidname_print(const struct oidname *on, const struct oidformat *of, "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789_")] == '\0'); - fprintf(fp, "%c%s=\"", separator, label); + snprintf(buf, sizeof(buf), "%c%s=\"", separator, label); + strlcat(metric, buf, mlen); while (*name != '\0') { /* Escape backslashes and double quotes. */ if (*name == '\\' || *name == '"') - fputc('\\', fp); - fputc(*name++, fp); + strlcat(metric, "\\", mlen); + snprintf(buf, sizeof(buf), "%c", *name++); + strlcat(metric, buf, mlen); } - fputc('"', fp); + strlcat(metric, "\"", mlen); separator = ','; } name += strlen(name) + 1; label += strlen(label) + 1; } if (separator != '{') - fputc('}', fp); + strlcat(metric, "}", mlen); } /* Returns whether the OID name has any labels associated to it. */ @@ -483,16 +492,25 @@ oiddescription_print(const struct oiddescription *od, FILE *fp) static void oid_print(const struct oid *o, struct oidname *on, bool print_description, - FILE *fp) + bool exclude, bool include, FILE *fp) { struct oidformat of; struct oidvalue ov; struct oiddescription od; + char metric[BUFSIZ]; if (!oid_get_format(o, &of) || !oid_get_value(o, &of, &ov)) return; oid_get_name(o, on); + oid_get_metric(on, &of, metric, sizeof(metric)); + + if (exclude && regexec(&exc_regex, metric, 0, NULL, 0) == 0) + return; + + if (include && regexec(&inc_regex, metric, 0, NULL, 0) != 0) + return; + /* * Print the line with the description. Prometheus expects a * single unique description for every metric, which cannot be @@ -502,14 +520,14 @@ oid_print(const struct oid *o, struct oidname *on, bool print_description, if (print_description && !oidname_has_labels(on) && oid_get_description(o, &od)) { fprintf(fp, "# HELP "); - oidname_print(on, &of, fp); + fprintf(fp, "%s", metric); fputc(' ', fp); oiddescription_print(&od, fp); fputc('\n', fp); } /* Print the line with the value. */ - oidname_print(on, &of, fp); + fprintf(fp, "%s", metric); fputc(' ', fp); oidvalue_print(&ov, fp); fputc('\n', fp); @@ -539,8 +557,9 @@ static void usage(void) { - fprintf(stderr, - "usage: prometheus_sysctl_exporter [-dgh] [prefix ...]\n"); + fprintf(stderr, "%s", + "usage: prometheus_sysctl_exporter [-dgh] [-e pattern] [-i pattern]\n" + "\t[prefix ...]\n"); exit(1); } @@ -551,22 +570,41 @@ main(int argc, char *argv[]) char *http_buf; FILE *fp; size_t http_buflen; - int ch; - bool gzip_mode, http_mode, print_descriptions; + int ch, error; + bool exclude, include, gzip_mode, http_mode, print_descriptions; + char errbuf[BUFSIZ]; /* Parse command line flags. */ - gzip_mode = http_mode = print_descriptions = false; - while ((ch = getopt(argc, argv, "dgh")) != -1) { + include = exclude = gzip_mode = http_mode = print_descriptions = false; + while ((ch = getopt(argc, argv, "de:ghi:")) != -1) { switch (ch) { case 'd': print_descriptions = true; break; + case 'e': + error = regcomp(&exc_regex, optarg, REG_EXTENDED); + if (error != 0) { + regerror(error, &exc_regex, errbuf, sizeof(errbuf)); + errx(1, "bad regular expression '%s': %s", + optarg, errbuf); + } + exclude = true; + break; case 'g': gzip_mode = true; break; case 'h': http_mode = true; break; + case 'i': + error = regcomp(&inc_regex, optarg, REG_EXTENDED); + if (error != 0) { + regerror(error, &inc_regex, errbuf, sizeof(errbuf)); + errx(1, "bad regular expression '%s': %s", + optarg, errbuf); + } + include = true; + break; default: usage(); } @@ -590,7 +628,7 @@ main(int argc, char *argv[]) /* Print all OIDs. */ oid_get_root(&o); do { - oid_print(&o, &on, print_descriptions, fp); + oid_print(&o, &on, print_descriptions, exclude, include, fp); } while (oid_get_next(&o, &o)); } else { int i; @@ -602,7 +640,7 @@ main(int argc, char *argv[]) oid_get_by_name(&root, argv[i]); o = root; do { - oid_print(&o, &on, print_descriptions, fp); + oid_print(&o, &on, print_descriptions, exclude, include, fp); } while (oid_get_next(&o, &o) && oid_is_beneath(&o, &root)); } From nobody Fri Oct 8 06:35:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6034117ECAE8; Fri, 8 Oct 2021 06:35: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 4HQdk204Mzz4ZNv; Fri, 8 Oct 2021 06:35:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D36422795; Fri, 8 Oct 2021 06:35:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1986ZrsZ039451; Fri, 8 Oct 2021 06:35:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1986ZraT039450; Fri, 8 Oct 2021 06:35:53 GMT (envelope-from git) Date: Fri, 8 Oct 2021 06:35:53 GMT Message-Id: <202110080635.1986ZraT039450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: e6c28c2465d8 - main - stress2: exclude known problem 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: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6c28c2465d82e3341b589710b6302e35e1eee1c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=e6c28c2465d82e3341b589710b6302e35e1eee1c commit e6c28c2465d82e3341b589710b6302e35e1eee1c Author: Peter Holm AuthorDate: 2021-10-08 06:35:17 +0000 Commit: Peter Holm CommitDate: 2021-10-08 06:35:17 +0000 stress2: exclude known problem test --- tools/test/stress2/misc/all.exclude | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index 5106478ff2d0..7ee33f258f87 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -49,6 +49,7 @@ quota7.sh panic: dqflush: stray dquot 20120221 sctp3.sh panic: Queues are not empty when handling SHUTDOWN-COMPLETE 20210211 sendfile25.sh WiP 20200611 signal.sh Timing issues. Needs fixing 20171116 +snap8.sh https://people.freebsd.org/~pho/stress/log/log0123.txt 20211008 swapoff2.sh swap_pager_force_pagein: read from swap failed 20171223 swapoff5.sh log0005.txt, known issue 20210111 systrace.sh WiP 20200227 From nobody Fri Oct 8 06:38:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 057C717ED6C4; Fri, 8 Oct 2021 06:38: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 4HQdnB2WKvz4chT; Fri, 8 Oct 2021 06:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CAFD22611; Fri, 8 Oct 2021 06:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1986cbOu039740; Fri, 8 Oct 2021 06:38:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1986cb1s039739; Fri, 8 Oct 2021 06:38:37 GMT (envelope-from git) Date: Fri, 8 Oct 2021 06:38:37 GMT Message-Id: <202110080638.1986cb1s039739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 89ec6dcce03b - main - stress2: Added a regression 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: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89ec6dcce03bf2b684acdaf2e62fb4365647c0a8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=89ec6dcce03bf2b684acdaf2e62fb4365647c0a8 commit 89ec6dcce03bf2b684acdaf2e62fb4365647c0a8 Author: Peter Holm AuthorDate: 2021-10-08 06:38:17 +0000 Commit: Peter Holm CommitDate: 2021-10-08 06:38:17 +0000 stress2: Added a regression test --- tools/test/stress2/misc/elf.sh | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/tools/test/stress2/misc/elf.sh b/tools/test/stress2/misc/elf.sh new file mode 100755 index 000000000000..e0f88e5e90bc --- /dev/null +++ b/tools/test/stress2/misc/elf.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# 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. +# + +# Fuzz test +# Spending a long time in elf64_coredump() seen: +# https://people.freebsd.org/~pho/stress/log/log0183.txt +# Fixed by: b5cadc643e85 + +. ../default.cfg +[ `id -u` -ne 0 ] && echo "Must be root!" && exit 1 + +dir=/tmp +odir=`pwd` +cc -o /tmp/flip -Wall -Wextra -O2 ../tools/flip.c || exit 1 + +set -e +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 2g -u $mdstart +newfs $newfs_flags md$mdstart > /dev/null +mount /dev/md$mdstart $mntpoint +cd $mntpoint +set +e + +echo "Expect lots of warnings." +start=`date +%s` +while [ $((`date +%s` - start)) -lt 180 ]; do + cp /bin/ps ./elf + for j in `jot 10`; do + /tmp/flip -n 1 ./elf + timeout -s SIGKILL 2 ./elf aux > /dev/null 2>&1 || break + rm -f *.core + done +done +cd $odir + +for i in `jot 6`; do + mount | grep -q "on $mntpoint " || break + umount $mntpoint && break || sleep 10 + [ $i -eq 6 ] && + { echo FATAL; fstat -mf $mntpoint; exit 1; } +done +mdconfig -d -u $mdstart +rm /tmp/flip +exit 0 From nobody Fri Oct 8 07:22:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6715112D35FD; Fri, 8 Oct 2021 07:22: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 4HQflS11Vfz4jWj; Fri, 8 Oct 2021 07:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04AB922D5A; Fri, 8 Oct 2021 07:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1987MBYr006598; Fri, 8 Oct 2021 07:22:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1987MB71006597; Fri, 8 Oct 2021 07:22:11 GMT (envelope-from git) Date: Fri, 8 Oct 2021 07:22:11 GMT Message-Id: <202110080722.1987MB71006597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: dfb736022285 - main - dwmmc: Calculate the maximum transaction length correctly. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfb7360222856e7e4f5e0e5564281a25af63319c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=dfb7360222856e7e4f5e0e5564281a25af63319c commit dfb7360222856e7e4f5e0e5564281a25af63319c Author: Michal Meloun AuthorDate: 2021-10-07 18:42:56 +0000 Commit: Michal Meloun CommitDate: 2021-10-08 07:21:03 +0000 dwmmc: Calculate the maximum transaction length correctly. We should reserve two descriptors (not MMC_SECTORS) for potentially unaligned (so bounced) buffer fragments, one for the starting fragment and one for the ending fragment. Submitted by: kjopek@gmail.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30387 --- sys/dev/mmc/host/dwmmc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 77c8e42a6150..2080a973564f 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -145,6 +145,11 @@ struct idmac_desc { * second half of page */ #define IDMAC_MAX_SIZE 2048 +/* + * Busdma may bounce buffers, so we must reserve 2 descriptors + * (on start and on end) for bounced fragments. + */ +#define DWMMC_MAX_DATA (IDMAC_MAX_SIZE * (IDMAC_DESC_SEGS - 2)) / MMC_SECTOR_SIZE static void dwmmc_next_operation(struct dwmmc_softc *); static int dwmmc_setup_bus(struct dwmmc_softc *, int); @@ -1358,13 +1363,7 @@ dwmmc_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: - /* - * Busdma may bounce buffers, so we must reserve 2 descriptors - * (on start and on end) for bounced fragments. - * - */ - *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / - MMC_SECTOR_SIZE - 3; + *(int *)result = DWMMC_MAX_DATA; break; case MMCBR_IVAR_TIMING: *(int *)result = sc->host.ios.timing; @@ -1444,7 +1443,7 @@ dwmmc_get_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) cts->host_f_min = sc->host.f_min; cts->host_f_max = sc->host.f_max; cts->host_caps = sc->host.caps; - cts->host_max_data = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / MMC_SECTOR_SIZE; + cts->host_max_data = DWMMC_MAX_DATA; memcpy(&cts->ios, &sc->host.ios, sizeof(struct mmc_ios)); return (0); From nobody Fri Oct 8 07:59:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B391712D9CB7; Fri, 8 Oct 2021 07:59: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 4HQgZG4dL2z4qYj; Fri, 8 Oct 2021 07:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AA352365B; Fri, 8 Oct 2021 07:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1987xIm3046582; Fri, 8 Oct 2021 07:59:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1987xIrF046581; Fri, 8 Oct 2021 07:59:18 GMT (envelope-from git) Date: Fri, 8 Oct 2021 07:59:18 GMT Message-Id: <202110080759.1987xIrF046581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7e64580b5f47 - main - routing: Use the same index space for both nexthop and nexthop groups. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e64580b5f477ba4523799f26d1178f611f5d6cb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7e64580b5f477ba4523799f26d1178f611f5d6cb commit 7e64580b5f477ba4523799f26d1178f611f5d6cb Author: Alexander V. Chernikov AuthorDate: 2021-10-06 19:07:54 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-10-08 07:58:55 +0000 routing: Use the same index space for both nexthop and nexthop groups. This simplifies userland object handling along with kernel-level nexthop handling in fib algo framework. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32342 --- sys/net/route/fib_algo.c | 6 ++---- sys/net/route/nhgrp.c | 31 +++++++------------------------ sys/net/route/nhop_var.h | 1 - 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 4bae9e5edd6c..54b0464711a5 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1764,12 +1764,10 @@ get_nhop_idx(struct nhop_object *nh) { #ifdef ROUTE_MPATH if (NH_IS_NHGRP(nh)) - return (nhgrp_get_idx((struct nhgrp_object *)nh) * 2 - 1); + return (nhgrp_get_idx((struct nhgrp_object *)nh)); else - return (nhop_get_idx(nh) * 2); -#else - return (nhop_get_idx(nh)); #endif + return (nhop_get_idx(nh)); } uint32_t diff --git a/sys/net/route/nhgrp.c b/sys/net/route/nhgrp.c index 982ff2a72f15..07abdf480101 100644 --- a/sys/net/route/nhgrp.c +++ b/sys/net/route/nhgrp.c @@ -159,9 +159,9 @@ link_nhgrp(struct nh_control *ctl, struct nhgrp_priv *grp_priv) NHOPS_WLOCK(ctl); /* Check if we need to resize hash and index */ new_num_buckets = CHT_SLIST_GET_RESIZE_BUCKETS(&ctl->gr_head); - new_num_items = bitmask_get_resize_items(&ctl->gr_idx_head); + new_num_items = bitmask_get_resize_items(&ctl->nh_idx_head); - if (bitmask_alloc_idx(&ctl->gr_idx_head, &idx) != 0) { + if (bitmask_alloc_idx(&ctl->nh_idx_head, &idx) != 0) { NHOPS_WUNLOCK(ctl); DPRINTF("Unable to allocate mpath index"); consider_resize(ctl, new_num_buckets, new_num_items); @@ -196,7 +196,7 @@ unlink_nhgrp(struct nh_control *ctl, struct nhgrp_priv *key) } idx = nhg_priv_ret->nhg_idx; - ret = bitmask_free_idx(&ctl->gr_idx_head, idx); + ret = bitmask_free_idx(&ctl->nh_idx_head, idx); nhg_priv_ret->nhg_idx = 0; nhg_priv_ret->nh_control = NULL; @@ -243,8 +243,8 @@ consider_resize(struct nh_control *ctl, uint32_t new_gr_bucket, uint32_t new_idx CHT_SLIST_RESIZE(&ctl->gr_head, mpath, gr_ptr, new_gr_bucket); } if (gr_idx_ptr != NULL) { - if (bitmask_copy(&ctl->gr_idx_head, gr_idx_ptr, new_idx_items) == 0) - bitmask_swap(&ctl->gr_idx_head, gr_idx_ptr, new_idx_items, &old_idx_ptr); + if (bitmask_copy(&ctl->nh_idx_head, gr_idx_ptr, new_idx_items) == 0) + bitmask_swap(&ctl->nh_idx_head, gr_idx_ptr, new_idx_items, &old_idx_ptr); } NHOPS_WUNLOCK(ctl); @@ -261,8 +261,8 @@ bool nhgrp_ctl_alloc_default(struct nh_control *ctl, int malloc_flags) { size_t alloc_size; - uint32_t num_buckets, num_items; - void *cht_ptr, *mask_ptr; + uint32_t num_buckets; + void *cht_ptr; malloc_flags = (malloc_flags & (M_NOWAIT | M_WAITOK)) | M_ZERO; @@ -275,29 +275,16 @@ nhgrp_ctl_alloc_default(struct nh_control *ctl, int malloc_flags) return (false); } - /* - * Allocate nexthop index bitmask. - */ - num_items = 128; - mask_ptr = malloc(bitmask_get_size(num_items), M_NHOP, malloc_flags); - if (mask_ptr == NULL) { - DPRINTF("mpath bitmask init failed"); - free(cht_ptr, M_NHOP); - return (false); - } - NHOPS_WLOCK(ctl); if (ctl->gr_head.hash_size == 0) { /* Init hash and bitmask */ CHT_SLIST_INIT(&ctl->gr_head, cht_ptr, num_buckets); - bitmask_init(&ctl->gr_idx_head, mask_ptr, num_items); NHOPS_WUNLOCK(ctl); } else { /* Other thread has already initiliazed hash/bitmask */ NHOPS_WUNLOCK(ctl); free(cht_ptr, M_NHOP); - free(mask_ptr, M_NHOP); } DPRINTF("mpath init done for fib/af %d/%d", ctl->rh->rib_fibnum, @@ -315,18 +302,14 @@ nhgrp_ctl_init(struct nh_control *ctl) * routes will not be necessarily used. */ CHT_SLIST_INIT(&ctl->gr_head, NULL, 0); - bitmask_init(&ctl->gr_idx_head, NULL, 0); return (0); } void nhgrp_ctl_free(struct nh_control *ctl) { - if (ctl->gr_head.ptr != NULL) free(ctl->gr_head.ptr, M_NHOP); - if (ctl->gr_idx_head.idx != NULL) - free(ctl->gr_idx_head.idx, M_NHOP); } void diff --git a/sys/net/route/nhop_var.h b/sys/net/route/nhop_var.h index 4ce82dd4a968..76984df0497f 100644 --- a/sys/net/route/nhop_var.h +++ b/sys/net/route/nhop_var.h @@ -57,7 +57,6 @@ struct nh_control { struct nhops_head nh_head; /* hash table head */ struct bitmask_head nh_idx_head; /* nhop index head */ struct nhgroups_head gr_head; /* nhgrp hash table head */ - struct bitmask_head gr_idx_head; /* nhgrp index head */ struct rwlock ctl_lock; /* overall ctl lock */ struct rib_head *ctl_rh; /* pointer back to rnh */ struct epoch_context ctl_epoch_ctx; /* epoch ctl helper */ From nobody Fri Oct 8 09:25:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 16F5517E4E5E; Fri, 8 Oct 2021 09:25: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 4HQjTh08cJz3HBP; Fri, 8 Oct 2021 09:25:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D543824B46; Fri, 8 Oct 2021 09:25:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1989PREx066948; Fri, 8 Oct 2021 09:25:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1989PRgf066947; Fri, 8 Oct 2021 09:25:27 GMT (envelope-from git) Date: Fri, 8 Oct 2021 09:25:27 GMT Message-Id: <202110080925.1989PRgf066947@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: 174aad047e12 - main - vm_fault: do not trigger OOM too early List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 174aad047e12e8f30f9a5919ca1c08919441a217 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=174aad047e12e8f30f9a5919ca1c08919441a217 commit 174aad047e12e8f30f9a5919ca1c08919441a217 Author: Konstantin Belousov AuthorDate: 2021-10-04 06:36:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-08 09:24:46 +0000 vm_fault: do not trigger OOM too early Wakeup in vm_waitpfault() does not mean that the thread would get the page on the next vm_page_alloc() call, other thread might steal the free page we were waiting for. On the other hand, this wakeup might come much earlier than just vm_pfault_oom_wait seconds, if the rate of the page reclamation is high enough. If wakeups come fast and we loose the allocation race enough times, OOM could be undeservably triggered much earlier than vm_pfault_oom_attempts x vm_pfault_oom_wait seconds. Fix it by not counting the number of sleeps, but measuring the time to th first allocation failure, and triggering OOM when it was older than oom_attempts x oom_wait seconds. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32287 --- sys/vm/vm_fault.c | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 5cfe7d1ae315..8a4b5a543dd6 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -125,7 +125,8 @@ struct faultstate { vm_prot_t fault_type; vm_prot_t prot; int fault_flags; - int oom; + struct timeval oom_start_time; + bool oom_started; boolean_t wired; /* Page reference for cow. */ @@ -1073,6 +1074,38 @@ vm_fault_zerofill(struct faultstate *fs) vm_page_valid(fs->m); } +/* + * Initiate page fault after timeout. Returns true if caller should + * do vm_waitpfault() after the call. + */ +static bool +vm_fault_allocate_oom(struct faultstate *fs) +{ + struct timeval now; + + unlock_and_deallocate(fs); + if (vm_pfault_oom_attempts < 0) + return (true); + if (!fs->oom_started) { + fs->oom_started = true; + getmicrotime(&fs->oom_start_time); + return (true); + } + + getmicrotime(&now); + timevalsub(&now, &fs->oom_start_time); + if (now.tv_sec < vm_pfault_oom_attempts * vm_pfault_oom_wait) + return (true); + + if (bootverbose) + printf( + "proc %d (%s) failed to alloc page on fault, starting OOM\n", + curproc->p_pid, curproc->p_comm); + vm_pageout_oom(VM_OOM_MEM_PF); + fs->oom_started = false; + return (false); +} + /* * Allocate a page directly or via the object populate method. */ @@ -1136,22 +1169,11 @@ vm_fault_allocate(struct faultstate *fs) fs->m = vm_page_alloc(fs->object, fs->pindex, alloc_req); } if (fs->m == NULL) { - unlock_and_deallocate(fs); - if (vm_pfault_oom_attempts < 0 || - fs->oom < vm_pfault_oom_attempts) { - fs->oom++; + if (vm_fault_allocate_oom(fs)) vm_waitpfault(dset, vm_pfault_oom_wait * hz); - } else { - if (bootverbose) - printf( - "proc %d (%s) failed to alloc page on fault, starting OOM\n", - curproc->p_pid, curproc->p_comm); - vm_pageout_oom(VM_OOM_MEM_PF); - fs->oom = 0; - } return (KERN_RESOURCE_SHORTAGE); } - fs->oom = 0; + fs->oom_started = false; return (KERN_NOT_RECEIVER); } @@ -1300,7 +1322,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, fs.fault_flags = fault_flags; fs.map = map; fs.lookup_still_valid = false; - fs.oom = 0; + fs.oom_started = false; faultcount = 0; nera = -1; hardfault = false; From nobody Fri Oct 8 09:34:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8ABAB17E6DFB; Fri, 8 Oct 2021 09:34: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 4HQjgZ3FZJz3KRs; Fri, 8 Oct 2021 09:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F58E24BB6; Fri, 8 Oct 2021 09:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1989Y2FL079883; Fri, 8 Oct 2021 09:34:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1989Y2uG079882; Fri, 8 Oct 2021 09:34:02 GMT (envelope-from git) Date: Fri, 8 Oct 2021 09:34:02 GMT Message-Id: <202110080934.1989Y2uG079882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: bd19202c92e3 - main - sctp: improve KASSERT messages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd19202c92e3d73e90aedd518f0963797744e50f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bd19202c92e3d73e90aedd518f0963797744e50f commit bd19202c92e3d73e90aedd518f0963797744e50f Author: Michael Tuexen AuthorDate: 2021-10-08 09:32:55 +0000 Commit: Michael Tuexen CommitDate: 2021-10-08 09:33:56 +0000 sctp: improve KASSERT messages MFC after: 1 week --- sys/netinet/sctp_ss_functions.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/netinet/sctp_ss_functions.c b/sys/netinet/sctp_ss_functions.c index c08bec07c588..23b1dc20e4cf 100644 --- a/sys/netinet/sctp_ss_functions.c +++ b/sys/netinet/sctp_ss_functions.c @@ -165,20 +165,20 @@ sctp_ss_default_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, { struct sctp_stream_out *strq, *strqt; - if (asoc->ss_data.locked_on_sending) { + if (asoc->ss_data.locked_on_sending != NULL) { KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, - ("strq %p not scheduled", + ("locked_on_sending %p not scheduled", (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); } strqt = asoc->ss_data.last_out_stream; + KASSERT(strqt == NULL || strqt->ss_params.scheduled, + ("last_out_stream %p not scheduled", (void *)strqt)); default_again: /* Find the next stream to use */ if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { - KASSERT(strqt->ss_params.scheduled, - ("strq %p not scheduled", (void *)strqt)); strq = TAILQ_NEXT(strqt, ss_params.ss.rr.next_spoke); if (strq == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); @@ -332,13 +332,13 @@ sctp_ss_rrp_packet_done(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net struct sctp_stream_out *strq, *strqt; strqt = asoc->ss_data.last_out_stream; + KASSERT(strqt == NULL || strqt->ss_params.scheduled, + ("last_out_stream %p not scheduled", (void *)strqt)); rrp_again: /* Find the next stream to use */ if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { - KASSERT(strqt->ss_params.scheduled, - ("strq %p not scheduled", (void *)strqt)); strq = TAILQ_NEXT(strqt, ss_params.ss.rr.next_spoke); if (strq == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); @@ -484,20 +484,20 @@ sctp_ss_prio_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, { struct sctp_stream_out *strq, *strqt, *strqn; - if (asoc->ss_data.locked_on_sending) { + if (asoc->ss_data.locked_on_sending != NULL) { KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, - ("strq %p not scheduled", + ("locked_on_sending %p not scheduled", (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); } strqt = asoc->ss_data.last_out_stream; + KASSERT(strqt == NULL || strqt->ss_params.scheduled, + ("last_out_stream %p not scheduled", (void *)strqt)); prio_again: /* Find the next stream to use */ if (strqt == NULL) { strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); } else { - KASSERT(strqt->ss_params.scheduled, - ("strq %p not scheduled", (void *)strqt)); strqn = TAILQ_NEXT(strqt, ss_params.ss.prio.next_spoke); if (strqn != NULL && strqn->ss_params.ss.prio.priority == strqt->ss_params.ss.prio.priority) { @@ -656,9 +656,9 @@ sctp_ss_fb_select(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, { struct sctp_stream_out *strq = NULL, *strqt; - if (asoc->ss_data.locked_on_sending) { + if (asoc->ss_data.locked_on_sending != NULL) { KASSERT(asoc->ss_data.locked_on_sending->ss_params.scheduled, - ("strq %p not scheduled", + ("locked_on_sending %p not scheduled", (void *)asoc->ss_data.locked_on_sending)); return (asoc->ss_data.locked_on_sending); } From nobody Fri Oct 8 10:25:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6E94317EB8A8; Fri, 8 Oct 2021 10:25: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 4HQkpY2mMNz3MY6; Fri, 8 Oct 2021 10:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33A502561D; Fri, 8 Oct 2021 10:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198AP9M2046892; Fri, 8 Oct 2021 10:25:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198AP9Zd046891; Fri, 8 Oct 2021 10:25:09 GMT (envelope-from git) Date: Fri, 8 Oct 2021 10:25:09 GMT Message-Id: <202110081025.198AP9Zd046891@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: 526370fb85db - main - net80211: proper ssid length check in setmlme_assoc_adhoc() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 526370fb85db4b659cff4625eb2f379acaa4a1a8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=526370fb85db4b659cff4625eb2f379acaa4a1a8 commit 526370fb85db4b659cff4625eb2f379acaa4a1a8 Author: Bjoern A. Zeeb AuthorDate: 2021-10-06 18:41:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-10-08 10:23:31 +0000 net80211: proper ssid length check in setmlme_assoc_adhoc() A user supplied SSID length is used without proper checks in setmlme_assoc_adhoc() which can lead to copies beyond the end of the user supplied buffer. The ssid is a fixed size array for the ioctl and the argument to setmlme_assoc_adhoc(). In addition to an ssid_len check of 0 also error in case the ssid_len is larger than the size of the ssid array to prevent problems. PR: 254737 Reported by: Tommaso (cutesmilee.research protonmail.com) MFC after: 3 days Reviewed by: emaste, adrian Differential Revision: https://reviews.freebsd.org/D32341 --- sys/net80211/ieee80211_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 2fef9ac0084a..b0339d996999 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1591,7 +1591,7 @@ setmlme_assoc_adhoc(struct ieee80211vap *vap, ("expected opmode IBSS or AHDEMO not %s", ieee80211_opmode_name[vap->iv_opmode])); - if (ssid_len == 0) + if (ssid_len == 0 || ssid_len > sizeof(ssid)) return EINVAL; sr = IEEE80211_MALLOC(sizeof(*sr), M_TEMP, From nobody Fri Oct 8 10:27:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 55F0D17EBD40; Fri, 8 Oct 2021 10:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQksX1y9lz3NJd; Fri, 8 Oct 2021 10:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19D952561F; Fri, 8 Oct 2021 10:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198ARiQx047175; Fri, 8 Oct 2021 10:27:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198ARiCL047174; Fri, 8 Oct 2021 10:27:44 GMT (envelope-from git) Date: Fri, 8 Oct 2021 10:27:44 GMT Message-Id: <202110081027.198ARiCL047174@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: 09dd08f16781 - main - net80211: correct length check in ieee80211_ies_expand() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 09dd08f167812a5fdb516fc98f14dbb43221432f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=09dd08f167812a5fdb516fc98f14dbb43221432f commit 09dd08f167812a5fdb516fc98f14dbb43221432f Author: Bjoern A. Zeeb AuthorDate: 2021-10-06 18:09:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-10-08 10:26:22 +0000 net80211: correct length check in ieee80211_ies_expand() In ieee80211_ies_expand() we are looping over Elements (also known as Information Elements or IEs). The comment suggests that we assume well-formedness of the IEs themselves. Checking the buffer length being least 2 (1 byte Element ID and 1 byte Length fields) rather than just 1 before accessing ie[1] is still good practise and can prevent and out-of-bounds read in case the input is not behaving according to the comment. Reported by: (coypu sdf.org) admbugs: 857 MFC after: 3 days Reviewed by: adrian, markj Differential Revision: https://reviews.freebsd.org/D32340 --- sys/net80211/ieee80211_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index d71503d28179..95bed7821d16 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1133,7 +1133,7 @@ ieee80211_ies_expand(struct ieee80211_ies *ies) ie = ies->data; ielen = ies->len; - while (ielen > 0) { + while (ielen > 1) { switch (ie[0]) { case IEEE80211_ELEMID_VENDOR: if (iswpaoui(ie)) From nobody Fri Oct 8 10:30:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 15EF217EC7C4; Fri, 8 Oct 2021 10:30: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 4HQkwF09Qfz3Ntl; Fri, 8 Oct 2021 10:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5AF5255A6; Fri, 8 Oct 2021 10:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198AU4p6049680; Fri, 8 Oct 2021 10:30:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198AU4dI049677; Fri, 8 Oct 2021 10:30:04 GMT (envelope-from git) Date: Fri, 8 Oct 2021 10:30:04 GMT Message-Id: <202110081030.198AU4dI049677@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: 76f3b8cb6405 - main - USB: adjust the Generic XHCI ACPI probe return value List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 76f3b8cb640536de2c370cc2bd60382bbc35cf5d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=76f3b8cb640536de2c370cc2bd60382bbc35cf5d commit 76f3b8cb640536de2c370cc2bd60382bbc35cf5d Author: Bjoern A. Zeeb AuthorDate: 2021-10-01 13:37:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-10-08 10:28:44 +0000 USB: adjust the Generic XHCI ACPI probe return value Change the probe return value from BUS_PROBE_DEFAULT to BUS_PROBE_GENERIC given this is the "generic" attach method. This allows individual drivers using XHCI generic but needing their own intialisation to gain priority for attaching over the generic implementation. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D32257 --- sys/dev/usb/controller/generic_xhci_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/controller/generic_xhci_acpi.c b/sys/dev/usb/controller/generic_xhci_acpi.c index 80ad8ca4e8a4..1594fa8c6670 100644 --- a/sys/dev/usb/controller/generic_xhci_acpi.c +++ b/sys/dev/usb/controller/generic_xhci_acpi.c @@ -64,7 +64,7 @@ generic_xhci_acpi_probe(device_t dev) device_set_desc(dev, XHCI_HC_DEVSTR); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_GENERIC); } static device_method_t xhci_acpi_methods[] = { From nobody Fri Oct 8 11:25:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4CC9517F1865; Fri, 8 Oct 2021 11:25:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQm8G1jVtz3jYL; Fri, 8 Oct 2021 11:25:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 166612632C; Fri, 8 Oct 2021 11:25:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198BPXRH026389; Fri, 8 Oct 2021 11:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198BPXDN026388; Fri, 8 Oct 2021 11:25:33 GMT (envelope-from git) Date: Fri, 8 Oct 2021 11:25:33 GMT Message-Id: <202110081125.198BPXDN026388@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: 0525ece3554e - main - net80211: fix build for 526370fb85db4b659cff4625eb2f379acaa4a1a8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 0525ece3554edce14fa68a7fb61078ae2110c44b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0525ece3554edce14fa68a7fb61078ae2110c44b commit 0525ece3554edce14fa68a7fb61078ae2110c44b Author: Bjoern A. Zeeb AuthorDate: 2021-10-08 11:21:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-10-08 11:21:44 +0000 net80211: fix build for 526370fb85db4b659cff4625eb2f379acaa4a1a8 In 526370fb85db4b659cff4625eb2f379acaa4a1a8 "net80211: proper ssid length check in setmlme_assoc_adhoc()" we are checking the sizeof on an array function parameter which leads to a warning that it will resturn the size of the type of the array rather than the array size itself. Use the defined length used both in the ioctl and the sizing of the array function parameter instead. Reported by: CI MFC after: 3 days X-MFC with: 526370fb85db4b659cff4625eb2f379acaa4a1a8 --- sys/net80211/ieee80211_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index b0339d996999..419518eb1224 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1591,7 +1591,7 @@ setmlme_assoc_adhoc(struct ieee80211vap *vap, ("expected opmode IBSS or AHDEMO not %s", ieee80211_opmode_name[vap->iv_opmode])); - if (ssid_len == 0 || ssid_len > sizeof(ssid)) + if (ssid_len == 0 || ssid_len > IEEE80211_NWID_LEN) return EINVAL; sr = IEEE80211_MALLOC(sizeof(*sr), M_TEMP, From nobody Fri Oct 8 14:49:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DC3D617E08C6; Fri, 8 Oct 2021 14:49: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 4HQrgV5nQZz4bjV; Fri, 8 Oct 2021 14:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2CC6CE2; Fri, 8 Oct 2021 14:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198EnQIp094535; Fri, 8 Oct 2021 14:49:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198EnQ0S094534; Fri, 8 Oct 2021 14:49:26 GMT (envelope-from git) Date: Fri, 8 Oct 2021 14:49:26 GMT Message-Id: <202110081449.198EnQ0S094534@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: 1c680e620bf7 - main - pf: do not copy anchor_wildcard / anchor_relative from userspace List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c680e620bf7e53d043d10b23bdfc980e45e6455 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1c680e620bf7e53d043d10b23bdfc980e45e6455 commit 1c680e620bf7e53d043d10b23bdfc980e45e6455 Author: Kristof Provost AuthorDate: 2021-10-08 13:13:21 +0000 Commit: Kristof Provost CommitDate: 2021-10-08 12:46:59 +0000 pf: do not copy anchor_wildcard / anchor_relative from userspace We overwrite these fields again in pf_kanchor_setup() anyway. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 2 -- sys/netpfil/pf/pf_nv.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 3242c51a2c66..89ab2b08c64a 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1812,8 +1812,6 @@ pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) krule->return_ttl = rule->return_ttl; krule->tos = rule->tos; krule->set_tos = rule->set_tos; - krule->anchor_relative = rule->anchor_relative; - krule->anchor_wildcard = rule->anchor_wildcard; krule->flush = rule->flush; krule->prio = rule->prio; diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index fb2bab77ad8f..73f0c55a7a21 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -595,8 +595,6 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule *rule) PFNV_CHK(pf_nvuint8(nvl, "return_ttl", &rule->return_ttl)); PFNV_CHK(pf_nvuint8(nvl, "tos", &rule->tos)); PFNV_CHK(pf_nvuint8(nvl, "set_tos", &rule->set_tos)); - PFNV_CHK(pf_nvuint8(nvl, "anchor_relative", &rule->anchor_relative)); - PFNV_CHK(pf_nvuint8(nvl, "anchor_wildcard", &rule->anchor_wildcard)); PFNV_CHK(pf_nvuint8(nvl, "flush", &rule->flush)); PFNV_CHK(pf_nvuint8(nvl, "prio", &rule->prio)); From nobody Fri Oct 8 15:09:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 96B7917E3000; Fri, 8 Oct 2021 15:09: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 4HQs683rm7z4dJp; Fri, 8 Oct 2021 15:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 603201147; Fri, 8 Oct 2021 15:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198F94nl022515; Fri, 8 Oct 2021 15:09:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198F94HG022514; Fri, 8 Oct 2021 15:09:04 GMT (envelope-from git) Date: Fri, 8 Oct 2021 15:09:04 GMT Message-Id: <202110081509.198F94HG022514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: bf8f6ffcb66a - main - Mention kern.timecounter.alloweddeviation in nanosleep.1 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf8f6ffcb66a27f498a18e520758ea0d18a6d2de Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=bf8f6ffcb66a27f498a18e520758ea0d18a6d2de commit bf8f6ffcb66a27f498a18e520758ea0d18a6d2de Author: Piotr Pawel Stefaniak AuthorDate: 2021-10-07 19:14:27 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-10-08 15:07:50 +0000 Mention kern.timecounter.alloweddeviation in nanosleep.1 PR: 224837 Reported by: Aleksander Derevianko --- lib/libc/sys/nanosleep.2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/nanosleep.2 b/lib/libc/sys/nanosleep.2 index 19ffcf1b7026..12758a974f7f 100644 --- a/lib/libc/sys/nanosleep.2 +++ b/lib/libc/sys/nanosleep.2 @@ -30,7 +30,7 @@ .\" @(#)sleep.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 17, 2017 +.Dd October 7, 2021 .Dt NANOSLEEP 2 .Os .Sh NAME @@ -93,6 +93,8 @@ returns immediately and the calling thread is not suspended. .Pp The suspension time may be longer than requested due to the scheduling of other activity by the system. +It is also subject to the allowed time interval deviation +specified by the sysctl kern.timecounter.alloweddeviation. An unmasked signal will terminate the sleep early, regardless of the .Dv SA_RESTART value on the interrupting signal. From nobody Fri Oct 8 15:14:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 633A517E3F60; Fri, 8 Oct 2021 15:14:00 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQsCr2Nglz4fM8; Fri, 8 Oct 2021 15:14:00 +0000 (UTC) (envelope-from pstef@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1633706040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=umdmqqYAwCOWq7fVRJurwyWE6DwWUSm3zyOeHxx/tyE=; b=dAPeXXeAsn3ZE2VtwweZPXL/H6qiBXlK2CyV1SD1MurprEotG1VLxooxJzpz71E9cO7r6A Y9o0dvmVyvjN5IQ4PjDdMSnQwInjiPJyNEIdtv1puiSU25dhGPIbj4pTuVb7a2MQr29V/Y TaZMGX+CF49khupKtmNr14I8a3Y++N510G20nAQdlRyc1aIyiYaMEvGzSX24tQ5tlyLXWX qwuU6mEw2Mu2edBf4Bpp7CLNqZrpPtiQusB7LL6XBfOT/qCfqT1RBKStTxqY1/kmRBjfX2 Y89XO0wWik9VhJQJ9qYXkhRAwH27Mk7mkV4nyI+/nLaKq2UAM6cPx2LtbIP67A== Received: by freefall.freebsd.org (Postfix, from userid 1403) id 379EB1E1AE; Fri, 8 Oct 2021 15:14:00 +0000 (UTC) Date: Fri, 8 Oct 2021 15:14:00 +0000 From: "Piotr P. Stefaniak" To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bf8f6ffcb66a - main - Mention kern.timecounter.alloweddeviation in nanosleep.1 Message-ID: References: <202110081509.198F94HG022514@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <202110081509.198F94HG022514@gitrepo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1633706040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=umdmqqYAwCOWq7fVRJurwyWE6DwWUSm3zyOeHxx/tyE=; b=oJfqivwR6cE/DGEk7zs76F7gEWkM/ZbpUIl0O4v80bWgxBP/qmLnwpTRXXX6RHdDZSrgZN jrkNoTlGVJRP/CunRyeWIs+iqCEPs4d4Lh12CDwvaQRScT/X1lbmBuOuupeRFsy07VVq3m WaQ9Uylait4o/NFFmFhO9mTXvjyOwCBl6wAxzc4PF1h+764t1/0lBSDTL1Q5NhSm2HygMe O9G4zJoaWT0NBP6D15fD3w8mtNgdi6M9FMbfkZzA6EHevZHmo3TO3qAUhQBJQp709ks7TI RDQZek0XEh+8P6Liyj10+Hicxki9yEQkXl/cibuNsORJMHcW+zwN6VPhoCkWeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1633706040; a=rsa-sha256; cv=none; b=CJ0tR6keO8MP8ZAR+6jcAygc+gZGzTQUoLZ5UvfEMHqtAHq0wGth6Td0QAWGvImeVMCNCl m/M2cLkhlKPZNO2oWw6a0if+vhIRcMFOzMcHQvNGMfb7gh4yN5KJVfHYJ/ZS329HeoWi8Q KK9kF0VfD9Qh7i8ZDc4hfPTOaRwsoIVlp1wpdP3iccIZrwDumt68vFvNGRODUaW4e9y5b4 hdR7CBKA5gIfaPyAtzFcuYI0OeXpHpYr/N215TG/exDUFCRCMU0DxiVyUMdO11nc0Rg+Fx ATL5B815qR+L5P2JTi85vn3U6zYmxyffb4qTj+sn+4F/IOAllFgUPfEGNjxQow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 2021-10-08 15:09:04, Piotr Pawel Stefaniak wrote: >The branch main has been updated by pstef: > Mention kern.timecounter.alloweddeviation in nanosleep.1 Sorry, wrong section. > lib/libc/sys/nanosleep.2 | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) From nobody Fri Oct 8 16:19:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6C7D117F27A0; Fri, 8 Oct 2021 16:19:28 +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 4HQtgN1jY4z3CMT; Fri, 8 Oct 2021 16:19:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 3868658C0; Fri, 8 Oct 2021 16:19:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: b5cadc643e85 - main - Make core dump writes interruptible with SIGKILL To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110080022.1980M9HS043290@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Fri, 8 Oct 2021 09:19:25 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.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 In-Reply-To: <202110080022.1980M9HS043290@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 10/7/21 5:22 PM, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b5cadc643e853fa4cb23e5315e6f40bf9979a9c0 > > commit b5cadc643e853fa4cb23e5315e6f40bf9979a9c0 > Author: Konstantin Belousov > AuthorDate: 2021-10-05 05:11:32 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-10-08 00:21:43 +0000 > > Make core dump writes interruptible with SIGKILL > > This can be disabled by sysctl kern.core_dump_can_intr > > Reported and tested by: pho > Reviewed by: imp, markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D32313 Nice! I've long wanted this feature. -- John Baldwin From nobody Fri Oct 8 17:17:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8C03512D1C58; Fri, 8 Oct 2021 17:17: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 4HQvxv3WNDz3Kyp; Fri, 8 Oct 2021 17:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49E502BDE; Fri, 8 Oct 2021 17:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198HH72P095903; Fri, 8 Oct 2021 17:17:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198HH7J0095902; Fri, 8 Oct 2021 17:17:07 GMT (envelope-from git) Date: Fri, 8 Oct 2021 17:17:07 GMT Message-Id: <202110081717.198HH7J0095902@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: 17f790f49f58 - main - arm, arm64, riscv: adjust top-level nexus 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17f790f49f5879ae9888b99fdbf857010ec13f9c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=17f790f49f5879ae9888b99fdbf857010ec13f9c commit 17f790f49f5879ae9888b99fdbf857010ec13f9c Author: Mitchell Horne AuthorDate: 2021-10-07 18:02:02 +0000 Commit: Mitchell Horne CommitDate: 2021-10-08 17:16:32 +0000 arm, arm64, riscv: adjust top-level nexus comment These platforms don't manage resources for DMA request lines or I/O ports, this is specific to x86. Remove the references from the comments. Reviewed by: imp, jhb MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32358 --- sys/arm/arm/nexus.c | 4 +--- sys/arm64/arm64/nexus.c | 4 +--- sys/riscv/riscv/nexus.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index f9e9fec7ad25..be84ab82d43f 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -34,9 +34,7 @@ * attachment point for both processors and buses, and to manage * resources which are common to all of them. In particular, * this code implements the core resource managers for interrupt - * requests, DMA requests (which rightfully should be a part of the - * ISA code but it's easier to do it here for now), I/O port addresses, - * and I/O memory address space. + * requests and I/O memory address space. */ #include "opt_platform.h" diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index cc28d87f002b..0775cc820a8c 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -34,9 +34,7 @@ * attachment point for both processors and buses, and to manage * resources which are common to all of them. In particular, * this code implements the core resource managers for interrupt - * requests, DMA requests (which rightfully should be a part of the - * ISA code but it's easier to do it here for now), I/O port addresses, - * and I/O memory address space. + * requests and I/O memory address space. */ #include "opt_acpi.h" diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c index b56cf29aa3ee..16fe971b6521 100644 --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -34,9 +34,7 @@ * attachment point for both processors and buses, and to manage * resources which are common to all of them. In particular, * this code implements the core resource managers for interrupt - * requests, DMA requests (which rightfully should be a part of the - * ISA code but it's easier to do it here for now), I/O port addresses, - * and I/O memory address space. + * requests and I/O memory address space. */ #include "opt_platform.h" From nobody Fri Oct 8 21:45:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C54DB17EE8AE; Fri, 8 Oct 2021 21:45: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 4HR1v25F52z4TqV; Fri, 8 Oct 2021 21:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 903C26AD7; Fri, 8 Oct 2021 21:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198Lj2T8055543; Fri, 8 Oct 2021 21:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198Lj25H055542; Fri, 8 Oct 2021 21:45:02 GMT (envelope-from git) Date: Fri, 8 Oct 2021 21:45:02 GMT Message-Id: <202110082145.198Lj25H055542@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: 15575aca8754 - main - bsd.cpu.mk: Minor formatting for armv6 vs armv7 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 15575aca875403e796d647ec5e42f7919197d130 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=15575aca875403e796d647ec5e42f7919197d130 commit 15575aca875403e796d647ec5e42f7919197d130 Author: Warner Losh AuthorDate: 2021-09-27 17:33:05 +0000 Commit: Warner Losh CommitDate: 2021-10-08 21:44:46 +0000 bsd.cpu.mk: Minor formatting for armv6 vs armv7 Separate out the arch/cpu options for armv6 from the armv7 ones. This is less confusing. Sponsored by: Netflix --- share/mk/bsd.cpu.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index f269bb110ed7..7984cba9536d 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -116,10 +116,12 @@ _CPUCFLAGS = -march=${CPUTYPE} # arm: (any arm v4 or v5 processor you are targeting) # arm920t, arm926ej-s, marvell-pj4, fa526, fa626, # fa606te, fa626te, fa726te -# armv6: (any arm v7 or v8 processor you are targeting and the arm1176jzf-s) -# arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7, cortex-a8, -# cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53, cortex-a57, -# cortex-a72, exynos-m1 +# armv6: +# arm1176jzf-s +# armv7: generic-armv7-a, cortex-a5, cortex-a7, cortex-a8, cortex-a9, +# cortex-a12, cortex-a15, cortex-a17 +# cortex-a53, cortex-a57, cortex-a72, +# exynos-m1 _CPUCFLAGS = -mcpu=${CPUTYPE} . endif . elif ${MACHINE_ARCH} == "powerpc" From nobody Fri Oct 8 23:31:59 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2A6D712D82B9; Fri, 8 Oct 2021 23:32: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 4HR4GS0nLWz4cFs; Fri, 8 Oct 2021 23:32:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF5DC1051E; Fri, 8 Oct 2021 23:31:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 198NVxLx000665; Fri, 8 Oct 2021 23:31:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198NVxru000664; Fri, 8 Oct 2021 23:31:59 GMT (envelope-from git) Date: Fri, 8 Oct 2021 23:31:59 GMT Message-Id: <202110082331.198NVxru000664@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 1c64959bff17 - main - bsdconfig: 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: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c64959bff1772da4c9cc7d86c56f3729189b88e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=1c64959bff1772da4c9cc7d86c56f3729189b88e commit 1c64959bff1772da4c9cc7d86c56f3729189b88e Author: Devin Teske AuthorDate: 2021-10-08 23:26:21 +0000 Commit: Devin Teske CommitDate: 2021-10-08 23:26:21 +0000 bsdconfig: Comments My current style is to copy C for "/* NOTREACHED */" instead of spelling out "Not reached". Make this one nominal change in this one file and the others later. While here, word-smith "Preload" into "Pre-load" as I believe that to be more grammatically correct in this instance. Also while here, fix a comment capitalization error. Lastly, bump copyright for above changes. --- usr.sbin/bsdconfig/bsdconfig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bsdconfig/bsdconfig b/usr.sbin/bsdconfig/bsdconfig index 2ecdb30bc5a9..f132c0370264 100755 --- a/usr.sbin/bsdconfig/bsdconfig +++ b/usr.sbin/bsdconfig/bsdconfig @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2014 Devin Teske +# Copyright (c) 2012-2021 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -132,7 +132,7 @@ usage() # local x=$longest_cmd ncols=1 x=$(( $x + 8 )) # Accommodate leading tab character - x=$(( $x + 3 + $longest_cmd )) # Preload end of next column + x=$(( $x + 3 + $longest_cmd )) # Pre-load end of next column while [ $x -lt $max_width ]; do ncols=$(( $ncols + 1 )) x=$(( $x + 3 + $longest_cmd )) @@ -176,7 +176,7 @@ usage() "PROGRAM_NAME" "$pgm" \ "COMMAND_LIST" "$cmd_list" - # Never reached + # NOTREACHED } # dialog_menu_main @@ -365,7 +365,7 @@ if [ "$1" ]; then # case "$1" in -help|--help|-\?) usage - # Not reached + # NOTREACHED esac # @@ -375,16 +375,16 @@ if [ "$1" ]; then if ! { indexfile=$( f_index_file "$1" ) && cmd=$( f_index_menusel_command "$indexfile" "$1" ) }; then - # no matches, display usage (which shows valid keywords) + # No matches, display usage (which shows valid keywords) f_err "%s: %s: $msg_not_found\n" "$pgm" "$1" usage - # Not reached + # NOTREACHED fi f_dprintf "cmd=[%s] *=[%s]" "$cmd" "$*" shift exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1 - # Not reached + # NOTREACHED fi # From nobody Sat Oct 9 01:30:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4C32917E509C; Sat, 9 Oct 2021 01:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HR6tk1dWtz4nK3; Sat, 9 Oct 2021 01:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1828D11D0D; Sat, 9 Oct 2021 01:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1991U6XM051056; Sat, 9 Oct 2021 01:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1991U6oh051053; Sat, 9 Oct 2021 01:30:06 GMT (envelope-from git) Date: Sat, 9 Oct 2021 01:30:06 GMT Message-Id: <202110090130.1991U6oh051053@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: 172fa4aa7577 - main - OpenSSH: cherry-pick "need initgroups() before setresgid()" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 172fa4aa7577915bf5ace5783251821d3774dc05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=172fa4aa7577915bf5ace5783251821d3774dc05 commit 172fa4aa7577915bf5ace5783251821d3774dc05 Author: Ed Maste AuthorDate: 2021-10-09 01:28:53 +0000 Commit: Ed Maste CommitDate: 2021-10-09 01:29:25 +0000 OpenSSH: cherry-pick "need initgroups() before setresgid()" From openssh-portable commits f3cbe43e28fe and bf944e3794ef. --- crypto/openssh/misc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crypto/openssh/misc.c b/crypto/openssh/misc.c index b8d1040d1e3c..0134d69492e4 100644 --- a/crypto/openssh/misc.c +++ b/crypto/openssh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.169 2021/08/09 23:47:44 djm Exp $ */ +/* $OpenBSD: misc.c,v 1.170 2021/09/26 14:01:03 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005-2020 Damien Miller. All rights reserved. @@ -56,6 +56,7 @@ #ifdef HAVE_PATHS_H # include #include +#include #endif #ifdef SSH_TUN_OPENBSD #include @@ -2695,6 +2696,12 @@ subprocess(const char *tag, const char *command, } closefrom(STDERR_FILENO + 1); + if (geteuid() == 0 && + initgroups(pw->pw_name, pw->pw_gid) == -1) { + error("%s: initgroups(%s, %u): %s", tag, + pw->pw_name, (u_int)pw->pw_gid, strerror(errno)); + _exit(1); + } if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) { error("%s: setresgid %u: %s", tag, (u_int)pw->pw_gid, strerror(errno)); From nobody Sat Oct 9 03:17:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EED1117F12EB; Sat, 9 Oct 2021 03:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HR9H06LGtz3Fgr; Sat, 9 Oct 2021 03:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8D211358C; Sat, 9 Oct 2021 03:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1993Hm96095977; Sat, 9 Oct 2021 03:17:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1993Hm4v095976; Sat, 9 Oct 2021 03:17:48 GMT (envelope-from git) Date: Sat, 9 Oct 2021 03:17:48 GMT Message-Id: <202110090317.1993Hm4v095976@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: 032448cd2c52 - main - Belatedly track private lib renaming for OptionalObsoleteFiles.inc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 032448cd2c52161aa03fd4ee5bf243d78d61b53e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=032448cd2c52161aa03fd4ee5bf243d78d61b53e commit 032448cd2c52161aa03fd4ee5bf243d78d61b53e Author: Ed Maste AuthorDate: 2021-10-09 00:15:43 +0000 Commit: Ed Maste CommitDate: 2021-10-09 03:15:56 +0000 Belatedly track private lib renaming for OptionalObsoleteFiles.inc Reviewed by: kevans Fixes: 5551c573554e ("Rework PRIVATELIB") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32384 --- tools/build/mk/OptionalObsoleteFiles.inc | 96 ++++++++++++++++---------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index f1febd18dd4c..cacfe28069e3 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -2900,14 +2900,14 @@ OLD_FILES+=usr/lib/pam_krb5.so OLD_LIBS+=usr/lib/pam_krb5.so.6 OLD_FILES+=usr/lib/pam_ksu.so OLD_LIBS+=usr/lib/pam_ksu.so.6 -OLD_FILES+=usr/lib/private/libheimipcc.a -OLD_FILES+=usr/lib/private/libheimipcc.so -OLD_LIBS+=usr/lib/private/libheimipcc.so.11 -OLD_FILES+=usr/lib/private/libheimipcc_p.a -OLD_FILES+=usr/lib/private/libheimipcs.a -OLD_FILES+=usr/lib/private/libheimipcs.so -OLD_LIBS+=usr/lib/private/libheimipcs.so.11 -OLD_FILES+=usr/lib/private/libheimipcs_p.a +OLD_FILES+=usr/lib/libprivateheimipcc.a +OLD_FILES+=usr/lib/libprivateheimipcc.so +OLD_LIBS+=usr/lib/libprivateheimipcc.so.11 +OLD_FILES+=usr/lib/libprivateheimipcc_p.a +OLD_FILES+=usr/lib/libprivateheimipcs.a +OLD_FILES+=usr/lib/libprivateheimipcs.so +OLD_LIBS+=usr/lib/libprivateheimipcs.so.11 +OLD_FILES+=usr/lib/libprivateheimipcs_p.a .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libasn1.a OLD_FILES+=usr/lib32/libasn1.so @@ -2977,14 +2977,14 @@ OLD_FILES+=usr/lib32/pam_krb5.so OLD_LIBS+=usr/lib32/pam_krb5.so.6 OLD_FILES+=usr/lib32/pam_ksu.so OLD_LIBS+=usr/lib32/pam_ksu.so.6 -OLD_FILES+=usr/lib32/private/libheimipcc.a -OLD_FILES+=usr/lib32/private/libheimipcc.so -OLD_LIBS+=usr/lib32/private/libheimipcc.so.11 -OLD_FILES+=usr/lib32/private/libheimipcc_p.a -OLD_FILES+=usr/lib32/private/libheimipcs.a -OLD_FILES+=usr/lib32/private/libheimipcs.so -OLD_LIBS+=usr/lib32/private/libheimipcs.so.11 -OLD_FILES+=usr/lib32/private/libheimipcs_p.a +OLD_FILES+=usr/lib32/libprivateheimipcc.a +OLD_FILES+=usr/lib32/libprivateheimipcc.so +OLD_LIBS+=usr/lib32/libprivateheimipcc.so.11 +OLD_FILES+=usr/lib32/libprivateheimipcc_p.a +OLD_FILES+=usr/lib32/libprivateheimipcs.a +OLD_FILES+=usr/lib32/libprivateheimipcs.so +OLD_LIBS+=usr/lib32/libprivateheimipcs.so.11 +OLD_FILES+=usr/lib32/libprivateheimipcs_p.a .endif OLD_FILES+=usr/libexec/digest-service OLD_FILES+=usr/libexec/hprop @@ -3736,15 +3736,15 @@ OLD_FILES+=usr/share/man/man3/com_err.3.gz .endif .if ${MK_LDNS} == no -OLD_FILES+=usr/lib/private/libldns.a -OLD_FILES+=usr/lib/private/libldns.so -OLD_LIBS+=usr/lib/private/libldns.so.5 -OLD_FILES+=usr/lib/private/libldns_p.a +OLD_FILES+=usr/lib/libprivateldns.a +OLD_FILES+=usr/lib/libprivateldns.so +OLD_LIBS+=usr/lib/libprivateldns.so.5 +OLD_FILES+=usr/lib/libprivateldns_p.a .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" -OLD_FILES+=usr/lib32/private/libldns.a -OLD_FILES+=usr/lib32/private/libldns.so -OLD_LIBS+=usr/lib32/private/libldns.so.5 -OLD_FILES+=usr/lib32/private/libldns_p.a +OLD_FILES+=usr/lib32/libprivateldns.a +OLD_FILES+=usr/lib32/libprivateldns.so +OLD_LIBS+=usr/lib32/libprivateldns.so.5 +OLD_FILES+=usr/lib32/libprivateldns_p.a .endif .endif @@ -7117,17 +7117,17 @@ OLD_FILES+=usr/bin/ssh-keygen OLD_FILES+=usr/bin/ssh-keyscan OLD_FILES+=usr/lib/pam_ssh.so OLD_LIBS+=usr/lib/pam_ssh.so.6 -OLD_FILES+=usr/lib/private/libssh.a -OLD_FILES+=usr/lib/private/libssh.so -OLD_LIBS+=usr/lib/private/libssh.so.5 -OLD_FILES+=usr/lib/private/libssh_p.a +OLD_FILES+=usr/lib/libprivatessh.a +OLD_FILES+=usr/lib/libprivatessh.so +OLD_LIBS+=usr/lib/libprivatessh.so.5 +OLD_FILES+=usr/lib/libprivatessh_p.a .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/pam_ssh.so OLD_LIBS+=usr/lib32/pam_ssh.so.6 -OLD_FILES+=usr/lib32/private/libssh.a -OLD_FILES+=usr/lib32/private/libssh.so -OLD_LIBS+=usr/lib32/private/libssh.so.5 -OLD_FILES+=usr/lib32/private/libssh_p.a +OLD_FILES+=usr/lib32/libprivatessh.a +OLD_FILES+=usr/lib32/libprivatessh.so +OLD_LIBS+=usr/lib32/libprivatessh.so.5 +OLD_FILES+=usr/lib32/libprivatessh_p.a .endif OLD_FILES+=usr/libexec/sftp-server OLD_FILES+=usr/libexec/ssh-keysign @@ -7537,8 +7537,8 @@ OLD_FILES+=usr/lib/libypclnt_p.a OLD_FILES+=usr/lib/libz_p.a OLD_FILES+=usr/lib/libzfs_core_p.a OLD_FILES+=usr/lib/libzfs_p.a -OLD_FILES+=usr/lib/private/libldns_p.a -OLD_FILES+=usr/lib/private/libssh_p.a +OLD_FILES+=usr/lib/libprivateldns_p.a +OLD_FILES+=usr/lib/libprivatessh_p.a .endif .if ${MK_QUOTAS} == no @@ -8171,8 +8171,8 @@ OLD_LIBS+=usr/lib/libatf-c.a OLD_LIBS+=usr/lib/libatf-c.so OLD_LIBS+=usr/lib/libatf-c.so.1 OLD_LIBS+=usr/lib/libatf-c_p.a -OLD_LIBS+=usr/lib/private/libatf-c.so.0 -OLD_LIBS+=usr/lib/private/libatf-c++.so.1 +OLD_LIBS+=usr/lib/libprivateatf-c.so.0 +OLD_LIBS+=usr/lib/libprivateatf-c++.so.1 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_LIBS+=usr/lib32/libatf-c++.a OLD_LIBS+=usr/lib32/libatf-c++.so @@ -8183,8 +8183,8 @@ OLD_LIBS+=usr/lib32/libatf-c.a OLD_LIBS+=usr/lib32/libatf-c.so OLD_LIBS+=usr/lib32/libatf-c.so.1 OLD_LIBS+=usr/lib32/libatf-c_p.a -OLD_LIBS+=usr/lib32/private/libatf-c.so.0 -OLD_LIBS+=usr/lib32/private/libatf-c++.so.1 +OLD_LIBS+=usr/lib32/libprivateatf-c.so.0 +OLD_LIBS+=usr/lib32/libprivateatf-c++.so.1 .endif OLD_FILES+=usr/libdata/pkgconfig/atf-c++.pc OLD_FILES+=usr/libdata/pkgconfig/atf-c.pc @@ -8713,8 +8713,8 @@ OLD_FILES+=usr/include/atf-c/tc.h OLD_FILES+=usr/include/atf-c/tp.h OLD_FILES+=usr/include/atf-c/utils.h OLD_FILES+=usr/lib/debug/usr/bin/kyua.debug -OLD_LIBS+=usr/lib/private/libatf-c++.so.2 -OLD_LIBS+=usr/lib/private/libatf-c.so.1 +OLD_LIBS+=usr/lib/libprivateatf-c++.so.2 +OLD_LIBS+=usr/lib/libprivateatf-c.so.1 OLD_FILES+=usr/share/examples/kyua/kyua.conf OLD_FILES+=usr/share/examples/kyua/Kyuafile.top OLD_FILES+=usr/share/kyua/misc/context.html @@ -9206,15 +9206,15 @@ OLD_DIRS+=usr/tests/usr.bin/yacc .if ${MK_UNBOUND} == no OLD_FILES+=etc/rc.d/local_unbound OLD_FILES+=etc/unbound -OLD_FILES+=usr/lib/private/libunbound.a -OLD_FILES+=usr/lib/private/libunbound.so -OLD_LIBS+=usr/lib/private/libunbound.so.5 -OLD_FILES+=usr/lib/private/libunbound_p.a +OLD_FILES+=usr/lib/libprivateunbound.a +OLD_FILES+=usr/lib/libprivateunbound.so +OLD_LIBS+=usr/lib/libprivateunbound.so.5 +OLD_FILES+=usr/lib/libprivateunbound_p.a .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" -OLD_FILES+=usr/lib32/private/libunbound.a -OLD_FILES+=usr/lib32/private/libunbound.so -OLD_LIBS+=usr/lib32/private/libunbound.so.5 -OLD_FILES+=usr/lib32/private/libunbound_p.a +OLD_FILES+=usr/lib32/libprivateunbound.a +OLD_FILES+=usr/lib32/libprivateunbound.so +OLD_LIBS+=usr/lib32/libprivateunbound.so.5 +OLD_FILES+=usr/lib32/libprivateunbound_p.a OLD_FILES+=usr/share/man/man5/local-unbound.conf.5.gz OLD_FILES+=usr/share/man/man8/local-unbound-anchor.8.gz OLD_FILES+=usr/share/man/man8/local-unbound-checkconf.8.gz From nobody Sat Oct 9 05:53:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8A6E112D6252; Sat, 9 Oct 2021 05:53:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRDkM6Lgmz3RFm; Sat, 9 Oct 2021 05:53:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 1995r8Z0000921 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 9 Oct 2021 08:53:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 1995r8Z0000921 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 1995r84Q000920; Sat, 9 Oct 2021 08:53:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 9 Oct 2021 08:53:08 +0300 From: Konstantin Belousov To: Piotr Pawel Stefaniak Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bf8f6ffcb66a - main - Mention kern.timecounter.alloweddeviation in nanosleep.1 Message-ID: References: <202110081509.198F94HG022514@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110081509.198F94HG022514@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HRDkM6Lgmz3RFm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, Oct 08, 2021 at 03:09:04PM +0000, Piotr Pawel Stefaniak wrote: > The branch main has been updated by pstef: > > URL: https://cgit.FreeBSD.org/src/commit/?id=bf8f6ffcb66a27f498a18e520758ea0d18a6d2de > > commit bf8f6ffcb66a27f498a18e520758ea0d18a6d2de > Author: Piotr Pawel Stefaniak > AuthorDate: 2021-10-07 19:14:27 +0000 > Commit: Piotr Pawel Stefaniak > CommitDate: 2021-10-08 15:07:50 +0000 > > Mention kern.timecounter.alloweddeviation in nanosleep.1 > > PR: 224837 > Reported by: Aleksander Derevianko > --- > lib/libc/sys/nanosleep.2 | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/libc/sys/nanosleep.2 b/lib/libc/sys/nanosleep.2 > index 19ffcf1b7026..12758a974f7f 100644 > --- a/lib/libc/sys/nanosleep.2 > +++ b/lib/libc/sys/nanosleep.2 > @@ -30,7 +30,7 @@ > .\" @(#)sleep.3 8.1 (Berkeley) 6/4/93 > .\" $FreeBSD$ > .\" > -.Dd March 17, 2017 > +.Dd October 7, 2021 > .Dt NANOSLEEP 2 > .Os > .Sh NAME > @@ -93,6 +93,8 @@ returns immediately and the calling thread is not suspended. > .Pp > The suspension time may be longer than requested due to the > scheduling of other activity by the system. > +It is also subject to the allowed time interval deviation > +specified by the sysctl kern.timecounter.alloweddeviation. This should be like .Xr sysctl 3 .Dv kern.timecounter.alloweddeviation And then, it is missing a description what exactly is allowed by deviation, for instance, what units this sysctl is? > An unmasked signal will terminate the sleep early, regardless of the > .Dv SA_RESTART > value on the interrupting signal. From nobody Sat Oct 9 06:18:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A34D812D8B16; Sat, 9 Oct 2021 06:18:48 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRFHr3yXcz3j7N; Sat, 9 Oct 2021 06:18:48 +0000 (UTC) (envelope-from pstef@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1633760328; 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=Vkj3JdQSToPc2w2Cj5wKBNAUEpOwHAhGUyzmAUj44wo=; b=CA6TgVO822bQySsLvjpleNOcWeFHd2+S3zRjwHfBrfaR/8iPs6X9q52CoJnP9YohWb7F9F FtYnaMo8L2t60vLBD/TcSU2XtTx/UQ5M9kurRPFI7o9s0CtIszi/AnFIPsbYH+QyRdYqdv jrRBf0VRWONuwXT6bgdw+oRqb4a4Cd769QeOlWdN0MJ4uUdzhhmvW+qS4wYuqVCToIYao7 z3jbnSiRsra+jnhQWAYfJbvtE4/4ll22HF0ko4quGHTfKGy4t74MHSTHjMyrQvMN+doZRf u5L9F3xgA9IF80gaR/lIsDY+JyyHYCHaav6c6gAFCHKdNMjvLdP+LwO2BHA51w== Received: by freefall.freebsd.org (Postfix, from userid 1403) id 65320D18; Sat, 9 Oct 2021 06:18:48 +0000 (UTC) Date: Sat, 9 Oct 2021 06:18:48 +0000 From: "Piotr P. Stefaniak" To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bf8f6ffcb66a - main - Mention kern.timecounter.alloweddeviation in nanosleep.1 Message-ID: References: <202110081509.198F94HG022514@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1633760328; 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=Vkj3JdQSToPc2w2Cj5wKBNAUEpOwHAhGUyzmAUj44wo=; b=T0TSWo0Embq72zyPH3z6Z+SSrf9nKTPmsB594Q8GX+qkf9bRNf5QDYCCYfHgY5wrKvMtkD bbXqdBhfS53lLVwovVzuM/kCVNQJbJWcBqnFgZEUTPUiJUhSFUTA0zziE96yWoSXlnGWxS sC3+L4tKfeTPOJVzkJ+yNAk6GUrWnY4XT+r24hNakSxMHCIDIeYwfj9T0Z+cHNMAyn4r9u S89uOZwsXkk4LgdJ8GVbR6ph8/ADncSes49AomGUjjVSnLCZpLmSwxEP88EgKH/pC80nte PqksyyRPIJiRspcjtXviaPePWcZNGUibMSN7cQ4/U4lpxG/Yvq9pyk4iGZeWYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1633760328; a=rsa-sha256; cv=none; b=WLeDHdasFZCii2ANM55TBxjMLPkgj9NlB1i7OL1BDBIVypjh5AdGHGJ73Jm0+qcP/vztG3 K9wQX47hK9kSIOv9Gehdj4O8zIS0ecEpkr2yqtRdlCaliBvolX0ABEBQy3CCo6AnqpdopL ewv2iBmFfSmVIabVQLJPaSF5Ax7SYS1JifNfNcahmSC0HPhODqb30Uwj8nx8hQ82Mw6OKO Q0wY232+5N0G2zG9zro60PqTJqHaQElX6iftMHpJqaKuwozTN6MYLfguIl+el5D57M0rn/ o4sj/m4WuTLyACsPhlMmJzp7EspQLhVJSWT1NqGKdhjcgindg8gGF91Czfc35g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 2021-10-09 08:53:08, Konstantin Belousov wrote: >On Fri, Oct 08, 2021 at 03:09:04PM +0000, Piotr Pawel Stefaniak wrote: >> @@ -93,6 +93,8 @@ returns immediately and the calling thread is not suspended. >> .Pp >> The suspension time may be longer than requested due to the >> scheduling of other activity by the system. >> +It is also subject to the allowed time interval deviation >> +specified by the sysctl kern.timecounter.alloweddeviation. >This should be like >.Xr sysctl 3 >.Dv kern.timecounter.alloweddeviation @@ -94,7 +94,9 @@ returns immediately and the calling thread is not suspended. The suspension time may be longer than requested due to the scheduling of other activity by the system. It is also subject to the allowed time interval deviation -specified by the sysctl kern.timecounter.alloweddeviation. +specified by the +.Xr sysctl 3 +.Dv kern.timecounter.alloweddeviation . An unmasked signal will terminate the sleep early, regardless of the .Dv SA_RESTART value on the interrupting signal. >And then, it is missing a description what exactly is allowed by deviation, >for instance, what units this sysctl is? That would be redundant with sysctl -d. The point of this change is that now the user is much more likely to know of the sysctl and can look it up and read all about it. The bug may be that there isn't much documentation to be read about it, only sysctl -d and kern_tc.c. The only thing I worry that may be missing from this change is this reference in any other manual pages that might need it as much as nanosleep. From nobody Sat Oct 9 06:43:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 43CC512DBAA7; Sat, 9 Oct 2021 06:43:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRFrZ09KHz3lFb; Sat, 9 Oct 2021 06:43:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 1996hY2x013488 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 9 Oct 2021 09:43:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 1996hY2x013488 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 1996hYqx013487; Sat, 9 Oct 2021 09:43:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 9 Oct 2021 09:43:34 +0300 From: Konstantin Belousov To: "Piotr P. Stefaniak" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bf8f6ffcb66a - main - Mention kern.timecounter.alloweddeviation in nanosleep.1 Message-ID: References: <202110081509.198F94HG022514@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HRFrZ09KHz3lFb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Oct 09, 2021 at 06:18:48AM +0000, Piotr P. Stefaniak wrote: > On 2021-10-09 08:53:08, Konstantin Belousov wrote: > > On Fri, Oct 08, 2021 at 03:09:04PM +0000, Piotr Pawel Stefaniak wrote: > > > @@ -93,6 +93,8 @@ returns immediately and the calling thread is not suspended. > > > .Pp > > > The suspension time may be longer than requested due to the > > > scheduling of other activity by the system. > > > +It is also subject to the allowed time interval deviation > > > +specified by the sysctl kern.timecounter.alloweddeviation. > > This should be like > > .Xr sysctl 3 > > .Dv kern.timecounter.alloweddeviation > > @@ -94,7 +94,9 @@ returns immediately and the calling thread is not suspended. > The suspension time may be longer than requested due to the > scheduling of other activity by the system. > It is also subject to the allowed time interval deviation > -specified by the sysctl kern.timecounter.alloweddeviation. > +specified by the > +.Xr sysctl 3 > +.Dv kern.timecounter.alloweddeviation . > An unmasked signal will terminate the sleep early, regardless of the > .Dv SA_RESTART > value on the interrupting signal. > > > And then, it is missing a description what exactly is allowed by deviation, > > for instance, what units this sysctl is? > > That would be redundant with sysctl -d. The point of this change is that now > the user is much more likely to know of the sysctl and can look it up and read > all about it. > sysctl -d is not a (good) documentation. When you read a man text, you are supposed to get everything that is relevant there, although it might be terse and requiring making logical deduction. This is not the case there. Anyway, I went ahead and did what you suggested. On one of my machines, I got solo% sysctl -d kern.timecounter.alloweddeviation kern.timecounter.alloweddeviation: solo% On another, v1% sysctl -d kern.timecounter.alloweddeviation ~ kern.timecounter.alloweddeviation: Allowed time interval deviation in percents Slightly more useful, but still. Percents of what? Imagine somebody reads the man page in the browser from Linux. Where should he search for the sysctl description? > The bug may be that there isn't much documentation to be read about it, only > sysctl -d and kern_tc.c. > > The only thing I worry that may be missing from this change is this reference > in any other manual pages that might need it as much as nanosleep. Well, nanosleep is just an example of a syscall requesting timeout. Another poster childs there are select(2), and poll(2) family which explicitly use precision. To get the definitive list, you would need to review all uses of callout_reset() variants. From nobody Sat Oct 9 08:16:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2100E17E5CCB; Sat, 9 Oct 2021 08:16:21 +0000 (UTC) (envelope-from gljennjohn@gmail.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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRHvT0493z3ttC; Sat, 9 Oct 2021 08:16:21 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-ed1-x52b.google.com with SMTP id g8so45149179edt.7; Sat, 09 Oct 2021 01:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=g78y0fImNcabdUJNyZ8zD8Bh+WAe0w9VGUHDIqQwFHE=; b=iA2P+JMX5Bmgf9z2HinkZ3nXIR2lzMGl8meDPbUggcPnoLUoMYRwWWM22fl5qamI4u s6D4e5DmUtAh3PA3oRO3QQ0HQgm+SNDp5PjCSCJRZow3yEy6KDUZPrhszReFrTgOGfx6 j3+Vpap7wlDWkh5mkQQ+CRRcMDYeqKmbs22Q7GKWP0PdKSqiVfh3hYsoV3S6ZVpvfkNN cOGdD2fJt31b3mIYOoRYbRlyM5EfBK+v3mhlj5nYBM0NIQB/r/9h5HoXarUf6liAPyeT Dlhz1iktbqWob3P5WQ8+ejK7HWC51LsYaKX8NDyoOGs9xZ1P17JJOdFYzx9MZFkIWlmS +SNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=g78y0fImNcabdUJNyZ8zD8Bh+WAe0w9VGUHDIqQwFHE=; b=SWgmImICl8kipkIwqKpnqVCBQr5xKaD+JCoG4UsTfxyKT68qjq+AJzZd3Lcbj5hAtn WWzuzOXzKI6IJ/dnkTBEfLt25WCiE+00HYiFE/c3nWgAbJAtLKihVWV0cLISPs6u5xoI psmM4Zi+z3XKUgt3lbOlAOngkjkHGIvt++qns6vuTv+tkCIit9OvaNl32z4CIK7H+es/ +T0LnhbJPf5pyn9DD7/MllGQHrdj3OZS/6VTGizwxFWIkcHvGrvfiKudcbOuNw78IufL jNk3ji2qaUVBf9vRu1ZuRztrbMqw30zI/T+WmTvQJScLszW5Rw9h7M8lowKxmW5CkaFM jB0Q== X-Gm-Message-State: AOAM532E1t8EyXtdrlS7pyTwW8bzuWnCsL1MQqM184c8HimaRASZtKnU x/fNp/klMMGFYCFzGlJi3sEavEFq5wI= X-Google-Smtp-Source: ABdhPJwfUuJGssFP5uKJP7CXA5rNTymf4xEeFwYscuxpRCxOI1Oj7TdNi3y8qnNXYOuZaUj8dzyXDw== X-Received: by 2002:a05:6402:5112:: with SMTP id m18mr14062385edd.101.1633767373832; Sat, 09 Oct 2021 01:16:13 -0700 (PDT) Received: from ernst.home (p5b3becad.dip0.t-ipconnect.de. [91.59.236.173]) by smtp.gmail.com with ESMTPSA id o3sm644821eju.123.2021.10.09.01.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Oct 2021 01:16:12 -0700 (PDT) Date: Sat, 9 Oct 2021 10:16:11 +0200 From: Gary Jennejohn To: Konstantin Belousov Cc: "Piotr P. Stefaniak" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bf8f6ffcb66a - main - Mention kern.timecounter.alloweddeviation in nanosleep.1 Message-ID: <20211009101611.07c89a1c@ernst.home> In-Reply-To: References: <202110081509.198F94HG022514@gitrepo.freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.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=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HRHvT0493z3ttC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, 9 Oct 2021 09:43:34 +0300 Konstantin Belousov wrote: > On Sat, Oct 09, 2021 at 06:18:48AM +0000, Piotr P. Stefaniak wrote: > > On 2021-10-09 08:53:08, Konstantin Belousov wrote: > > > On Fri, Oct 08, 2021 at 03:09:04PM +0000, Piotr Pawel Stefaniak wrote: > > > > @@ -93,6 +93,8 @@ returns immediately and the calling thread is not suspended. > > > > .Pp > > > > The suspension time may be longer than requested due to the > > > > scheduling of other activity by the system. > > > > +It is also subject to the allowed time interval deviation > > > > +specified by the sysctl kern.timecounter.alloweddeviation. > > > This should be like > > > .Xr sysctl 3 > > > .Dv kern.timecounter.alloweddeviation > > > > @@ -94,7 +94,9 @@ returns immediately and the calling thread is not suspended. > > The suspension time may be longer than requested due to the > > scheduling of other activity by the system. > > It is also subject to the allowed time interval deviation > > -specified by the sysctl kern.timecounter.alloweddeviation. > > +specified by the > > +.Xr sysctl 3 > > +.Dv kern.timecounter.alloweddeviation . > > An unmasked signal will terminate the sleep early, regardless of the > > .Dv SA_RESTART > > value on the interrupting signal. > > > > > And then, it is missing a description what exactly is allowed by deviation, > > > for instance, what units this sysctl is? > > > > That would be redundant with sysctl -d. The point of this change is that now > > the user is much more likely to know of the sysctl and can look it up and read > > all about it. > > > sysctl -d is not a (good) documentation. When you read a man text, you are > supposed to get everything that is relevant there, although it might be > terse and requiring making logical deduction. This is not the case there. > > Anyway, I went ahead and did what you suggested. On one of my machines, > I got > solo% sysctl -d kern.timecounter.alloweddeviation > kern.timecounter.alloweddeviation: > solo% > > On another, > v1% sysctl -d kern.timecounter.alloweddeviation ~ > kern.timecounter.alloweddeviation: Allowed time interval deviation in percents > > Slightly more useful, but still. Percents of what? > I wondered about that myself when I looked at it yesterday. Just to be pedantic, percent is a contraction of per centum and does not have a plural form. It's always percent. > Imagine somebody reads the man page in the browser from Linux. Where should > he search for the sysctl description? > > > The bug may be that there isn't much documentation to be read about it, only > > sysctl -d and kern_tc.c. > > > > The only thing I worry that may be missing from this change is this reference > > in any other manual pages that might need it as much as nanosleep. > Well, nanosleep is just an example of a syscall requesting timeout. > Another poster childs there are select(2), and poll(2) family which > explicitly use precision. > > To get the definitive list, you would need to review all uses of > callout_reset() variants. > -- Gary Jennejohn From nobody Sat Oct 9 11:36:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2103A17F70A9; Sat, 9 Oct 2021 11:36: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 4HRNLc0QYbz4d2R; Sat, 9 Oct 2021 11:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E281819B6A; Sat, 9 Oct 2021 11:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 199Bad0S060124; Sat, 9 Oct 2021 11:36:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 199Bad0K060123; Sat, 9 Oct 2021 11:36:39 GMT (envelope-from git) Date: Sat, 9 Oct 2021 11:36:39 GMT Message-Id: <202110091136.199Bad0K060123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: 1549575f22d1 - main - [fib_algo][dxr] Improve incremental updating strategy List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1549575f22d14b3ac89a73627618a63132217460 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=1549575f22d14b3ac89a73627618a63132217460 commit 1549575f22d14b3ac89a73627618a63132217460 Author: Marko Zec AuthorDate: 2021-10-09 11:22:27 +0000 Commit: Marko Zec CommitDate: 2021-10-09 11:22:27 +0000 [fib_algo][dxr] Improve incremental updating strategy Tracking the number of unused holes in the trie and the range table was a bad metric based on which full trie and / or range rebuilds were triggered, which would happen in vain by far too frequently, particularly with live BGP feeds. Instead, track the total unused space inside the trie and range table structures, and trigger rebuilds if the percentage of unused space exceeds a sysctl-tunable threshold. MFC after: 3 days PR: 257965 --- sys/netinet/in_fib_dxr.c | 103 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 84 insertions(+), 19 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 6a9f414c3ab0..d832a66ee2cc 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -195,6 +196,7 @@ struct dxr_aux { uint32_t updates_high; uint32_t all_chunks_cnt; uint32_t unused_chunks_cnt; + uint32_t unused_chunks_size; uint32_t xtbl_size; uint32_t all_trie_cnt; uint32_t unused_trie_cnt; @@ -232,21 +234,48 @@ static MALLOC_DEFINE(M_DXRAUX, "dxr aux", "DXR auxiliary"); uma_zone_t chunk_zone; uma_zone_t trie_zone; +VNET_DEFINE_STATIC(int, frag_limit) = 100; +#define V_frag_limit VNET(frag_limit) + SYSCTL_DECL(_net_route_algo); SYSCTL_NODE(_net_route_algo, OID_AUTO, dxr, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "DXR tunables"); -VNET_DEFINE_STATIC(int, max_trie_holes) = 8; -#define V_max_trie_holes VNET(max_trie_holes) -SYSCTL_INT(_net_route_algo_dxr, OID_AUTO, max_trie_holes, - CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(max_trie_holes), 0, - "Trie fragmentation threshold before triggering a full rebuild"); +static int +sysctl_dxr_frag_limit(SYSCTL_HANDLER_ARGS) +{ + char buf[8]; + int error, new, i; + + snprintf(buf, sizeof(buf), "%d.%02d%%", V_frag_limit / 100, + V_frag_limit % 100); + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + if (!isdigit(*buf) && *buf != '.') + return (EINVAL); + for (i = 0, new = 0; isdigit(buf[i]) && i < sizeof(buf); i++) + new = new * 10 + buf[i] - '0'; + new *= 100; + if (buf[i++] == '.') { + if (!isdigit(buf[i])) + return (EINVAL); + new += (buf[i++] - '0') * 10; + if (isdigit(buf[i])) + new += buf[i++] - '0'; + } + if (new > 1000) + return (EINVAL); + V_frag_limit = new; + snprintf(buf, sizeof(buf), "%d.%02d%%", V_frag_limit / 100, + V_frag_limit % 100); + return (0); +} -VNET_DEFINE_STATIC(int, max_range_holes) = 16; -#define V_max_range_holes VNET(max_range_holes) -SYSCTL_INT(_net_route_algo_dxr, OID_AUTO, max_range_holes, - CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(max_range_holes), 0, - "Range table fragmentation threshold before triggering a full rebuild"); +SYSCTL_PROC(_net_route_algo_dxr, OID_AUTO, frag_limit, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_VNET, + 0, 0, sysctl_dxr_frag_limit, "A", + "Fragmentation threshold to full rebuild"); /* Binary search for a matching address range */ #define DXR_LOOKUP_STAGE \ @@ -424,6 +453,7 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) fdesc->base = cdp->cd_base; da->rtbl_top -= size; da->unused_chunks_cnt--; + da->unused_chunks_size -= cdp->cd_max_size; if (cdp->cd_max_size > size) { /* Split the range in two, need a new descriptor */ empty_cdp = uma_zalloc(chunk_zone, M_NOWAIT); @@ -442,6 +472,7 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) da->all_chunks_cnt++; da->unused_chunks_cnt++; + da->unused_chunks_size += empty_cdp->cd_max_size; cdp->cd_max_size = size; } LIST_REMOVE(cdp, cd_hash_le); @@ -471,9 +502,9 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) return (1); } da->rtbl_size += RTBL_SIZE_INCR; - if (da->rtbl_top >= BASE_MAX / 4) - FIB_PRINTF(LOG_WARNING, da->fd, "range table at %d%%", - da->rtbl_top * 100 / BASE_MAX); + i = (BASE_MAX - da->rtbl_top) * LOG_DEBUG / BASE_MAX; + FIB_PRINTF(i, da->fd, "range table at %d%% structural limit", + da->rtbl_top * 100 / BASE_MAX); da->range_tbl = realloc(da->range_tbl, sizeof(*da->range_tbl) * da->rtbl_size + FRAGS_PREF_SHORT, M_DXRAUX, M_NOWAIT); @@ -508,6 +539,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) LIST_REMOVE(cdp, cd_hash_le); da->unused_chunks_cnt++; + da->unused_chunks_size += cdp->cd_max_size; cdp->cd_cur_size = 0; /* Attempt to merge with the preceding chunk, if empty */ @@ -546,6 +578,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) da->all_chunks_cnt--; da->unused_chunks_cnt--; da->rtbl_top -= cdp->cd_max_size; + da->unused_chunks_size -= cdp->cd_max_size; LIST_REMOVE(cdp, cd_all_le); uma_zfree(chunk_zone, cdp); return; @@ -846,10 +879,12 @@ dxr_build(struct dxr *dxr) struct timeval t0, t1, t2, t3; uint32_t r_size, dxr_tot_size; uint32_t i, m, range_rebuild = 0; + uint32_t range_frag; #ifdef DXR2 struct trie_desc *tp; uint32_t d_tbl_size, dxr_x, d_size, x_size; uint32_t ti, trie_rebuild = 0, prev_size = 0; + uint32_t trie_frag; #endif KASSERT(dxr->d == NULL, ("dxr: d not free")); @@ -897,9 +932,10 @@ dxr_build(struct dxr *dxr) dxr->nh_tbl = fib_get_nhop_array(da->fd); fib_get_rtable_info(fib_get_rh(da->fd), &rinfo); - if (da->updates_low > da->updates_high || - da->unused_chunks_cnt > V_max_range_holes) + if (da->updates_low > da->updates_high) range_rebuild = 1; + +range_build: if (range_rebuild) { /* Bulk cleanup */ bzero(da->chunk_hashtbl, sizeof(da->chunk_hashtbl)); @@ -910,6 +946,7 @@ dxr_build(struct dxr *dxr) for (i = 0; i < UNUSED_BUCKETS; i++) LIST_INIT(&da->unused_chunks[i]); da->all_chunks_cnt = da->unused_chunks_cnt = 0; + da->unused_chunks_size = 0; da->rtbl_top = 0; da->updates_low = 0; da->updates_high = DIRECT_TBL_SIZE - 1; @@ -929,18 +966,32 @@ dxr_build(struct dxr *dxr) else if (m & 1 && update_chunk(da, i) != 0) return; } + + range_frag = 0; + if (da->rtbl_top) + range_frag = da->unused_chunks_size * 10000ULL / da->rtbl_top; + if (range_frag > V_frag_limit) { + range_rebuild = 1; + goto range_build; + } + r_size = sizeof(*da->range_tbl) * da->rtbl_top; microuptime(&t1); #ifdef DXR2 - if (range_rebuild || da->unused_trie_cnt > V_max_trie_holes || + if (range_rebuild || abs(fls(da->prefixes) - fls(da->trie_rebuilt_prefixes)) > 1) trie_rebuild = 1; + +trie_build: if (trie_rebuild) { da->trie_rebuilt_prefixes = da->prefixes; da->d_bits = DXR_D; da->updates_low = 0; da->updates_high = DIRECT_TBL_SIZE - 1; + if (!range_rebuild) + memset(da->updates_mask, 0xff, + sizeof(da->updates_mask)); } dxr2_try_squeeze: @@ -976,6 +1027,14 @@ dxr2_try_squeeze: da->d_tbl[i] = ti; } + trie_frag = 0; + if (da->all_trie_cnt) + trie_frag = da->unused_trie_cnt * 10000ULL / da->all_trie_cnt; + if (trie_frag > V_frag_limit) { + trie_rebuild = 1; + goto trie_build; + } + d_size = sizeof(*da->d_tbl) * d_tbl_size; x_size = sizeof(*da->x_tbl) * DIRECT_TBL_SIZE / d_tbl_size * da->all_trie_cnt; @@ -1035,6 +1094,15 @@ dxr2_try_squeeze: FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d KBytes, %d.%02d Bytes/prefix", dxr_tot_size / 1024, dxr_tot_size * 100 / 1024 % 100, i / 100, i % 100); +#ifdef DXR2 + FIB_PRINTF(LOG_INFO, da->fd, + "%d.%02d%% trie, %d.%02d%% range fragmentation", + trie_frag / 100, trie_frag % 100, + range_frag / 100, range_frag % 100); +#else + FIB_PRINTF(LOG_INFO, da->fd, "%d.%01d%% range fragmentation", + range_frag / 100, range_frag % 100); +#endif i = (t1.tv_sec - t0.tv_sec) * 1000000 + t1.tv_usec - t0.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "range table %s in %u.%03u ms", range_rebuild ? "rebuilt" : "updated", i / 1000, i % 1000); @@ -1046,9 +1114,6 @@ dxr2_try_squeeze: i = (t3.tv_sec - t2.tv_sec) * 1000000 + t3.tv_usec - t2.tv_usec; FIB_PRINTF(LOG_INFO, da->fd, "snapshot forked in %u.%03u ms", i / 1000, i % 1000); - FIB_PRINTF(LOG_INFO, da->fd, "range table: %d%%, %d chunks, %d holes", - da->rtbl_top * 100 / BASE_MAX, da->all_chunks_cnt, - da->unused_chunks_cnt); } /* From nobody Sat Oct 9 11:54:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D490312B1A54; Sat, 9 Oct 2021 11:54: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 4HRNkp5hdfz4gQP; Sat, 9 Oct 2021 11:54:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3B4A1A389; Sat, 9 Oct 2021 11:54:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 199BsAk4086602; Sat, 9 Oct 2021 11:54:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 199BsAYB086601; Sat, 9 Oct 2021 11:54:10 GMT (envelope-from git) Date: Sat, 9 Oct 2021 11:54:10 GMT Message-Id: <202110091154.199BsAYB086601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: bc8b8e106bd1 - main - [fib_algo][dxr] Retire counters which are no longer 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: zec X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc8b8e106bd1526ff19e270d2a8f2ccf6d225507 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=bc8b8e106bd1526ff19e270d2a8f2ccf6d225507 commit bc8b8e106bd1526ff19e270d2a8f2ccf6d225507 Author: Marko Zec AuthorDate: 2021-10-09 11:47:10 +0000 Commit: Marko Zec CommitDate: 2021-10-09 11:47:10 +0000 [fib_algo][dxr] Retire counters which are no longer used The number of chunks can still be tracked via vmstat -z|fgrep dxr. MFC after: 3 days --- sys/netinet/in_fib_dxr.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index d832a66ee2cc..f23db925444f 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -194,8 +194,6 @@ struct dxr_aux { uint32_t prefixes; uint32_t updates_low; uint32_t updates_high; - uint32_t all_chunks_cnt; - uint32_t unused_chunks_cnt; uint32_t unused_chunks_size; uint32_t xtbl_size; uint32_t all_trie_cnt; @@ -452,7 +450,6 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) size * sizeof(struct range_entry_long)); fdesc->base = cdp->cd_base; da->rtbl_top -= size; - da->unused_chunks_cnt--; da->unused_chunks_size -= cdp->cd_max_size; if (cdp->cd_max_size > size) { /* Split the range in two, need a new descriptor */ @@ -470,8 +467,6 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) LIST_INSERT_HEAD(&da->unused_chunks[i], empty_cdp, cd_hash_le); - da->all_chunks_cnt++; - da->unused_chunks_cnt++; da->unused_chunks_size += empty_cdp->cd_max_size; cdp->cd_max_size = size; } @@ -484,7 +479,6 @@ chunk_ref(struct dxr_aux *da, uint32_t chunk) cdp->cd_max_size = size; cdp->cd_base = fdesc->base; LIST_INSERT_HEAD(&da->all_chunks, cdp, cd_all_le); - da->all_chunks_cnt++; KASSERT(cdp->cd_base + cdp->cd_max_size == da->rtbl_top, ("dxr: %s %d", __FUNCTION__, __LINE__)); } @@ -538,7 +532,6 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) return; LIST_REMOVE(cdp, cd_hash_le); - da->unused_chunks_cnt++; da->unused_chunks_size += cdp->cd_max_size; cdp->cd_cur_size = 0; @@ -548,9 +541,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) KASSERT(cdp2->cd_base + cdp2->cd_max_size == cdp->cd_base, ("dxr: %s %d", __FUNCTION__, __LINE__)); LIST_REMOVE(cdp, cd_all_le); - da->all_chunks_cnt--; LIST_REMOVE(cdp2, cd_hash_le); - da->unused_chunks_cnt--; cdp2->cd_max_size += cdp->cd_max_size; uma_zfree(chunk_zone, cdp); cdp = cdp2; @@ -562,9 +553,7 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) KASSERT(cdp->cd_base + cdp->cd_max_size == cdp2->cd_base, ("dxr: %s %d", __FUNCTION__, __LINE__)); LIST_REMOVE(cdp, cd_all_le); - da->all_chunks_cnt--; LIST_REMOVE(cdp2, cd_hash_le); - da->unused_chunks_cnt--; cdp2->cd_max_size += cdp->cd_max_size; cdp2->cd_base = cdp->cd_base; uma_zfree(chunk_zone, cdp); @@ -575,8 +564,6 @@ chunk_unref(struct dxr_aux *da, uint32_t chunk) /* Free the chunk on the top of the range heap, trim the heap */ KASSERT(cdp == LIST_FIRST(&da->all_chunks), ("dxr: %s %d", __FUNCTION__, __LINE__)); - da->all_chunks_cnt--; - da->unused_chunks_cnt--; da->rtbl_top -= cdp->cd_max_size; da->unused_chunks_size -= cdp->cd_max_size; LIST_REMOVE(cdp, cd_all_le); @@ -945,7 +932,6 @@ range_build: } for (i = 0; i < UNUSED_BUCKETS; i++) LIST_INIT(&da->unused_chunks[i]); - da->all_chunks_cnt = da->unused_chunks_cnt = 0; da->unused_chunks_size = 0; da->rtbl_top = 0; da->updates_low = 0; From nobody Sat Oct 9 15:04:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6323B17E0E2E; Sat, 9 Oct 2021 15:04: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 4HRSyR2Mw0z3JLx; Sat, 9 Oct 2021 15:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FCE71C472; Sat, 9 Oct 2021 15:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 199F4Vo6040002; Sat, 9 Oct 2021 15:04:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 199F4VDu040001; Sat, 9 Oct 2021 15:04:31 GMT (envelope-from git) Date: Sat, 9 Oct 2021 15:04:31 GMT Message-Id: <202110091504.199F4VDu040001@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: c8a45820e0d9 - main - sbin/mount_fusefs/mount_fusefs.8: Fix typos List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: c8a45820e0d94892c1a632d49ccfddd8f559801e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=c8a45820e0d94892c1a632d49ccfddd8f559801e commit c8a45820e0d94892c1a632d49ccfddd8f559801e Author: Elyes HAOUAS AuthorDate: 2021-10-08 16:44:48 +0000 Commit: Alan Somers CommitDate: 2021-10-09 15:02:39 +0000 sbin/mount_fusefs/mount_fusefs.8: Fix typos "expicitly" --> "explicitly" "uknown" --> "unknown" Signed-off-by: Elyes HAOUAS MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/552 --- sbin/mount_fusefs/mount_fusefs.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/mount_fusefs/mount_fusefs.8 b/sbin/mount_fusefs/mount_fusefs.8 index 051a5c273ef7..9740d0ed59ff 100644 --- a/sbin/mount_fusefs/mount_fusefs.8 +++ b/sbin/mount_fusefs/mount_fusefs.8 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2019 +.Dd October 9, 2021 .Dt MOUNT_FUSEFS 8 .Os .Sh NAME @@ -162,7 +162,7 @@ Limit size of read requests to Do not refuse unmounting if there are secondary mounts. .It Cm private Refuse shared mounting of the daemon. -This is the default behaviour, to allow sharing, expicitly use +This is the default behaviour, to allow sharing, explicitly use .Fl o Cm noprivate . .It Cm push_symlinks_in Prefix absolute symlinks with the mountpoint. @@ -293,7 +293,7 @@ option. .It Ev MOUNT_FUSEFS_IGNORE_UNKNOWN If set, .Nm -will ignore uknown mount options. +will ignore unknown mount options. .It Ev MOUNT_FUSEFS_CALL_BY_LIB Adjust behavior to the needs of the FUSE library. Currently it effects help output. From nobody Sat Oct 9 15:47:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 024F317E53AE; Sat, 9 Oct 2021 15:47: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 4HRTvq6R3Bz3MfD; Sat, 9 Oct 2021 15:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD31F1CE35; Sat, 9 Oct 2021 15:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 199FlJxZ092479; Sat, 9 Oct 2021 15:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 199FlJZD092478; Sat, 9 Oct 2021 15:47:19 GMT (envelope-from git) Date: Sat, 9 Oct 2021 15:47:19 GMT Message-Id: <202110091547.199FlJZD092478@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: 7fa233534736 - main - bhyve: Map the MSI-X table unconditionally for passthrough List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 7fa2335347362378322a4d27cb40f6e6cd5dd0fb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7fa2335347362378322a4d27cb40f6e6cd5dd0fb commit 7fa2335347362378322a4d27cb40f6e6cd5dd0fb Author: Mark Johnston AuthorDate: 2021-10-09 15:36:19 +0000 Commit: Mark Johnston CommitDate: 2021-10-09 15:36:19 +0000 bhyve: Map the MSI-X table unconditionally for passthrough It is possible for the PBA to reside in the same page as the MSI-X table. And, while devices are not supposed to do this, at least some Intel wifi devices place registers in a page shared with the MSI-X table. To handle the first case we currently map the PBA page using /dev/mem, and the second case is not handled. Kill two birds with one stone: map the MSI-X table BAR using the PCIOCBARMMAP ioctl instead of /dev/mem, and map the entire table so that accesses beyond the bounds of the table can be emulated. Regions of the BAR not containing the table are left unmapped. Reviewed by: bz, grehan, jhb MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32359 --- usr.sbin/bhyve/pci_emul.h | 4 +- usr.sbin/bhyve/pci_passthru.c | 186 +++++++++++++++++------------------------- 2 files changed, 76 insertions(+), 114 deletions(-) diff --git a/usr.sbin/bhyve/pci_emul.h b/usr.sbin/bhyve/pci_emul.h index 031a6113fac4..5b6a17119960 100644 --- a/usr.sbin/bhyve/pci_emul.h +++ b/usr.sbin/bhyve/pci_emul.h @@ -157,8 +157,8 @@ struct pci_devinst { int pba_size; int function_mask; struct msix_table_entry *table; /* allocated at runtime */ - void *pba_page; - int pba_page_offset; + uint8_t *mapped_addr; + size_t mapped_size; } pi_msix; void *pi_arg; /* devemu-private data */ diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c index 2c6a2ebd8dd9..bf99c646c480 100644 --- a/usr.sbin/bhyve/pci_passthru.c +++ b/usr.sbin/bhyve/pci_passthru.c @@ -43,7 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include +#include #ifndef WITHOUT_CAPSICUM #include @@ -69,17 +72,12 @@ __FBSDID("$FreeBSD$"); #define _PATH_DEVPCI "/dev/pci" #endif -#ifndef _PATH_MEM -#define _PATH_MEM "/dev/mem" -#endif - #define LEGACY_SUPPORT 1 #define MSIX_TABLE_COUNT(ctrl) (((ctrl) & PCIM_MSIXCTRL_TABLE_SIZE) + 1) #define MSIX_CAPLEN 12 static int pcifd = -1; -static int memfd = -1; struct passthru_softc { struct pci_devinst *psc_pi; @@ -290,30 +288,30 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size) uint64_t *src64; uint64_t data; size_t entry_offset; - int index; + uint32_t table_offset; + int index, table_count; pi = sc->psc_pi; - if (pi->pi_msix.pba_page != NULL && offset >= pi->pi_msix.pba_offset && - offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) { - switch(size) { + + table_offset = pi->pi_msix.table_offset; + table_count = pi->pi_msix.table_count; + if (offset < table_offset || + offset >= table_offset + table_count * MSIX_TABLE_ENTRY_SIZE) { + switch (size) { case 1: - src8 = (uint8_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + src8 = (uint8_t *)(pi->pi_msix.mapped_addr + offset); data = *src8; break; case 2: - src16 = (uint16_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + src16 = (uint16_t *)(pi->pi_msix.mapped_addr + offset); data = *src16; break; case 4: - src32 = (uint32_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + src32 = (uint32_t *)(pi->pi_msix.mapped_addr + offset); data = *src32; break; case 8: - src64 = (uint64_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + src64 = (uint64_t *)(pi->pi_msix.mapped_addr + offset); data = *src64; break; default: @@ -322,32 +320,28 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size) return (data); } - if (offset < pi->pi_msix.table_offset) - return (-1); - - offset -= pi->pi_msix.table_offset; + offset -= table_offset; index = offset / MSIX_TABLE_ENTRY_SIZE; - if (index >= pi->pi_msix.table_count) - return (-1); + assert(index < table_count); entry = &pi->pi_msix.table[index]; entry_offset = offset % MSIX_TABLE_ENTRY_SIZE; - switch(size) { + switch (size) { case 1: - src8 = (uint8_t *)((void *)entry + entry_offset); + src8 = (uint8_t *)((uint8_t *)entry + entry_offset); data = *src8; break; case 2: - src16 = (uint16_t *)((void *)entry + entry_offset); + src16 = (uint16_t *)((uint8_t *)entry + entry_offset); data = *src16; break; case 4: - src32 = (uint32_t *)((void *)entry + entry_offset); + src32 = (uint32_t *)((uint8_t *)entry + entry_offset); data = *src32; break; case 8: - src64 = (uint64_t *)((void *)entry + entry_offset); + src64 = (uint64_t *)((uint8_t *)entry + entry_offset); data = *src64; break; default: @@ -368,46 +362,39 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc, uint32_t *dest32; uint64_t *dest64; size_t entry_offset; - uint32_t vector_control; - int index; + uint32_t table_offset, vector_control; + int index, table_count; pi = sc->psc_pi; - if (pi->pi_msix.pba_page != NULL && offset >= pi->pi_msix.pba_offset && - offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) { - switch(size) { + + table_offset = pi->pi_msix.table_offset; + table_count = pi->pi_msix.table_count; + if (offset < table_offset || + offset >= table_offset + table_count * MSIX_TABLE_ENTRY_SIZE) { + switch (size) { case 1: - dest8 = (uint8_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + dest8 = (uint8_t *)(pi->pi_msix.mapped_addr + offset); *dest8 = data; break; case 2: - dest16 = (uint16_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + dest16 = (uint16_t *)(pi->pi_msix.mapped_addr + offset); *dest16 = data; break; case 4: - dest32 = (uint32_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + dest32 = (uint32_t *)(pi->pi_msix.mapped_addr + offset); *dest32 = data; break; case 8: - dest64 = (uint64_t *)(pi->pi_msix.pba_page + offset - - pi->pi_msix.pba_page_offset); + dest64 = (uint64_t *)(pi->pi_msix.mapped_addr + offset); *dest64 = data; break; - default: - break; } return; } - if (offset < pi->pi_msix.table_offset) - return; - - offset -= pi->pi_msix.table_offset; + offset -= table_offset; index = offset / MSIX_TABLE_ENTRY_SIZE; - if (index >= pi->pi_msix.table_count) - return; + assert(index < table_count); entry = &pi->pi_msix.table[index]; entry_offset = offset % MSIX_TABLE_ENTRY_SIZE; @@ -435,13 +422,10 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc, static int init_msix_table(struct vmctx *ctx, struct passthru_softc *sc, uint64_t base) { + struct pci_devinst *pi = sc->psc_pi; + struct pci_bar_mmap pbm; int b, s, f; - int idx; - size_t remaining; uint32_t table_size, table_offset; - uint32_t pba_size, pba_offset; - vm_paddr_t start; - struct pci_devinst *pi = sc->psc_pi; assert(pci_msix_table_bar(pi) >= 0 && pci_msix_pba_bar(pi) >= 0); @@ -449,55 +433,48 @@ init_msix_table(struct vmctx *ctx, struct passthru_softc *sc, uint64_t base) s = sc->psc_sel.pc_dev; f = sc->psc_sel.pc_func; - /* - * If the MSI-X table BAR maps memory intended for - * other uses, it is at least assured that the table - * either resides in its own page within the region, - * or it resides in a page shared with only the PBA. + /* + * Map the region of the BAR containing the MSI-X table. This is + * necessary for two reasons: + * 1. The PBA may reside in the first or last page containing the MSI-X + * table. + * 2. While PCI devices are not supposed to use the page(s) containing + * the MSI-X table for other purposes, some do in practice. */ + memset(&pbm, 0, sizeof(pbm)); + pbm.pbm_sel = sc->psc_sel; + pbm.pbm_flags = PCIIO_BAR_MMAP_RW; + pbm.pbm_reg = PCIR_BAR(pi->pi_msix.pba_bar); + pbm.pbm_memattr = VM_MEMATTR_DEVICE; + + if (ioctl(pcifd, PCIOCBARMMAP, &pbm) != 0) { + warn("Failed to map MSI-X table BAR on %d/%d/%d", b, s, f); + return (-1); + } + assert(pbm.pbm_bar_off == 0); + pi->pi_msix.mapped_addr = (uint8_t *)(uintptr_t)pbm.pbm_map_base; + pi->pi_msix.mapped_size = pbm.pbm_map_length; + table_offset = rounddown2(pi->pi_msix.table_offset, 4096); table_size = pi->pi_msix.table_offset - table_offset; table_size += pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; table_size = roundup2(table_size, 4096); - idx = pi->pi_msix.table_bar; - start = pi->pi_bar[idx].addr; - remaining = pi->pi_bar[idx].size; - - if (pi->pi_msix.pba_bar == pi->pi_msix.table_bar) { - pba_offset = pi->pi_msix.pba_offset; - pba_size = pi->pi_msix.pba_size; - if (pba_offset >= table_offset + table_size || - table_offset >= pba_offset + pba_size) { - /* - * If the PBA does not share a page with the MSI-x - * tables, no PBA emulation is required. - */ - pi->pi_msix.pba_page = NULL; - pi->pi_msix.pba_page_offset = 0; - } else { - /* - * The PBA overlaps with either the first or last - * page of the MSI-X table region. Map the - * appropriate page. - */ - if (pba_offset <= table_offset) - pi->pi_msix.pba_page_offset = table_offset; - else - pi->pi_msix.pba_page_offset = table_offset + - table_size - 4096; - pi->pi_msix.pba_page = mmap(NULL, 4096, PROT_READ | - PROT_WRITE, MAP_SHARED, memfd, start + - pi->pi_msix.pba_page_offset); - if (pi->pi_msix.pba_page == MAP_FAILED) { - warn( - "Failed to map PBA page for MSI-X on %d/%d/%d", - b, s, f); - return (-1); - } - } - } + /* + * Unmap any pages not covered by the table, we do not need to emulate + * accesses to them. Avoid releasing address space to help ensure that + * a buggy out-of-bounds access causes a crash. + */ + if (table_offset != 0) + if (mprotect(pi->pi_msix.mapped_addr, table_offset, + PROT_NONE) != 0) + warn("Failed to unmap MSI-X table BAR region"); + if (table_offset + table_size != pi->pi_msix.mapped_size) + if (mprotect(pi->pi_msix.mapped_addr, + pi->pi_msix.mapped_size - (table_offset + table_size), + PROT_NONE) != 0) + warn("Failed to unmap MSI-X table BAR region"); return (0); } @@ -645,7 +622,7 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) #ifndef WITHOUT_CAPSICUM cap_rights_t rights; cap_ioctl_t pci_ioctls[] = - { PCIOCREAD, PCIOCWRITE, PCIOCGETBAR, PCIOCBARIO }; + { PCIOCREAD, PCIOCWRITE, PCIOCGETBAR, PCIOCBARIO, PCIOCBARMMAP }; #endif sc = NULL; @@ -676,21 +653,6 @@ passthru_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif - if (memfd < 0) { - memfd = open(_PATH_MEM, O_RDWR, 0); - if (memfd < 0) { - warn("failed to open %s", _PATH_MEM); - return (error); - } - } - -#ifndef WITHOUT_CAPSICUM - cap_rights_clear(&rights, CAP_IOCTL); - cap_rights_set(&rights, CAP_MMAP_RW); - if (caph_rights_limit(memfd, &rights) == -1) - errx(EX_OSERR, "Unable to apply rights for sandbox"); -#endif - #define GET_INT_CONFIG(var, name) do { \ value = get_config_value_node(nvl, name); \ if (value == NULL) { \ From nobody Sat Oct 9 16:35:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AEA5717ECCE5; Sat, 9 Oct 2021 16:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRVz14Kg2z3lGR; Sat, 9 Oct 2021 16:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74A471D3F3; Sat, 9 Oct 2021 16:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 199GZ9hK059304; Sat, 9 Oct 2021 16:35:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 199GZ9cC059303; Sat, 9 Oct 2021 16:35:09 GMT (envelope-from git) Date: Sat, 9 Oct 2021 16:35:09 GMT Message-Id: <202110091635.199GZ9cC059303@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: fa9da1f590ca - main - timecounter: Let kern.timecounter.stepwarnings be set as a tunable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: fa9da1f590caba94b98717c33633efcf719da151 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fa9da1f590caba94b98717c33633efcf719da151 commit fa9da1f590caba94b98717c33633efcf719da151 Author: Mark Johnston AuthorDate: 2021-10-09 16:34:06 +0000 Commit: Mark Johnston CommitDate: 2021-10-09 16:34:06 +0000 timecounter: Let kern.timecounter.stepwarnings be set as a tunable MFC after: 1 week --- sys/kern/kern_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 81d373b3b1d0..be4142e19d77 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -121,7 +121,7 @@ static SYSCTL_NODE(_kern_timecounter, OID_AUTO, tc, ""); static int timestepwarnings; -SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, +SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RWTUN, ×tepwarnings, 0, "Log time steps"); static int timehands_count = 2; From nobody Sat Oct 9 19:32:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2C91D12DEA7D; Sat, 9 Oct 2021 19:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRZvB0bLlz4TF3; Sat, 9 Oct 2021 19:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9B6E20385; Sat, 9 Oct 2021 19:32:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 199JW5XE097483; Sat, 9 Oct 2021 19:32:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 199JW55r097482; Sat, 9 Oct 2021 19:32:05 GMT (envelope-from git) Date: Sat, 9 Oct 2021 19:32:05 GMT Message-Id: <202110091932.199JW55r097482@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: 5fb54d2fc845 - main - readlinkat(2): allow O_PATH fd List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: 5fb54d2fc845464ea809e6a1a69380693943cf51 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5fb54d2fc845464ea809e6a1a69380693943cf51 commit 5fb54d2fc845464ea809e6a1a69380693943cf51 Author: Konstantin Belousov AuthorDate: 2021-10-09 05:12:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-09 19:31:37 +0000 readlinkat(2): allow O_PATH fd PR: 258856 Reported by: ashish Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32390 --- lib/libc/sys/open.2 | 5 +++-- sys/kern/vfs_syscalls.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 5a6f161291f6..da42c238a151 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd May 6, 2021 +.Dd October 9, 2021 .Dt OPEN 2 .Os .Sh NAME @@ -327,7 +327,7 @@ and others. The other functionality of the returned file descriptor is limited to the descriptor-level operations. It can be used for -.Bl -tag -width SCM_RIGHTS -offset indent -compact +.Bl -tag -width readlinkat(2) -offset indent -compact .It Xr fcntl 2 but advisory locking is not allowed .It Xr dup 2 @@ -346,6 +346,7 @@ message .It Xr kqueue 2 using for .Dv EVFILT_VNODE +.It Xr readlinkat 2 .El But operations like .Xr read 2 , diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index bd496db50e99..1b355eea7d6a 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2640,8 +2640,8 @@ kern_readlinkat(struct thread *td, int fd, const char *path, if (count > IOSIZE_MAX) return (EINVAL); - NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, - pathseg, path, fd, td); + NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1 | + EMPTYPATH, pathseg, path, fd, td); if ((error = namei(&nd)) != 0) return (error); From nobody Sat Oct 9 21:30:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1567417F03A3; Sat, 9 Oct 2021 21:30: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 4HRdWP065hz4ltv; Sat, 9 Oct 2021 21:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7A6521A8A; Sat, 9 Oct 2021 21:30:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 199LU8LN047643; Sat, 9 Oct 2021 21:30:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 199LU8NR047640; Sat, 9 Oct 2021 21:30:08 GMT (envelope-from git) Date: Sat, 9 Oct 2021 21:30:08 GMT Message-Id: <202110092130.199LU8NR047640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Peek Subject: git: 0f14bcbe3840 - main - vmci: fix panic due to freeing unallocated resources List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f14bcbe384091c729464cb770372aeb79061070 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mp: URL: https://cgit.FreeBSD.org/src/commit/?id=0f14bcbe384091c729464cb770372aeb79061070 commit 0f14bcbe384091c729464cb770372aeb79061070 Author: Mark Peek AuthorDate: 2021-10-09 21:21:16 +0000 Commit: Mark Peek CommitDate: 2021-10-09 21:21:16 +0000 vmci: fix panic due to freeing unallocated resources Summary: An error mapping PCI resources results in a panic due to unallocated resources being freed up. This change puts the appropriate checks in place to prevent the panic. PR: 252445 Reported by: Marek Zarychta Tested by: marcus MFC after: 1 week Sponsored by: VMware Test Plan: Along with user testing, also simulated error by inserting a ENXIO return in vmci_map_bars(). Reviewed by: marcus Subscribers: imp Differential Revision: https://reviews.freebsd.org/D32016 --- sys/dev/vmware/vmci/vmci.c | 9 ++++--- sys/dev/vmware/vmci/vmci_event.c | 3 +++ sys/dev/vmware/vmci/vmci_kernel_if.c | 48 ++++++++++++++++++++++++++++++++++- sys/dev/vmware/vmci/vmci_kernel_if.h | 2 ++ sys/dev/vmware/vmci/vmci_queue_pair.c | 3 +++ 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/sys/dev/vmware/vmci/vmci.c b/sys/dev/vmware/vmci/vmci.c index bbf17bbe7e41..8adcb7f532b7 100644 --- a/sys/dev/vmware/vmci/vmci.c +++ b/sys/dev/vmware/vmci/vmci.c @@ -242,8 +242,10 @@ vmci_detach(device_t dev) vmci_components_cleanup(); - taskqueue_drain(taskqueue_thread, &sc->vmci_delayed_work_task); - mtx_destroy(&sc->vmci_delayed_work_lock); + if mtx_initialized(&sc->vmci_spinlock) { + taskqueue_drain(taskqueue_thread, &sc->vmci_delayed_work_task); + mtx_destroy(&sc->vmci_delayed_work_lock); + } if (sc->vmci_res0 != NULL) bus_space_write_4(sc->vmci_iot0, sc->vmci_ioh0, @@ -254,7 +256,8 @@ vmci_detach(device_t dev) vmci_unmap_bars(sc); - mtx_destroy(&sc->vmci_spinlock); + if mtx_initialized(&sc->vmci_spinlock) + mtx_destroy(&sc->vmci_spinlock); pci_disable_busmaster(dev); diff --git a/sys/dev/vmware/vmci/vmci_event.c b/sys/dev/vmware/vmci/vmci_event.c index 7f3bf9039e12..192828cc6f6a 100644 --- a/sys/dev/vmware/vmci/vmci_event.c +++ b/sys/dev/vmware/vmci/vmci_event.c @@ -593,6 +593,9 @@ vmci_event_unregister_subscription(vmci_id sub_id) { struct vmci_subscription *s; + if (!vmci_initialized_lock(&subscriber_lock)) + return NULL; + vmci_grab_lock_bh(&subscriber_lock); s = vmci_event_find(sub_id); if (s != NULL) { diff --git a/sys/dev/vmware/vmci/vmci_kernel_if.c b/sys/dev/vmware/vmci/vmci_kernel_if.c index e845650873b5..de54a8d1ca4f 100644 --- a/sys/dev/vmware/vmci/vmci_kernel_if.c +++ b/sys/dev/vmware/vmci/vmci_kernel_if.c @@ -70,7 +70,8 @@ void vmci_cleanup_lock(vmci_lock *lock) { - mtx_destroy(lock); + if mtx_initialized(lock) + mtx_destroy(lock); } /* @@ -165,6 +166,29 @@ vmci_release_lock_bh(vmci_lock *lock) mtx_unlock(lock); } +/* + *------------------------------------------------------------------------------ + * + * vmci_initialized_lock + * + * Returns whether a lock has been initialized. + * + * Results: + * Return 1 if initialized or 0 if unininitialized. + * + * Side effects: + * None + * + *------------------------------------------------------------------------------ + */ + +int +vmci_initialized_lock(vmci_lock *lock) +{ + + return mtx_initialized(lock); +} + /* *------------------------------------------------------------------------------ * @@ -446,6 +470,28 @@ vmci_mutex_release(vmci_mutex *mutex) mtx_unlock(mutex); } +/* + *------------------------------------------------------------------------------ + * + * vmci_mutex_initialized + * + * Returns whether a mutex has been initialized. + * + * Results: + * Return 1 if initialized or 0 if unininitialized. + * + * Side effects: + * None + * + *------------------------------------------------------------------------------ + */ + +int +vmci_mutex_initialized(vmci_mutex *mutex) +{ + + return mtx_initialized(mutex); +} /* *------------------------------------------------------------------------------ * diff --git a/sys/dev/vmware/vmci/vmci_kernel_if.h b/sys/dev/vmware/vmci/vmci_kernel_if.h index fc23eefe98e0..048e480b0698 100644 --- a/sys/dev/vmware/vmci/vmci_kernel_if.h +++ b/sys/dev/vmware/vmci/vmci_kernel_if.h @@ -48,6 +48,7 @@ void vmci_grab_lock(vmci_lock *lock); void vmci_release_lock(vmci_lock *lock); void vmci_grab_lock_bh(vmci_lock *lock); void vmci_release_lock_bh(vmci_lock *lock); +int vmci_initialized_lock(vmci_lock *lock); void *vmci_alloc_kernel_mem(size_t size, int flags); void vmci_free_kernel_mem(void *ptr, size_t size); @@ -72,6 +73,7 @@ int vmci_mutex_init(vmci_mutex *mutex, char *name); void vmci_mutex_destroy(vmci_mutex *mutex); void vmci_mutex_acquire(vmci_mutex *mutex); void vmci_mutex_release(vmci_mutex *mutex); +int vmci_mutex_initialized(vmci_mutex *mutex); void *vmci_alloc_queue(uint64_t size, uint32_t flags); void vmci_free_queue(void *q, uint64_t size); diff --git a/sys/dev/vmware/vmci/vmci_queue_pair.c b/sys/dev/vmware/vmci/vmci_queue_pair.c index 2ff963c691d0..0e2f83b20c67 100644 --- a/sys/dev/vmware/vmci/vmci_queue_pair.c +++ b/sys/dev/vmware/vmci/vmci_queue_pair.c @@ -338,6 +338,9 @@ vmci_qp_guest_endpoints_exit(void) { struct qp_guest_endpoint *entry; + if (!vmci_mutex_initialized(&qp_guest_endpoints.mutex)) + return; + vmci_mutex_acquire(&qp_guest_endpoints.mutex); while ((entry = From nobody Sun Oct 10 05:51:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8C4C417E710C; Sun, 10 Oct 2021 05:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRrdQ3JQ7z4mSs; Sun, 10 Oct 2021 05:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 528FF1E9; Sun, 10 Oct 2021 05:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19A5p6x0019270; Sun, 10 Oct 2021 05:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19A5p63p019269; Sun, 10 Oct 2021 05:51:06 GMT (envelope-from git) Date: Sun, 10 Oct 2021 05:51:06 GMT Message-Id: <202110100551.19A5p63p019269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 9294a2c7195a - main - ncurses: convert libncursesw.a into a static ldscript List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9294a2c7195ade0055c9d0b2917d929f5b20c035 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9294a2c7195ade0055c9d0b2917d929f5b20c035 commit 9294a2c7195ade0055c9d0b2917d929f5b20c035 Author: Baptiste Daroussin AuthorDate: 2021-10-10 05:37:26 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-10 05:51:00 +0000 ncurses: convert libncursesw.a into a static ldscript Introduce the notion of static linker scripts to allow libncursesw.a to track its dependency on libtinfow.a this allows the build of older freebsd source tree to happen and make static linking in part with dynamic linking which already provides a ldscript This fixes a bootstrapping FreeBSD 12 or 13 on recent FreeBSD 14 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D32435 --- lib/ncurses/ncurses/Makefile | 14 ++++++++++++++ share/mk/bsd.lib.mk | 9 ++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index d2ba1007b54a..5f80def49458 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -169,6 +169,11 @@ SYMLINKS+= libncursesw_p.a ${LIBDIR}/libcurses_p.a LIBADD+= tinfow SHLIB_LDSCRIPT= libncursesw.ldscript +STATIC_LDSCRIPT= libncursesw.aldscript +CLEANFILES+= ${STATIC_LDSCRIPT} + +libncursesw.aldscript: + @${ECHO} "INPUT(-lncursesw_real -ltinfow)" >$@ libncurses.ldscript: @${ECHO} "INPUT(${SHLIB_NAME} AS NEEDED(-ltinfow))" >$@ @@ -180,4 +185,13 @@ lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h ncurses_dll.h expanded.c: MKexpanded.sh sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c +all: ${STATIC_LDSCRIPT} + +install-aldscript: ${STATIC_LDSCRIPT} + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} ${STATIC_LDSCRIPT} ${DESTDIR}${_LIBDI}/lib${LIB}.a + +realinstall: install-aldscript + + .include diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 4afe719b8152..10262e6bb80c 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -271,9 +271,12 @@ CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS} .endif .if defined(LIB) && !empty(LIB) -_LIBS= lib${LIB_PRIVATE}${LIB}.a +.if defined(STATIC_LDSCRIPT) +_STATICLIB_SUFFIX= _real +.endif +_LIBS= lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a -lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} +lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${OBJS} ${STATICOBJS} ${ARADD} @@ -477,7 +480,7 @@ realinstall: _libinstall installpcfiles _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/ + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a ${DESTDIR}${_LIBDIR}/ .endif .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ From nobody Sun Oct 10 07:12:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6D95917F2BE3; Sun, 10 Oct 2021 07:12: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 4HRtR62lDWz3Dqp; Sun, 10 Oct 2021 07:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EAE41785; Sun, 10 Oct 2021 07:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19A7CIjL029491; Sun, 10 Oct 2021 07:12:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19A7CIvM029490; Sun, 10 Oct 2021 07:12:18 GMT (envelope-from git) Date: Sun, 10 Oct 2021 07:12:18 GMT Message-Id: <202110100712.19A7CIvM029490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: b158d4d7a12f - main - rescue: fix after with to a ldscript of libncursesw.a List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b158d4d7a12fad8e9c4509466d5f1ebd15862d9f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b158d4d7a12fad8e9c4509466d5f1ebd15862d9f commit b158d4d7a12fad8e9c4509466d5f1ebd15862d9f Author: Baptiste Daroussin AuthorDate: 2021-10-10 06:53:41 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-10 06:53:41 +0000 rescue: fix after with to a ldscript of libncursesw.a --- rescue/rescue/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile index f2aa614f1dfc..42094340e768 100644 --- a/rescue/rescue/Makefile +++ b/rescue/rescue/Makefile @@ -131,7 +131,7 @@ CRUNCH_PROGS_usr.sbin+= zdb # crunchgen does not like C++ programs; this should be fixed someday # CRUNCH_PROGS+= devd -CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma +CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw_real -ldevstat -lipsec -llzma .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem CRUNCH_LIBS+= -lbe -lzfsbootenv -lzutil -ltpool -lspl -licp_rescue From nobody Sun Oct 10 11:50:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9047317F81C6; Sun, 10 Oct 2021 11:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HS0cS3hztz4XfP; Sun, 10 Oct 2021 11:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F7325127; Sun, 10 Oct 2021 11:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19ABomCf098035; Sun, 10 Oct 2021 11:50:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19ABomdm098034; Sun, 10 Oct 2021 11:50:48 GMT (envelope-from git) Date: Sun, 10 Oct 2021 11:50:48 GMT Message-Id: <202110101150.19ABomdm098034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yoshihiro Takahashi Subject: git: 2c614481fd52 - main - unzip: Fix segmentation fault if a zip file contains buggy filename. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nyan X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c614481fd5248c1685e713f67d40cf2d5fba494 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by nyan: URL: https://cgit.FreeBSD.org/src/commit/?id=2c614481fd5248c1685e713f67d40cf2d5fba494 commit 2c614481fd5248c1685e713f67d40cf2d5fba494 Author: Yoshihiro Takahashi AuthorDate: 2021-10-10 11:49:19 +0000 Commit: Yoshihiro Takahashi CommitDate: 2021-10-10 11:49:19 +0000 unzip: Fix segmentation fault if a zip file contains buggy filename. PR: 259011 Reported by: Robert Morris Submitted by: ak MFC after:: 1 week --- usr.bin/unzip/unzip.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/usr.bin/unzip/unzip.c b/usr.bin/unzip/unzip.c index e5ca1ff2c939..0b564b0f08ec 100644 --- a/usr.bin/unzip/unzip.c +++ b/usr.bin/unzip/unzip.c @@ -211,6 +211,9 @@ pathdup(const char *path) char *str; size_t i, len; + if (path == NULL || path[0] == '\0') + return (NULL); + len = strlen(path); while (len && path[len - 1] == '/') len--; @@ -697,7 +700,11 @@ extract(struct archive *a, struct archive_entry *e) mode_t filetype; char *p, *q; - pathname = pathdup(archive_entry_pathname(e)); + if ((pathname = pathdup(archive_entry_pathname(e))) == NULL) { + warningx("skipping empty or unreadable filename entry"); + ac(archive_read_data_skip(a)); + return; + } filetype = archive_entry_filetype(e); /* sanity checks */ @@ -760,7 +767,11 @@ extract_stdout(struct archive *a, struct archive_entry *e) char *pathname; mode_t filetype; - pathname = pathdup(archive_entry_pathname(e)); + if ((pathname = pathdup(archive_entry_pathname(e))) == NULL) { + warningx("skipping empty or unreadable filename entry"); + ac(archive_read_data_skip(a)); + return; + } filetype = archive_entry_filetype(e); /* I don't think this can happen in a zipfile.. */ From nobody Sun Oct 10 15:47:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 80F8817F15E6; Sun, 10 Oct 2021 15:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HS5s63Cwjz566c; Sun, 10 Oct 2021 15:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AB15103E5; Sun, 10 Oct 2021 15:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19AFl65c009881; Sun, 10 Oct 2021 15:47:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19AFl64a009880; Sun, 10 Oct 2021 15:47:06 GMT (envelope-from git) Date: Sun, 10 Oct 2021 15:47:06 GMT Message-Id: <202110101547.19AFl64a009880@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: 24b51c7295db - main - ObsoleteFiles.inc: stop removing pthread_mutexattr_get/setpshared.3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24b51c7295db6b316250f0288aaf05660a81063e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=24b51c7295db6b316250f0288aaf05660a81063e commit 24b51c7295db6b316250f0288aaf05660a81063e Author: Konstantin Belousov AuthorDate: 2021-10-10 14:38:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-10 15:46:43 +0000 ObsoleteFiles.inc: stop removing pthread_mutexattr_get/setpshared.3 The man pages were added by 6bda192013fc8e (as symlinks). Sponsored by: The FreeBSD Foundation MFC after: 3 days --- ObsoleteFiles.inc | 2 -- 1 file changed, 2 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index ee77a56b7acc..cea96addd379 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -14836,8 +14836,6 @@ OLD_FILES+=usr/share/man/man3/isnanf.3.gz OLD_FILES+=usr/share/man/man3/libautofs.3.gz OLD_FILES+=usr/share/man/man3/pthread_attr_setsstack.3.gz OLD_FILES+=usr/share/man/man3/pthread_getcancelstate.3.gz -OLD_FILES+=usr/share/man/man3/pthread_mutexattr_getpshared.3.gz -OLD_FILES+=usr/share/man/man3/pthread_mutexattr_setpshared.3.gz OLD_FILES+=usr/share/man/man3/set_assertion_failure_callback.3.gz OLD_FILES+=usr/share/man/man3/setkey.3.gz OLD_FILES+=usr/share/man/man3/setvfsent.3.gz From nobody Sun Oct 10 16:52:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C730817DB524; Sun, 10 Oct 2021 16:52:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HS7K15FsMz3JB0; Sun, 10 Oct 2021 16:52:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92E9911790; Sun, 10 Oct 2021 16:52:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19AGqrXl003321; Sun, 10 Oct 2021 16:52:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19AGqrXT003320; Sun, 10 Oct 2021 16:52:53 GMT (envelope-from git) Date: Sun, 10 Oct 2021 16:52:53 GMT Message-Id: <202110101652.19AGqrXT003320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 9082bc4c3d0b - main - ncurses: fix typo in makefile List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9082bc4c3d0b0c27bec13bcff9e76b072303e59b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9082bc4c3d0b0c27bec13bcff9e76b072303e59b commit 9082bc4c3d0b0c27bec13bcff9e76b072303e59b Author: Baptiste Daroussin AuthorDate: 2021-10-10 16:52:21 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-10 16:52:48 +0000 ncurses: fix typo in makefile --- lib/ncurses/ncurses/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 5f80def49458..951e8a4ea63f 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -189,7 +189,7 @@ all: ${STATIC_LDSCRIPT} install-aldscript: ${STATIC_LDSCRIPT} ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} ${STATIC_LDSCRIPT} ${DESTDIR}${_LIBDI}/lib${LIB}.a + ${_INSTALLFLAGS} ${STATIC_LDSCRIPT} ${DESTDIR}${_LIBDIR}/lib${LIB}.a realinstall: install-aldscript From nobody Sun Oct 10 17:18:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7C14B17DF8BE; Sun, 10 Oct 2021 17:18: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 4HS7tX39X3z3MPL; Sun, 10 Oct 2021 17:18:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C9CD118B8; Sun, 10 Oct 2021 17:18:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19AHIS54031070; Sun, 10 Oct 2021 17:18:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19AHISiX031069; Sun, 10 Oct 2021 17:18:28 GMT (envelope-from git) Date: Sun, 10 Oct 2021 17:18:28 GMT Message-Id: <202110101718.19AHISiX031069@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: 880aec7361ea - main - cross-build: Remove redundant lines. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 880aec7361eab106b62dea28f3dedd457b3abb47 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=880aec7361eab106b62dea28f3dedd457b3abb47 commit 880aec7361eab106b62dea28f3dedd457b3abb47 Author: Warner Losh AuthorDate: 2021-10-10 16:21:49 +0000 Commit: Warner Losh CommitDate: 2021-10-10 17:17:14 +0000 cross-build: Remove redundant lines. There's two identical gid_from_group lines in a row. We only need one. Ditto for uid_from_user(). Sponsored by: Netflix Reviewed by: bapt, jrtc27 Differential Revision: https://reviews.freebsd.org/D32442 --- tools/build/cross-build/include/common/grp.h | 2 -- tools/build/cross-build/include/common/pwd.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/tools/build/cross-build/include/common/grp.h b/tools/build/cross-build/include/common/grp.h index 08a8bc540569..750e1e9a49f6 100644 --- a/tools/build/cross-build/include/common/grp.h +++ b/tools/build/cross-build/include/common/grp.h @@ -47,8 +47,6 @@ int pwcache_groupdb(int (*a_setgroupent)(int), void (*a_endgrent)(void), int gid_from_group(const char *name, gid_t *gid); -int gid_from_group(const char *name, gid_t *gid); - const char *group_from_gid(gid_t gid, int noname); #ifdef __linux__ diff --git a/tools/build/cross-build/include/common/pwd.h b/tools/build/cross-build/include/common/pwd.h index e167fe47701f..14abc7fcadf0 100644 --- a/tools/build/cross-build/include/common/pwd.h +++ b/tools/build/cross-build/include/common/pwd.h @@ -45,8 +45,6 @@ int pwcache_userdb(int (*a_setpassent)(int), void (*a_endpwent)(void), struct passwd *(*a_getpwnam)(const char *), struct passwd *(*a_getpwuid)(uid_t)); -int uid_from_user(const char *name, uid_t *uid); - int uid_from_user(const char *name, uid_t *uid); const char *user_from_uid(uid_t uid, int noname); From nobody Sun Oct 10 18:24:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4590E17EAC95; Sun, 10 Oct 2021 18:24: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 4HS9Ls1Y6Yz3mvl; Sun, 10 Oct 2021 18:24:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 157AA12A9F; Sun, 10 Oct 2021 18:24:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19AIOacb024464; Sun, 10 Oct 2021 18:24:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19AIOapi024463; Sun, 10 Oct 2021 18:24:36 GMT (envelope-from git) Date: Sun, 10 Oct 2021 18:24:36 GMT Message-Id: <202110101824.19AIOapi024463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: a0558fe90d3b - main - Retire code added to support CloudABI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0558fe90d3bebdf8583888cc96b4c170eab8cfb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a0558fe90d3bebdf8583888cc96b4c170eab8cfb commit a0558fe90d3bebdf8583888cc96b4c170eab8cfb Author: Mateusz Guzik AuthorDate: 2021-04-28 20:55:03 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-10 18:24:29 +0000 Retire code added to support CloudABI CloudABI was removed in cf0ee8738e31aa9e6fbf4dca4dac56d89226a71a --- sys/kern/kern_descrip.c | 97 ++----------------------------------------------- sys/kern/kern_exec.c | 88 ++++---------------------------------------- sys/kern/kern_fork.c | 4 +- sys/kern/subr_syscall.c | 2 - sys/sys/filedesc.h | 5 --- sys/sys/imgact.h | 3 -- sys/sys/proc.h | 2 +- 7 files changed, 14 insertions(+), 187 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 755b5df51c6a..b10dcc2f9469 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -906,7 +906,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int old, int new) FILEDESC_XLOCK(fdp); if (fget_locked(fdp, old) == NULL) goto unlock; - if ((mode == FDDUP_FIXED || mode == FDDUP_MUSTREPLACE) && old == new) { + if (mode == FDDUP_FIXED && old == new) { td->td_retval[0] = new; if (flags & FDDUP_FLAG_CLOEXEC) fdp->fd_ofiles[new].fde_flags |= UF_EXCLOSE; @@ -932,13 +932,6 @@ kern_dup(struct thread *td, u_int mode, int flags, int old, int new) goto unlock; } break; - case FDDUP_MUSTREPLACE: - /* Target file descriptor must exist. */ - if (fget_locked(fdp, new) == NULL) { - fdrop(oldfp, td); - goto unlock; - } - break; case FDDUP_FIXED: if (new >= fdp->fd_nfiles) { /* @@ -2320,14 +2313,6 @@ pdunshare(struct thread *td) p->p_pd = pdp; } -void -fdinstall_remapped(struct thread *td, struct filedesc *fdp) -{ - - fdescfree(td); - td->td_proc->p_fd = fdp; -} - /* * Copy a filedesc structure. A NULL pointer in returns a NULL reference, * this is to ease callers, not catch errors. @@ -2380,66 +2365,6 @@ pdcopy(struct pwddesc *pdp) return (newpdp); } -/* - * Copies a filedesc structure, while remapping all file descriptors - * stored inside using a translation table. - * - * File descriptors are copied over to the new file descriptor table, - * regardless of whether the close-on-exec flag is set. - */ -int -fdcopy_remapped(struct filedesc *fdp, const int *fds, size_t nfds, - struct filedesc **ret) -{ - struct filedesc *newfdp; - struct filedescent *nfde, *ofde; - int error, i, lastfile; - - MPASS(fdp != NULL); - - newfdp = fdinit(fdp, true, &lastfile); - if (nfds > lastfile + 1) { - /* New table cannot be larger than the old one. */ - error = E2BIG; - goto bad; - } - /* Copy all passable descriptors (i.e. not kqueue). */ - newfdp->fd_freefile = nfds; - for (i = 0; i < nfds; ++i) { - if (fds[i] < 0 || fds[i] > lastfile) { - /* File descriptor out of bounds. */ - error = EBADF; - goto bad; - } - ofde = &fdp->fd_ofiles[fds[i]]; - if (ofde->fde_file == NULL) { - /* Unused file descriptor. */ - error = EBADF; - goto bad; - } - if ((ofde->fde_file->f_ops->fo_flags & DFLAG_PASSABLE) == 0) { - /* File descriptor cannot be passed. */ - error = EINVAL; - goto bad; - } - if (!fhold(ofde->fde_file)) { - error = EBADF; - goto bad; - } - nfde = &newfdp->fd_ofiles[i]; - *nfde = *ofde; - filecaps_copy(&ofde->fde_caps, &nfde->fde_caps, true); - fdused_init(newfdp, i); - } - FILEDESC_SUNLOCK(fdp); - *ret = newfdp; - return (0); -bad: - FILEDESC_SUNLOCK(fdp); - fdescfree_remapped(newfdp); - return (error); -} - /* * Clear POSIX style locks. This is only used when fdp looses a reference (i.e. * one of processes using it exits) and the table used to be shared. @@ -2526,7 +2451,7 @@ retry: * Release a filedesc structure. */ static void -fdescfree_fds(struct thread *td, struct filedesc *fdp, bool needclose) +fdescfree_fds(struct thread *td, struct filedesc *fdp) { struct filedesc0 *fdp0; struct freetable *ft, *tft; @@ -2551,10 +2476,7 @@ fdescfree_fds(struct thread *td, struct filedesc *fdp, bool needclose) fp = fde->fde_file; if (fp != NULL) { fdefree_last(fde); - if (needclose) - (void) closef(fp, td); - else - fdrop(fp, td); + (void) closef(fp, td); } } @@ -2598,7 +2520,7 @@ fdescfree(struct thread *td) if (refcount_release(&fdp->fd_refcnt) == 0) return; - fdescfree_fds(td, fdp, 1); + fdescfree_fds(td, fdp); } void @@ -2621,17 +2543,6 @@ pdescfree(struct thread *td) pddrop(pdp); } -void -fdescfree_remapped(struct filedesc *fdp) -{ -#ifdef INVARIANTS - /* fdescfree_fds() asserts that fd_refcnt == 0. */ - if (!refcount_release(&fdp->fd_refcnt)) - panic("%s: fd table %p has extra references", __func__, fdp); -#endif - fdescfree_fds(curthread, fdp, 0); -} - /* * For setugid programs, we don't want to people to use that setugidness * to generate error messages which write to a file which otherwise would diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 7ec405ee6a62..50e75fda6cfb 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -704,21 +704,14 @@ interpret: goto exec_fail_dealloc; } - if (args->fdp != NULL) { - /* Install a brand new file descriptor table. */ - fdinstall_remapped(td, args->fdp); - args->fdp = NULL; - } else { - /* - * Keep on using the existing file descriptor table. For - * security and other reasons, the file descriptor table - * cannot be shared after an exec. - */ - fdunshare(td); - pdunshare(td); - /* close files on exec */ - fdcloseexec(td); - } + /* + * For security and other reasons, the file descriptor table cannot be + * shared after an exec. + */ + fdunshare(td); + pdunshare(td); + /* close files on exec */ + fdcloseexec(td); /* * Malloc things before we need locks. @@ -1239,69 +1232,6 @@ err_exit: return (error); } -int -exec_copyin_data_fds(struct thread *td, struct image_args *args, - const void *data, size_t datalen, const int *fds, size_t fdslen) -{ - struct filedesc *ofdp; - const char *p; - int *kfds; - int error; - - memset(args, '\0', sizeof(*args)); - ofdp = td->td_proc->p_fd; - if (datalen >= ARG_MAX || fdslen >= ofdp->fd_nfiles) - return (E2BIG); - error = exec_alloc_args(args); - if (error != 0) - return (error); - - args->begin_argv = args->buf; - args->stringspace = ARG_MAX; - - if (datalen > 0) { - /* - * Argument buffer has been provided. Copy it into the - * kernel as a single string and add a terminating null - * byte. - */ - error = copyin(data, args->begin_argv, datalen); - if (error != 0) - goto err_exit; - args->begin_argv[datalen] = '\0'; - args->endp = args->begin_argv + datalen + 1; - args->stringspace -= datalen + 1; - - /* - * Traditional argument counting. Count the number of - * null bytes. - */ - for (p = args->begin_argv; p < args->endp; ++p) - if (*p == '\0') - ++args->argc; - } else { - /* No argument buffer provided. */ - args->endp = args->begin_argv; - } - - /* Create new file descriptor table. */ - kfds = malloc(fdslen * sizeof(int), M_TEMP, M_WAITOK); - error = copyin(fds, kfds, fdslen * sizeof(int)); - if (error != 0) { - free(kfds, M_TEMP); - goto err_exit; - } - error = fdcopy_remapped(ofdp, kfds, fdslen, &args->fdp); - free(kfds, M_TEMP); - if (error != 0) - goto err_exit; - - return (0); -err_exit: - exec_free_args(args); - return (error); -} - struct exec_args_kva { vm_offset_t addr; u_int gen; @@ -1438,8 +1368,6 @@ exec_free_args(struct image_args *args) free(args->fname_buf, M_TEMP); args->fname_buf = NULL; } - if (args->fdp != NULL) - fdescfree_remapped(args->fdp); } /* diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 2d8381894a7c..606801283a1f 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -597,8 +597,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * * been preserved. */ p2->p_flag |= p1->p_flag & P_SUGID; - td2->td_pflags |= (td->td_pflags & (TDP_ALTSTACK | - TDP_SIGFASTBLOCK)) | TDP_FORKING; + td2->td_pflags |= (td->td_pflags & (TDP_ALTSTACK | TDP_SIGFASTBLOCK)); SESS_LOCK(p1->p_session); if (p1->p_session->s_ttyvp != NULL && p1->p_flag & P_CONTROLT) p2->p_flag |= P_CONTROLT; @@ -1100,7 +1099,6 @@ fork_exit(void (*callout)(void *, struct trapframe *), void *arg, if (p->p_sysent->sv_schedtail != NULL) (p->p_sysent->sv_schedtail)(td); - td->td_pflags &= ~TDP_FORKING; } /* diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index 2304e3e7f3f9..ada2053bc87c 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -215,8 +215,6 @@ syscallret(struct thread *td) ksiginfo_t ksi; int traced; - KASSERT((td->td_pflags & TDP_FORKING) == 0, - ("fork() did not clear TDP_FORKING upon completion")); KASSERT(td->td_errno != ERELOOKUP, ("ERELOOKUP not consumed syscall %d", td->td_sa.code)); diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index f17fdf601ba1..30392c1bf0fd 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -203,7 +203,6 @@ enum { FDDUP_NORMAL, /* dup() behavior. */ FDDUP_FCNTL, /* fcntl()-style errors. */ FDDUP_FIXED, /* Force fixed allocation. */ - FDDUP_MUSTREPLACE, /* Target must exist. */ FDDUP_LASTMODE, }; @@ -250,12 +249,8 @@ void fdclose(struct thread *td, struct file *fp, int idx); void fdcloseexec(struct thread *td); void fdsetugidsafety(struct thread *td); struct filedesc *fdcopy(struct filedesc *fdp); -int fdcopy_remapped(struct filedesc *fdp, const int *fds, size_t nfds, - struct filedesc **newfdp); -void fdinstall_remapped(struct thread *td, struct filedesc *fdp); void fdunshare(struct thread *td); void fdescfree(struct thread *td); -void fdescfree_remapped(struct filedesc *fdp); int fdlastfile(struct filedesc *fdp); int fdlastfile_single(struct filedesc *fdp); struct filedesc *fdinit(struct filedesc *fdp, bool prepfiles, int *lastfile); diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index cd130551c050..ef4de48c3e6d 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -55,7 +55,6 @@ struct image_args { int argc; /* count of argument strings */ int envc; /* count of environment strings */ int fd; /* file descriptor of the executable */ - struct filedesc *fdp; /* new file descriptor table */ }; struct image_params { @@ -120,8 +119,6 @@ void exec_setregs(struct thread *, struct image_params *, uintptr_t); int exec_shell_imgact(struct image_params *); int exec_copyin_args(struct image_args *, const char *, enum uio_seg, char **, char **); -int exec_copyin_data_fds(struct thread *, struct image_args *, const void *, - size_t, const int *, size_t); void exec_stackgap(struct image_params *imgp, uintptr_t *dp); int pre_execve(struct thread *td, struct vmspace **oldvmspace); void post_execve(struct thread *td, int error, struct vmspace *oldvmspace); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 691bdae8b41a..1e3d7359a55b 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -524,7 +524,7 @@ do { \ #define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ -#define TDP_FORKING 0x20000000 /* Thread is being created through fork() */ +#define TDP_UNUSED0 0x20000000 /* UNUSED */ #define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ #define TDP_SIGFASTPENDING 0x80000000 /* Pending signal due to sigfastblock */ From nobody Sun Oct 10 18:24:38 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 15DE717EAC14; Sun, 10 Oct 2021 18: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 4HS9Lt2LPLz3my3; Sun, 10 Oct 2021 18:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B56712855; Sun, 10 Oct 2021 18:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19AIOcHg024488; Sun, 10 Oct 2021 18:24:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19AIOc18024487; Sun, 10 Oct 2021 18:24:38 GMT (envelope-from git) Date: Sun, 10 Oct 2021 18:24:38 GMT Message-Id: <202110101824.19AIOc18024487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 93e0523499fe - main - vfs: add predicts to getvnode and getvnode_path List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93e0523499fecb2ce1ca434c8ab96b58559771f3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=93e0523499fecb2ce1ca434c8ab96b58559771f3 commit 93e0523499fecb2ce1ca434c8ab96b58559771f3 Author: Mateusz Guzik AuthorDate: 2021-10-10 18:17:50 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-10 18:24:29 +0000 vfs: add predicts to getvnode and getvnode_path --- sys/kern/vfs_syscalls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 1b355eea7d6a..82a8125ece95 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -4316,7 +4316,7 @@ getvnode_path(struct thread *td, int fd, cap_rights_t *rightsp, * other thread to dereference it. Guard against the race by * checking f_ops. */ - if (fp->f_vnode == NULL || fp->f_ops == &badfileops) { + if (__predict_false(fp->f_vnode == NULL || fp->f_ops == &badfileops)) { fdrop(fp, td); return (EINVAL); } @@ -4336,12 +4336,14 @@ getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) int error; error = getvnode_path(td, fd, rightsp, fpp); + if (__predict_false(error != 0)) + return (error); /* * Filter out O_PATH file descriptors, most getvnode() callers * do not call fo_ methods. */ - if (error == 0 && (*fpp)->f_ops == &path_fileops) { + if (__predict_false((*fpp)->f_ops == &path_fileops)) { fdrop(*fpp, td); error = EBADF; } From nobody Sun Oct 10 19:34:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A434717F42AA; Sun, 10 Oct 2021 19:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HSBw04FvCz4Rt7; Sun, 10 Oct 2021 19:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71E2613944; Sun, 10 Oct 2021 19:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19AJYuAx019277; Sun, 10 Oct 2021 19:34:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19AJYuIJ019276; Sun, 10 Oct 2021 19:34:56 GMT (envelope-from git) Date: Sun, 10 Oct 2021 19:34:56 GMT Message-Id: <202110101934.19AJYuIJ019276@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: e81e77c5a055 - main - Enable PPS_SYNC on amd64, arm64 and armv7 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f commit e81e77c5a055d1cbf6d6a6f0acbaf443267aa84f Author: Konstantin Belousov AuthorDate: 2021-10-10 12:20:45 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-10 19:34:40 +0000 Enable PPS_SYNC on amd64, arm64 and armv7 Remove the option from NOTES/LINT, and add to NOTES for powerpc and riscv. PR: 259036 Requested by: John Hay Discussed with: ian, imp Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/conf/GENERIC | 6 ++++++ sys/arm/conf/std.armv7 | 6 ++++++ sys/arm64/conf/std.arm64 | 6 ++++++ sys/conf/NOTES | 6 ------ sys/powerpc/conf/NOTES | 2 ++ sys/riscv/conf/NOTES | 2 ++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 40c14e90aef0..f47b995beb2c 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -138,6 +138,12 @@ options PCI_IOV # PCI SR-IOV support options COMPAT_LINUXKPI +# Enable support for the kernel PLL to use an external PPS signal, +# under supervision of [x]ntpd(8) +# More info in ntpd documentation: http://www.eecis.udel.edu/~ntp + +options PPS_SYNC + # Floppy drives device fdc diff --git a/sys/arm/conf/std.armv7 b/sys/arm/conf/std.armv7 index 2d1dfa135780..fda291df289a 100644 --- a/sys/arm/conf/std.armv7 +++ b/sys/arm/conf/std.armv7 @@ -84,3 +84,9 @@ options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default #options KTR_VERBOSE=0 #options USB_REQ_DEBUG #options USB_VERBOSE + +# Enable support for the kernel PLL to use an external PPS signal, +# under supervision of [x]ntpd(8) +# More info in ntpd documentation: http://www.eecis.udel.edu/~ntp + +options PPS_SYNC diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 index 8460d449939d..5c26f19b4299 100644 --- a/sys/arm64/conf/std.arm64 +++ b/sys/arm64/conf/std.arm64 @@ -96,3 +96,9 @@ options NETDUMP # netdump(4) client support # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel + +# Enable support for the kernel PLL to use an external PPS signal, +# under supervision of [x]ntpd(8) +# More info in ntpd documentation: http://www.eecis.udel.edu/~ntp + +options PPS_SYNC diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 39446fba06b3..e41b00edf2f6 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1245,12 +1245,6 @@ options CAPABILITY_MODE # sandboxes with no global namespace access options HZ=100 -# Enable support for the kernel PLL to use an external PPS signal, -# under supervision of [x]ntpd(8) -# More info in ntpd documentation: http://www.eecis.udel.edu/~ntp - -options PPS_SYNC - # Enable support for generic feed-forward clocks in the kernel. # The feed-forward clock support is an alternative to the feedback oriented # ntpd/system clock approach, and is to be used with a feed-forward diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES index 78d990331ead..1a0c70fb08f9 100644 --- a/sys/powerpc/conf/NOTES +++ b/sys/powerpc/conf/NOTES @@ -46,6 +46,8 @@ options PSIM #GDB PSIM ppc simulator options MAMBO #IBM Mambo Full System Simulator options QEMU #QEMU processor emulator +options PPS_SYNC + # The cpufreq(4) driver provides support for CPU frequency control device cpufreq diff --git a/sys/riscv/conf/NOTES b/sys/riscv/conf/NOTES index 7dda89bfe1a8..60e842ab2709 100644 --- a/sys/riscv/conf/NOTES +++ b/sys/riscv/conf/NOTES @@ -20,6 +20,8 @@ options FPE # Floating-point extension support options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options INTRNG # Include INTRNG framework +options PPS_SYNC + # RISC-V SBI console device rcons From nobody Sun Oct 10 21:31:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A5E6817EA0D7; Sun, 10 Oct 2021 21:31: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 4HSFV64Lmtz4rTW; Sun, 10 Oct 2021 21:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7582D150F0; Sun, 10 Oct 2021 21:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19ALVArv076012; Sun, 10 Oct 2021 21:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19ALVAYb076011; Sun, 10 Oct 2021 21:31:10 GMT (envelope-from git) Date: Sun, 10 Oct 2021 21:31:10 GMT Message-Id: <202110102131.19ALVAYb076011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 235891a1273d - main - nfscl: Fix NFS VOP_ALLOCATE for mounts without Allocate 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 235891a1273d99b86784f935d2d6c554ce189559 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=235891a1273d99b86784f935d2d6c554ce189559 commit 235891a1273d99b86784f935d2d6c554ce189559 Author: Rick Macklem AuthorDate: 2021-10-10 21:27:52 +0000 Commit: Rick Macklem CommitDate: 2021-10-10 21:27:52 +0000 nfscl: Fix NFS VOP_ALLOCATE for mounts without Allocate support Without this patch, nfs_allocate() fell back on using vop_stdallocate() for NFS mounts without Allocate operation support. This was incorrect, since some file systems, such as ZFS, cannot do allocate via vop_stdallocate(), which uses writes to try and allocate blocks. Also, fix nfs_allocate() to return EINVAL when mounts cannot do Allocate, since that is the correct error for posix_fallocate(2). Note that Allocate is only supported by some NFSv4.2 servers. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clvnops.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 0b60100d1fc9..3e444780eb24 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3671,17 +3671,12 @@ nfs_allocate(struct vop_allocate_args *ap) mtx_lock(&nmp->nm_mtx); nmp->nm_privflag |= NFSMNTP_NOALLOCATE; mtx_unlock(&nmp->nm_mtx); + error = EINVAL; } } else { mtx_unlock(&nmp->nm_mtx); - error = EIO; + error = EINVAL; } - /* - * If the NFS server cannot perform the Allocate operation, just call - * vop_stdallocate() to perform it. - */ - if (error != 0) - error = vop_stdallocate(ap); if (attrflag != 0) { ret = nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); if (error == 0 && ret != 0)